(no commit message)
authorCindy Li <cli@ocad.ca>
Mon, 29 Mar 2010 16:06:34 +0000 (16:06 -0000)
committerCindy Li <cli@ocad.ca>
Mon, 29 Mar 2010 16:06:34 +0000 (16:06 -0000)
404 files changed:
docs/documentation/oauth_server_api.php
docs/documentation/web_service_api.php
docs/home/classes/ContentUtility.class.php
docs/home/course/content.php
docs/include/classes/DAO/CoursesDAO.class.php
docs/include/classes/DAO/TestsDAO.class.php
docs/include/classes/DAO/TestsQuestionsAssocDAO.class.php
docs/include/classes/DAO/TestsQuestionsCategoriesDAO.class.php [new file with mode: 0644]
docs/include/classes/DAO/UserGroupPrivilegeDAO.class.php
docs/include/classes/DAO/UsersDAO.class.php
docs/include/classes/Menu.class.php
docs/include/classes/QTI/QTIImport.class.php
docs/include/classes/Utility.class.php
docs/include/constants.inc.php
docs/include/header.inc.php
docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/img/code.png [new file with mode: 0644]
docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/img/media.png [new file with mode: 0644]
docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/img/term.png [new file with mode: 0644]
docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/img/tex.png [new file with mode: 0644]
docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/langs/en.js [new file with mode: 0644]
docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/img/bullet_arrow_down.png [new file with mode: 0644]
docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/img/bullet_arrow_up.png [new file with mode: 0644]
docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/langs/en.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/changelog.txt [new file with mode: 0644]
docs/include/jscripts/tiny_mce/langs/en.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/license.txt [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/acheck/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/acheck/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/acheck/img/acheck.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/acheck/js/dialog.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/acheck/langs/en.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/acheck/langs/en_dlg.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advhr/css/advhr.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advhr/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advhr/js/rule.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advhr/langs/en_dlg.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advhr/rule.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advimage/css/advimage.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advimage/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advimage/image.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advimage/img/sample.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advimage/js/image.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advlink/css/advlink.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advlink/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advlink/js/advlink.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advlink/link.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advlist/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/advlist/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/autoresize/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/autosave/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/autosave/langs/en.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/compat2x/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/compat2x/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/directionality/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/emotions.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/js/emotions.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/example/dialog.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/example/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/example/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/example/img/example.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/example/js/dialog.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/example/langs/en.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/example/langs/en_dlg.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/fullpage/fullpage.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/iespell/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/inlinepopups/template.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/insert_tag/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/insert_tag/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/insert_tag/img/insert_tag.png [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/insert_tag/img/term.png [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/insert_tag/langs/en.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/layer/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/media/css/content.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/media/css/media.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/media/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/media/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/media/img/flash.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/media/img/flv_player.swf [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/media/img/quicktime.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/media/img/realmedia.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/media/img/shockwave.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/media/img/trans.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/media/img/windowsmedia.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/media/js/embed.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/media/js/media.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/media/langs/en_dlg.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/media/media.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/pagebreak/css/content.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/pagebreak/img/trans.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/paste/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/paste/js/pastetext.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/paste/js/pasteword.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/paste/pastetext.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/paste/pasteword.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/preview/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/preview/example.html [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/preview/jscripts/embed.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/preview/preview.html [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/print/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/print/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/safari/blank.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/safari/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/safari/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/save/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/save/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/spellchecker/css/content.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/spellchecker/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/spellchecker/img/wline.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/style/css/props.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/style/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/style/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/style/js/props.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/style/langs/en_dlg.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/style/props.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/table/cell.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/table/css/cell.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/table/css/row.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/table/css/table.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/table/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/table/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/table/js/cell.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/table/js/merge_cells.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/table/js/row.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/table/js/table.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/table/langs/en_dlg.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/table/merge_cells.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/table/row.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/table/table.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/template/blank.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/template/css/template.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/template/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/template/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/template/js/template.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/template/langs/en_dlg.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/template/template.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/about.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/anchor.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/charmap.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/color_picker.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/editor_template.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/editor_template_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/image.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/img/icons.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/js/about.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/js/anchor.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/js/charmap.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/js/color_picker.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/js/image.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/js/link.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/js/source_editor.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/langs/en.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/link.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/default/content.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/items.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/progress.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/default/ui.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/advanced/source_editor.htm [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/simple/editor_template.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/simple/editor_template_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/simple/img/icons.gif [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/simple/langs/en.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/simple/skins/default/content.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/simple/skins/default/ui.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png [new file with mode: 0644]
docs/include/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css [new file with mode: 0644]
docs/include/jscripts/tiny_mce/tiny_mce.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/tiny_mce_popup.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/tiny_mce_src.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/utils/editable_selects.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/utils/form_utils.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/utils/mctabs.js [new file with mode: 0644]
docs/include/jscripts/tiny_mce/utils/validate.js [new file with mode: 0644]
docs/include/jscripts/transformable.js
docs/include/lib/html_resource_parser.inc.php [new file with mode: 0644]
docs/include/lib/output.inc.php
docs/include/lib/tinymce.inc.php [new file with mode: 0644]
docs/include/page_constants.inc.php
docs/include/vitals.inc.php
docs/install/db/db_schema.sql
docs/tests/add_test_questions.php [new file with mode: 0644]
docs/tests/add_test_questions_confirm.php [new file with mode: 0644]
docs/tests/classes/TestsUtility.class.php [new file with mode: 0644]
docs/tests/classes/testQuestions.class.php [moved from docs/include/classes/testQuestions.class.php with 81% similarity]
docs/tests/create_question_likert.php [new file with mode: 0644]
docs/tests/create_question_long.php [new file with mode: 0644]
docs/tests/create_question_matching.php [new file with mode: 0644]
docs/tests/create_question_matchingdd.php [new file with mode: 0644]
docs/tests/create_question_multianswer.php [new file with mode: 0644]
docs/tests/create_question_multichoice.php [new file with mode: 0644]
docs/tests/create_question_ordering.php [new file with mode: 0644]
docs/tests/create_question_truefalse.php [new file with mode: 0644]
docs/tests/create_test.php [new file with mode: 0644]
docs/tests/dd.php [new file with mode: 0644]
docs/tests/delete_question.php [new file with mode: 0644]
docs/tests/delete_result.php [new file with mode: 0644]
docs/tests/delete_test.php [new file with mode: 0644]
docs/tests/edit_question_likert.php [new file with mode: 0644]
docs/tests/edit_question_long.php [new file with mode: 0644]
docs/tests/edit_question_matching.php [new file with mode: 0644]
docs/tests/edit_question_matchingdd.php [new file with mode: 0644]
docs/tests/edit_question_multianswer.php [new file with mode: 0644]
docs/tests/edit_question_multichoice.php [new file with mode: 0644]
docs/tests/edit_question_ordering.php [new file with mode: 0644]
docs/tests/edit_question_truefalse.php [new file with mode: 0644]
docs/tests/edit_test.php [new file with mode: 0644]
docs/tests/export_test.php [new file with mode: 0644]
docs/tests/form_editor.php [new file with mode: 0644]
docs/tests/html/tests_questions.inc.php [new file with mode: 0644]
docs/tests/import_test.php [new file with mode: 0644]
docs/tests/index.php [new file with mode: 0644]
docs/tests/lib/likert_presets.inc.php [new file with mode: 0644]
docs/tests/lib/test_question_queries.inc.php [new file with mode: 0644]
docs/tests/lib/test_result_functions.inc.php [moved from docs/home/lib/test_result_functions.inc.php with 87% similarity]
docs/tests/my_tests.php [new file with mode: 0644]
docs/tests/preview.php [new file with mode: 0644]
docs/tests/preview_question.php [new file with mode: 0644]
docs/tests/question_cats.php [new file with mode: 0644]
docs/tests/question_cats_delete.php [new file with mode: 0644]
docs/tests/question_cats_manage.php [new file with mode: 0644]
docs/tests/question_db.php [new file with mode: 0644]
docs/tests/question_import.php [new file with mode: 0644]
docs/tests/question_remove.php [new file with mode: 0644]
docs/tests/questions.php [new file with mode: 0644]
docs/themes/default/forms.css
docs/themes/default/home/index_course.tmpl.php
docs/themes/default/include/header.tmpl.php
docs/themes/default/styles.css
docs/themes/default/tests/create_edit_question_likert.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/create_edit_question_long.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/create_edit_question_matching.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/create_edit_question_matchingdd.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/create_edit_question_multianswer.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/create_edit_question_multichoice.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/create_edit_question_ordering.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/create_edit_question_truefalse.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/create_edit_test.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/index.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/question_cats.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/question_cats_manage.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/question_db_top.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/footer.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/header.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/likert.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/likert_qti_1p2.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/likert_qti_2p1.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/likert_result.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/likert_stats.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/long.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/long_qti_1p2.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/long_qti_2p1.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/long_result.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/long_stats.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/manifest_qti_1p2.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/manifest_qti_2p1.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/matching.tmpl.new.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/matching.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/matching_qti_1p2.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/matching_qti_2p1.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/matching_result.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/matching_stats.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/matchingdd.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/matchingdd_qti_1p2.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/matchingdd_qti_2p1.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/matchingdd_result.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/matchingdd_stats.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/multianswer.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/multianswer_qti_1p2.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/multianswer_qti_2p1.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/multianswer_result.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/multianswer_stats.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/multichoice.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/multichoice_qti_1p2.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/multichoice_qti_2p1.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/multichoice_result.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/multichoice_stats.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/ordering.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/ordering_qti_1p2.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/ordering_qti_2p1.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/ordering_result.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/ordering_stats.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/truefalse.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/truefalse_qti_1p2.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/truefalse_qti_2p1.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/truefalse_result.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/truefalse_stats.tmpl.php [new file with mode: 0644]
docs/themes/default/tests/test_questions/wrapper.tmpl.php [new file with mode: 0644]
docs/themes/default/user/user_group_create_edit.tmpl.php
docs/user/user_group_create_edit.php

index d6833f9..fb0f2a8 100644 (file)
@@ -29,6 +29,7 @@ include(TR_INCLUDE_PATH.'header.inc.php');
         <li><a href="<?php echo TR_BASE_HREF.'documentation/oauth_server_api.php'; ?>#request_token">Request token</a></li>\r
         <li><a href="<?php echo TR_BASE_HREF.'documentation/oauth_server_api.php'; ?>#authorization">Authorization</a></li>\r
         <li><a href="<?php echo TR_BASE_HREF.'documentation/oauth_server_api.php'; ?>#access_token">Access token</a></li>\r
+        <li><a href="<?php echo TR_BASE_HREF.'documentation/oauth_server_api.php'; ?>#import">Import Common Cartridge or Content Package into Transformable</a></li>\r
       </ul>\r
     </div>\r
     \r
@@ -78,7 +79,7 @@ error=Empty+parameter+%22consumer%22.<br />
 </pre>\r
 <p>A fail response returns error message.</p> \r
 \r
-<h2 id="register_consumer">Request token</h2>\r
+<h2 id="request_token">Request token</h2>\r
 \r
 <h3>Endpoint: </h3><p>http://server-cname/oauth/request_token.php</p>\r
 <h3>Parameters</h3><br />\r
@@ -165,9 +166,10 @@ error=Consumer+is+not+registered.<br />
 <tr>\r
   <th>oauth_callback</th>\r
   <td>Optional. The Consumer MAY specify a URL the Service Provider will use to redirect the User \r
-  back to the Consumer when <a href="http://oauth.net/core/1.0#auth_step2">Obtaining User Authorization</a> \r
+  back to the Consumer along with the request token when \r
+  <a href="http://oauth.net/core/1.0#auth_step2">Obtaining User Authorization</a> \r
   is complete. If this parameter was not given or empty, the message "User is authenticated successfully" \r
-  will be displayed as success response.</td>\r
+  will be returned as success response.</td>\r
   <td>0</td>\r
 </tr>\r
 \r
@@ -181,8 +183,8 @@ error=Consumer+is+not+registered.<br />
 </pre>\r
 \r
 <span style="font-weight:bold">Success response</span>\r
-<p>Redirect the User back to the URL specified in oauth_callback. If oauth_callback is not given or empty, the message \r
-"User is authenticated successfully" will be displayed.</p> \r
+<p>Redirect the User back to the URL specified in oauth_callback along with the send-in request token "oauth_token". \r
+If oauth_callback is not given or empty, the message "User is authenticated successfully" will be returned.</p> \r
 \r
 <span style="font-weight:bold">Fail response</span>\r
 <pre style="background-color:#F7F3ED;"> \r
@@ -190,7 +192,7 @@ error=Empty+oauth+token.<br />
 </pre>\r
 <p>A fail response returns error message.</p> \r
 \r
-<h2 id="register_consumer">Access token</h2>\r
+<h2 id="access_token">Access token</h2>\r
 \r
 <h3>Endpoint: </h3><p>http://server-cname/oauth/access_token.php</p>\r
 <h3>Parameters</h3><br />\r
@@ -264,5 +266,59 @@ oauth_token=086cbfe90b41a7fdf9&oauth_token_secret=55e2bd8454b2f75a21<br />
 error=Invalid+oauth+request+token.<br />\r
 </pre>\r
 <p>A fail response returns error message.</p> \r
+<p>Note that the access token can be reused during the expire threshold is reached. Expire threshold is defined in the \r
+<a href="<?php echo TR_BASE_HREF;?>documentation/oauth_server_api.php#register_consumer">register consumer request</a>.</p>\r
+\r
+<h2 id="import">Import Common Cartridge or Content Package into Transformable</h2>\r
+<p>Till here, with a set of token credentials, the client is now able to import common cartridge or content package into\r
+Transformable as a new course. The generated course ID is returned at success. Or, an error message is returned at fail.</p>\r
+<h3>Endpoint: </h3><p>http://server-cname/home/ims/ims_import.php</p>\r
+<h3>Parameters</h3><br />\r
+\r
+<table class="data" rules="all">\r
+<tbody><tr>\r
+<th>Parameter</th><th>Description</th><th>Default value</th>\r
+</tr>\r
+\r
+<tr>\r
+  <th>oauth_token</th>\r
+  <td>Required. The Access Token obtained previously.</td>\r
+  <td>None.</td>\r
+</tr>\r
+\r
+<tr>\r
+  <th>url</th>\r
+  <td>Required. The URL pointing to a zip file of the common cartridge or content package.</td>\r
+  <td>None.</td>\r
+</tr>\r
+</tbody></table>\r
+<br />\r
+\r
+<h3>Example</h3><br />\r
+<span style="font-weight: bold">Request</span>\r
+<pre style="background-color:#F7F3ED;"> \r
+<?php echo TR_BASE_HREF; ?>home/ims/ims_import.php?oauth_token=9941b13ebc574a62d0&\r
+url=http%3A%2F%2Fatutor.ca%2Fdemo%2Fmods%2F_core%2Fimscp%2Fims_export.php%3Fcid%3D0%26c%3D15%26m%3D7478785009a6629d0a5d5b5ff5850eb8<br />\r
+</pre>\r
+\r
+<span style="font-weight:bold">Success response</span>\r
+<pre style="background-color:#F7F3ED;"> \r
+course_id=20<br />\r
+</pre>\r
+<p>course_id is the number ID of the newly-imported course. This ID can be used to view and download the imported course. \r
+Refer to <a href="<?php echo TR_BASE_HREF;?>documentation/web_service_api.php">Web Service API</a> for details.</p> \r
+\r
+<span style="font-weight:bold">Fail response</span>\r
+<pre style="background-color:#F7F3ED;"> \r
+error=User+has+no+author+privilege.<br />\r
+error=Empty+OAuth+token.<br />\r
+error=Invalid+OAuth+token.<br />\r
+error=OAuth+token+expired.<br />\r
+error=Invalid+imported+file.<br />\r
+error=Cannot+create+import+directory.<br />\r
+error=IMS+manifest+file+does+not+appear+to+be+valid.<br />\r
+error=Error+at+parsing+IMS+manifest+file.<br />\r
+</pre>\r
+<p>A fail response returns error message. Could be any of the above.</p> \r
 \r
 <?php include(TR_INCLUDE_PATH.'footer.inc.php'); ?>\r
index 06eb559..13974ae 100644 (file)
@@ -18,6 +18,173 @@ include(TR_INCLUDE_PATH.'header.inc.php');
 <div class="output-form" style="line-height:150%">\r
 \r
 <h1>Transformable Web Service API</h1>\r
-<p>Interface applications with the Transformable through its experimental API. This is version 0.1, dated Mar 2009.</p>\r
-<p>[Your content here.]</p>\r
+<p>Interface applications with the Transformable through its experimental API. This is version 0.1, dated Jun 2010.</p>\r
+<p>Transformable provides search web service API that allows users to send request to Transformable to search through \r
+the repository by keywords. Transformable returns the search results in REST format. Transformable also provides URLs and \r
+<a href="<?php echo TR_BASE_HREF;?>documentation/oauth_web_server">OAuth web service API</a> to view, download, import, \r
+export courses at Transformable. </p>\r
+\r
+<h2 id="TableOfContents">Table of Contents</h2>\r
+\r
+    <div id="toc">\r
+      <ul>\r
+        <li><a href="<?php echo TR_BASE_HREF.'documentation/web_service_api.php'; ?>#search">Search Web Service</a>\r
+          <ul>\r
+            <li><a href="<?php echo TR_BASE_HREF.'documentation/web_service_api.php'; ?>#request_format">Search request format</a></li>\r
+            <li><a href="<?php echo TR_BASE_HREF.'documentation/web_service_api.php'; ?>#response_format">Search response format</a></li>\r
+          </ul>\r
+        </li>\r
+        <li><a href="<?php echo TR_BASE_HREF.'documentation/web_service_api.php'; ?>#urls">URLs to view, download, import, export course</a>\r
+          <ul>\r
+            <li><a href="<?php echo TR_BASE_HREF.'documentation/web_service_api.php'; ?>#view">View course</a></li>\r
+            <li><a href="<?php echo TR_BASE_HREF.'documentation/web_service_api.php'; ?>#download">Download course</a></li>\r
+            <li><a href="<?php echo TR_BASE_HREF.'documentation/web_service_api.php'; ?>#import">Import course into Transformable</a></li>\r
+          </ul>\r
+        </li>\r
+      </ul>\r
+    </div>\r
+\r
+<div id="search">\r
+<h2 id="request_format">Search request format</h2>\r
+\r
+<p>Below is a table of the parameter you can use to send a request to Transformable to search through the repository\r
+by keywords. Transformable returns the matching results in REST format.</p>\r
+\r
+<p>URL:<br />\r
+<kbd><?php echo TR_BASE_HREF; ?>search.php</kbd> <br />\r
+(replace with the address of your own server if you want to call a private instance of the Transformable)</p>\r
+\r
+<table class="data" rules="all">\r
+<tbody><tr>\r
+<th>Parameter</th><th>Description</th><th>Default value</th>\r
+</tr>\r
+\r
+<tr>\r
+  <th>id</th>\r
+  <td>The "Web Service ID" generated once successfully registering into Transformable. \r
+  This ID is a 32 characters long string. It can always be retrieved from user's "Profile" page.</td>\r
+  <td>None, must be given.</td>\r
+</tr>\r
+\r
+<tr>\r
+  <th>keywords</th>\r
+  <td>The keywords to search for.</td>\r
+  <td>None, must be given.</td>\r
+</tr>\r
+\r
+<tr>\r
+  <th>start</th>\r
+  <td>Start receiving from this record number</td>\r
+  <td>0. Optional</td>\r
+</tr>\r
+\r
+<tr>\r
+  <th>maxResults</th>\r
+  <td>Number of results to return.</td>\r
+  <td>10. Optional</td>\r
+</tr>\r
+</tbody></table>\r
+<br />\r
+\r
+<span style="font-weight: bold">Sample search request</span>\r
+<p><?php echo TR_BASE_HREF; ?>search.php?id=fb170575596b4a5b52a87da39ef59586&keywords=atutor+all&start=10&maxResults=25</p>\r
+<p>Goal: Search for keywords "atutor all". Return search results from record #10 and maximum 25 results returned.</p>\r
+\r
+<h2 id="response_format">Search response format</h2><br/>\r
+<span style="font-weight:bold">Success REST Response</span>\r
+<p>A REST success response for the validation of a document (invalid) will look like this:</p>\r
+\r
+<pre style="background-color:#F7F3ED;"> \r
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;\r
+&lt;resultset&gt;\r
+  &lt;summary&gt;\r
+    &lt;numOfTotalResults&gt;11&lt;/numOfTotalResults&gt;\r
+\r
+    &lt;numOfResults&gt;3&lt;/numOfResults&gt;\r
+    &lt;lastResultNumber&gt;3&lt;/lastResultNumber&gt;\r
+  &lt;/summary&gt;\r
+\r
+  &lt;results&gt;\r
+\r
+    &lt;result&gt;\r
+      &lt;courseID&gt;3&lt;/courseID&gt;\r
+      &lt;title&gt;another import - welcome to atutor11sdf&lt;/title&gt;\r
+      &lt;description&gt;&lt;/description&gt;\r
+\r
+      &lt;creationDate&gt;2010-01-13 13:51:53&lt;/creationDate&gt;\r
+    &lt;/result&gt; \r
+    &lt;result&gt;\r
+\r
+      &lt;courseID&gt;4&lt;/courseID&gt;\r
+      &lt;title&gt;an introduction to data and information&lt;/title&gt;\r
+\r
+      &lt;description&gt;this work is licensed under a creative commons attribution-noncommercial-sharealike 2.0 http://creativecommons.org/licenses/by-nc-sa/2.0/uk/&lt;/description&gt;\r
+      &lt;creationDate&gt;2010-01-13 13:52:07&lt;/creationDate&gt;\r
+    &lt;/result&gt; \r
+    &lt;result&gt;\r
+      &lt;courseID&gt;7&lt;/courseID&gt;\r
+\r
+      &lt;title&gt;atutor howto 1.4.3&lt;/title&gt;\r
+      &lt;description&gt;documentation for students, instructors, and administrators.&lt;/description&gt;\r
+      &lt;creationDate&gt;2010-02-02 12:07:43&lt;/creationDate&gt;\r
+    &lt;/result&gt; \r
+\r
+  &lt;/results&gt;\r
+\r
+&lt;/resultset&gt;\r
+</pre>\r
+\r
+<br />\r
+<span style="font-weight:bold">Error Response</span>\r
+\r
+<pre style="background-color:#F7F3ED;"> \r
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;\r
+&lt;errors&gt;\r
+  &lt;totalCount&gt;1&lt;/totalCount&gt;\r
+  &lt;error code=&quot;401&quot;&gt;\r
+\r
+    &lt;message&gt;Empty keywords&lt;/message&gt;\r
+  &lt;/error&gt;\r
+\r
+&lt;/errors&gt;\r
+</pre>\r
+\r
+</div>\r
+\r
+<div id="urls">\r
+<h2 id="view">View course URL</h2>\r
+<kbd><?php echo TR_BASE_HREF;?>home/course/index.php?_course_id=10</kbd><br />\r
+<p>_course_id is the "courseID" element returned in the REST search result</p>\r
+<p>This URL leads to the first content page of the course.</p>\r
+\r
+<h2 id="download">Download course URL</h2>\r
+<kbd><?php echo TR_BASE_HREF;?>home/imscc/ims_export.php?course_id=10</kbd><br />\r
+<p>course_id is the "courseID" element returned in the REST search result</p>\r
+<p>This URL returns a zipped common cartridge of the course.</p>\r
+</div>\r
+\r
+<h2 id="import">Import common cartridge or content package into Transformable</h2>\r
+<p>A Transformable user ID with author privilege is required for this action. If you\r
+don't have an Transformable ID yet, register at <a href="<?php echo TR_BASE_HREF;?>register.php">here</a>.</p> \r
+\r
+<p>Once the Transformable user ID is ready, the first step is to go through \r
+<a href="<?php echo TR_BASE_HREF;?>documentation/oauth_server_api.php">\r
+Transformable OAuth authentication process</a> to get an OAuth access token. The \r
+authentication process prompts user to login with the Transformable user ID and an\r
+access token is returned at the end of the authentication process. This access \r
+token must be sent along with the import request for user privilege check. The access\r
+token can be used repeatedly till its expire threshold is reached. After the\r
+user is confirmed as an valid author, the common cartridge or content package retrieved\r
+from the request "url" parameter is imported as a new Transformable course. The course\r
+ID of the newly-imported course is returned at success.</p>\r
+\r
+<kbd><?php echo TR_BASE_HREF;?>home/ims/ims_import.php?oauth_token=xxx&url=xxx</kbd><br />\r
+\r
+<p>oauth_token is the valid access token returned by Transformable OAuth server.<br />\r
+url points to a zip file of a common cartridge or a content package.<br />\r
+Refer to <a href="<?php echo TR_BASE_HREF;?>documentation/oauth_server_api.php#import">\r
+Import Common Cartridge or Content Package into Transformable via OAuth</a> for detailed \r
+request parameters and success/fail responses.</p>\r
+\r
+</div>\r
 <?php include(TR_INCLUDE_PATH.'footer.inc.php'); ?>\r
index 9e95ecc..81ca781 100644 (file)
@@ -428,7 +428,7 @@ class ContentUtility {
        {\r
                global $_course_id;\r
                \r
-               if (!$content_id) return;\r
+               if (!$content_id || !isset($_SESSION['user_id'])) return;\r
                \r
                include_once(TR_INCLUDE_PATH.'classes/DAO/UserCoursesDAO.class.php');\r
                \r
index 0eb0926..7347cf7 100644 (file)
@@ -22,7 +22,6 @@ if ($cid == 0) {
        header('Location: '.$_base_href.'index.php');
        exit;
 }
-
 /* show the content page */
 $content_row = $contentManager->getContentPage($cid);
 
@@ -162,7 +161,7 @@ $_custom_head .= '
        </script>
 ';
 
-ContentUtility::saveLastCid($cid);
+if (isset($_SESSION['user_id'])) ContentUtility::saveLastCid($cid);
 
 if (isset($top_num) && $top_num != (int) $top_num) {
        $top_num = substr($top_num, 0, strpos($top_num, '.'));
index 9e9b235..2b4ca9a 100644 (file)
@@ -220,6 +220,7 @@ class CoursesDAO extends DAO {
         */
        public function getSearchResult($keywords, $start=0, $maxResults=0)
        {
+               require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
                // full-text search
 //             $sql = "SELECT DISTINCT course_id, title, description, created_date
 //                       FROM (SELECT cs.course_id as course_id, cs.title as title, cs.description as description
@@ -249,7 +250,7 @@ class CoursesDAO extends DAO {
                           AND cs.course_id = ct.course_id
                           AND cs.user_id = u.user_id
                           AND ".$sql_where."
-                        ORDER BY ".$sql_order;
+                        ORDER BY ".$sql_order." DESC ";
                
                if ($maxResults > 0) $sql .= " LIMIT ".$start.", ".$maxResults;
                return $this->execute($sql);
index 5f84cac..66289c7 100644 (file)
 if (!defined('TR_INCLUDE_PATH')) exit;
 
 require_once(TR_INCLUDE_PATH. 'classes/DAO/DAO.class.php');
+require_once(TR_INCLUDE_PATH. 'classes/Utility.class.php');
 
 class TestsDAO extends DAO {
 
        /**
-        * Create a new record
+        * Create a new row
         * @access  public
-        * @param   $course_id, $title, $description, $format, $start_date, $end_date,
-                   $order, $num_questions, $instructions, $content_id, $passscore, $passpercent,
-                   $passfeedback, $failfeedback, $result_release, $random, $difficulty,
-                   $num_takes, $anonymous, $out_of, $allow_guests, $display
-        * @return  test id, if successful
+        * @param   
+        * @return  true, if successful
         *          false and add error into global var $msg, if unsuccessful
         * @author  Cindy Qi Li
         */
-       public function Create($course_id, $title, $description, $format, $start_date, $end_date,
-                              $order, $num_questions, $instructions, $content_id, $passscore, $passpercent,
-                              $passfeedback, $failfeedback, $result_release, $random, $difficulty,
-                              $num_takes, $anonymous, $out_of, $allow_guests, $display)
+       public function Create($course_id, $title, $description)
        {
                global $addslashes;
+               
+               $title = Utility::validateLength($addslashes(trim($title)), 100);
+               $description = $addslashes(trim($description));
 
-               if ($this->isFieldsValid($course_id, $title))
+               if ($this->isFieldsValid($title))
                {
-                       /* insert into the db */
                        $sql = "INSERT INTO ".TABLE_PREFIX."tests " .
-                                  "(course_id,
-                                        title,
-                                        description,
-                                        `format`,
-                                        start_date,
-                                        end_date,
-                                        randomize_order,
-                                        num_questions,
-                                        instructions,
-                                        content_id,
-                                        passscore,
-                                        passpercent,
-                                        passfeedback,
-                                        failfeedback,
-                                        result_release,
-                                        random,
-                                        difficulty,
-                                        num_takes,
-                                        anonymous,
-                                        out_of,
-                                        guests,
-                                        display) " .
-                               "VALUES 
-                                   (".$course_id.", 
-                                   '".$title."', 
-                                   '".$description."', 
-                                   ".$format.", 
-                                   '".$start_date."', 
-                                   '".$end_date."', 
-                                   ".$order.", 
-                                   ".$num_questions.", 
-                                   '".$instructions."', 
-                                   ".$content_id.", 
-                                   ".$passscore.", 
-                                   ".$passpercent.", 
-                                   '".$passfeedback."', 
-                                   '".$failfeedback."', 
-                                   ".$result_release.", 
-                                   ".$random.", 
-                                   ".$difficulty.", 
-                                   ".$num_takes.", 
-                                   ".$anonymous.", 
-                                   '".$out_of."', 
-                                   ".$allow_guests.", 
-                                   ".$display.")";
-                                               
+                              "(course_id, title, description)" .
+                              "VALUES ($course_id, '$title', '$description')";
+       
                        if (!$this->execute($sql))
                        {
                                $msg->addError('DB_NOT_UPDATED');
@@ -110,134 +64,53 @@ class TestsDAO extends DAO {
        /**
         * Update an existing user record
         * @access  public
-        * @param   userID: user ID (1 [admin] or 2 [user])
-        *          login: login name
-        *          pwd: password
-        *          email: email
-        *          first_name: first name
-        *          last_name: last name
-        *          status
+        * @param   testID, title, description
         * @return  user id, if successful
         *          false and add error into global var $msg, if unsuccessful
         * @author  Cindy Qi Li
         */
-       public function Update($userID, $user_group_id, $login, $email, $first_name, $last_name, 
-                              $is_author, $organization, $phone, $address, $city,
-                              $province, $country, $postal_code, $status)
-       {
-               global $addslashes, $msg;
-
-               /* email check */
-               $login = $addslashes(strtolower(trim($login)));
-               $email = $addslashes(trim($email));
-               $first_name = $addslashes(str_replace('<', '', trim($first_name)));
-               $last_name = $addslashes(str_replace('<', '', trim($last_name)));
-               $organization = $addslashes(trim($organization));
-               $phone = $addslashes(trim($phone));
-               $address = $addslashes(trim($address));
-               $city = $addslashes(trim($city));
-               $province = $addslashes(trim($province));
-               $country = $addslashes(trim($country));
-               $postal_code = $addslashes(trim($postal_code));
-               
-               if ($this->isFieldsValid('update', $user_group_id,$login, $email,$first_name, $last_name,
-                                        $is_author, $organization, $phone, $address, $city,
-                                    $province, $country, $postal_code))
-               {
-                       /* insert into the db */
-                       $sql = "UPDATE ".TABLE_PREFIX."users
-                                  SET login = '".$login."',
-                                      user_group_id = '".$user_group_id."',
-                                      first_name = '".$first_name."',
-                                      last_name = '".$last_name."',
-                                      email = '".$email."',
-                                      is_author = ".$is_author.",
-                                      organization = '".$organization."',
-                                      phone = '".$phone."',
-                                      address = '".$address."',
-                                      city = '".$city."',
-                                      province = '".$province."',
-                                      country = '".$country."',
-                                      postal_code = '".$postal_code."',
-                                      status = '".$status."'
-                                WHERE user_id = ".$userID;
-
-                       return $this->execute($sql);
-               }
-       }
-
-       /**
-        * Update an existing user record
-        * @access  public
-        * @param   userID: user ID
-        *          fieldName: the name of the table field to update
-        *          fieldValue: the value to update
-        * @return  true if successful
-        *          error message array if failed; false if update db failed
-        * @author  Cindy Qi Li
-        */
-       public function UpdateField($userID, $fieldName, $fieldValue)
+       public function Update($testID, $title, $description)
        {
                global $addslashes;
                
-               // check if the required fields are filled
-               if ($fieldValue == '') return array(_AT('TR_ERROR_EMPTY_FIELD'));
-               
-               if ($fieldName == 'login')
-               {
-                       if (!$this->isLoginValid($fieldValue))
-                       {
-                               return array(_AT('TR_ERROR_LOGIN_CHARS'));
-                       }
-                       else if ($this->isLoginExists($fieldValue))
-                       {
-                               return array(_AT('TR_ERROR_LOGIN_EXISTS'));
-                       }
-               }
-                               
-               if ($fieldName == 'email')
+               $title = Utility::validateLength($addslashes(trim($title)), 100);
+               $description = $addslashes(trim($description));
+
+               if ($this->isFieldsValid($title))
                {
-                       if (!$this->isEmailValid($fieldValue))
-                       {
-                               return array(_AT('TR_ERROR_EMAIL_INVALID'));
-                       }
-                       else if ($this->isEmailExists($fieldValue))
-                       {
-                               return array(_AT('TR_ERROR_EMAIL_EXISTS'));
-                       }
+                       $sql = "UPDATE ".TABLE_PREFIX."tests " . 
+                              "SET title='$title', 
+                                   description='$description' 
+                               WHERE test_id=$testID";
+                       
+                       return $this->execute($sql);
                }
-                                               
-               $sql = "UPDATE ".TABLE_PREFIX."users 
-                          SET ".$fieldName."='".$addslashes($fieldValue)."'
-                        WHERE user_id = ".$userID;
-               
-               return $this->execute($sql);
        }
        
        /**
         * Delete content
         * @access  public
-        * @param   content ID
+        * @param   test ID
         * @return  true, if successful
         *          false and add error into global var $msg, if unsuccessful
         * @author  Cindy Qi Li
         */
-       public function Delete($contentID)
+       public function Delete($testID)
        {
-               $sql = "DELETE FROM ".TABLE_PREFIX."content WHERE content_id = ".$contentID;
+               $sql = "DELETE FROM ".TABLE_PREFIX."tests WHERE test_id = ".$testID;
                return $this->execute($sql);
        }
 
        /**
         * Return content information by given content id
         * @access  public
-        * @param   content id
-        * @return  content row
+        * @param   test id
+        * @return  test row
         * @author  Cindy Qi Li
         */
-       public function getContentByID($contentID)
+       public function get($testID)
        {
-               $sql = 'SELECT * FROM '.TABLE_PREFIX.'content WHERE content_id='.$contentID;
+               $sql = 'SELECT * FROM '.TABLE_PREFIX.'tests WHERE test_id='.$testID;
                if ($rows = $this->execute($sql))
                {
                        return $rows[0];
@@ -248,53 +121,48 @@ class TestsDAO extends DAO {
        /**
         * Return max ordering based on given course id and content parent id 
         * @access  public
-        * @param   course_id, content_parent_id
-        * @return  max ordering: int
+        * @param   course_id
+        * @return  test rows
         * @author  Cindy Qi Li
         */
-       public function getMaxOrdering($course_id, $content_parent_id)
+       public function getByCourseID($courseID)
        {
-               $sql = "SELECT MAX(ordering) AS ordering FROM ".TABLE_PREFIX."content 
-                        WHERE course_id=".$course_id." 
-                          AND content_parent_id=".$content_parent_id;
-               $rows = $this->execute($sql);
-               return intval($rows[0]['ordering']);
+               $sql = "SELECT * 
+                         FROM ".TABLE_PREFIX."tests 
+                        WHERE course_id=$courseID";
+               return $this->execute($sql);
        }
 
        /**
-        * Validate fields preparing for insert and update
+        * Validates fields preparing for insert and update
         * @access  private
-        * @param   $course_id, $title
+        * @param   $title
+        *          $random
+        *          $num_questions
+        *          $pass_score_checkbox
+        *          $passscore
+        *          $passpercent
         * @return  true    if update successfully
         *          false   if update unsuccessful
         * @author  Cindy Qi Li
         */
-       private function isFieldsValid($course_id, $title)
+       private function isFieldsValid($title)
        {
                global $msg;
                
                $missing_fields = array();
                
-               if (intval($course_id) == 0)
-               {
-                       $missing_fields[] = _AT('course_id');
-               }
-               if ($title == '')
-               {
+               if ($title == '') {
                        $missing_fields[] = _AT('title');
                }
-               
-               if ($missing_fields)
-               {
+       
+               if ($missing_fields) {
                        $missing_fields = implode(', ', $missing_fields);
                        $msg->addError(array('EMPTY_FIELDS', $missing_fields));
                }
-               
-               if (!$msg->containsErrors())
-                       return true;
-               else
-                       return false;
+       
+               if (!$msg->containsErrors()) return true;
+               else return false;
        }
-
 }
 ?>
\ No newline at end of file
index f4cf1e5..2675c36 100644 (file)
@@ -39,31 +39,35 @@ class TestsQuestionsAssocDAO extends DAO {
        }
        
        /**
-       * Delete a row
+       * Delete rows by question id
        * @access  public
-       * @param   name
+       * @param   questionID
        * @return  true or false
        * @author  Cindy Qi Li
-       function Delete($name)
+       */
+       function DeleteByQuestionID($questionID)
        {
-           $sql = "DELETE FROM ".TABLE_PREFIX."config 
-                    WHERE name = '".$name."'";
+           $sql = "DELETE FROM ".TABLE_PREFIX."tests_questions_assoc 
+                    WHERE question_id = '".$questionID."'";
            return $this->execute($sql);
        }
-       */
        
        /**
-       * Return a config row by name
+       * Return all associated questions of the given test
        * @access  public
-       * @param   name
-       * @return  table rows
+       * @param   testID
+       * @return  table rows if successful. false if unsuccessful
        * @author  Cindy Qi Li
-       function get($name)
+       */
+       function getByTestID($testID)
        {
-           $sql = "SELECT * FROM ".TABLE_PREFIX."config WHERE name = '".$name."'";
-           $rows = $this->execute($sql);
-           return $rows[0];
+           $sql = "SELECT TQ.*, TQA.weight, TQA.ordering, TQA.required 
+                     FROM ".TABLE_PREFIX."tests_questions TQ 
+                    INNER JOIN ".TABLE_PREFIX."tests_questions_assoc TQA 
+                    USING (question_id) 
+                    WHERE TQA.test_id=".$testID."
+                    ORDER BY TQA.ordering, TQA.question_id";
+           return $this->execute($sql);
        }
-       */
 }
 ?>
\ No newline at end of file
diff --git a/docs/include/classes/DAO/TestsQuestionsCategoriesDAO.class.php b/docs/include/classes/DAO/TestsQuestionsCategoriesDAO.class.php
new file mode 100644 (file)
index 0000000..68eb67d
--- /dev/null
@@ -0,0 +1,175 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+/**
+ * DAO for "tests_questions_categories" table
+ * @access     public
+ * @author     Cindy Qi Li
+ * @package    DAO
+ */
+
+if (!defined('TR_INCLUDE_PATH')) exit;
+
+require_once(TR_INCLUDE_PATH. 'classes/DAO/DAO.class.php');
+
+class TestsQuestionsCategoriesDAO extends DAO {
+       
+       /**
+        * Create a new row
+        * @access  public
+        * @param   course_id, title
+        * @return  category id, if successful
+        *          false and add error into global var $msg, if unsuccessful
+        * @author  Cindy Qi Li
+        */
+       public function Create($courseID, $title)
+       {
+               global $addslashes;
+
+               $courseID = intval($courseID);
+               $title = $addslashes(trim($title));
+
+               if ($this->isFieldsValid('new', $title, $courseID))
+               {
+                       $sql = "INSERT INTO ".TABLE_PREFIX."tests_questions_categories (course_id, title)
+                               VALUES (".$courseID.", '".$title."')";
+
+                       if (!$this->execute($sql))
+                       {
+                               $msg->addError('DB_NOT_UPDATED');
+                               return false;
+                       }
+                       else
+                       {
+                               return mysql_insert_id();
+                       }
+               }
+               else
+               {
+                       return false;
+               }
+       }
+
+       /**
+        * Update the title of an existing category
+        * @access  public
+        * @param   categoryID
+        *          title
+        * @return  user id, if successful
+        *          false and add error into global var $msg, if unsuccessful
+        * @author  Cindy Qi Li
+        */
+       public function Update($categoryID, $title)
+       {
+               global $addslashes;
+
+               $title = $addslashes(trim($title));
+                               
+               if ($this->isFieldsValid('update', $title, $categoryID))
+               {
+                       /* insert into the db */
+                       $sql = "UPDATE ".TABLE_PREFIX."tests_questions_categories
+                                  SET title = '".$title."'
+                                WHERE category_id = ".$categoryID;
+
+                       return $this->execute($sql);
+               }
+       }
+       
+       /**
+        * Delete content
+        * @access  public
+        * @param   category ID
+        * @return  true, if successful
+        *          false if unsuccessful
+        * @author  Cindy Qi Li
+        */
+       public function Delete($categoryID)
+       {
+               $sql = "DELETE FROM ".TABLE_PREFIX."tests_questions_categories WHERE category_id = ".$categoryID;
+               return $this->execute($sql);
+       }
+
+       /**
+        * Return content information by given category id
+        * @access  public
+        * @param   categoryID: category id
+        * @return  the row if successful, otherwise, return false
+        * @author  Cindy Qi Li
+        */
+       public function get($categoryID)
+       {
+               $sql = "SELECT * FROM ".TABLE_PREFIX."tests_questions_categories 
+                            WHERE category_id=".$categoryID;
+               
+               $rows = $this->execute($sql);
+               
+               if (is_array($rows)) return $rows[0];
+               else return false;
+       }
+       
+       /**
+        * Return content information by given content id
+        * @access  public
+        * @param   courseID: course id
+        * @return  rows
+        * @author  Cindy Qi Li
+        */
+       public function getByCourseID($courseID)
+       {
+               $sql = "SELECT * FROM ".TABLE_PREFIX."tests_questions_categories 
+                        WHERE course_id=".$courseID."
+                        ORDER BY title";
+               
+               return $this->execute($sql);
+       }
+
+       /**
+        * Validates fields preparing for insert and update
+        * @access  private
+        * @param   $validate_type : new/update. When "new", $ID is course_id. When "update", $ID is category_id
+        *          $title
+        *          $ID
+        * @return  true    if update successfully
+        *          false   if update unsuccessful
+        * @author  Cindy Qi Li
+        */
+       private function isFieldsValid($validate_type, $title, $ID)
+       {
+               global $msg;
+               
+               $missing_fields = array();
+               /* login name check */
+               if ($title == '')
+               {
+                       $missing_fields[] = _AT('title');
+               }
+
+               if ($ID == 0)
+               {
+                       if ($validate_type == 'new') $missing_fields[] = _AT('course_id');
+                       if ($validate_type == 'update') $missing_fields[] = _AT('category_id');
+               }
+
+               if ($missing_fields)
+               {
+                       $missing_fields = implode(', ', $missing_fields);
+                       $msg->addError(array('EMPTY_FIELDS', $missing_fields));
+               }
+               
+               if (!$msg->containsErrors())
+                       return true;
+               else
+                       return false;
+       }
+}
+?>
\ No newline at end of file
index 1b0894f..14eff45 100644 (file)
@@ -45,6 +45,29 @@ class UserGroupPrivilegeDAO extends DAO {
                return $this->execute($sql);
        }
 
+       /**
+        * Update an existing user group privilege record
+        * @access  public
+        * @param   userGroupID: user group ID
+        *          privilegeID: privilege ID
+        *          fieldName: the name of the table field to update
+        *          fieldValue: the value to update
+        * @return  true if successful
+        *          error message array if failed; false if update db failed
+        * @author  Cindy Qi Li
+        */
+       public function UpdateField($userGroupID, $privilegeID, $fieldName, $fieldValue)
+       {
+               global $addslashes;
+
+               $sql = "UPDATE ".TABLE_PREFIX."user_group_privilege
+                          SET ".$fieldName."='".$addslashes($fieldValue)."'
+                        WHERE user_group_id = ".$userGroupID."
+                          AND privilege_id = ".$privilegeID;
+               
+               return $this->execute($sql);
+       }
+       
        /**
         * Delete a row
         * @access  public
@@ -79,5 +102,26 @@ class UserGroupPrivilegeDAO extends DAO {
                return $this->execute($sql);
        }
 
+       /**
+        * Get a row by userGroupID and privilegeID
+        * @access  public
+        * @param   userGroupID
+        *          privilegeID
+        * @return  a table row, if successful
+        *          false, if the row is not found
+        * @author  Cindy Qi Li
+        */
+       public function Get($userGroupID, $privilegeID)
+       {
+               $sql = "SELECT * FROM ".TABLE_PREFIX."user_group_privilege
+                        WHERE user_group_id = ".$userGroupID."
+                          AND privilege_id = ".$privilegeID;
+       
+               $rows = $this->execute($sql);
+               
+               if (is_array($rows)) return $rows[0];
+               else return false;
+       }
+
 }
 ?>
\ No newline at end of file
index 931860b..a277be3 100644 (file)
@@ -170,7 +170,7 @@ class UsersDAO extends DAO {
                               $is_author, $organization, $phone, $address, $city,
                               $province, $country, $postal_code, $status)
        {
-               global $addslashes, $msg;
+               global $addslashes;
 
                /* email check */
                $login = $addslashes(strtolower(trim($login)));
@@ -492,7 +492,7 @@ class UsersDAO extends DAO {
        }
 
        /**
-        * Validate fields preparing for insert and update
+        * Validates fields preparing for insert and update
         * @access  private
         * @param   $validate_type : new/update. When validating for update, don't check if the login, email, name are unique
         *          $user_group_id : user ID
index 98d01fd..8c4fcad 100644 (file)
@@ -26,6 +26,7 @@
 if (!defined('TR_INCLUDE_PATH')) exit;
 
 require_once(TR_INCLUDE_PATH. 'classes/DAO/PrivilegesDAO.class.php');
+require_once(TR_INCLUDE_PATH. 'classes/Utility.class.php');
 
 class Menu {
 
@@ -102,7 +103,7 @@ class Menu {
         */
        private function setTopPages()
        {
-               global $_base_path;
+               global $_base_path, $_course_id, $_content_id;
 
                $priviledgesDAO = new PrivilegesDAO();
 
@@ -114,22 +115,33 @@ class Menu {
                {
                        $rows = $priviledgesDAO->getPublicPrivileges();
                }
-
                if (is_array($rows))
                {
                        foreach ($rows as $id => $row)
                        {
-                               $this->pages[TR_NAV_TOP][] = array('url' => $_base_path.$row['link'], 'title' => _AT($row['title_var']));
-
+                               // replace the required constants in link
+                               $row['link'] = Utility::replaceConstants($row['link']);
+                               
+                               list($url, $param) = Utility::separateURLAndParam($row['link']);
+                               if (Utility::authenticate($row['user_requirement'], false)) {
+                                       $this->pages[TR_NAV_TOP][] = array('url' => $_base_path.$row['link'], 
+                                                                  'title' => _AT($row['title_var']),
+                                                                      'param' => $param);
+                               }
+                               
                                // add section pages if it has not been defined in $this->pages
-                               if (!isset($this->pages[$row['link']]))
+                               if (!isset($this->pages[$url]))
                                {
-                                       $this->pages = array_merge($this->pages, 
-                                                          array($row['link'] => array('title_var'=>$row['title_var'], 'parent'=>TR_NAV_TOP)));
+                                   $this->pages = array_merge($this->pages, 
+                                                          array($url => array('title_var'=>$row['title_var'], 'parent'=>TR_NAV_TOP, 'param' => $param)));
+                               }
+                               else
+                               {
+                                       $this->pages[$url]['param'] = $param;
                                }
                        }
                }
-
+               
                return true;
        }
 
@@ -179,7 +191,7 @@ class Menu {
        * @author  Cindy Qi Li
        */
        private function setSubMenus($page) {
-               global $_base_path;
+               global $_base_path, $_course_id;
 
                if (isset($page) && defined($page)) 
                {
@@ -188,13 +200,16 @@ class Menu {
                } 
                else if (isset($this->pages[$page]['children'])) 
                {
-                       $sub_menus[] = array('url' => $_base_path . $page, 'title' => $this->getPageTitle($page));
+                       $param = $this->getParam($page);
+//                     $sub_menus[] = array('url' => $_base_path . $page.$param, 'title' => $this->getPageTitle($page), 'param' => $param);
 
                        foreach ($this->pages[$page]['children'] as $child) 
                        {
-                               $sub_menus[] = array('url' => $_base_path . $child, 
+                               $this->pages[$child]['param'] = $param;
+                               $sub_menus[] = array('url' => $_base_path . $child.$param, 
                                                    'title' => $this->getPageTitle($child), 
-                                                   'has_children' => isset($this->pages[$child]['children']));
+                                                   'has_children' => isset($this->pages[$child]['children']),
+                                                   'param' => $param);
                        }
                } 
                else if (isset($this->pages[$page]['parent'])) 
@@ -202,7 +217,7 @@ class Menu {
                        // no children
                        return $this->setSubMenus($this->pages[$page]['parent']);
                }
-               
+
                return $sub_menus;
        }
 
@@ -373,20 +388,22 @@ class Menu {
        {
                global $_base_path;
 
+               // all children pages inherit URL parameter of the parent page
                $parent_page = $this->pages[$page]['parent'];
+               $parent_page_param = $this->getParam($page);
 
                $page_title = $this->getPageTitle($page);
 
                if (isset($parent_page) && defined($parent_page))
                {
-                       $path[] = array('url' => $_base_path . $page, 'title' => $page_title);
+                       $path[] = array('url' => $_base_path . $page.$parent_page_param, 'title' => $page_title, 'param' => $parent_page_param);
                }
                else if (isset($parent_page))
                {
-                       $path[] = array('url' => $_base_path . $page, 'title' => $page_title);
+                       $path[] = array('url' => $_base_path . $page.$parent_page_param, 'title' => $page_title, 'param' => $parent_page_param);
                        $path = array_merge((array) $path, $this->setPath($parent_page));
                } else {
-                       $path[] = array('url' => $_base_path . $page, 'title' => $page_title);
+                       $path[] = array('url' => $_base_path . $page.$parent_page_param, 'title' => $page_title, 'param' => $parent_page_param);
                }
 
                return $path;
@@ -403,5 +420,21 @@ class Menu {
                return $this->path;
        }
        
+       /**
+        * return "param" element of the given page or the parents of the given page
+        * @param $page
+        * @return "param" element value
+        */
+       private function getParam($page)
+       {
+               if (isset($this->pages[$page]['param'])) return $this->pages[$page]['param'];
+               
+               if ($page == TR_NAV_TOP) return '';
+               
+               if (isset($this->pages[$this->pages[$page]['parent']]['param']))
+                       return $this->pages[$this->pages[$page]['parent']]['param'];
+               else
+                       return $this->getParam($this->pages[$page]['parent']);
+       }
 }
 ?>
\ No newline at end of file
index a3ec22d..c7cc411 100644 (file)
@@ -11,7 +11,7 @@
 /************************************************************************/
 
 define('TR_INCLUDE_PATH', '../../');
-require_once(TR_INCLUDE_PATH.'classes/testQuestions.class.php');
+require_once(TR_INCLUDE_PATH.'../tests/classes/testQuestions.class.php');
 require_once(TR_INCLUDE_PATH.'classes/QTI/QTIParser.class.php');       
 require_once(TR_INCLUDE_PATH.'classes/DAO/TestsDAO.class.php');
 
index bfed099..f354afe 100644 (file)
@@ -220,10 +220,17 @@ class Utility {
        * This function authenticate user privilege\r
        * @access  public\r
        * @param   privilege constants\r
+       *          $printMsg: true or false. \r
+       *                     When it's true, the function prints "NO_PRIV" error msg if the user does not have $privilegeToValidate\r
+       *                     When it's fales, the function returns true if the user has $privilegeToValidate, or false if the user has no $privilegeToValidate\r
+       * @return  If the caller is oauth, echo error msg.\r
+       *          Otherwise, the return is based on the value of $printMsg, @see @param $printMsg\r
        * @author  Cindy Qi Li\r
        */\r
-       public static function authenticate($privilegeToValidate) {\r
-               global $_current_user, $_course_id, $msg;\r
+       public static function authenticate($privilegeToValidate, $printMsg=true) {\r
+               global $_current_user, $_course_id, $msg, $oauth_import;\r
+               \r
+               if ($privilegeToValidate == '' || $privilegeToValidate == 0) return true;\r
                \r
                $authenticated = true; // default\r
                /* make sure the user is the author of the current course */\r
@@ -239,14 +246,32 @@ class Utility {
                        $authenticated = false;\r
                }\r
                \r
+               if ($privilegeToValidate == TR_PRIV_IN_A_COURSE &&\r
+                   (!isset($_course_id) || $_course_id == 0))\r
+               {\r
+                       $authenticated = false;\r
+               }\r
+               \r
                if (!$authenticated)\r
                {\r
-                       $msg->addError('NO_PRIV');\r
-                       include(TR_INCLUDE_PATH.'header.inc.php');\r
-                       $msg->printAll(); \r
-                       include(TR_INCLUDE_PATH.'footer.inc.php');\r
-                       exit;\r
+                       if ($oauth_import)\r
+                       {\r
+                               echo "error=".urlencode('User has no author privilege.');\r
+                               exit;\r
+                       }\r
+                       else if ($printMsg)\r
+                       {\r
+                               $msg->addError('NO_PRIV');\r
+                               include(TR_INCLUDE_PATH.'header.inc.php');\r
+                               $msg->printAll(); \r
+                               include(TR_INCLUDE_PATH.'footer.inc.php');\r
+                               exit;\r
+                       }\r
+                       else\r
+                               return false;\r
                }\r
+               \r
+               if (!$printMsg) return true;\r
        }\r
        \r
        /**\r
@@ -260,32 +285,35 @@ class Utility {
        public static function highlightKeywords($text, $keywords)\r
        {\r
                if (!is_array($keywords)) return $text;\r
+               // remove empty and "OR" element from the keywords array\r
+               $keywords = array_diff($keywords, array('OR', '', NULL));\r
                \r
-               foreach($keywords as $keyword)\r
-               {        \r
-                       // skip "OR"\r
-                       if ($keyword == 'OR') continue;\r
-                       \r
-                       $textLen = strlen($keyword);\r
-       \r
-                       $textArray = array();\r
-                       $pos                                    = 0;\r
-                       $count                   = 0;\r
-       \r
-                       while($pos !== FALSE) {\r
-                                       $pos = stripos($text,$keyword,$pos);\r
-                                       if($pos !== FALSE) {\r
-                                                       $textArray[$count]['kwic'] = substr($text,$pos,$textLen);\r
-                                                       $textArray[$count++]['pos']     = $pos;\r
-                                                       $pos++;\r
-                                       }\r
-                       }\r
-       \r
-                       for($i=count($textArray)-1;$i>=0;$i--) {\r
-                                       $replace = '<strong class="highlight">'.$textArray[$i]['kwic'].'</strong>';\r
-                                       $text = substr_replace($text,$replace,$textArray[$i]['pos'],$textLen);\r
+               // strip html tags from input text\r
+               $text = strip_tags($text);\r
+               \r
+               $i = 0;\r
+               $highlight_start_tag = '<strong class="highlight">';\r
+               $highlight_end_tag = '</strong>';\r
+               \r
+               $strlen_highlight_start_tag = strlen($highlight_start_tag);\r
+               $strlen_highlight_end_tag = strlen($highlight_end_tag);\r
+               \r
+               // Read the text character one by one and highlight from the reading point\r
+               // This is to avoid the highlight on highlight html tags.\r
+               while ($i < strlen($text))\r
+               {\r
+                       foreach ($keywords as $keyword)\r
+                       {\r
+                               if (strtolower(substr($text, $i, strlen($keyword))) == strtolower($keyword))\r
+                               {\r
+                                       $text = substr($text, 0, $i).$highlight_start_tag.substr($text, $i, strlen($keyword)).$highlight_end_tag.substr($text, $i+strlen($keyword));\r
+                                       $i += strlen($keyword) + $strlen_highlight_start_tag + $strlen_highlight_end_tag;\r
+                                       continue 2;\r
+                               }\r
                        }\r
+                       $i++;\r
                }\r
+               \r
                return $text;\r
        }\r
        \r
@@ -306,5 +334,35 @@ class Utility {
                \r
                return array_values($in_array);\r
        }\r
+       \r
+       /**\r
+        * This funciton replace the reserved constants with the real values\r
+        * @access public\r
+        * @param $str\r
+        * @return a replaced string\r
+        * @author Cindy Qi Li\r
+        */\r
+       public static function replaceConstants($str)\r
+       {\r
+               global $_course_id, $_content_id;\r
+               \r
+               return str_replace(array('{COURSE_ID}', '{CONTENT_ID}'), array($_course_id, $_content_id), $str);\r
+       }\r
+\r
+       /**\r
+        * This funciton returns a pair of (URL, URL parameters). \r
+        * For example, if input "tests/index.php?a=1&b=2", returns array ("tests/index.php", '?a=1&b=2"');\r
+        * @access public\r
+        * @param $str\r
+        * @return array of (URL, URL parameters)\r
+        * @author Cindy Qi Li\r
+        */\r
+       public static function separateURLAndParam($str)\r
+       {\r
+               $pos = strpos($str, '?');\r
+               \r
+               if (!$pos) return array($str, '');\r
+               else return array(substr($str, 0, $pos), substr($str, $pos));\r
+       }\r
 }\r
 ?>
\ No newline at end of file
index 45ebc1b..d74c9a9 100644 (file)
@@ -59,6 +59,7 @@ define('TR_USERROLE_VIEWER', 2);
 // User privilege
 define('TR_PRIV_ISAUTHOR', 1);
 define('TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE', 2);
+define('TR_PRIV_IN_A_COURSE', 3);
 
 // course size
 define('TR_COURSESIZE_UNLIMITED',         -1); 
@@ -69,6 +70,11 @@ define('CONTENT_TYPE_CONTENT',  0);
 define('CONTENT_TYPE_FOLDER', 1);
 define('CONTENT_TYPE_WEBLINK', 2);
 
+/* ways of releasing a test */
+//define('TR_RELEASE_NEVER',              0); // do not release 
+define('TR_RELEASE_IMMEDIATE',    1); // release after submitted
+//define('TR_RELEASE_MARKED',             2); // release after all q's marked
+
 define('TR_KBYTE_SIZE', 1024);
 
 /* valid date format_types:                                            */
index ecaf243..5915b5d 100644 (file)
@@ -46,6 +46,7 @@ $current_page = $menu->getCurrentPage();
 
 $_sub_menus = $menu->getSubMenus();
 $back_to_page = $menu->getBackToPage();
+$_pages = $menu->getAllPages();   // add "param" element into $_pages items
 
 //debug($_base_path.$current_page);
 //debug($back_to_page);
diff --git a/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/editor_plugin.js b/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/editor_plugin.js
new file mode 100644 (file)
index 0000000..cc633d0
--- /dev/null
@@ -0,0 +1 @@
+"use strict";(function(){tinymce.PluginManager.requireLangPack('insert_tag');tinymce.create('tinymce.plugins.Insert_tagPlugin',{init:function(ed,url){var placeCursor=function(){ed.selection.select(ed.dom.select('span#remove_me')[0]);ed.dom.remove(ed.dom.select('span#remove_me')[0])};var insertionFunction=function(insertionString){return function(){if(ed.selection.isCollapsed()){ed.selection.setContent('['+insertionString+']<span id="remove_me"></span>[/'+insertionString+']');placeCursor()}else{ed.selection.setContent('['+insertionString+']'+ed.selection.getContent()+'[/'+insertionString+']')}}};ed.addCommand('mceInsertTermTag',insertionFunction("?"));ed.addButton('insert_term_tag',{title:'insert_tag.termdesc',cmd:'mceInsertTermTag',image:url+'/img/term.png'});ed.addCommand('mceInsertCodeTag',insertionFunction("code"));ed.addButton('insert_code_tag',{title:'insert_tag.codedesc',cmd:'mceInsertCodeTag',image:url+'/img/code.png'});ed.addCommand('mceInsertTexTag',insertionFunction("tex"));ed.addButton('insert_tex_tag',{title:'insert_tag.texdesc',cmd:'mceInsertTexTag',image:url+'/img/tex.png'});ed.addCommand('mceInsertMediaTag',function(){if(ed.selection.isCollapsed()){ed.selection.setContent('[media|640|480]http://<span id="remove_me"></span>[/media]');placeCursor()}else{ed.selection.setContent('[media|640|480]http://'+ed.selection.getContent()+'[/media]')}});ed.addButton('insert_media_tag',{title:'insert_tag.mediadesc',cmd:'mceInsertMediaTag',image:url+'/img/media.png'})},getInfo:function(){return{longname:'Insert tag plugin',author:'ATutor',authorurl:'http://www.atutor.ca',infourl:'http://www.atutor.ca',version:"0.9beta"}}});tinymce.PluginManager.add('insert_tag',tinymce.plugins.Insert_tagPlugin)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/editor_plugin_src.js b/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..9936cf4
--- /dev/null
@@ -0,0 +1,126 @@
+/**\r
+ * $Id: $\r
+ *\r
+ * @author Laurel A. Williams\r
+ * @copyright Copyright Â© 2008, ATutor, All rights reserved.\r
+ */\r
+\r
+/*global tinymce*/\r
+\r
+"use strict";\r
+(function () {\r
+       \r
+       // Load plugin specific language pack\r
+       tinymce.PluginManager.requireLangPack('insert_tag');\r
+       \r
+       tinymce.create('tinymce.plugins.Insert_tagPlugin', {\r
+\r
+               /**\r
+                * Initializes the plugin, this will be executed after the plugin has been created.\r
+                * This call is done before the editor instance has finished it's initialization so use the onInit event\r
+                * of the editor instance to intercept that event.\r
+                *\r
+                * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.\r
+                * @param {string} url Absolute URL to where the plugin is located.\r
+                */\r
+               init : function (ed, url) {\r
+               \r
+                       /**\r
+                        * Places the cursor in the appropriate insertion point between [][/] \r
+                        * tags. It deletes the <span> with the id="remove_me", which was \r
+                        * placed between the [][/] tags, leaving the caret between \r
+                        * the tags as desired.\r
+                        */\r
+                       var placeCursor = function () {\r
+                               ed.selection.select(ed.dom.select('span#remove_me')[0]);\r
+                               ed.dom.remove(ed.dom.select('span#remove_me')[0]);\r
+                       };\r
+                       \r
+                       /**\r
+                        * A function which generates a function to insert the appropriate \r
+                        * tags, either [?], [code] or [tex].\r
+                        * \r
+                        * Note the slightly hacky insertion of a span with id="remove_me" \r
+                        * which is used to place the cursor in the correct insertion point.\r
+                        */\r
+                       var insertionFunction = function (insertionString) {\r
+                               return function () {\r
+                                       if (ed.selection.isCollapsed()) {\r
+                                               ed.selection.setContent('['+ insertionString + \r
+                                                               ']<span id="remove_me"></span>[/' + insertionString + ']');\r
+                                               placeCursor();\r
+                                       }\r
+                                       else {\r
+                                               ed.selection.setContent('['+ insertionString + ']' + \r
+                                                       ed.selection.getContent() + '[/' + insertionString + ']');\r
+                                       }\r
+                               }; \r
+                       };\r
+       \r
+                       //[?] tag \r
+                       ed.addCommand('mceInsertTermTag', insertionFunction("?"));\r
+                       ed.addButton('insert_term_tag', {\r
+                               title : 'insert_tag.termdesc',\r
+                               cmd : 'mceInsertTermTag',\r
+                               image : url + '/img/term.png'\r
+                       });\r
+\r
+                       //[code] tag - has not been added to interface because it doesn't work\r
+                       ed.addCommand('mceInsertCodeTag', insertionFunction("code"));\r
+                       ed.addButton('insert_code_tag', {\r
+                               title : 'insert_tag.codedesc',\r
+                               cmd : 'mceInsertCodeTag',\r
+                               image : url + '/img/code.png'\r
+                       });\r
+\r
+                       //[tex] tag\r
+                       ed.addCommand('mceInsertTexTag', insertionFunction("tex"));\r
+                       ed.addButton('insert_tex_tag', {\r
+                               title : 'insert_tag.texdesc',\r
+                               cmd : 'mceInsertTexTag',\r
+                               image : url + '/img/tex.png'\r
+                       });\r
+\r
+                       //[media] tag\r
+                       // a bit more complex tag, so formed inline instead of using insertionFunction\r
+                       ed.addCommand('mceInsertMediaTag', function () {\r
+                               if (ed.selection.isCollapsed()) {\r
+                                       ed.selection.setContent('[media|640|480]http://<span id="remove_me"></span>[/media]');\r
+                                       placeCursor();\r
+                               }\r
+                               else {\r
+                                       ed.selection.setContent('[media|640|480]http://' + \r
+                                                       ed.selection.getContent() + '[/media]');\r
+                                       \r
+                               }\r
+                       });\r
+                       ed.addButton('insert_media_tag', {\r
+                               title : 'insert_tag.mediadesc',\r
+                               cmd : 'mceInsertMediaTag',\r
+                               image : url + '/img/media.png'\r
+                       });\r
+\r
+               },      \r
+               \r
+               \r
+               /**\r
+                * Returns information about the plugin as a name/value array. The\r
+                * current keys are longname, author, authorurl, infourl and version.\r
+                * \r
+                * @return {Object} Name/value array containing information about the\r
+                *         plugin.\r
+                */\r
+               getInfo : function () {\r
+                       return {\r
+                               longname : 'Insert tag plugin',\r
+                               author : 'ATutor',\r
+                               authorurl : 'http://www.atutor.ca',\r
+                               infourl : 'http://www.atutor.ca',\r
+                               version : "0.9beta"\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('insert_tag', tinymce.plugins.Insert_tagPlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/img/code.png b/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/img/code.png
new file mode 100644 (file)
index 0000000..fc0301a
Binary files /dev/null and b/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/img/code.png differ
diff --git a/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/img/media.png b/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/img/media.png
new file mode 100644 (file)
index 0000000..b0ce7bb
Binary files /dev/null and b/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/img/media.png differ
diff --git a/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/img/term.png b/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/img/term.png
new file mode 100644 (file)
index 0000000..4ad60d2
Binary files /dev/null and b/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/img/term.png differ
diff --git a/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/img/tex.png b/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/img/tex.png
new file mode 100644 (file)
index 0000000..2e871ca
Binary files /dev/null and b/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/img/tex.png differ
diff --git a/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/langs/en.js b/docs/include/jscripts/ATutor_tiny_mce_plugins/insert_tag/langs/en.js
new file mode 100644 (file)
index 0000000..c20be8d
--- /dev/null
@@ -0,0 +1,6 @@
+tinyMCE.addI18n('en.insert_tag',{\r
+       termdesc : 'Insert term tag',\r
+       codedesc : 'Insert code tag',\r
+       mediadesc : 'Insert media tag',\r
+       texdesc : 'Insert tex tag'\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/editor_plugin.js b/docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/editor_plugin.js
new file mode 100644 (file)
index 0000000..df23a98
--- /dev/null
@@ -0,0 +1 @@
+"use strict";(function(){tinymce.PluginManager.requireLangPack('swap_toolbar');tinymce.create('tinymce.plugins.Swap_toolbarPlugin',{init:function(ed,url){ed.addCommand('mceSwapToComplex',function(){tinyMCE.execCommand('mceRemoveControl',false,ed.id);ATutor.tinymce.initComplex();tinyMCE.execCommand('mceAddControl',false,ed.id);jQuery("#complexeditor").val('1')});ed.addButton('swap_toolbar_complex',{title:'swap_toolbar_complex.desc',cmd:'mceSwapToComplex',image:url+'/img/bullet_arrow_down.png'});ed.addCommand('mceSwapToSimple',function(){tinyMCE.execCommand('mceRemoveControl',false,ed.id);ATutor.tinymce.initSimple();tinyMCE.execCommand('mceAddControl',false,ed.id);jQuery("#complexeditor").val('0')});ed.addButton('swap_toolbar_simple',{title:'swap_toolbar_simple.desc',cmd:'mceSwapToSimple',image:url+'/img/bullet_arrow_up.png'})},getInfo:function(){return{longname:'Swap toolbar plugin',author:'ATutor',authorurl:'http://www.atutor.ca',infourl:'http://www.atutor.ca',version:"0.9beta"}}});tinymce.PluginManager.add('swap_toolbar',tinymce.plugins.Swap_toolbarPlugin)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/editor_plugin_src.js b/docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..ddb62dd
--- /dev/null
@@ -0,0 +1,76 @@
+/**\r
+ * $Id: $\r
+ *\r
+ * @author Laurel A. Williams\r
+ * @copyright Copyright Â© 2008, ATutor, All rights reserved.\r
+ */\r
+\r
+/*global tinymce*/\r
+\r
+"use strict";\r
+(function () {\r
+       \r
+       // Load plugin specific language pack\r
+       tinymce.PluginManager.requireLangPack('swap_toolbar');\r
+       \r
+       tinymce.create('tinymce.plugins.Swap_toolbarPlugin', {\r
+               \r
+               /**\r
+                * Initializes the plugin, this will be executed after the plugin has been created.\r
+                * This call is done before the editor instance has finished it's initialization so use the onInit event\r
+                * of the editor instance to intercept that event.\r
+                *\r
+                * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.\r
+                * @param {string} url Absolute URL to where the plugin is located.\r
+                */\r
+               init : function (ed, url) {                     \r
+                       \r
+                       ed.addCommand('mceSwapToComplex', function () {\r
+                               tinyMCE.execCommand('mceRemoveControl', false, ed.id);\r
+                               ATutor.tinymce.initComplex();\r
+                tinyMCE.execCommand('mceAddControl', false, ed.id);\r
+                jQuery("#complexeditor").val('1');\r
+                       });\r
+                       \r
+                       ed.addButton('swap_toolbar_complex', {\r
+                               title : 'swap_toolbar_complex.desc',\r
+                               cmd : 'mceSwapToComplex',\r
+                               image : url + '/img/bullet_arrow_down.png'\r
+                       });\r
+                       \r
+                       ed.addCommand('mceSwapToSimple', function () {\r
+                               tinyMCE.execCommand('mceRemoveControl', false, ed.id);\r
+                               ATutor.tinymce.initSimple();\r
+                tinyMCE.execCommand('mceAddControl', false, ed.id);\r
+                jQuery("#complexeditor").val('0');\r
+                       });\r
+                       \r
+                       ed.addButton('swap_toolbar_simple', {\r
+                               title : 'swap_toolbar_simple.desc',\r
+                               cmd : 'mceSwapToSimple',\r
+                               image : url + '/img/bullet_arrow_up.png'\r
+                       });\r
+               },      \r
+               \r
+               \r
+               /**\r
+                * Returns information about the plugin as a name/value array. The\r
+                * current keys are longname, author, authorurl, infourl and version.\r
+                * \r
+                * @return {Object} Name/value array containing information about the\r
+                *         plugin.\r
+                */\r
+               getInfo : function () {\r
+                       return {\r
+                               longname : 'Swap toolbar plugin',\r
+                               author : 'ATutor',\r
+                               authorurl : 'http://www.atutor.ca',\r
+                               infourl : 'http://www.atutor.ca',\r
+                               version : "0.9beta"\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('swap_toolbar', tinymce.plugins.Swap_toolbarPlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/img/bullet_arrow_down.png b/docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/img/bullet_arrow_down.png
new file mode 100644 (file)
index 0000000..9b23c06
Binary files /dev/null and b/docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/img/bullet_arrow_down.png differ
diff --git a/docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/img/bullet_arrow_up.png b/docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/img/bullet_arrow_up.png
new file mode 100644 (file)
index 0000000..24df0f4
Binary files /dev/null and b/docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/img/bullet_arrow_up.png differ
diff --git a/docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/langs/en.js b/docs/include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/langs/en.js
new file mode 100644 (file)
index 0000000..173d0f0
--- /dev/null
@@ -0,0 +1,7 @@
+tinyMCE.addI18n('en.swap_toolbar_simple',{\r
+       desc : 'Hide toolbars'\r
+});\r
+\r
+tinyMCE.addI18n('en.swap_toolbar_complex',{\r
+       desc : 'More toolbars'\r
+});\r
diff --git a/docs/include/jscripts/tiny_mce/changelog.txt b/docs/include/jscripts/tiny_mce/changelog.txt
new file mode 100644 (file)
index 0000000..20b188f
--- /dev/null
@@ -0,0 +1,984 @@
+Version 3.3rc1 (2010-02-23)\r
+       Fixed bug with new legacyoutput plugin not working correctly on it's own.\r
+       Fixed bug some performance issues with removing text formats.\r
+       Fixed bug where TinyMCE specific attributes wasn't removed properly by remove format.\r
+       Fixed bug where it wasn't possible to align images within inline elements.\r
+       Fixed bug where Ctrl+Delete/Backspace would produce an invalid argument exception on IE.\r
+       Fixed bug where the search/replace logic could produce an infinite loop on IE for reverse searches.\r
+       Fixed bug where cloning formats in cells didn't work properly on IE.\r
+       Fixed bug where IE6 would produce a horizontal scroll bar.\r
+       Fixed so remove jQuery method removes the TinyMCE instance as well as the specified textarea.\r
+       Fixed so selected rows and cells gets updated using the row/cell properties dialogs.\r
+Version 3.3b2 (2010-02-04)\r
+       Fixed bug where sometimes img elements would be removed by split method in DOMUtils.\r
+       Fixed bug where merging of span elements could occur on bookmark nodes.\r
+       Fixed bug where classes wasn't properly removed when removeformat was used on IE 6.\r
+       Fixed bug where multiple calls to an tinyMCE.init with mode set to exact could produce the same unique ID.\r
+       Fixed bug with the IE selection implementation when it was feeded an document range.\r
+       Fixed bug where block elements formatting wasn't properly removed by removeformat on all browsers.\r
+       Fixed bug where selection location was lost if you performed a manual cleanup.\r
+       Fixed bug where removeformat wouldn't remove span elements within styled block elements.\r
+       Fixed bug where an error would be thrown if you clicked on the separator lines in menus.\r
+       Fixed bug with the jQuery plugin adding always adding a querystring value to other resources.\r
+       Fixed bug where IE would produce an error message if you had an empty editor instance.\r
+       Fixed bug where Shift+Enter didn't produce br elements on WebKit browsers.\r
+       Fixed bug where a temporary marker element wasn't removed by the paste plugin.\r
+       Fixed bug where inserting a table would produce two undo levels instead of one.\r
+Version 3.3b1 (2010-01-25)\r
+       Added new text formatting engine. Fixes a lot of browser quirks and adds new possibilities.\r
+       Added new advlist plugin that enables you to set the formats of list elements.\r
+       Added new paste plugin logic that enables you to retain style information from Office.\r
+       Added new autosave plugin logic that automatically saves contents in local storage.\r
+       Added new valid_styles option. Adds the possibility to restrict styles and their order.\r
+       Added new theme_advanced_runtime_fontsize option to display the runtime font size in font size select box.\r
+       Added new jquery plugin version that handles the gzip compressor amongst other things. Contributed by Speednet.\r
+       Added new $ function to tinymce namespace and editor instances for the jQuery build.\r
+       Added the possibility to get editors by index as well as name in the tinyMCE.editors collection.\r
+       Fixed so the contents inside the editor renders in standards mode by default.\r
+       Fixed bug where it wasn't possible to move the caret on short documents running in standards mode on IE.\r
+       Fixed bug where the decode method of the DOMUtils class could end up in an endless loop.\r
+       Fixed bug where it was possible to bypass the paste cleanup on non IE browsers if you clicked while pasting.\r
+       Fixed bug where some attributes wasn't serialized correctly on IE if wildcard attribute patters where used.\r
+       Fixed bug where entity decoding was performed on strings that didn't have any valid entities in them.\r
+       Fixed bugs with the insertNode method of the IE DOMRange implementation. Patch contributed by Scott McNaught.\r
+       Rewrote the getBookmark/moveToBookmark selection logic to boost performance on larger documents.\r
+       Rewrote the table plugin to include new cell selection logic and fixed various bugs and issues.\r
+       Merged the tinyMCE, tinymce and tinymce.EditorManager into the same instance makes more sense.\r
+       Removed browser setting since the browser support for TinyMCE is not far better than it was when that setting was introduced.\r
+       Changed the mce_ attribute prefix to the more standard _mce_ prefix. This is similar to browser vendors prefixes.\r
+       Optimized performance with named entities on Gecko. Regexp replace was executing very slowly probably due to a Gecko bug.\r
+       Optimized performance of the IE specific selection/range implementation.\r
+       Removed the safari plugin since we now replaced all text formatting logic to custom code.\r
+Version 3.2.7 (2009-09-22)\r
+       Fixed bug where uppercase paragraphs could still produce an invalid DOM tree on IE.\r
+       Fixed bug where split command didn't work on WebKit since the node serializer needs a real document to work with.\r
+       Fixed bug where it was impossible in Gecko to place the caret before a table if it was the first one.\r
+       Fixed bug where linking to urls like ../../ would produce an extra traling slash ../..//.\r
+       Fixed bug where the template cdate functionality was using an old 2.x API call. Patch contributed by vectorjohn.\r
+       Fixed bug where urls to the same site but different protocol would be converted when relative_urls where set to false. Patch contributed by Ted Rust.\r
+       Fixed bug where the paste plugin would remove mceItem prefixed classes.\r
+       Fixed bug where the paste plugin would sometimes add items in a reverse order on WebKit.\r
+       Fixed bug where the paste buttons would present an error message on Gecko even if you changed user.js. Patch contributed by Todd (teeaykay).\r
+       Fixed bug where Opera would crash if you had tables incorrectly placed inside paragraphs.\r
+       Fixed bug where styles elements wasn't properly processed if you had bad input HTML.\r
+       Fixed bug where style attributes wasn't properly forced into a specific format.\r
+       Fixed bug and issues with boolean attributes like checked, nowrap etc.\r
+       Fixed bug where input elements could override attributes on form elements.\r
+       Fixed bug where script or style elements could get modified by the DOMUtils processHTML method.\r
+       Fixed bug where the selected attribute could get lost when force root blocks logic got executed on IE. Patch contributed by Attila Mezei-Horvati.\r
+       Fixed bug where getAttribs method didn't handle boolean attributes correctly on IE.\r
+       Fixed so the paste from word dialog is presented if you paste content on an IE with to restrictive security settings.\r
+       Fixed so the paste_strip_class_attributes option is set to none by default in the paste plugin.\r
+       Removed default border=0 on tables for the default value of valid_elements.\r
+Version 3.2.6 (2009-08-19)\r
+       Added new wordcount plugin, this will display the number of typed words as you write. Contributed by Andrew Ozz.\r
+       Added new getNext and getPrev methods to DOM utils. These will return the first matching sibling.\r
+       Fixed bug where it was impossible to place the caret after a table on Gecko. It will now add a paragraph after tables.\r
+       Fixed bug where inline dialogs would fail if used in a window opened using a showModalDialog. Patch contributed by Derek Britt.\r
+       Fixed bug where IE could sometimes render a unknown runtime error on invalid input HTML.\r
+       Fixed bug where some incorrectly placed tables wouldn't be moved outside the paragraphs on IE.\r
+       Fixed bug where uppercase script/style element wouldn't be handled correctly and converted to valid lowercase.\r
+       Fixed bug where some WebKit versions on Mac OS X would produce issues with hidden select fields.\r
+       Fixed bug where the media plugin would fail on WebKit since the node wasn't properly imported to the right document.\r
+       Fixed bug where absolute URLs for the TinyMCE script using a base href element would cause loading problems in IE 6/7.\r
+       Fixed bug where pasting using the paste plugin wasn't possible on IE with to restrictive security settings.\r
+       Fixed bug where pasting of whitespace was impossible using the new custom paste method.\r
+       Fixed bug where pasting on some WebKit browsers would not work if you pasted specific contents due to a WebKit bug.\r
+       Fixed bug where doctypes with multiple lines would not be parsed correctly by the fullpage plugin. Patch contributed by Colin.\r
+       Fixed bug where the autoresize plugin would break the fullscreen functionality.\r
+       Fixed bug where tables would be chopped up running on IE using invalid contents and pasting paragraphs into a cell.\r
+       Fixed bug where the each method of jQuery build didn't iterate styleSheets. We now use the TinyMCE API one instead.\r
+       Fixed bug where auto switching to paragraphs after headers some times failed in Gecko.  \r
+       Fixed so all editor options gets passed to the Serializer class. Patch contributed by Jasper Mattsson.\r
+       Fixed so script/style blocks isn't wrapped in paragraphs as other inline elements.\r
+       Fixed so the XHR requests sends the X-Requested-With HTTP header.\r
+       Fixed so the data url scheme is handled in the tinymce.util.URI class.\r
+       Changed inline documentation to use moxiedoc style comments.\r
+       Removed the compat2x plugin people should have upgraded to the 3.x API by now. 3.0 was released more then a year ago.\r
+       Re-added Gecko specific message for users who doesn't understand the security concept regarding paste.\r
+Version 3.2.5 (2009-06-29)\r
+       Added new jQuery plugin for the jQuery specific package. This enables you to more easily load and use TinyMCE.\r
+       Added new autoresize plugin contributed by Peter Dekkers. This plugin will auto resize the editor to the size of the contents.\r
+       Fixed so all packages have the same directory structure. Previous releases had a different structure for the production package.\r
+       Fixed so the paste from word dialog forces the contents to be processed as word contents even if it's not.\r
+       Fixed so the jQuery build adapter build works. It's currently only excluding Sizzle.\r
+       Fixed so noscript element contents is retained during the editing process.\r
+       Fixed bug where the getBookmark method would need a "simple" string input when the documented way is a boolean.\r
+       Fixed bug where invalid contents could break the fix_table_elements logic.\r
+       Fixed bug where Sizzle specific attributes would be serialized if the valid_elements was set to *[*].\r
+       Fixed bug where IE would produce an error if you specified a relative content_css and opened the paste dialog.\r
+       Fixed bug where pasting images on IE would produce broken images if they came from an external site.\r
+       Fixed bug where memory was leaked if you add/remove controls dynamically. Some event handlers wasn't removed properly.\r
+       Fixed bug where domain relaxing wasn't treated correctly if you added it after the TinyMCE script element.\r
+       Fixed bug where the activeEditor wasn't set to null if the last editor instance was removed.\r
+       Fixed bug where IE was leaking memory on the onbeforeunload event due to some recently introduced logic. Patch contributed by Options.\r
+       Fixed bug where inserting tables in Safari 4 didn't work due to a new WebKit bug where some element names are reserved.\r
+       Fixed bug where URLs having a :// value in the query string would make it absolute regardless of URL settings.\r
+       Fixed the WebKit specific bug where DOM Ranges would fail if the node wasn't attached to something in a different way.\r
+       Removed the auto_resize option and the resizeToContent method from the tinymce.Editor class. Use the new autoresize plugin instead.\r
+Version 3.2.4.1 (2009-05-25)\r
+       Fixed bug where Gecko browsers would produce an extra space after for example strong when loaded from sub domains.\r
+       Fixed bug where script elements would be removed if they where placed inside a paragraph element.\r
+       Fixed bug where IE 8 would produce 1 item remaining when loading CSS files dynamically with an empty cache.\r
+       Fixed bug where bound events would be removed from other editor instances if a specific one was removed.\r
+       Fixed various bugs and issues with script and style elements inside the editor.\r
+       Fixed so all script contents gets wrapped in CDATA sections so that they can be parsed using a XML parser.\r
+       Fixed so it's impossible for elements marked as closed to have child nodes rendered in output.\r
+Version 3.2.4 (2009-05-21)\r
+       Added new paste_remove_styles/paste_remove_styles_if_webkit option to paste plugin concept contributed by Hadrien Gardeur.\r
+       Added new functionality to paste plugin contributed by Scott Eade aka monkeybrain.\r
+       Added new paste_block_drop option to the paste plugin this is disabled by default and will block any drag/drop event.\r
+       Added new bind/unbind methods to DOMUtils these works like Event.add/Event.remove but is easier to access.\r
+       Added new paste_dialog_width/paste_dialog_height options to paste pluign. Enables you to change the dialog sizes.\r
+       Fixed bug on IE 8 where it would sometimes produce a "1 item remaining" status message that would never finish.\r
+       Fixed bug on Safari 4 beta that would produce DOM Range exceptions on the DOMUtils split method since the browser has a bug.\r
+       Fixed bug where the paste plugin could accidentally think that some word sentences was supposed to be list elements.\r
+       Fixed bug where paste plugin would produce one extra empty undo level on some browsers.\r
+       Fixed bug where spans wasn't produced correctly on new line when the keep_styles option was enabled.\r
+       Fixed bug where the caret would be placed at the beginning of contents in IE 8 if you selected colors from the color pickers.\r
+       Fixed so the Event class is a normal class instead of a static one. The tinymce.dom.Event is now a global instance of that class.\r
+       Fixed so internal events for instances gets removed when the DOMUtils instance is removed.\r
+       Fixed so preventDefault and stopPropagation methods can be used on the event object in all browsers.\r
+Version 3.2.3.1 (2009-05-05)\r
+       Fixed bug where paragraphs containing form elements such as input or textarea would be removed.\r
+       Fixed bug where some IE versions would produce a wrapper function for events attributes.\r
+       Fixed bug where table cell contents could be removed if you pressed return/enter at the end of the cell contents.\r
+       Fixed bug where the paste plugin would remove a extra character if the selection range was collapsed.\r
+       Fixed bug where creating tables with % width wouldn't be handled correctly on WebKit browsers.\r
+Version 3.2.3 (2009-04-23)\r
+       Added new paste plugin logic. This new version will autodetect Word contents and clean it up.\r
+       Added a optional root element argument to getPos so you can tell it where to stop the calculation.\r
+       Added new DOM ready logic to remove the usage of document.write. We now use basically the same method as jQuery.\r
+       Fixed bug where WebKit browsers would fail when selecting all contents in the area using Ctrl+A.\r
+       Fixed bug where IE would produce paragraphs with empty inline style elements.\r
+       Fixed bug where WebKit browsers would fail when inserting tables with a non pixel width.\r
+       Fixed bug where block elements could get a redundant br element at the end of the element.\r
+       Fixed bug where the tabfocus plugin only worked with a single editor instance on page.\r
+       Fixed bug where IE 8 was loosing caret position if the selection was collapsed and a menu was clicked.\r
+       Fixed bug with application/xhtml+xml mode where menus wasn't working properly.\r
+       Fixed bug where the onstop workaround fix for IE would produce errors in an ASP update panel.\r
+       Fixed bug where the submit function override could produce errors if executed in the wrong scope.\r
+       Fixed bug where the area element wasn't closed by a short ending.\r
+       Fixed various number issues in the style plugins properties dialog. Contributed by datpaulchen.\r
+       Fixed issues with size suffix values in the style plugin dialog.\r
+       Fixed issue where hasDuplicate variable would leak out to the global space due to a bug in the Sizzle engine.\r
+       Fixed issue where the paste event would fire a dialog warning on IE since we extracted the text contents.\r
+       Updated Sizzle engine to the latest version, this version fixes a few bugs that was reported.\r
+Version 3.2.2.3 (2009-03-26)\r
+       Fixed regression bug with the getPos method, it would return invalid if the view port was to small.\r
+Version 3.2.2.2 (2009-03-25)\r
+       Fixed so the DOMUtils getPos method can be used cross documents if needed.\r
+       Fixed bug where undo/redo wasn't working correctly in Gecko browsers.\r
+Version 3.2.2.1 (2009-03-19)\r
+       Added support for tel: URL prefixes. Even though this doesn't match any official RFC.\r
+       Fixed so the select method of the Selection class selects the first best suitable contents.\r
+       Fixed bug where the regexps for www. prefixes for link and advlink dialogs would match wwwX.\r
+       Fixed bug where the preview dialog would fail to open if the content_css wasn't defined. Patch contributed by David Bildström (ChronoZ).\r
+       Fixed bug where editors wasn't converted in application/xhtml+xml mode due to an issue with Sizzle.\r
+       Fixed bug where alignment would fail if multiple lines where selected.\r
+       Updated Sizzle engine to the latest version, this version fixes a few bugs that was reported.\r
+Version 3.2.2 (2009-03-05)\r
+       Added new CSS selector engine. Sizzle the same one that jQuery and other libraries are using.\r
+       Added new is and getParents methods to the DOMUtils class. These use the new Sizzle engine to select elements.\r
+       Added new removeformat_selector option, enables you to specify a CSS selector pattern of elements to remove when using removeformat.\r
+       Fixed so the getParent method can take CSS expressions when selecting it's parents.\r
+       Added new ant based build process, includes a new javabased preprocessor and a yuicompressor ant task.\r
+       Moved the tab_focus logic into a plugin called tabfocus, so the old tab_focus option has been removed from the core.\r
+       Replaced the TinyMCE custom unit testing framework with Qunit and rewrote all tests to match the new logic.\r
+       Moved the examples/testcases to a root directory called tests since it now includes slickspeed.\r
+       Fixed bug where nbsp wasn't replaced correctly in ForceBlocks.js. Patch contributed by thorn.\r
+       Fixed bug where an dom exception would be thrown in Gecko when the theme_advanced_path path was set to false under xml application mode.\r
+       Fixed bug where it was impossible to get out of a link at the end of a block element in Gecko.\r
+       Fixed bug where the latest WebKit nightly would fail when changing font size and font family.\r
+       Fixed bug where the latest WebKit nightly would fail when opening dialogs due to changes to the arguments object.\r
+       Fixed bug where paragraphs wasn't added to elements positioned absolute using classes.\r
+       Fixed bug where font size values with dot's like 1.4em would produce a class instead of the style value.\r
+       Fixed bug where IE 8 would return an incorrect position for elements.\r
+       Fixed bug where IE 8 would render colorpicker/filepicker icons incorrectly.\r
+       Fixed bug where trailing slashes for directories in URLs would be removed.\r
+       Fixed bug where autostart and other boolean values in the media dialog wouldn't be stored/parsed correctly.\r
+       Fixed bug where the repaint call for the media plugin wouldn't be executed due to a typo in the source.\r
+       Fixed bug where id attribute of object elements wasn't kept intact by the media plugin.\r
+       Fixed bug where preview of embeded elements when the media_use_script option was used would fail.\r
+       Fixed bug where inlinepopups could be rendered at an incorrect location on IE 6 while dragging.\r
+       Fixed bug where the blocker shim could be placed at an incorrect location on IE 6.\r
+       Fixed bug where the multiple and size attributes of select elements would produce incorrect values while running in IE.\r
+       Fixed bug where IE would loose the caret position is you selected a color from the color drop down.\r
+       Fixed bug where remove format wouldn't work on IE since it couldn't remove span elements that had style information.\r
+       Fixed bug where Opera was removing links when removing formatting from selected contents.\r
+       Fixed bug where paragraphs could be produced inside non positional elements styled with the CSS position value of static.\r
+       Fixed bug where removeformat wouldn't work if you selected part of a span in IE.\r
+       Fixed bug where media plugin didn't retain the style attribute on embed/object elements.\r
+       Fixed bug where auto focus on empty editor instances could produce strange results if you inserted an image into it.\r
+       Fixed bug where &nbsp; characters would be removed in FF when inserted with the mceInsertContent or selection.setContent methods.\r
+       Fixed bug where warning message of missing paste support wasn't displayed on WebKit browsers.\r
+       Fixed bug where anchor links could include other links. The selected range is now unlinked before adding news links to it.\r
+       Fixed memory leak when TinyMCE was used with prototype. Patch contributed by James Ots.\r
+       Fixed so the non documented fullpage_hide_in_source_view option for the fullpage plugin works again in the 3.x branch.\r
+       Fixed so tables doesn't get inserted into paragraphs by default since it's not W3C valid. Can be disabled by using the fix_table_elements option.\r
+       Fixed so the source view dialog sets a source_view state to the event object. Enables plugins to intercept the source view mode.\r
+       Fixed various validation issues with the html dialogs and pages.\r
+       Removed ask mode option since there is way better ways of doing this now. Use the add/remove control methods instead.\r
+       Removed logic for compatibility with Safari 2.x, this browser is no longer supported since no one is using it.\r
+       Removed the auto domain relaxing feature. If loading scripts cross sub domains it's better to specify the document.domain by hand.\r
+Version 3.2.1.1 (2008-11-27)\r
+       Added new theme_advanced_default_background_color/theme_advanced_default_foreground_color options. Patch contributed by David Bildström (ChronoZ).\r
+       Fixed font style formatting compatibility issue with Adobe Air.\r
+       Fixed so legacy font elements get converted into spans even if cleanup_on_startup isn't enabled.\r
+       Fixed bug where pre elements could be incorrectly modified by an IE bug workaround. Patch contributed by hu vime.\r
+       Fixed bug where input elements inside inlinepopups wasn't editable in Firefox 2.\r
+       Fixed bug where the xhtmlxtras plugin wasn't replacing attribute values correctly.\r
+       Fixed bug where menu buttons in skin variants would look strange due to IE 8 fixes.\r
+       Fixed bug where WebKit browsers would on backspace take you back to the previous page if the editor was empty.\r
+       Fixed bug where DOMUtils decode method wouldn't handle strings larger than 4096kb due to node chunking.\r
+       Fixed bug where meta key wasn't handled as ctrl key on Mac OS X for custom keyboard short cuts.\r
+       Fixed bug where init event would get fired twice on WebKit on Mac OS X.\r
+Version 3.2.1 (2008-11-04)\r
+       Added support for custom icon image for drop menus. Use icon_src to set a custom image directly.\r
+       Added new media_strict option to media plugin. Enables you to control if the flash embed is strict or not. Enabled by default.\r
+       Fixed so the editors script files gets dynamically loaded without using XHR or eval.\r
+       Fixed so the media plugin outputs valid XHTML object elements for Flash movies. Can be disabled with the media_strict option.\r
+       Fixed so dynamic loading doesn't require eval calls on non IE browsers for better Air support.\r
+       Fixed bug where the editor wasn't treated as empty if the remaining paragraph had attributes.\r
+       Fixed bug where id's of elements was removed ones they got wrapped in paragraphs. Patch contributed by ChronoZ.\r
+       Fixed bug where WebKit browsers where placing list elements inside paragraph elements.\r
+       Fixed bug where inserting images or links would produce absolute urls on WebKit browsers.\r
+       Fixed bug where values for checked, readonly, disabled and selected attributes was incorrect on IE.\r
+       Fixed bug where positive values for checked, readonly, disabled and selected attributes wasn't forced to valid values.\r
+       Fixed bug where selecting the first option in a native select box would produce an undefined error.\r
+       Fixed bug where tabindex 32768 could be outputted on IE if element attributes where cloned.\r
+       Fixed bug where the media dialogs preview window would display incorrect contents due to duplicate clsid prefixes.\r
+       Fixed bug where non pixel or percent heights for textarea elements would produce errors on IE.\r
+       Fixed bug where cdata sections in script elements wasn't handled correctly.\r
+       Fixed bug where nowrap of table cells would produce a 65535 value output.\r
+       Fixed bug where media plugin would produce an error if you selected the first item in the items list.\r
+       Fixed bug where media plugin would modify links with the item _value in them.\r
+       Fixed so table width/height is better forced if inline_styles is enabled. Patch contributed by daKmoR.\r
+       Fixed css for IE 8 such as opacity and other rendering quirks.\r
+Version 3.2.0.2 (2008-10-02)\r
+       Fixed bug where the SelectBox and NativeSelectBox wasn't updated correctly if undefined was passed to them.\r
+       Fixed bug where the style dropdown wasn't correctly changed back to it's original state when element had no class.\r
+       Fixed bug where multiple pending font styles wasn't handled correctly.\r
+       Fixed so you can disable all auto css loading for dialogs by setting the popups_css option to false.\r
+Version 3.2.0.1 (2008-09-17)\r
+       Fixed bug where font sizes and faces wouldn't be changed correctly when there was a parent with a different style.\r
+       Fixed bug where adding fonts to the same selection would produce redundant spans.\r
+Version 3.2 (2008-09-11)\r
+       Added new text style support, it will now use span elements internally instead of font elements.\r
+       Added new improved support for the theme_advanced_font_sizes option, check the Wiki for details.\r
+       Added new keep_style setting that maintains the text style on return/enter on non IE browsers, enabled by default.\r
+       Added new onBeforeSetContent/onBeforeGetContent/onSetContent/onGetContent events to the Selection class.\r
+       Added new selectByIndex method to ListBox class. This enables you to select list items by an index instead of a value.\r
+       Added new possibility to the select method of the ListBox class. This can now have a selector function as it's value argument.\r
+       Added new possibility to skip the loading of popups css by setting the feature popup_css to the value false.\r
+       Added new possibility to skip translation of popups by setting the translate_i18n feature to false.\r
+       Added new element_format option enables you to produce HTML element endings instead of XHTML. But we are still in the XHTML is better camp.\r
+       Added missing allowfullscreen and quality options for flash elements, this will now get correctly stored.\r
+       Fixed bug where table cell dialog didn't close properly unless the accessibility_warnings option was set to false.\r
+       Fixed bug where the modal dialog blocker element for inlinepopups wasn't placed at a correct location if the page had scroll.\r
+       Fixed bug where non inline dialogs didn't close correctly if the inlinepopups plugin was used.\r
+       Fixed bug where non inline dialogs could make the modal dialog blocker to work incorrectly.\r
+       Fixed bug where style select wasn't populated correctly if you pressed the arrow. Patch by Hari Karam Singh.\r
+       Fixed bug where toggling the fullscreen mode didn't restore scrollbars on IE when the editor was inside a frame. Patch by Jacob Barrett.\r
+       Fixed bug where inserting flash contents using the template plugin didn't work correctly.\r
+       Fixed bug where inserting flash contents using the selection.setContent or mceInsertContent command didn't work correctly.\r
+       Fixed bug where IE would produce an exception if a comment started with -.\r
+       Fixed bug where the blockquote button would wrap lists incorrectly on non IE browsers.\r
+       Fixed bug where Opera would display BR elements in the element path.\r
+       Fixed bug where xhtmlxtras didn't insert elements correctly on IE.\r
+       Fixed bug where the buttons wasn't activated correctly in the xhtmlxtras plugin.\r
+       Fixed bug where adding an object as the style attribute for the dom setAttribs method wouldn't work.\r
+       Fixed bug where the background color would bleed out to parent container element in Gecko.\r
+       Fixed bug where the insert column actions for tables would fail if you did it in a thead or tfoot. Patch contributed by T Andersen (tan73).\r
+       Fixed bug where event blocker element wasn't positioned correctly for the inlinepopups plugin.\r
+       Fixed bug where pasting from Office 2007 would produce an odd comment in the contents.\r
+       Fixed bug where the paste as plain text could remove an extra character. Patch contributed by Speednet.\r
+       Fixed bug where some characters where missing for the paste_replace_list option. Patch contributed by Speednet.\r
+       Fixed bug where removing non existing editor instances by the mceRemoveControl command would produce an error.\r
+       Fixed bug where meta elements with the name description would produce errors in IE.\r
+       Fixed bug where color and background colors wouldn't be updated properly.\r
+       Fixed bug where the createMenuButton of tinymce.ControlManager didn't implement the last class argument.\r
+       Fixed bug where the editor_css option was relative from the TinyMCE installation directory not the current page.\r
+       Fixed bug where elements wouldn't be padded if the element contained bogus br elements. For example TD elements.\r
+       Fixed bug where parsing of <body > in fullpage plugin would produce an error.\r
+       Fixed bug where relative urls with just ./ would become an empty string.\r
+       Fixed bug where outdent button would be disabled if inline_styles where set to false.\r
+       Fixed bug where replace with an empty search string would produce an error on IE.\r
+       Fixed bug where restoring the overflow state of the body in fullscreen plugin running on IE would produce vertical scrollbars.\r
+       Fixed bug where pressing return/enter in list items would sometimes move the caret the to top of the content area in FF.\r
+       Fixed bug where the style listbox wouldn't be updated correctly if you used the use_native_selects option.\r
+       Fixed bug where WebKit browsers would produce a div element when ending list elements using return.\r
+       Fixed so translation of popup contents only occurs if it's needed.\r
+       Optimized the URI object in regards or converting absolute URIs to relative URIs.\r
+Version 3.1.1 (2008-08-18)\r
+       Added new getSize method to DOMUtils it will return the dimensions only of an element.\r
+       Added new alert/confirm methods to the tinyMCEPopup class to prevent focus problems and also to shorten method calls.\r
+       Added new plugin_preview_inline option to preview plugin to enable/disable native/inline dialogs.\r
+       Added new readonly option. If this is set the editor will only display the contents for the user.\r
+       Added missing tabindex and accesskey to input elements in the default valid_elements setup.\r
+       Updated firebug lite to 1.2, to enable it use the tiny_mce_dev.js?debug=1 on the development package.\r
+       Fixed so the preview dialog in the preview plugin uses inline dialogs/popups.\r
+       Fixed so CDATA sections remains intact through the serialization process of the DOM tree.\r
+       Fixed various issues with the getAttrib command. It will now return more correct values.\r
+       Fixed bug where the embed element wasn't properly parsed in the media plugin it now supports 3 formats.\r
+       Fixed bug where the noshade attribute was serialized incorrectly on IE.\r
+       Fixed bug where editing an existing link element didn't force it relative.\r
+       Fixed bug where image link creation fails on Safari if the image is aligned.\r
+       Fixed bug where it was possible to scroll the fullscreen mode in Opera 9.50.\r
+       Fixed bug where removal of center image alignment would fail. Patch contributed by Andrew Ozz.\r
+       Fixed bug where inlinedialogs didn't work properly if the doctype was incorrect in IE.\r
+       Fixed bug where cross domain loading didn't work correctly in Opera 9.50.\r
+       Fixed bug where breaking huge text blocks with return/enter key would scroll to end of block.\r
+       Fixed bug where replace button kept inserting the replacement text even if there is no more matches.\r
+       Fixed bug with fullpage plugin where value wasn't set correctly. Patch contributed by Pascal Chantelois.\r
+       Fixed bug where the dom utils setAttrib method call could produce an exception if the input was null/false.\r
+       Fixed bug where pressing backspace would sometimes remove one extra character in Gecko browsers.\r
+       Fixed bug where the native confirm/alert boxes would move focus to parent document if fired in dialogs.\r
+       Fixed bug where Opera 9.50 was telling you that the selection is collapsed even when it isn't.\r
+       Fixed bug where mceInsertContent would break up existing elements in Opera and Gecko.\r
+       Fixed bug where TinyMCE fails to detect some keyboard combos on Mac, contributed by MattyRob.\r
+       Fixed bug where replace all didn't move the caret to beginning of text before searching.\r
+       Fixed bug where the oninit callback wasn't executed correctly when the strict_loading_mode option was used, thanks goes to Nicholas Oxhoej.\r
+       Fixed bug where a access denied exception was thrown if some other script specified document.domain before loading TinyMCE.\r
+       Fixed so setting language to empty string will skip language loading if translations are made by some backend.\r
+       Fixed so dialog_type is automatically modal if you use the inlinepopups plugin use dialog_type : "window" to re-enable the old behavior.\r
+Version 3.1.0.1 (2008-06-18)\r
+       Fixed bug where the Opera line break fix didn't work correctly on Mac OS X and Unix.\r
+       Fixed bug where IE was producing the default value the maxlength attribute of input elements.\r
+Version 3.1.0 (2008-06-17)\r
+       Fixed bug where the paste as text didn't work correctly it encoded produced paragraphs and br elements.\r
+       Fixed bug where embed element in XHTML style didn't work correctly in the media plugin.\r
+       Fixed bug where style elements was forced empty in IE. The will now be wrapped in a comment just like script elements.\r
+       Fixed bug where some script elements wrapped in CDATA could fail to be serialized correctly.\r
+       Fixed bug where FF 3 produced -moz- internal styles in some style attributes.\r
+       Fixed bug where query strings and external URLs didn't work correctly in style attributes.\r
+       Fixed bug where shape attribute of area elements got serialized as rect regardless of it's initial value in IE 6.\r
+       Fixed bug where selection of elements inside layers would fail in IE since focus was moved to the document body.\r
+       Fixed bug where pressing enter/return in an editable select box would produce an __mce_add_custom__ class value.\r
+       Fixed bug where changing font size of text placed inside a colored text chunk would remove the parent node.\r
+       Fixed bug where Opera 9.5 final produced a strange line break behavior due to a workaround for previous Opera versions.\r
+       Fixed bug where text/background color would produce a strange focus problem when you tried to click on the body in IE.\r
+       Fixed issue where selecting the title of an listbox equals the old 2.x behavior of changing the value to an empty string.\r
+       Fixed issue where it was common for the media plugin to break if the _value attribute wasn't added for the param element.\r
+       Fixed issue where the wrong parent editor instance might be updated if you use fullscreen mode in an incorrect way.\r
+       Fixed issue where Safari was producing a warning about the base element not being closed correctly.\r
+       Removed redundant form element name matching from regexp in the DOMUtils class.\r
+Version 3.0.9 (2008-06-02)\r
+       Added new contextmenu_offset_x/contextmenu_offset_y options for the contextmenu plugin.\r
+       Added cite attribute to the default rule for the blockquote element.\r
+       Added support for using arrow keys for selection of items in listboxes.\r
+       Added support for using arrow keys for selection of items in dropmenus.\r
+       Fixed bug where blockformat change on elements with BR inside them didn't change correctly on Firefox.\r
+       Fixed bug where removing table rows inside thead or tfoot would remove the whole table if it was the last one.\r
+       Fixed bug where XHR synchronous mode didn't execute the callback handlers synchronously.\r
+       Fixed bug where setting border to 0 didn't add border: 0 to the style attribute when using the advimage dialog.\r
+       Fixed bug where the selection of images and table cells didn't work correctly when the editor is placed in a frame and running on IE.\r
+       Fixed bug where the store/restore of a selection didn't work correctly in non IE browsers.\r
+       Fixed bug where only the first element would be invalid for the invalid_elements option.\r
+       Fixed bug where paste as plain text didn't encode the characters correctly when they where inserted.\r
+       Fixed bug where HTML source window couldn't be maximized on Gecko when the maximizable feature was enabled.\r
+       Fixed bug where color selection using the color picker could produce exception in IE.\r
+       Fixed bug where font size changes could produce produce extra redundant elements.\r
+       Fixed bug where IE could produce unknown runtime error if you replaced a image with another image from a separate frame.\r
+       Fixed bug where the domLoaded state for the Event class wasn't set correctly if the editor was loaded dynamically using the gzip compressor.\r
+       Fixed bug where handling of the base element for a page would produce incorrect urls. Based on a patch contributed by John LeSueur.\r
+       Fixed bug where table constraint alert boxes was presented with an empty value and wasn't the skinned inline ones.\r
+       Fixed bug where the onChange event wasn't fired when the form was submitted. It's now also triggered when the save method is called.\r
+       Fixed bug where encoding set to xml didn't work as expected. It now encodes the contents into XML entities.\r
+       Fixed bug where numrows didn't work correctly for the merge cells dialog of the table plugin.\r
+       Fixed bug where the onGetContent event was fired even when the no_events flag was set.\r
+       Fixed bug where the preview panels for the advimage and the media plugin could overflow on Safari and FF 3.\r
+       Fixed bug where the editing and removal of abbr elements using the xhtmlxtras plugin working correctly on IE.\r
+       Fixed bug where save button in the save plugin didn't work correctly on IE.\r
+       Fixed bug where dragging layers didn't work as expected since it would snap back to it's original location if you saved.\r
+       Fixed bug where the description of the template plugin dialog wasn't updated correctly.\r
+       Fixed bug where the values for frame and rules in the table dialogs where swapped.\r
+       Fixed bug where the elements like ins, del, cite, acronym and abbr didn't have the default editing style as the old 2.x branch.\r
+       Fixed bug where ask mode would lock the focused textarea if you pressed cancel in the confirm dialog on FF 3.\r
+       Fixed bug where ask mode would produce contents for empty textareas if you reloaded the page.\r
+       Fixed so the onGetContent event gets the full pass through object just like the other events.\r
+       Fixed so attributes for block elements remains the same when you change format of a element.\r
+Version 3.0.8 (2008-04-30)\r
+       Fixed bug where IE would produce an error if textareas without names where converted.\r
+       Fixed bug where editor wasn't forced empty when there was only a single br or empty paragraph left.\r
+       Fixed bug where IE would produce an warning message if object elements where produced in the media plugins preview running on https.\r
+       Fixed bug where new addVer function didn't handle hash items correctly. Patch contributed by Mirek Burkon.\r
+       Fixed bug where font_size_style_values option wasn't applied correctly to fonts inside the editor.\r
+       Fixed bug where image selection could be lost if a image was edited using context menu on IE.\r
+       Fixed bug where style values wasn't updated properly due to an invalid regexp.\r
+       Fixed bug where IE 6 where displaying warning message about insecure items when inserting an image while using https. Patch contributed by Norifumi Sunaoka.\r
+       Fixed bug where IE was producing an auto save message if you selected a color from the color split button.\r
+       Fixed bug where backspace sometimes would move the caret to the end of the previous block in Gecko.\r
+       Fixed bug where the rowlayout manager didn't work as described in the documentation.\r
+       Fixed bug where the default options for the fullpage plugin wasn't applied correctly.\r
+       Fixed bug where selection would jump one character if you applied a styles to a words in non IE browsers.\r
+       Fixed bug where undo levels wasn't added correctly if you went back in undo history and added a new event.\r
+       Fixed bug where font size dropdown didn't mark the selected size in IE.\r
+       Fixed bug where the size of the editor was determined using clientWidth instead of offsetWidth.\r
+       Fixed so the onchange event doesn't fire on the initial undo level, it will also fire when the editor is blurred.\r
+       Fixed so the advhr plugin produces XHTML valid output instead of non standard attributes.\r
+       Fixed so blockquote gets converted into [quote] in when the bbcode plugin is enabled.\r
+       Fixed so theme_advanced_font_sizes can be named for example Font 1=1, Font 2=2 etc.\r
+       Fixed so editor_selector/editor_deselector can be regexps. By default only strings are allowed not part regexps like before.\r
+       Fixed so that the version suffix is optional. It still requires the build process so you need to export it manually.\r
+       Fixed so it's possible to tab to table cells in non Gecko browsers and also produce new rows if you tab at the end of a table. Contributed by Josh Peek.\r
+Version 3.0.7 (2008-04-14)\r
+       Added new version suffix to all internal GET requests to make sure that the users cache gets cleared correctly.\r
+       Fixed issue with isDirty returning true event if it wasn't dirty on IE due to changes in tables during initialization.\r
+       Fixed memory leak in IE where if a page was unloaded before all images on the page was loaded it would leak.\r
+       Fixed bug in IE where underline and strikethrough could produce an exception error message.\r
+       Fixed bug where inserting paragraphs in totally empty table cells would produce odd effects.\r
+       Fixed bug where layer style data wasn't updated correctly due to some performance enhancements with the DOM serializer.\r
+       Fixed bug where it would convert the wrong element if there was two elements with the same name and id on the page.\r
+       Fixed bug where it was possible to add style information to the body element using the style plugin.\r
+       Fixed bug where Gecko would add an extra undo level some times due to the blur event.\r
+       Fixed bug where the underline icon would get active if the caret was inside a link element.\r
+       Fixed bug where merging th cells not working correctly. Patch contributed by André R.\r
+       Fixed bug where forecolorpicker and backcolorpicker buttons where rendered incorrectly when the o2k7 skin was used.\r
+       Fixed bug where comment couldn't contain -- since it's invalid markup. It will now at least not break on those invalid comments.\r
+       Fixed bug where apos wasn't handled correctly in IE. It will now convert apos to &#39; on IE since that browser doesn't support that entity.\r
+       Fixed bug where entities wasn't encoded correctly inside pre elements since they where protected from whitespace removal.\r
+       Fixed bug where color split buttons where rendered incorrectly on IE6 when using the non default theme.\r
+       Fixed so caret is placed after links ones they are created, to improve usability of the editor.\r
+       Fixed so you can select tables by clicking on it's borders in non IE browsers to normalize the behavior.\r
+       Fixed so the menus can be toggled by clicking once more on the icon in listboxes, menubuttons and splitbuttons based on code contributed by Josh Peek.\r
+       Fixed so buttons can be labeled, currently only works with the default skin, so it's kind of experimental. Patch contributed by Daniel Insley.\r
+       Fixed so forecolorpicker and backcolorpicker remembers the last selected color. Patch contributed by Shane Tomlinson.\r
+       Fixed so that you can only execute the mceAddEditor command once for the same instance name.\r
+       Fixed so command functions added with addCommand can pass though the call to default handles if it returns true.\r
+Version 3.0.6.2 (2008-04-07)\r
+       Fixed bug where empty tables couldn't be edited correctly on non IE browsers if they where loaded into the editor.\r
+       Fixed bug where it was impossible to resize layers correctly in IE since it thought it was an image.\r
+       Fixed bug where an editor instance was stealing focus in IE resulting in a scroll to the editor on page reloads.\r
+       Fixed bug where Safari was crashing on Mac OS X if you closed dialogs using the Esc key.\r
+Version 3.0.6.1 (2008-04-04)\r
+       Added support for the missing mceAddFrameControl command. The input for this command has changed so consult the Wiki.\r
+       Fixed bug where sub menus for the drop menus would leave an empty element behind.\r
+       Fixed memory leak in IE if the editor was placed in a frame or iframe.\r
+Version 3.0.6 (2008-04-03)\r
+       Added elements to the default value of valid_elements option. It now contains all XHTML strict elements and a few transitional.\r
+       Added more accessibility fixes, it's now possible to navigate and close list boxes and split button menus with the keyboard.\r
+       Added missing getInfo method to the contextmenu and safari plugin, this caused problems for the Drupal module.\r
+       Added new inlinepopups_zindex option to the inlinepopups plugin so that you can configure the default start z-index.\r
+       Added new setControlType method to the tinymce.ControlManager class. This method enables you to override the default classes.\r
+       Added ability to specific an optional control class to use instead of the default one for the ControlManager methods. Based on concept by Josh Peek.\r
+       Fixed bug where attribute rules for the DOM Serializer couldn't contain - or _ characters in their names.\r
+       Fixed bug where inlinepopups event blocker and modal dialog blocker elements produced vertical scrollbars.\r
+       Fixed bug where there was a rendering issue with quirks mode in Safari moving the resize handle to an incorrect position.\r
+       Fixed bug with forecolor/backcolor controls on IE. Sometimes elements positioned relative will generate display errors.\r
+       Fixed bug where a p2 was leaking out in the global name space when you selected a color from the forecolor/backcolor controls.\r
+       Fixed bug where empty paragraphs didn't work as expected in browsers other than IE.\r
+       Fixed bug where the load method of the tinymce.dom.ScriptLoader didn't check if the file was already loaded.\r
+       Fixed bug where the load method for the PluginManager and ThemeManager didn't check if a plugin/theme by a specific name was all ready loaded.\r
+       Fixed bug where the theme_advanced_link_targets option didn't work correctly with the advanced themes link dialog. Patch contributed by Arnold B.\r
+       Fixed bug where the style command would merge classes into empty span elements.\r
+       Fixed bug where the style command would remove empty span elements outside the current selection.\r
+       Fixed bug where the fix for the Safari backspace bug removed all editor contents if it was filled with empty paragraphs.\r
+       Fixed bug where alert and confirm boxes opened by the inlinepopups plugin would produce an exception if domain relaxing was used.\r
+       Fixed bug where Safari was adding style attributes to all elements when you paste them into the editor.\r
+       Fixed bug where the spellchecker menus was visually incorrect since the space for the non existing icon was still there.\r
+       Fixed bug where remove_linebreaks option didn't remove line breaks inside the text contents of a element.\r
+       Fixed bug where Safari 3.1 was introducing _mc_tmp into paragraphs due to the new querySelectorAll and a TinyMCE specific workaround.\r
+       Fixed bug where getParam method in the Editor class was returning incorrect objects and would mess up the font drop down. Patch contributed by speednet.\r
+       Fixed bug where the table dialog would produce an exception in IE when you edited tables since it tried to place focus in a disabled field.\r
+       Fixed bug where class attribute on some span elements was removed on cleanup.\r
+       Fixed bug where resizing the editor in IE could produce an exception if the editor width/height got to be a negative value.\r
+       Fixed bug where wmv files wouldn't play since the src param was used instead of the url param.\r
+       Fixed bug where br elements would be added here and there in Gecko. Geckos internal _moz_dirty br elements where serialized as well.\r
+       Fixed bug where editing named anchors would produce two anchors instead of one updated one.\r
+       Fixed bug where arrow and function keys didn't work when an noneditable element was focused within the editor.\r
+       Fixed bug where the dispatcher could produce an exception if the listener list was altered inside an event callback.\r
+       Fixed bug where it was impossible to totally empty the editor contents on Safari due to an mistreatment of nbsp as whitespace. Patch contributed by Andrew Ozz.\r
+       Fixed bug where TinyMCE would not convert textareas with the same name attribute value. It will now generate an unique id for those textareas.\r
+       Fixed bug where backspace/delete key was deleting td elements inside tables while running on Gecko.\r
+       Fixed bug where Firefox 3.0b4 and Opera 9.26 where scrolling to the top of document when pressing return/enter.\r
+       Fixed bug where the template plugin wasn't just inserting the mceTmpl tagged element.\r
+       Fixed bug where the alert method of the default WindowManager implementation didn't translate input language strings like the inlinepopups dialog does.\r
+       Fixed bugs with the backspace behavior in Gecko. The caret was placed on incorrect locations in the DOM sometimes.\r
+       Fixed so advimage dialog and table dialogs has support for editable select boxes for the class value.\r
+       Fixed so the media, pagebreak and spellchecker doesn't load it's default content.css file if the content_css option is set to false.\r
+       Fixed so the paste_use_dialog option works again it's enabled by default but can be disabled on IE. Patch contributed by Speednet.\r
+       Fixed so that the fullscreen editor is focused when switching fullscreen editing on.\r
+       Fixed so it's possible to edit images and links inside tables using the context menu.\r
+       Fixed so table dialogs and the advanced image dialog doesn't loose selection in IE if the dialogs where navigated/submitted with the keyboard.\r
+       Fixed so the theme_advanced_blockformats options can have named items for example title 1=h1;title 2=h2.\r
+       Fixed so it's possible to add a custom editor_css for the simple theme.\r
+       Fixed quirks with directionality rtl, patch contributed by Andrew Ozz.\r
+       Fixed so the inlinepopups default start zIndex is 300000.\r
+       Fixed typo in media plugin Shockware is now replaced with Shockwave.\r
+       Fixed psuedo memory leak in IE with the replaceChild method inside the DOMUtils.replace method.\r
+       Fixed so memory is released when an editor instance is removed from page.\r
+       Optimized the color split button menus so that they use less event handlers.\r
+       Removed the util/mclayer.js file since it's no longer used by any of the TinyMCE dialogs and is considered deprecated.\r
+Version 3.0.5 (2008-03-12)\r
+       Added new black skin variant to the o2k7 skin contributed by Stefan Moonen.\r
+       Added new explode method to the tinymce core class. This does a split but removed whitespace it also defaults to a , delimiter.\r
+       Added new detection logic for IE 8 standards mode into the DOMUtils class strMode can now be checked to see if that mode is on/off.\r
+       Added new noscale option value for the scale select box for Flash in the media plugin.\r
+       Fixed bug where the menu for the ColorSplitButton wasn't removed when the editor was removed.\r
+       Fixed bug where font colors couldn't be edited correctly since the style of the element didn't get updated correctly.\r
+       Fixed bug where class of elements would get lost when TinyMCE was fixing incorrect HTML markup.\r
+       Fixed bug where table editing would produce double height values.\r
+       Fixed bug where width style value wouldn't be removed if you switched width unit from cm/em to pixels or percent.\r
+       Fixed bug where the search/replace input box wasn't auto focused like the other dialogs.\r
+       Fixed bug where the old mceAddControl command would use the fullscreen settings next time it created an instance.\r
+       Fixed bug where multiple lines where added to the target cell if you merged multiple empty cells.\r
+       Fixed bug where drop down menus would be incorrectly positioned inside scrollable divs.\r
+       Fixed bug where the separators of the silver skin variant didn't display correctly in IE 6.\r
+       Fixed bug where createStyleSheet seems to load scripts at opposite order in some IE versions.\r
+       Fixed bug where directionality could produce odd results for the UI and the dialogs.\r
+       Fixed bug where the DOM serializer wouldn't serialize custom namespaced attributes in IE 6 using the *[*] valid elements rule.\r
+       Fixed bug where table caption would be inserted after the thead element if you swapped a tr to be inside the thead.\r
+       Fixed bug where the youtube detection logic for the media plugin was to generic.\r
+       Fixed so the deprecated and undocumented theme_advanced_path_location set to none won't hide the whole statusbar.\r
+       Fixed so most input lists can have whitespace in them they are now split using the new tinymce.explode method.\r
+       Fixed so the popup_css and popup_css_add URLs are relative to where the current document is located.\r
+       Fixed various bugs and quirks with the store/restore selection logic.\r
+       Fixed so the editor starts in IE 8 standards mode but still that browser is very very buggy.\r
+       Fixed so dialog_type set to modal will block the background and other inline windows and only give access to the front most window.\r
+Version 3.0.4.1 (2008-03-08)\r
+       Fixed critical bug where it was impossible to edit images when inlinepopups where used due to lost selection in IE.\r
+Version 3.0.4 (2008-03-07)\r
+       Added new option constrain_menus, this enables you to force view port constraints on all menus. Contributed by Shane Tomlinson.\r
+       Fixed bug where table background wasn't visible inside the editor due to a default CSS rule overriding the style attribute.\r
+       Fixed bug where links would get a null class added if no styles was used in IE.\r
+       Fixed bug where spellchecker was auto focusing the editor in IE.\r
+       Fixed bug where document.domain would produce invalid argument if the editor was loaded in IE6 over a network UNC path.\r
+       Fixed bug where table height attribute was used, this is deprecated in XHTML so it now adds it as an style.\r
+       Fixed bug where textareas with style values would produce error in IE.\r
+       Fixed so the first element in each dialog is focused by default to enhance keyboard usage.\r
+       Fixed so you can add a mceFocus class to elements to make it auto focused.\r
+       Fixed so you can close dialogs using the esc key.\r
+       Fixed so you can press return/enter to submit the action of each dialog.\r
+       Fixed so tabbing inside an inline popups wont focus the resize anchor elements.\r
+       Fixed so you can press ok in inline alert messages using the return/enter key.\r
+       Fixed so textareas can be set to non px or % sizes for example em, cm, pt etc.\r
+       Fixed so non pixel values can be used in width/height properties for tables.\r
+       Fixed so the custom context menu can be disabled by holding down ctrl key while clicking.\r
+       Fixed so the layout for the o2k7 skin looks better if you don't have separators before and after list boxes.\r
+       Fixed so the sub classes get a copy of the super class constructor function to ease up type checking.\r
+       Fixed so font sizes for the format block previews are normalized according to http://www.w3.org/TR/CSS21/sample.html (it can be overridden).\r
+       Fixed so font sizes for h1-h6 in the default content.css is normalized according to http://www.w3.org/TR/CSS21/sample.html (it can be overridden).\r
+Version 3.0.3 (2008-03-03)\r
+       Fixed bug where an error about document.domain would be thrown if TinyMCE was loaded using a different port.\r
+       Fixed bug where mode exact would convert textareas without id or name if the elements option was omitted.\r
+       Fixed bug where the caret could be placed at an incorrect location when backspace was used in Gecko.\r
+       Fixed bug where local file:// URLs where converted into absolute domain URLs.\r
+       Fixed bug where an error was produced if a editor was removed inside an editor command.\r
+       Fixed bug where force_p_newlines didn't effect the paste plugin correctly.\r
+       Fixed bug where the paste plugin was producing an exception on IE if you pasted contents with middots.\r
+       Fixed bug where delete key could produce exceptions in Gecko sometimes due to the fix for the table cell bug.\r
+       Fixed bug where the layer plugin would produce an visual add class called mceVisualAid this one is now renamed to mceItemVisualAid to mark it internal.\r
+       Fixed bug where TinyMCE wouldn't initialize properly if ActiveX controls was disabled in IE.\r
+       Fixed bug where tables and other elements that had visual aids on them would produce an extra space after any custom class names.\r
+       Fixed bug where search with an empty string would produce some odd "invalid pointer" error in IE.\r
+       Fixed bug where elements like menus where placed at incorrect positions in Opera 9.26.\r
+       Fixed bug where IE was loosing focus of the editor when you clicked some dropmenu and if it was placed in a frame or iframe.\r
+       Fixed bug where focus of images could be lost in IE if you focused the accessibility confirm dialog in the advimage plugin.\r
+       Fixed bug where nestled font elements would produce odd output like missing font elements.\r
+       Fixed bug where text colors and styles got removed if invalid_elements included the font element.\r
+       Fixed bug where text-decoration set to underline or line-through would remove other styles from span elements.\r
+       Fixed bug where editor contents like \n\n would be incorrectly handled and processed as real line feeds.\r
+       Fixed bug where incorrectly encoded urls with ampersands in them would be decoded incorrectly.\r
+       Optimized the DOMUtils decode method to be a lot faster if the string doesn't have any entities to decode.\r
+Version 3.0.2.1 (2008-02-26)\r
+       Fixed alert/confirm dialogs so they display correctly.\r
+Version 3.0.2 (2008-02-26)\r
+       Added new body_id option that enables you to specify the id of the body inside the editor iframe based on ideas by David Bildström (ChronoZ).\r
+       Added new body_class option that enables you to set the class for the body of the editor iframe based on ideas by David Bildström (ChronoZ).\r
+       Added new CSS class to the default content.css files mceForceColors that forces white background and black text can be used with the body_class option.\r
+       Added new type parameter to the Editor.getParam function to reduce redundant logic for parsing hash tables.\r
+       Added new isDone method to the ScriptLoaded class, this enables you to check if a script has been loaded or not.\r
+       Added new resizeTo and resizeBy methods for the advanced theme. Can be called using tinyMCE.activeEditor.theme.resizeTo(w, h);\r
+       Added new skin_variant option this can be used to extend existing skins with slight modifications like color.\r
+       Added new variant of the o2k7 skin called "silver" based on a contribution made by Stefan Moonen.\r
+       Fixed bug where the template plugin might produce errors if the template_mdate_classes wasn't configured.\r
+       Fixed bug where the media plugin didn't convert the URLs for movies once they where inserted.\r
+       Fixed bug where the style field for the advlink dialog didn't work correctly if you edited an existing link.\r
+       Fixed bug where alignment of toolbars would fail in editor was uses in a quirks mode on IE, fix contributed by Peter Wood & Art Lawry.\r
+       Fixed bug where initialization of multiple editors at the same time using the mceAddControl method would produce errors.\r
+       Fixed bug where initialization of editors using mceAddControl command or new tinymce.Editor calls would fail during page load.\r
+       Fixed bug where the check for domain relaxing could fail if the document.domain property was changed by another script.\r
+       Fixed bug where textareas couldn't be named description or any other name that matches the meta elements in IE and Opera.\r
+       Fixed bug where the element path would fail sometimes in IE due to "unknown runtime error" on innerHTML.\r
+       Fixed bug where Safari would crash if you was hiding the editor before serializing the contents.\r
+       Fixed bug where the editor wasn't scaled propertly in fullscreen mode using the old fullscreen_new_window option.\r
+       Fixed bug where render method didn't load language packs in IE and Opera if you rendered an editor during page load.\r
+       Fixed bug where resizing the browser window in fullscreen didn't resize the editor.\r
+       Fixed bug where the blockquote command didn't move the caret inside the new empty blockquote if you used it on an empty document.\r
+       Fixed bug where auto in a style width/height for the textarea would produce an editor with the size value of 100. Fix contributed by Shane Tomlinson.\r
+       Fixed bug where restoration of selection at the beginning of an element could fail in Gecko.\r
+       Fixed bug where caret restoration after a cleanup could place the it at an incorrect location.\r
+       Fixed bug where delete key inside td elements would delete the cell in Gecko.\r
+       Fixed so the blockquote button toggles individual lines. This behavior is a bit more like the old indentation behavior in the 2.x branch.\r
+       Fixed so the dialog language packs only gets loaded the first time you open a dialog.\r
+       Fixed so all classes in the whole UI is prefixed with "mce" to avoid collisions, use the skin converter to update your existing skins.\r
+       Fixed so all classes in the inlinepopups logic is prefixed with "mce" to avoid collisions, use the skin converter to update your existing skins.\r
+       Fixed so that the window in fullscreen mode can be resized when fullscreen_new_window option is enabled.\r
+       Fixed so blockquote elements are formatted in the source output with an linefeed before and after it.\r
+       Optimized the editor initialization by reducing the number of calls to getBookmark/moveToBookmark.\r
+Version 3.0.1 (2008-02-21)\r
+       Added spellchecker plugin into the main package, but without any backend can be specified with the spellchecker_rpc_url option.\r
+       Added src attribute for script elements to the default valid_elements option value.\r
+       Added extra parameter to the class_filter callback it can now also filter out classes based on the whole CSS rule.\r
+       Added support for domain relaxing, TinyMCE can now be loaded from an remote domain as long as they are on the same root domain.\r
+       Added support for custom elements the new custom_elements option enables you to add non HTML elements to the editor.\r
+       Added support for the W3C Selectors API that was added to latest nightly build of WebKit.\r
+       Fixed bug where some object param element wasn't stored correctly using the media plugin.\r
+       Fixed bug where Opera was scrolling to top of page is drop menus on list boxes where displayed.\r
+       Fixed bug where IE6 was crashing if a format block was used on a container with anchor elements.\r
+       Fixed bug where spans with font sizes wasn't handled correctly when editor was loading contents.\r
+       Fixed bug where mode exact couldn't convert editors with name only. Id is no longer required but recommended.\r
+       Fixed bug where the mceInsertRawHTML command produced an extra undo level.\r
+       Fixed bug where the specific_textareas mode didn't work correctly this is the same thing as textareas now.\r
+       Fixed bug where the values of input elements in the HTML page of dialogs pages where changed in IE.\r
+       Fixed bug where fullscreen and fullpage plugins didn't work well together.\r
+       Fixed bug where embed elements wasn't handled properly in the media plugin.\r
+       Fixed bug where style information on span elements gets munged when fonts are converted to spans.\r
+       Fixed bug where some entities in element attributes where encoded incorrectly in the latest WebKit build.\r
+       Fixed bug where initialization would fail in IE if there where two input elements with the name submit in the form.\r
+       Fixed bug where fullscreen mode didn't work correctly in IE when the fullscreen_new_window option was used.\r
+       Fixed bug where invalid contents like an ul inside a p element would produce odd results in IE.\r
+       Fixed bug where Opera 9.2x was placing the drop menus at incorrect locations if the editor was placed in a table.\r
+       Fixed bug where Opera was producing odd results if enter/return was pressed while having forced_root_blocks disabled.\r
+       Fixed bug where layer plugin was stealing focus in IE on initialization.\r
+       Fixed bug where body attributes wasn't set properly in the fullpage plugin, fix contributed by Hiroaki Kawai.\r
+       Fixed bug where insert image and insert link dialogs where producing an extra level in the undo history.\r
+       Fixed bug where Gecko would produce an error if empty elements like <div></div> where inserted using mceInsertContent.\r
+       Fixed bug where center alignment of images produced odd results inside table cells.\r
+       Fixed bug where center alignment of images couldn't be toggled correctly.\r
+       Fixed bug where alignment of images inside tables would produce double float style items in IE if the fix_table_elements option was enabled.\r
+       Fixed bug where a variable called 'v' was polluting the global namespace. Objects tinymce and tinyMCE are the only ones allowed to be global.\r
+       Fixed bug where insert table from context menu couldn't insert new tables inside existing tables.\r
+       Fixed bug where Safari wouldn't produce br elements on enter when the force_br_newlines option was enabled.\r
+       Fixed bug where switching cell type in table cell dialog would produce odd attributes in IE.\r
+       Fixed bug where Gecko was outputting internal attributes if valid_elements where set to "*[*]".\r
+       Fixed bug where the style plugin would produce non hex colors inside the dialog when running on Gecko.\r
+       Fixed bug where an empty src value for insert image would remove the currently selected image if it wasn't and image element.\r
+       Fixed bug where hidden input elements would break the logic for the tab_focus option.\r
+       Fixed bug where save button wasn't working correctly in fullscreen mode.\r
+       Fixed bug where the editor was forced to be placed in a form element if the save_onsavecallback option was used.\r
+       Fixed bug where upper case param attributes wasn't parsed correctly in the media plugin.\r
+       Fixed bug where render method of tinymce.Editor class would produce an exception if the strict_loading_mode option was omitted.\r
+       Fixed bug where nodeChanged event could be fired while the editor was loading and there for produce an exception in FF.\r
+       Fixed bug where no undo levels where added if the user created new table rows using the tab key on Gecko.\r
+       Fixed bug where tables would be broken if you selected a different block format for contents withing an table cell.\r
+       Fixed bug where the render method of the tinymce.Editor class didn't setup the tinymce.EditorManager.settings object correctly.\r
+       Fixed bug where the advanced image dialog would go to the first tab if the alternative image was changed using the file browser link.\r
+       Fixed bug where the forced_root_block option would produce BR elements inside empty blocks if the block wasn't a paragraph.\r
+       Fixed bug where the forced_root_block doesn't work correctly on IE if the specified element was something else than paragraphs.\r
+       Fixed bug where selection of images would get lost if user selected something from the context menu in IE.\r
+       Fixed bug where the context menu plugin would pollute the global namespace with two variables p1 and p2.\r
+       Fixed compatibility issue with Mootools, it is destroying document.getElementById on unload in IE. (Mantra: You don't own the internal objects).\r
+       Fixed bugs where dialogs/tabs and other UI elements where rendered incorrectly in Firefox 3.\r
+       Fixed so the auto CSS class importer is compatible with 2.x.\r
+       Fixed so the editor UI and inlinedialogs works correctly with the YUI CSS reset package.\r
+       Fixed so header and footer elements are forced to lower case when the fullpage plugin is used.\r
+       Fixed so load prefixes "-" for plugins and themes isn't required if the plugin/theme was loaded by the ThemeManager/PluginManager.\r
+       Fixed so the JSONRequest uses application/json content type to make Ruby on rails happy.\r
+       Fixed so the CSS rule is more exact for the body in the default content.css files. Body is now defined as "body.mceContentBody" instead of just "body".\r
+       Fixed so the tiny_mce_dev.js uses XHR instead of document.write to load scripts to resolve an issue with Opera 9.50.\r
+       Fixed so language pack loading can be disabled by setting the language option to false. Can be useful for systems with their own language pack management.\r
+Version 3.0 (2008-01-30)\r
+       Added map and area elements to the default valid_elements list and also some indentation rules.\r
+       Fixed bug where empty paragraphs wasn't padded when loading contents.\r
+       Fixed bug where the RowLayout manager didn't work at all.\r
+       Fixed bug where style attribute data would get messed up in advimage dialog.\r
+       Fixed bug where the table dialogs class select wasn't updated correctly.\r
+       Fixed bug where elements would get extra whitespace around on insert when body was present in valid_elements.\r
+       Fixed bug where coords attribute of the area element wasn't handled properly in IE.\r
+       Fixed bug where Safari didn't produce BR elements on shift+return.\r
+       Fixed bug where force blocks would cast odd invalid attribute exception in IE.\r
+       Fixed bug where media plugin would produce extra whitespace before and after objects.\r
+       Fixed bug where cleanup_callback could break the contents of the editor. But use the new event system instead of this option.\r
+       Fixed bug where the tab_focus option didn't work between editor instanced. You can now tab between editors.\r
+       Fixed bug where the load function of the ScriptLoader class didn't load single files without the load que as it was supposed to.\r
+       Fixed bug where the execcommand_callback parameter order was incorrect. Recommendation use the new addCommand method.\r
+       Fixed bug where range.select calls sometimes failed on some IE versions.\r
+       Fixed bug where Safari was scrolling to top of document when enter/returned was pressed.\r
+       Fixed bug where fullscreen_new_window option didn't work correctly.\r
+       Fixed bug where the nonbreaking plugin inserted an space instead of an non breaking space the first time.\r
+       Fixed bug where the visualization of non breaking spaces where visual in element path.\r
+       Fixed so the focus is restored to the editor after inserting an custom character.\r
+       Fixed so the isNotDirty state is set to false if a new undo level is added.\r
+       Fixed so pointless style information for borders gets removed in IE.\r
+       Fixed so the resize button has a se-resize cursor css value.\r
+Version 3.0rc2 (2008-01-18)\r
+       Added new fix_nesting option to fix bug #1867292, this is disabled by default.\r
+       Added new indentation option enables you to specify how much each indent/outdent call will add/remove.\r
+       Added easier support for enabling/disabling icon columns on drop menues.\r
+       Added new menu button control class. This control is very similar to the splitbutton but without any onclick action.\r
+       Added support for previous tab focus (shift+tab). The tab_focus setting now takes two items next and previous element.\r
+       Fixed bug where iframes inside the editor got removed in Firefox on initial load.\r
+       Fixed bug where the CSS for abbr elements wasn't applied correctly in IE.\r
+       Fixed bug where mceAddControl on element inside a hidden container produced errors.\r
+       Fixed bug where closed anchors like <a /> produced strange results.\r
+       Fixed bug where caret would jump to the top of the editor if enter was pressed a the end of a list.\r
+       Fixed bug where remove editor failed if the editor wasn't properly initialized.\r
+       Fixed bug where render call on for a non existing element produced exception.\r
+       Fixed bug where parent window was hidden when the color picker was used in a non inlinepopups setup.\r
+       Fixed bug where onchange event wasn't fired correctly on IE when color picker was used in dialogs.\r
+       Fixed bug where save plugin could not save contents if the converted element wasn't an textarea.\r
+       Fixed bug where events might be fired even after an editor instance was removed such as blur events.\r
+       Fixed bug where an exception about undefined undo levels could be throwed sometimes.\r
+       Fixed bug where the plugin_preview_pageurl option didn't work.\r
+       Fixed bug where adding/removing an editor instance very fast could produce problems.\r
+       Fixed bug where the link button was highlighted when an anchor element was selected.\r
+       Fixed bug where the selected contents where removed if a new anchor element was added.\r
+       Fixed bug where splitbuttons where rendered one pixel down in the default theme.\r
+       Fixed bug where some buttons where placed at incorrect positions in the o2k7 theme.\r
+       Fixed bug that made it impossible to visually disable a custom button that used an image instead of CSS sprites.\r
+       Fixed bug where it wasn't possible to press delete/backspace if the editor was added+removed and re-added due to a FF bug.\r
+       Fixed bug where an entities option with only 38,amp,60,lt,62,gt would fail in IE.\r
+       Fixed bug where innerHTML sometimes generated unknown runtime error on IE.\r
+       Fixed bug where content_css files wasn't loaded in the template preview iframe.\r
+       Fixed bug where scroll position was incorrect when toggling fullscreen mode.\r
+       Fixed bug where restoration of overflow didn't work correctly when disabling fullscreen mode in Opera.\r
+       Fixed bug where drop menus where places at incorrect locations if the editor was placed in a scrollable container element.\r
+       Fixed bug where hideMenu didn't hide sub menus correctly. It will now hide all menus recursively.\r
+       Fixed so theme_advanced_path_location can be used in init options for compatibility reasons.\r
+       Fixed so the drop menu colors matches the rest of o2k7 theme.\r
+       Fixed so the preview example.html file is updated to the new 3.x API.\r
+       Fixed so the margins are the same by default inside the editable area between IE and other browsers.\r
+       Fixed so editor contents gets stored before it the onSubmit event is fired.\r
+Version 3.0rc1 (2008-01-08)\r
+       Added new classes for toolbar rows in advanced theme mceToolbarRow1..n enabled you to change appearance of individual rows.\r
+       Added auto detection for the strict_loading_mode option when running in application/xhtml+xml mode on Gecko.\r
+       Optimized the HTML serializer by bundling some post process methods together.\r
+       Fixed so that the toolbars have unique IDs, enables you to alter the toolbars using the ControlManager and the DOM.\r
+       Fixed bug where delta values for dialog sizes in language packs didn't work correctly due to missing string to number casting.\r
+       Fixed bug where paragraph generation logic didn't handle hr or table elements correctly if they where the only element.\r
+       Fixed bug where some elements got extra linebreaks added after or before it in HTML output.\r
+       Fixed bug where it was hard to modify existing style data on table rows and table cells.\r
+       Fixed bug where the dom.getRect method didn't handle non pixel values correctly.\r
+       Fixed bug where strikethrough and underline couldn't be toggled on existing span elements.\r
+       Fixed bug where the postprocessor searched for nsbp instead of nbsp entities.\r
+       Fixed bug where it was impossible to edit links that had child elements within them.\r
+       Fixed bug where it was possible to click on the parent item of a submenu.\r
+       Fixed bug where mouseover/mouseout images couldn't be removed in advimage dialog.\r
+       Fixed bug where drop menus didn't work when running in application/xhtml+xml mode.\r
+       Fixed bug where Opera added doctype to output in application/xhtml+xml mode.\r
+       Fixed bug where some DOM methods didn't work correctly in the application/xhtml+xml mode.\r
+       Fixed bug where the inlinepopups didn't work correctly in the application/xhtml+xml mode.\r
+       Fixed bug where the ColorSplitButton didn't display correctly in the application/xhtml+xml mode.\r
+       Fixed bug where the UI layout was incorrect on Gecko browsers when running in application/xhtml+xml mode.\r
+       Fixed bug where the word paste plugin produced exception while running in application/xhtml+xml mode.\r
+       Fixed bug where there wasn't any hidden input element generated for divs while running in application/xhtml+xml mode.\r
+       Fixed bug where indentation of script/style/pre elements where incorrect.\r
+       Fixed bug where script element contents was removed in IE.\r
+       Fixed bug where script element contents got entity encoded.\r
+       Fixed bug where you couldn't edit existing element styles using the styles plugin.\r
+       Fixed bug where styles wasn't updated properly sometimes due to an performance enhancement.\r
+       Fixed bug where font sizes couldn't be changed using the style plugin.\r
+       Fixed bug where an error was produced in Gecko browsers when switching back from fullscreen mode.\r
+       Fixed bug where Opera was producing br elements after elements like h3.\r
+       Fixed bug where TinyMCE couldn't be loaded on a page using - characters in it's URL.\r
+       Fixed bug where the editor container element was forced to have a specific name.\r
+       Fixed bug with force_br_newlines option on Firefox, even though it should never be used (Read FAQ).\r
+       Fixed bug where onclick event had an return true; prefix added when creating an popup.\r
+       Fixed bug where the theme_advanced_statusbar_location option couldn't handle the value "none".\r
+       Fixed issue with URLs with multiple at characters for example an Zope URI.\r
+       Fixed so simple and advanced themes doesn't collide.\r
+       Fixed so a elements gets removed when the href field is left empty, the href attribute is required in a link after all.\r
+       Fixed so img elements gets removed when the src field is left empty, the src attribute is required for all images after all.\r
+       Removed the indent and encode methods from the tinymce.dom.Serializer class due to performance enhancement and reduction of the API size.\r
+Version 3.0b3 (2007-12-14)\r
+       Added new getElement method to Editor class, returns the element that was replaced with the editor instance.\r
+       Added new unavailable prefix for disabled controls for accessibility reasons.\r
+       Fixed bug where regexp patterns couldn't be used for the editor_selector/editor_deselector options.\r
+       Fixed bug where the DOM wasn't properly initialized before the onInit event was executed in popups.\r
+       Fixed bug where font sizes where reduced by font size actions on previous spans in Safari.\r
+       Fixed bug where HR elements got places at the wrong location in IE.\r
+       Fixed bug where align/justify didn't work correctly on multiple paragraphs.\r
+       Fixed bug with missing translation for cell scope settings.\r
+       Fixed bug where selection/caret position was lost on some table actions.\r
+       Fixed bug where editor instances couldn't be added to hidden div elements.\r
+       Fixed bug where list elements in Safari would get an odd ID attribute.\r
+       Fixed bug where IE would return <html/> when the editor was completely empty.\r
+       Fixed bug where accessibility title attribute for access keys wasn't setup properly.\r
+       Fixed bug where forecolorpicker and backcolorpicker control names wasn't working.\r
+       Fixed bug where inserting template content didn't work in Safari due to selection exception.\r
+       Fixed bug where absolute URLs to remote hosts couldn't be used for background images.\r
+       Fixed bug where mysterious span elements where produced in Safari when injecting HTML contents.\r
+       Fixed bug where the media plugin didn't work correctly on the latest Opera 9.24.\r
+       Fixed bug where indentation of HTML output wasn't applied to all block elements.\r
+       Fixed bug where Safari was production DOM exception if you pressed enter in an empty editor.\r
+       Fixed bug where media plugin didn't parse script tags correctly patch contributed by Mathieu Campagna.\r
+       Fixed bug where the drop menus of list boxes like blockformat could produce scrolling of the page.\r
+       Fixed bug where the drop menus where placed at an incorrect location if TinyMCE was placed in a scrollable div.\r
+       Fixed bug where submit buttons couldn't be named submit, it's not recommended to name submit buttons submit anyway.\r
+       Fixed bug where the stylelistbox produced an exception if there was only one class in the list box.\r
+       Fixed bug where the stylelistbox wasn't updated correctly when the current class was removed.\r
+       Fixed bug where the formatblock command sometimes removed the body element.\r
+       Fixed bug where fullscreen switching in IE sometimes produced an exception when the spellchecker plugin was enabled.\r
+       Fixed issue where FF produced an empty paragraph when the editor was completely empty.\r
+       Fixed issue with size of image dialog in the advanced theme.\r
+       Fixed issues with the bbcode plugin it now also handles spans and the [font] rule.\r
+       Fixed so the style compression feature is a bit smarter to resolve issues with Opera.\r
+       Reintroduced the remove_linebreaks option, this is enabled by default.\r
+Version 3.0b2 (2007-11-29)\r
+       Added type and compact attributes to the default valid_elements list for the ul and ol elements.\r
+       Added missing accessibility support to native list boxes in both the toolbar and dialogs.\r
+       Added missing access key for the element path for accessibility reasons.\r
+       Fixed support for loading themes from external URLs.\r
+       Fixed bug where setOuterHTML didn't work correctly when multiple elements where passed to it.\r
+       Fixed bug with visualchars plugin was moving elements around in the DOM.\r
+       Fixed bug with DIV elements that got converted into editors on IE.\r
+       Fixed bug with paste plugin using the old event API.\r
+       Fixed bug where the spellchecker was removing the word when it was ignored.\r
+       Fixed bug where fullscreen wasn't working properly.\r
+       Fixed bug where the base href element and attribute was ignored.\r
+       Fixed bug where redo function didn't work in IE.\r
+       Fixed bug where content_css didn't work as previous 2.x branch.\r
+       Fixed bug where preview dialog was throwing errors if the content_css wasn't defined.\r
+       Fixed bug where the theme_advanced_path option didn't work like the 2.x branch.\r
+       Fixed bug where the theme_advanced_statusbar_location was called theme_advanced_status_location.\r
+       Fixed bug where the strict_loading_mode option didn't work if you created editors dynamically without using the EditorManager.\r
+       Fixed bug where some language values wasn't translated such as insert and update in dialogs.\r
+       Fixed bug where some image attributes wasn't stored correctly when inserting an image.\r
+       Fixed bug where fullscreen mode didn't restore scrollbars when disabled.\r
+       Fixed bug where there was no visual representation for tab focus in toolbars on IE.\r
+       Fixed bug where HR elements wasn't treated as block elements so forced_root_block would fail on these.\r
+       Fixed bug where autosave presented warning message even when the form was submitted normally.\r
+       Fixed typo of openBrower it's now openBrowser in form_utils.js.\r
+       Fixed various HTML problems like missing TD elements and duplicated doctypes.\r
+       Fixed default values for theme_advanced_resize_horizontal, theme_advanced_resizing_use_cookie to be 2.x compatible.\r
+       Moved spellchecker JS files into the development package.\r
+       Removed support for theme_advanced_path_location since the theme_advanced_statusbar_location is the correct option name.\r
+Version 3.0b1 (2007-11-21)\r
+       Added new tab_focus option, that enables you to specify a element id or that the next element to be focused on tab key down.\r
+       Added new addQueryValueHandler method to the tinymce.Editor class.\r
+       Added new class_filter option, this enables you to specify a function that can filter out CSS classes for the styles list box.\r
+       Added support form [url=url]title[/url] to the bbcode plugin.\r
+       Renamed the addCommandQueryState method in the tinymce.Editor class to addQueryStateHandler.\r
+       Renamed loadQue to loadQueue, to correct spelling.\r
+       Removed the createDOM method from the window manager and replace it with a createInstance method.\r
+       Removed the add to beginning of class attribute parameter of the DOMUtils.addClass method.\r
+       Fixed bug with the forced_root_block option, didn't work correctly with multiple inline elements.\r
+       Fixed bug where image dialogs replaced the current image element with a new one even when it was updated.\r
+       Fixed bug where the submit trigger wasn't executed when divs where converted into editor instances.\r
+       Fixed bug where div elements that got converted into editors didn't get a hidden input element generated for them.\r
+       Fixed bug where the the media_use_script option for the media plugin wasn't working correctly.\r
+       Fixed bug where the font size and font family listboxes wasn't updated correctly on Safari.\r
+       Fixed bug where the height of the fieldset in default image dialog for the advanced theme was to small.\r
+       Fixed bug where the font sizes behaved incorrectly after a cleanup on Safari.\r
+       Fixed bug where formatblock didn't work correctly in Safari on some elements.\r
+       Fixed bug where template plugin didn't insert content correctly unless some options where specified.\r
+       Fixed bug where charmap on Safari produced scrollbars.\r
+       Fixed bug where there was white artifacts in some dialogs due to missing background color.\r
+       Fixed bug where port was added to all external URLs if the editor was loaded from a custom port.\r
+       Fixed bug where the context menus got duplicated on Safari 3.0.4 on Mac OS X.\r
+       Fixed bug where dialogs like paste from word was huge on Firefox.\r
+       Fixed bug with media plugin not working with windows media objects.\r
+       Fixed bug where a forever loop was created if multiple instances where submitted using form.submit.\r
+       Fixed bug with editing a table produce error in IE when inlinepopups where used.\r
+       Fixed bug where the style plugin generated ugly looking style information in IE.\r
+       Fixed bug where the inline dialogs that got opened while in fullscreen mode wasn't visible.\r
+       Fixed bug where it was difficult to place the caret inside the word paste dialog.\r
+       Fixed bug where Opera produced strange border in the word paste dialog.\r
+       Fixed bug where viewport constraints could move a inlinepopup to a negative x, y position if the viewport was to small.\r
+       Fixed bug where template plugin was producing an error due to a deprecated API call.\r
+       Fixed bug where drag drop of images failed in Gecko if a document_base_url was specified.\r
+       Fixed bug where Firefox 3 failed to apply block formats like H1-H6 it still breaks on DIVs this has been reported to bugzilla.\r
+       Fixed bug where IE was producing a warning dialog about non secure items when running TinyMCE over HTTPS.\r
+       Fixed bug where the onbeforeunload event was triggered when menus or dialogs where opened.\r
+       Fixed bug where the fullscreen mode of the HTML view source box threw an error.\r
+       Fixed bug where the mceFocus command didn't work correctly.\r
+       Fixed bug where the selection could get lost in IE using inlinepopups.\r
+       Fixed so the body of the editor area has the mceContentBody class just like the 2.x branch. \r
+       Fixed so the media icon gets active when a media element is selected.\r
+Version 3.0a3 (2007-11-13)\r
+       Added new experimental jQuery and Prototype framework adapters to the development package.\r
+       Added new translation.html file for the development package. Helps with the internationalization of TinyMCE.\r
+       Added new setup callback option, use this callback to add events to TinyMCE. This method is recommended over the old callbacks.\r
+       Added new API documetation to all classes, functions, events, properties to the Wiki with examples etc.\r
+       Added new init method to all plugins and themes, since it's shorter to write and it mimics interface capable languages better.\r
+       Fixed various CSS issues in the default skin such as alignment of split buttons and separators.\r
+       Fixed issues with mod_security. It didn't like that a content type of text/javascript was forced in a XHR.\r
+       Fixed all events so that they now pass the sender object as it's first argument.\r
+       Fixed some DOM methods so they now can take an array as input.\r
+       Fixed so addButton and the methods of the ControlManager uses less arguments and it now uses a settings object instead.\r
+       Fixed various issues with the tinymce.util.URI class.\r
+       Fixed bug in IE and Safari and the on demand gzip loading feature.\r
+       Fixed bug with moving inline windows sometimes failed in IE6.\r
+       Fixed bug where save_callback function wasn't executed at all.\r
+       Fixed bug where inlinepopups produces scrollbars if windows where moved to the corners of the browser.\r
+       Fixed bug where view HTML source failed when inserting a embedded media object.\r
+       Fixed bug where the listbox menus didn't display correctly on IE6.\r
+       Fixed bug where undo level wasn't added when editor was blurred.\r
+       Fixed bug where spellchecker wasn't disabled when fullscreen mode was enabled.\r
+       Fixed bug where Firefox could crash some times when the user switched to fullscreen mode.\r
+       Fixed bug where tinymce.ui.DropMenu didn't remove all item data when an item was removed from the menu.\r
+       Fixed bug where anchor list in advlink dialog wasn't populated correctly in Safari.\r
+       Fixed bug where it wasn't possible to edit tables in IE when inlinepopups was enabled.\r
+       Fixed bug where it wasn't possible to change the table width of an existing table.\r
+       Fixed bug where xhtmlxtras like abbr didn't work correctly on IE.\r
+       Fixed bug where IE6 had some graphics rendering issues with the inlinepopups.\r
+       Fixed bug where inlinepopup windows where moved incorrectly when they were boundary checked for min width.\r
+       Fixed bug where textareas without id or name couldn't be converted into editor instances.\r
+       Fixed bug where TinyMCE was stealing element focus on IE.\r
+       Fixed bug where the getParam method didn't handle false values correctly.\r
+       Fixed bug where inlinepopups was clipped by other TinyMCE instances or relative elements in IE.\r
+       Fixed bug where the contextmenu was clipped by other TinyMCE instances or relative elements in IE.\r
+       Fixed bug where listbox menus was clipped by other TinyMCE instances or relative elements in IE.\r
+       Fixed bug where listboxes wasn't updated correctly when the a value wasn't found by select.\r
+       Fixed various CSS issues that produced odd rendering bugs in IE.\r
+       Fixed issues with tinymce.ui.DropMenu class, it required some optional settings to be specified.\r
+       Fixed so multiple blockquotes can be removed with a easier method than before.\r
+       Optimized some of the core API to boost performance.\r
+       Removed some functions from the core API that wasn't needed.\r
+Version 3.0a2 (2007-11-02)\r
+       Fixed critical bug where IE generaded an error on a hasAttribute call in the serialization engine.\r
+       Fixed critical bug where some dialogs didn't open in the non dev package.\r
+       Fixed bug when using the theme_advanced_styles option. Error was thrown in some dialogs.\r
+       Fixed bug where the close buttons produced an error when native windows where used.\r
+       Fixed bug in default skin so that split buttons gets activated correctly.\r
+       Fixed so plugins can be loaded from external urls outsite the plugins directory.\r
+Version 3.0a1 (2007-11-01)\r
+       Rewrote the core and most of the plugins and themes from scratch.\r
+       Added new and improved serialization engine, faster and more powerful.\r
+       Added new internal event system, things like editor.onClick.add(func).\r
+       Added new inlinepopups plugin, the dialogs are now skinnable and uses clearlooks2 as default.\r
+       Added new contextmenu plugin, context menus can now have submenus and plugins can add items on the fly.\r
+       Added new skin support for the simple and advanced themes you can alter the whole UI using CSS.\r
+       Added new o2k7 skin for the simple and advanced themes.\r
+       Added new custom list boxes for font size/format/style etc with preview support.\r
+       Added new UI management, enabled plugins to create controls like splitbuttons or menus easier.\r
+       Added new JSON parser/serializer and JSON-RPC class to the core API.\r
+       Added new cookie utility class to the core API.\r
+       Added new Unit testing class to the core API only available in dev mode.\r
+       Added new firebug lite integration when loading the dev version of TinyMCE.\r
+       Added new Safari plugin, fixes lots compatibility of issues with Safari 3.x.\r
+       Added new URI/URL parsing it now handles the hole RFC and even some exceptions.\r
+       Added new pagebreak plugin, enables you to insert pagebreak comments like <!-- pagebreak -->\r
+       Added new on demand loading of plugins and themes. Enables you to load and init TinyMCE at any time.\r
+       Added new throbber/progress visualization a plugin can show/hide this when it's needed.\r
+       Added new blockquote button. Enables you to wrap paragraphs in blockquotes.\r
+       Added new compat2x plugin. Will provide a TinyMCE 2.x API for older plugins.\r
+       Added new theme_advanced_resizing_min_width, theme_advanced_resizing_min_height options.\r
+       Added new theme_advanced_resizing_max_height, theme_advanced_resizing_max_height options.\r
+       Added new use_native_selects option. Enables you to toggle native listboxes on and off.\r
+       Added new docs_url option enables you to specify where the TinyMCE user documentation is located.\r
+       Added new frame and rules options for the table dialog.\r
+       Added new global rule for valid_elements/extended_valid_elements enables you to specify global attributes for all elements.\r
+       Added new deny attribute rule characher so it's possible to deny global attribute rules on specific elements.\r
+       Added new unit tests in the dev package of TinyMCE. Runs tests on the core API, commands and settings of the editor.\r
+       Readded the inline_styles option and enabled it by default so deprecated attributes are no longer used.\r
+       Removed all button images and replaced them with CSS sprite images. Reduces the number of requests needed.\r
+       Removed lots of language files and merged them into the base language files. Reduces the number of requests needed.\r
+       Removed lots of unnecessary files and merged many of them together to reduce requests and improve loading speed.\r
+       Reduced the over all script size by 33% and the number of files/requests by 75% so it loads a lot faster.\r
+       Fixed so convert_fonts_to_spans are enabled by default. So no more font tags.\r
+       Fixed so underline and strikethrough uses spans instread of deprecated U and STRIKE elements.\r
+       Fixed so indent/outdent adds/removed margin-left instead of blockquotes.\r
+       Fixed so alignment of paragraphs results in a text-align style value instead of the deprecated align attribute.\r
+       Fixed so alignment of images uses float or vertical-align style values instead of the deprecated align attribute.\r
+       Fixed so all classes from @import stylesheets gets imported into the editor.\r
+       Fixed so the directionality can toggle the dir attribute on and off.\r
+       Fixed so the fullscreen_settings can be used for all types of fullscreen modes.\r
+       Fixed so the advanced HR dialog gets displayed when inserting a HR not only on edit.\r
+       Fixed bug where word wrap didn't work in the source editor on Safari.\r
+       Fixed so non HTML elements can be used within the editor such as <myns:tag>\r
+       Fixed various memory leaks in IE and reduced the unload cleanups needed.\r
+       Fixed so the preformatted option adds an invisible container pre tag inside the editor.\r
+       Renamed the _template plugin to example and updated it to use the new 3.x API.\r
diff --git a/docs/include/jscripts/tiny_mce/langs/en.js b/docs/include/jscripts/tiny_mce/langs/en.js
new file mode 100644 (file)
index 0000000..075bef7
--- /dev/null
@@ -0,0 +1,169 @@
+tinyMCE.addI18n({en:{\r
+common:{\r
+edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?",\r
+apply:"Apply",\r
+insert:"Insert",\r
+update:"Update",\r
+cancel:"Cancel",\r
+close:"Close",\r
+browse:"Browse",\r
+class_name:"Class",\r
+not_set:"-- Not set --",\r
+clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",\r
+clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",\r
+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.",\r
+invalid_data:"Error: Invalid values entered, these are marked in red.",\r
+more_colors:"More colors"\r
+},\r
+contextmenu:{\r
+align:"Alignment",\r
+left:"Left",\r
+center:"Center",\r
+right:"Right",\r
+full:"Full"\r
+},\r
+insertdatetime:{\r
+date_fmt:"%Y-%m-%d",\r
+time_fmt:"%H:%M:%S",\r
+insertdate_desc:"Insert date",\r
+inserttime_desc:"Insert time",\r
+months_long:"January,February,March,April,May,June,July,August,September,October,November,December",\r
+months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",\r
+day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",\r
+day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"\r
+},\r
+print:{\r
+print_desc:"Print"\r
+},\r
+preview:{\r
+preview_desc:"Preview"\r
+},\r
+directionality:{\r
+ltr_desc:"Direction left to right",\r
+rtl_desc:"Direction right to left"\r
+},\r
+layer:{\r
+insertlayer_desc:"Insert new layer",\r
+forward_desc:"Move forward",\r
+backward_desc:"Move backward",\r
+absolute_desc:"Toggle absolute positioning",\r
+content:"New layer..."\r
+},\r
+save:{\r
+save_desc:"Save",\r
+cancel_desc:"Cancel all changes"\r
+},\r
+nonbreaking:{\r
+nonbreaking_desc:"Insert non-breaking space character"\r
+},\r
+iespell:{\r
+iespell_desc:"Run spell checking",\r
+download:"ieSpell not detected. Do you want to install it now?"\r
+},\r
+advhr:{\r
+advhr_desc:"Horizontal rule"\r
+},\r
+emotions:{\r
+emotions_desc:"Emotions"\r
+},\r
+searchreplace:{\r
+search_desc:"Find",\r
+replace_desc:"Find/Replace"\r
+},\r
+advimage:{\r
+image_desc:"Insert/edit image"\r
+},\r
+advlink:{\r
+link_desc:"Insert/edit link"\r
+},\r
+xhtmlxtras:{\r
+cite_desc:"Citation",\r
+abbr_desc:"Abbreviation",\r
+acronym_desc:"Acronym",\r
+del_desc:"Deletion",\r
+ins_desc:"Insertion",\r
+attribs_desc:"Insert/Edit Attributes"\r
+},\r
+style:{\r
+desc:"Edit CSS Style"\r
+},\r
+paste:{\r
+paste_text_desc:"Paste as Plain Text",\r
+paste_word_desc:"Paste from Word",\r
+selectall_desc:"Select All"\r
+},\r
+paste_dlg:{\r
+text_title:"Use CTRL+V on your keyboard to paste the text into the window.",\r
+text_linebreaks:"Keep linebreaks",\r
+word_title:"Use CTRL+V on your keyboard to paste the text into the window."\r
+},\r
+table:{\r
+desc:"Inserts a new table",\r
+row_before_desc:"Insert row before",\r
+row_after_desc:"Insert row after",\r
+delete_row_desc:"Delete row",\r
+col_before_desc:"Insert column before",\r
+col_after_desc:"Insert column after",\r
+delete_col_desc:"Remove column",\r
+split_cells_desc:"Split merged table cells",\r
+merge_cells_desc:"Merge table cells",\r
+row_desc:"Table row properties",\r
+cell_desc:"Table cell properties",\r
+props_desc:"Table properties",\r
+paste_row_before_desc:"Paste table row before",\r
+paste_row_after_desc:"Paste table row after",\r
+cut_row_desc:"Cut table row",\r
+copy_row_desc:"Copy table row",\r
+del:"Delete table",\r
+row:"Row",\r
+col:"Column",\r
+cell:"Cell"\r
+},\r
+autosave:{\r
+unload_msg:"The changes you made will be lost if you navigate away from this page.",\r
+restore_content: "Restore auto-saved content",\r
+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?"\r
+},\r
+fullscreen:{\r
+desc:"Toggle fullscreen mode"\r
+},\r
+media:{\r
+desc:"Insert / edit embedded media",\r
+edit:"Edit embedded media"\r
+},\r
+fullpage:{\r
+desc:"Document properties"\r
+},\r
+template:{\r
+desc:"Insert predefined template content"\r
+},\r
+visualchars:{\r
+desc:"Visual control characters on/off."\r
+},\r
+spellchecker:{\r
+desc:"Toggle spellchecker",\r
+menu:"Spellchecker settings",\r
+ignore_word:"Ignore word",\r
+ignore_words:"Ignore all",\r
+langs:"Languages",\r
+wait:"Please wait...",\r
+sug:"Suggestions",\r
+no_sug:"No suggestions",\r
+no_mpell:"No misspellings found."\r
+},\r
+pagebreak:{\r
+desc:"Insert page break."\r
+},\r
+advlist : {\r
+       types : 'Types',\r
+       def : 'Default',\r
+       lower_alpha : "Lower alpha",\r
+       lower_greek : "Lower greek",\r
+       lower_roman : "Lower roman",\r
+       upper_alpha : "Upper alpha",\r
+       upper_roman : "Upper roman",\r
+       circle : "Circle",\r
+       disc : "Disc",\r
+       square : "Square"\r
+}\r
+}});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/license.txt b/docs/include/jscripts/tiny_mce/license.txt
new file mode 100644 (file)
index 0000000..60d6d4c
--- /dev/null
@@ -0,0 +1,504 @@
+                 GNU LESSER GENERAL PUBLIC LICENSE\r
+                      Version 2.1, February 1999\r
+\r
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.\r
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\r
+ Everyone is permitted to copy and distribute verbatim copies\r
+ of this license document, but changing it is not allowed.\r
+\r
+[This is the first released version of the Lesser GPL.  It also counts\r
+ as the successor of the GNU Library Public License, version 2, hence\r
+ the version number 2.1.]\r
+\r
+                           Preamble\r
+\r
+  The licenses for most software are designed to take away your\r
+freedom to share and change it.  By contrast, the GNU General Public\r
+Licenses are intended to guarantee your freedom to share and change\r
+free software--to make sure the software is free for all its users.\r
+\r
+  This license, the Lesser General Public License, applies to some\r
+specially designated software packages--typically libraries--of the\r
+Free Software Foundation and other authors who decide to use it.  You\r
+can use it too, but we suggest you first think carefully about whether\r
+this license or the ordinary General Public License is the better\r
+strategy to use in any particular case, based on the explanations below.\r
+\r
+  When we speak of free software, we are referring to freedom of use,\r
+not price.  Our General Public Licenses are designed to make sure that\r
+you have the freedom to distribute copies of free software (and charge\r
+for this service if you wish); that you receive source code or can get\r
+it if you want it; that you can change the software and use pieces of\r
+it in new free programs; and that you are informed that you can do\r
+these things.\r
+\r
+  To protect your rights, we need to make restrictions that forbid\r
+distributors to deny you these rights or to ask you to surrender these\r
+rights.  These restrictions translate to certain responsibilities for\r
+you if you distribute copies of the library or if you modify it.\r
+\r
+  For example, if you distribute copies of the library, whether gratis\r
+or for a fee, you must give the recipients all the rights that we gave\r
+you.  You must make sure that they, too, receive or can get the source\r
+code.  If you link other code with the library, you must provide\r
+complete object files to the recipients, so that they can relink them\r
+with the library after making changes to the library and recompiling\r
+it.  And you must show them these terms so they know their rights.\r
+\r
+  We protect your rights with a two-step method: (1) we copyright the\r
+library, and (2) we offer you this license, which gives you legal\r
+permission to copy, distribute and/or modify the library.\r
+\r
+  To protect each distributor, we want to make it very clear that\r
+there is no warranty for the free library.  Also, if the library is\r
+modified by someone else and passed on, the recipients should know\r
+that what they have is not the original version, so that the original\r
+author's reputation will not be affected by problems that might be\r
+introduced by others.\r
+\r
+  Finally, software patents pose a constant threat to the existence of\r
+any free program.  We wish to make sure that a company cannot\r
+effectively restrict the users of a free program by obtaining a\r
+restrictive license from a patent holder.  Therefore, we insist that\r
+any patent license obtained for a version of the library must be\r
+consistent with the full freedom of use specified in this license.\r
+\r
+  Most GNU software, including some libraries, is covered by the\r
+ordinary GNU General Public License.  This license, the GNU Lesser\r
+General Public License, applies to certain designated libraries, and\r
+is quite different from the ordinary General Public License.  We use\r
+this license for certain libraries in order to permit linking those\r
+libraries into non-free programs.\r
+\r
+  When a program is linked with a library, whether statically or using\r
+a shared library, the combination of the two is legally speaking a\r
+combined work, a derivative of the original library.  The ordinary\r
+General Public License therefore permits such linking only if the\r
+entire combination fits its criteria of freedom.  The Lesser General\r
+Public License permits more lax criteria for linking other code with\r
+the library.\r
+\r
+  We call this license the "Lesser" General Public License because it\r
+does Less to protect the user's freedom than the ordinary General\r
+Public License.  It also provides other free software developers Less\r
+of an advantage over competing non-free programs.  These disadvantages\r
+are the reason we use the ordinary General Public License for many\r
+libraries.  However, the Lesser license provides advantages in certain\r
+special circumstances.\r
+\r
+  For example, on rare occasions, there may be a special need to\r
+encourage the widest possible use of a certain library, so that it becomes\r
+a de-facto standard.  To achieve this, non-free programs must be\r
+allowed to use the library.  A more frequent case is that a free\r
+library does the same job as widely used non-free libraries.  In this\r
+case, there is little to gain by limiting the free library to free\r
+software only, so we use the Lesser General Public License.\r
+\r
+  In other cases, permission to use a particular library in non-free\r
+programs enables a greater number of people to use a large body of\r
+free software.  For example, permission to use the GNU C Library in\r
+non-free programs enables many more people to use the whole GNU\r
+operating system, as well as its variant, the GNU/Linux operating\r
+system.\r
+\r
+  Although the Lesser General Public License is Less protective of the\r
+users' freedom, it does ensure that the user of a program that is\r
+linked with the Library has the freedom and the wherewithal to run\r
+that program using a modified version of the Library.\r
+\r
+  The precise terms and conditions for copying, distribution and\r
+modification follow.  Pay close attention to the difference between a\r
+"work based on the library" and a "work that uses the library".  The\r
+former contains code derived from the library, whereas the latter must\r
+be combined with the library in order to run.\r
+\r
+                 GNU LESSER GENERAL PUBLIC LICENSE\r
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
+\r
+  0. This License Agreement applies to any software library or other\r
+program which contains a notice placed by the copyright holder or\r
+other authorized party saying it may be distributed under the terms of\r
+this Lesser General Public License (also called "this License").\r
+Each licensee is addressed as "you".\r
+\r
+  A "library" means a collection of software functions and/or data\r
+prepared so as to be conveniently linked with application programs\r
+(which use some of those functions and data) to form executables.\r
+\r
+  The "Library", below, refers to any such software library or work\r
+which has been distributed under these terms.  A "work based on the\r
+Library" means either the Library or any derivative work under\r
+copyright law: that is to say, a work containing the Library or a\r
+portion of it, either verbatim or with modifications and/or translated\r
+straightforwardly into another language.  (Hereinafter, translation is\r
+included without limitation in the term "modification".)\r
+\r
+  "Source code" for a work means the preferred form of the work for\r
+making modifications to it.  For a library, complete source code means\r
+all the source code for all modules it contains, plus any associated\r
+interface definition files, plus the scripts used to control compilation\r
+and installation of the library.\r
+\r
+  Activities other than copying, distribution and modification are not\r
+covered by this License; they are outside its scope.  The act of\r
+running a program using the Library is not restricted, and output from\r
+such a program is covered only if its contents constitute a work based\r
+on the Library (independent of the use of the Library in a tool for\r
+writing it).  Whether that is true depends on what the Library does\r
+and what the program that uses the Library does.\r
+  \r
+  1. You may copy and distribute verbatim copies of the Library's\r
+complete source code as you receive it, in any medium, provided that\r
+you conspicuously and appropriately publish on each copy an\r
+appropriate copyright notice and disclaimer of warranty; keep intact\r
+all the notices that refer to this License and to the absence of any\r
+warranty; and distribute a copy of this License along with the\r
+Library.\r
+\r
+  You may charge a fee for the physical act of transferring a copy,\r
+and you may at your option offer warranty protection in exchange for a\r
+fee.\r
+\r
+  2. You may modify your copy or copies of the Library or any portion\r
+of it, thus forming a work based on the Library, and copy and\r
+distribute such modifications or work under the terms of Section 1\r
+above, provided that you also meet all of these conditions:\r
+\r
+    a) The modified work must itself be a software library.\r
+\r
+    b) You must cause the files modified to carry prominent notices\r
+    stating that you changed the files and the date of any change.\r
+\r
+    c) You must cause the whole of the work to be licensed at no\r
+    charge to all third parties under the terms of this License.\r
+\r
+    d) If a facility in the modified Library refers to a function or a\r
+    table of data to be supplied by an application program that uses\r
+    the facility, other than as an argument passed when the facility\r
+    is invoked, then you must make a good faith effort to ensure that,\r
+    in the event an application does not supply such function or\r
+    table, the facility still operates, and performs whatever part of\r
+    its purpose remains meaningful.\r
+\r
+    (For example, a function in a library to compute square roots has\r
+    a purpose that is entirely well-defined independent of the\r
+    application.  Therefore, Subsection 2d requires that any\r
+    application-supplied function or table used by this function must\r
+    be optional: if the application does not supply it, the square\r
+    root function must still compute square roots.)\r
+\r
+These requirements apply to the modified work as a whole.  If\r
+identifiable sections of that work are not derived from the Library,\r
+and can be reasonably considered independent and separate works in\r
+themselves, then this License, and its terms, do not apply to those\r
+sections when you distribute them as separate works.  But when you\r
+distribute the same sections as part of a whole which is a work based\r
+on the Library, the distribution of the whole must be on the terms of\r
+this License, whose permissions for other licensees extend to the\r
+entire whole, and thus to each and every part regardless of who wrote\r
+it.\r
+\r
+Thus, it is not the intent of this section to claim rights or contest\r
+your rights to work written entirely by you; rather, the intent is to\r
+exercise the right to control the distribution of derivative or\r
+collective works based on the Library.\r
+\r
+In addition, mere aggregation of another work not based on the Library\r
+with the Library (or with a work based on the Library) on a volume of\r
+a storage or distribution medium does not bring the other work under\r
+the scope of this License.\r
+\r
+  3. You may opt to apply the terms of the ordinary GNU General Public\r
+License instead of this License to a given copy of the Library.  To do\r
+this, you must alter all the notices that refer to this License, so\r
+that they refer to the ordinary GNU General Public License, version 2,\r
+instead of to this License.  (If a newer version than version 2 of the\r
+ordinary GNU General Public License has appeared, then you can specify\r
+that version instead if you wish.)  Do not make any other change in\r
+these notices.\r
+\r
+  Once this change is made in a given copy, it is irreversible for\r
+that copy, so the ordinary GNU General Public License applies to all\r
+subsequent copies and derivative works made from that copy.\r
+\r
+  This option is useful when you wish to copy part of the code of\r
+the Library into a program that is not a library.\r
+\r
+  4. You may copy and distribute the Library (or a portion or\r
+derivative of it, under Section 2) in object code or executable form\r
+under the terms of Sections 1 and 2 above provided that you accompany\r
+it with the complete corresponding machine-readable source code, which\r
+must be distributed under the terms of Sections 1 and 2 above on a\r
+medium customarily used for software interchange.\r
+\r
+  If distribution of object code is made by offering access to copy\r
+from a designated place, then offering equivalent access to copy the\r
+source code from the same place satisfies the requirement to\r
+distribute the source code, even though third parties are not\r
+compelled to copy the source along with the object code.\r
+\r
+  5. A program that contains no derivative of any portion of the\r
+Library, but is designed to work with the Library by being compiled or\r
+linked with it, is called a "work that uses the Library".  Such a\r
+work, in isolation, is not a derivative work of the Library, and\r
+therefore falls outside the scope of this License.\r
+\r
+  However, linking a "work that uses the Library" with the Library\r
+creates an executable that is a derivative of the Library (because it\r
+contains portions of the Library), rather than a "work that uses the\r
+library".  The executable is therefore covered by this License.\r
+Section 6 states terms for distribution of such executables.\r
+\r
+  When a "work that uses the Library" uses material from a header file\r
+that is part of the Library, the object code for the work may be a\r
+derivative work of the Library even though the source code is not.\r
+Whether this is true is especially significant if the work can be\r
+linked without the Library, or if the work is itself a library.  The\r
+threshold for this to be true is not precisely defined by law.\r
+\r
+  If such an object file uses only numerical parameters, data\r
+structure layouts and accessors, and small macros and small inline\r
+functions (ten lines or less in length), then the use of the object\r
+file is unrestricted, regardless of whether it is legally a derivative\r
+work.  (Executables containing this object code plus portions of the\r
+Library will still fall under Section 6.)\r
+\r
+  Otherwise, if the work is a derivative of the Library, you may\r
+distribute the object code for the work under the terms of Section 6.\r
+Any executables containing that work also fall under Section 6,\r
+whether or not they are linked directly with the Library itself.\r
+\r
+  6. As an exception to the Sections above, you may also combine or\r
+link a "work that uses the Library" with the Library to produce a\r
+work containing portions of the Library, and distribute that work\r
+under terms of your choice, provided that the terms permit\r
+modification of the work for the customer's own use and reverse\r
+engineering for debugging such modifications.\r
+\r
+  You must give prominent notice with each copy of the work that the\r
+Library is used in it and that the Library and its use are covered by\r
+this License.  You must supply a copy of this License.  If the work\r
+during execution displays copyright notices, you must include the\r
+copyright notice for the Library among them, as well as a reference\r
+directing the user to the copy of this License.  Also, you must do one\r
+of these things:\r
+\r
+    a) Accompany the work with the complete corresponding\r
+    machine-readable source code for the Library including whatever\r
+    changes were used in the work (which must be distributed under\r
+    Sections 1 and 2 above); and, if the work is an executable linked\r
+    with the Library, with the complete machine-readable "work that\r
+    uses the Library", as object code and/or source code, so that the\r
+    user can modify the Library and then relink to produce a modified\r
+    executable containing the modified Library.  (It is understood\r
+    that the user who changes the contents of definitions files in the\r
+    Library will not necessarily be able to recompile the application\r
+    to use the modified definitions.)\r
+\r
+    b) Use a suitable shared library mechanism for linking with the\r
+    Library.  A suitable mechanism is one that (1) uses at run time a\r
+    copy of the library already present on the user's computer system,\r
+    rather than copying library functions into the executable, and (2)\r
+    will operate properly with a modified version of the library, if\r
+    the user installs one, as long as the modified version is\r
+    interface-compatible with the version that the work was made with.\r
+\r
+    c) Accompany the work with a written offer, valid for at\r
+    least three years, to give the same user the materials\r
+    specified in Subsection 6a, above, for a charge no more\r
+    than the cost of performing this distribution.\r
+\r
+    d) If distribution of the work is made by offering access to copy\r
+    from a designated place, offer equivalent access to copy the above\r
+    specified materials from the same place.\r
+\r
+    e) Verify that the user has already received a copy of these\r
+    materials or that you have already sent this user a copy.\r
+\r
+  For an executable, the required form of the "work that uses the\r
+Library" must include any data and utility programs needed for\r
+reproducing the executable from it.  However, as a special exception,\r
+the materials to be distributed need not include anything that is\r
+normally distributed (in either source or binary form) with the major\r
+components (compiler, kernel, and so on) of the operating system on\r
+which the executable runs, unless that component itself accompanies\r
+the executable.\r
+\r
+  It may happen that this requirement contradicts the license\r
+restrictions of other proprietary libraries that do not normally\r
+accompany the operating system.  Such a contradiction means you cannot\r
+use both them and the Library together in an executable that you\r
+distribute.\r
+\r
+  7. You may place library facilities that are a work based on the\r
+Library side-by-side in a single library together with other library\r
+facilities not covered by this License, and distribute such a combined\r
+library, provided that the separate distribution of the work based on\r
+the Library and of the other library facilities is otherwise\r
+permitted, and provided that you do these two things:\r
+\r
+    a) Accompany the combined library with a copy of the same work\r
+    based on the Library, uncombined with any other library\r
+    facilities.  This must be distributed under the terms of the\r
+    Sections above.\r
+\r
+    b) Give prominent notice with the combined library of the fact\r
+    that part of it is a work based on the Library, and explaining\r
+    where to find the accompanying uncombined form of the same work.\r
+\r
+  8. You may not copy, modify, sublicense, link with, or distribute\r
+the Library except as expressly provided under this License.  Any\r
+attempt otherwise to copy, modify, sublicense, link with, or\r
+distribute the Library is void, and will automatically terminate your\r
+rights under this License.  However, parties who have received copies,\r
+or rights, from you under this License will not have their licenses\r
+terminated so long as such parties remain in full compliance.\r
+\r
+  9. You are not required to accept this License, since you have not\r
+signed it.  However, nothing else grants you permission to modify or\r
+distribute the Library or its derivative works.  These actions are\r
+prohibited by law if you do not accept this License.  Therefore, by\r
+modifying or distributing the Library (or any work based on the\r
+Library), you indicate your acceptance of this License to do so, and\r
+all its terms and conditions for copying, distributing or modifying\r
+the Library or works based on it.\r
+\r
+  10. Each time you redistribute the Library (or any work based on the\r
+Library), the recipient automatically receives a license from the\r
+original licensor to copy, distribute, link with or modify the Library\r
+subject to these terms and conditions.  You may not impose any further\r
+restrictions on the recipients' exercise of the rights granted herein.\r
+You are not responsible for enforcing compliance by third parties with\r
+this License.\r
+\r
+  11. If, as a consequence of a court judgment or allegation of patent\r
+infringement or for any other reason (not limited to patent issues),\r
+conditions are imposed on you (whether by court order, agreement or\r
+otherwise) that contradict the conditions of this License, they do not\r
+excuse you from the conditions of this License.  If you cannot\r
+distribute so as to satisfy simultaneously your obligations under this\r
+License and any other pertinent obligations, then as a consequence you\r
+may not distribute the Library at all.  For example, if a patent\r
+license would not permit royalty-free redistribution of the Library by\r
+all those who receive copies directly or indirectly through you, then\r
+the only way you could satisfy both it and this License would be to\r
+refrain entirely from distribution of the Library.\r
+\r
+If any portion of this section is held invalid or unenforceable under any\r
+particular circumstance, the balance of the section is intended to apply,\r
+and the section as a whole is intended to apply in other circumstances.\r
+\r
+It is not the purpose of this section to induce you to infringe any\r
+patents or other property right claims or to contest validity of any\r
+such claims; this section has the sole purpose of protecting the\r
+integrity of the free software distribution system which is\r
+implemented by public license practices.  Many people have made\r
+generous contributions to the wide range of software distributed\r
+through that system in reliance on consistent application of that\r
+system; it is up to the author/donor to decide if he or she is willing\r
+to distribute software through any other system and a licensee cannot\r
+impose that choice.\r
+\r
+This section is intended to make thoroughly clear what is believed to\r
+be a consequence of the rest of this License.\r
+\r
+  12. If the distribution and/or use of the Library is restricted in\r
+certain countries either by patents or by copyrighted interfaces, the\r
+original copyright holder who places the Library under this License may add\r
+an explicit geographical distribution limitation excluding those countries,\r
+so that distribution is permitted only in or among countries not thus\r
+excluded.  In such case, this License incorporates the limitation as if\r
+written in the body of this License.\r
+\r
+  13. The Free Software Foundation may publish revised and/or new\r
+versions of the Lesser General Public License from time to time.\r
+Such new versions will be similar in spirit to the present version,\r
+but may differ in detail to address new problems or concerns.\r
+\r
+Each version is given a distinguishing version number.  If the Library\r
+specifies a version number of this License which applies to it and\r
+"any later version", you have the option of following the terms and\r
+conditions either of that version or of any later version published by\r
+the Free Software Foundation.  If the Library does not specify a\r
+license version number, you may choose any version ever published by\r
+the Free Software Foundation.\r
+\r
+  14. If you wish to incorporate parts of the Library into other free\r
+programs whose distribution conditions are incompatible with these,\r
+write to the author to ask for permission.  For software which is\r
+copyrighted by the Free Software Foundation, write to the Free\r
+Software Foundation; we sometimes make exceptions for this.  Our\r
+decision will be guided by the two goals of preserving the free status\r
+of all derivatives of our free software and of promoting the sharing\r
+and reuse of software generally.\r
+\r
+                           NO WARRANTY\r
+\r
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\r
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\r
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\r
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\r
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\r
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\r
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\r
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r
+\r
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\r
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\r
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\r
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\r
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\r
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\r
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\r
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r
+DAMAGES.\r
+\r
+                    END OF TERMS AND CONDITIONS\r
+\r
+           How to Apply These Terms to Your New Libraries\r
+\r
+  If you develop a new library, and you want it to be of the greatest\r
+possible use to the public, we recommend making it free software that\r
+everyone can redistribute and change.  You can do so by permitting\r
+redistribution under these terms (or, alternatively, under the terms of the\r
+ordinary General Public License).\r
+\r
+  To apply these terms, attach the following notices to the library.  It is\r
+safest to attach them to the start of each source file to most effectively\r
+convey the exclusion of warranty; and each file should have at least the\r
+"copyright" line and a pointer to where the full notice is found.\r
+\r
+    <one line to give the library's name and a brief idea of what it does.>\r
+    Copyright (C) <year>  <name of author>\r
+\r
+    This library is free software; you can redistribute it and/or\r
+    modify it under the terms of the GNU Lesser General Public\r
+    License as published by the Free Software Foundation; either\r
+    version 2.1 of the License, or (at your option) any later version.\r
+\r
+    This library is distributed in the hope that it will be useful,\r
+    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+    Lesser General Public License for more details.\r
+\r
+    You should have received a copy of the GNU Lesser General Public\r
+    License along with this library; if not, write to the Free Software\r
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\r
+\r
+Also add information on how to contact you by electronic and paper mail.\r
+\r
+You should also get your employer (if you work as a programmer) or your\r
+school, if any, to sign a "copyright disclaimer" for the library, if\r
+necessary.  Here is a sample; alter the names:\r
+\r
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the\r
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\r
+\r
+  <signature of Ty Coon>, 1 April 1990\r
+  Ty Coon, President of Vice\r
+\r
+That's all there is to it!\r
+\r
+\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/acheck/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/acheck/editor_plugin.js
new file mode 100644 (file)
index 0000000..198712c
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.PluginManager.requireLangPack('acheck');tinymce.create('tinymce.plugins.AcheckPlugin',{init:function(ed,url){ed.addCommand('mceACheck',function(){var theCode='<html><body onLoad="document.accessform.submit();"> \n';theCode+='<h1>Submitting Code for Accessibility Checking.....</h1>\n';theCode+='<form action="http://achecker.ca/checker/index.php" name="accessform" method="post"> \n';theCode+='<input type="hidden" name="gid[]" value="8" /> \n';theCode+='<input type="hidden" name="show_source" value="1" /> \n';theCode+='<textarea name="validate_content">'+tinyMCE.activeEditor.getContent()+'</textarea>\n';theCode+='<input type="submit" /></form> \n';theCode+='</body></html> \n';accessWin=window.open('','accessWin','');accessWin.document.writeln(theCode);accessWin.document.close();});ed.addButton('acheck',{title:'acheck.desc',cmd:'mceACheck',image:url+'/img/acheck.gif'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('acheck',n.nodeName=='acheck');});},createControl:function(n,cm){return null;},getInfo:function(){return{longname:'ACheck Plugin',author:'ATutor',authorurl:'http://www.atutor.ca',infourl:'http://www.atutor.ca',version:"1.0"};}});tinymce.PluginManager.add('acheck',tinymce.plugins.AcheckPlugin);})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/acheck/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/acheck/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..d950113
--- /dev/null
@@ -0,0 +1,83 @@
+/**\r
+ * $Id: editor_plugin_src.js 201 2008-04-17 15:56:56Z cindy $\r
+ *\r
+ * @author Cindy Li\r
+ * @copyright Copyright Â© 2008, ATutor, All rights reserved.\r
+ */\r
+\r
+(function() {\r
+       // Load plugin specific language pack\r
+       tinymce.PluginManager.requireLangPack('acheck');\r
+\r
+       tinymce.create('tinymce.plugins.AcheckPlugin', {\r
+               /**\r
+                * Initializes the plugin, this will be executed after the plugin has been created.\r
+                * This call is done before the editor instance has finished it's initialization so use the onInit event\r
+                * of the editor instance to intercept that event.\r
+                *\r
+                * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.\r
+                * @param {string} url Absolute URL to where the plugin is located.\r
+                */\r
+               init : function(ed, url) {\r
+                       // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceACheck');\r
+                       ed.addCommand('mceACheck', function() {\r
+\r
+                                       var theCode = '<html><body onLoad="document.accessform.submit();"> \n';\r
+                                       theCode += '<h1>Submitting Code for Accessibility Checking.....</h1>\n';\r
+                                       theCode += '<form action="http://achecker.ca/checker/index.php" name="accessform" method="post"> \n';\r
+                                       theCode += '<input type="hidden" name="gid[]" value="8" /> \n';\r
+                                       theCode += '<textarea name="validate_content">' + tinyMCE.activeEditor.getContent() + '</textarea>\n';\r
+                                       theCode += '<input type="submit" /></form> \n';  \r
+                                       theCode += '</body></html> \n';\r
+                                       accessWin = window.open('', 'accessWin',  '');\r
+                                       accessWin.document.writeln(theCode);\r
+                                       accessWin.document.close();\r
+                       });\r
+\r
+                       // Register ACheck button\r
+                       ed.addButton('acheck', {\r
+                               title : 'acheck.desc',\r
+                               cmd : 'mceACheck',\r
+                               image : url + '/img/acheck.gif'\r
+                       });\r
+\r
+                       // Add a node change handler, selects the button in the UI when a image is selected\r
+                       ed.onNodeChange.add(function(ed, cm, n) {\r
+                               cm.setActive('acheck', n.nodeName == 'acheck');\r
+                       });\r
+               },\r
+\r
+               /**\r
+                * Creates control instances based in the incomming name. This method is normally not\r
+                * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons\r
+                * but you sometimes need to create more complex controls like listboxes, split buttons etc then this\r
+                * method can be used to create those.\r
+                *\r
+                * @param {String} n Name of the control to create.\r
+                * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.\r
+                * @return {tinymce.ui.Control} New control instance or null if no control was created.\r
+                */\r
+               createControl : function(n, cm) {\r
+                       return null;\r
+               },\r
+\r
+               /**\r
+                * Returns information about the plugin as a name/value array.\r
+                * The current keys are longname, author, authorurl, infourl and version.\r
+                *\r
+                * @return {Object} Name/value array containing information about the plugin.\r
+                */\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'ACheck Plugin',\r
+                               author   : 'ATutor',\r
+                               authorurl : 'http://www.atutor.ca',\r
+                               infourl : 'http://www.atutor.ca',\r
+                               version : "1.0"\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('acheck', tinymce.plugins.AcheckPlugin);\r
+})();\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/acheck/img/acheck.gif b/docs/include/jscripts/tiny_mce/plugins/acheck/img/acheck.gif
new file mode 100644 (file)
index 0000000..76f3a7d
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/acheck/img/acheck.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/acheck/js/dialog.js b/docs/include/jscripts/tiny_mce/plugins/acheck/js/dialog.js
new file mode 100644 (file)
index 0000000..fa83411
--- /dev/null
@@ -0,0 +1,19 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+var ExampleDialog = {\r
+       init : function() {\r
+               var f = document.forms[0];\r
+\r
+               // Get the selected contents as text and place it in the input\r
+               f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'});\r
+               f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg');\r
+       },\r
+\r
+       insert : function() {\r
+               // Insert the contents from the input into the document\r
+               tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value);\r
+               tinyMCEPopup.close();\r
+       }\r
+};\r
+\r
+tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/acheck/langs/en.js b/docs/include/jscripts/tiny_mce/plugins/acheck/langs/en.js
new file mode 100644 (file)
index 0000000..7bce9e9
--- /dev/null
@@ -0,0 +1,3 @@
+tinyMCE.addI18n('en.acheck',{\r
+       desc : 'Check Accessibility'\r
+});\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/acheck/langs/en_dlg.js b/docs/include/jscripts/tiny_mce/plugins/acheck/langs/en_dlg.js
new file mode 100644 (file)
index 0000000..54826f8
--- /dev/null
@@ -0,0 +1,3 @@
+tinyMCE.addI18n('en.acheck_dlg',{\r
+       title : 'ATRC Accessibility Checker'\r
+});\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/advhr/css/advhr.css b/docs/include/jscripts/tiny_mce/plugins/advhr/css/advhr.css
new file mode 100644 (file)
index 0000000..0e22834
--- /dev/null
@@ -0,0 +1,5 @@
+input.radio {border:1px none #000; background:transparent; vertical-align:middle;}\r
+.panel_wrapper div.current {height:80px;}\r
+#width {width:50px; vertical-align:middle;}\r
+#width2 {width:50px; vertical-align:middle;}\r
+#size {width:100px;}\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/advhr/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/advhr/editor_plugin.js
new file mode 100644 (file)
index 0000000..4d3b062
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..0c652d3
--- /dev/null
@@ -0,0 +1,57 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.AdvancedHRPlugin', {\r
+               init : function(ed, url) {\r
+                       // Register commands\r
+                       ed.addCommand('mceAdvancedHr', function() {\r
+                               ed.windowManager.open({\r
+                                       file : url + '/rule.htm',\r
+                                       width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),\r
+                                       height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),\r
+                                       inline : 1\r
+                               }, {\r
+                                       plugin_url : url\r
+                               });\r
+                       });\r
+\r
+                       // Register buttons\r
+                       ed.addButton('advhr', {\r
+                               title : 'advhr.advhr_desc',\r
+                               cmd : 'mceAdvancedHr'\r
+                       });\r
+\r
+                       ed.onNodeChange.add(function(ed, cm, n) {\r
+                               cm.setActive('advhr', n.nodeName == 'HR');\r
+                       });\r
+\r
+                       ed.onClick.add(function(ed, e) {\r
+                               e = e.target;\r
+\r
+                               if (e.nodeName === 'HR')\r
+                                       ed.selection.select(e);\r
+                       });\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Advanced HR',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/advhr/js/rule.js b/docs/include/jscripts/tiny_mce/plugins/advhr/js/rule.js
new file mode 100644 (file)
index 0000000..b6cbd66
--- /dev/null
@@ -0,0 +1,43 @@
+var AdvHRDialog = {\r
+       init : function(ed) {\r
+               var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;\r
+\r
+               w = dom.getAttrib(n, 'width');\r
+               f.width.value = w ? parseInt(w) : (dom.getStyle('width') || '');\r
+               f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || '';\r
+               f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width');\r
+               selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');\r
+       },\r
+\r
+       update : function() {\r
+               var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = '';\r
+\r
+               h = '<hr';\r
+\r
+               if (f.size.value) {\r
+                       h += ' size="' + f.size.value + '"';\r
+                       st += ' height:' + f.size.value + 'px;';\r
+               }\r
+\r
+               if (f.width.value) {\r
+                       h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';\r
+                       st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';';\r
+               }\r
+\r
+               if (f.noshade.checked) {\r
+                       h += ' noshade="noshade"';\r
+                       st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;';\r
+               }\r
+\r
+               if (ed.settings.inline_styles)\r
+                       h += ' style="' + tinymce.trim(st) + '"';\r
+\r
+               h += ' />';\r
+\r
+               ed.execCommand("mceInsertContent", false, h);\r
+               tinyMCEPopup.close();\r
+       }\r
+};\r
+\r
+tinyMCEPopup.requireLangPack();\r
+tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/advhr/langs/en_dlg.js b/docs/include/jscripts/tiny_mce/plugins/advhr/langs/en_dlg.js
new file mode 100644 (file)
index 0000000..873bfd8
--- /dev/null
@@ -0,0 +1,5 @@
+tinyMCE.addI18n('en.advhr_dlg',{\r
+width:"Width",\r
+size:"Height",\r
+noshade:"No shadow"\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/advhr/rule.htm b/docs/include/jscripts/tiny_mce/plugins/advhr/rule.htm
new file mode 100644 (file)
index 0000000..fc37b2a
--- /dev/null
@@ -0,0 +1,57 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#advhr.advhr_desc}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="js/rule.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <link href="css/advhr.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body>\r
+<form onsubmit="AdvHRDialog.update();return false;" action="#">\r
+       <div class="tabs">\r
+               <ul>\r
+                       <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li>\r
+               </ul>\r
+       </div>\r
+\r
+       <div class="panel_wrapper">\r
+               <div id="general_panel" class="panel current">\r
+                       <table border="0" cellpadding="4" cellspacing="0">\r
+                    <tr>\r
+                        <td><label for="width">{#advhr_dlg.width}</label></td>\r
+                        <td class="nowrap">\r
+                            <input id="width" name="width" type="text" value="" class="mceFocus" />\r
+                            <select name="width2" id="width2">\r
+                                <option value="">px</option>\r
+                                <option value="%">%</option>\r
+                            </select>\r
+                        </td>\r
+                    </tr>\r
+                    <tr>\r
+                        <td><label for="size">{#advhr_dlg.size}</label></td>\r
+                        <td><select id="size" name="size">\r
+                            <option value="">Normal</option>\r
+                            <option value="1">1</option>\r
+                            <option value="2">2</option>\r
+                            <option value="3">3</option>\r
+                            <option value="4">4</option>\r
+                            <option value="5">5</option>\r
+                        </select></td>\r
+                    </tr>\r
+                    <tr>\r
+                        <td><label for="noshade">{#advhr_dlg.noshade}</label></td>\r
+                        <td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>\r
+                    </tr>\r
+            </table>\r
+               </div>\r
+       </div>\r
+\r
+       <div class="mceActionPanel">\r
+               <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+               <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+       </div>\r
+</form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/advimage/css/advimage.css b/docs/include/jscripts/tiny_mce/plugins/advimage/css/advimage.css
new file mode 100644 (file)
index 0000000..0a6251a
--- /dev/null
@@ -0,0 +1,13 @@
+#src_list, #over_list, #out_list {width:280px;}\r
+.mceActionPanel {margin-top:7px;}\r
+.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}\r
+.checkbox {border:0;}\r
+.panel_wrapper div.current {height:305px;}\r
+#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}\r
+#align, #classlist {width:150px;}\r
+#width, #height {vertical-align:middle; width:50px; text-align:center;}\r
+#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}\r
+#class_list {width:180px;}\r
+input {width: 280px;}\r
+#constrain, #onmousemovecheck {width:auto;}\r
+#id, #dir, #lang, #usemap, #longdesc {width:200px;}\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/advimage/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/advimage/editor_plugin.js
new file mode 100644 (file)
index 0000000..4c7a9c3
--- /dev/null
@@ -0,0 +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
diff --git a/docs/include/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..2625dd2
--- /dev/null
@@ -0,0 +1,50 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.AdvancedImagePlugin', {\r
+               init : function(ed, url) {\r
+                       // Register commands\r
+                       ed.addCommand('mceAdvImage', function() {\r
+                               // Internal image object like a flash placeholder\r
+                               if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)\r
+                                       return;\r
+\r
+                               ed.windowManager.open({\r
+                                       file : url + '/image.htm',\r
+                                       width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),\r
+                                       height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),\r
+                                       inline : 1\r
+                               }, {\r
+                                       plugin_url : url\r
+                               });\r
+                       });\r
+\r
+                       // Register buttons\r
+                       ed.addButton('image', {\r
+                               title : 'advimage.image_desc',\r
+                               cmd : 'mceAdvImage'\r
+                       });\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Advanced image',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/advimage/image.htm b/docs/include/jscripts/tiny_mce/plugins/advimage/image.htm
new file mode 100644 (file)
index 0000000..79cff3f
--- /dev/null
@@ -0,0 +1,232 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#advimage_dlg.dialog_title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <script type="text/javascript" src="../../utils/validate.js"></script>\r
+       <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+       <script type="text/javascript" src="js/image.js"></script>\r
+       <link href="css/advimage.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body id="advimage" style="display: none">\r
+    <form onsubmit="ImageDialog.insert();return false;" action="#"> \r
+               <div class="tabs">\r
+                       <ul>\r
+                               <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advimage_dlg.tab_general}</a></span></li>\r
+                               <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#advimage_dlg.tab_appearance}</a></span></li>\r
+                               <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advimage_dlg.tab_advanced}</a></span></li>\r
+                       </ul>\r
+               </div>\r
+\r
+               <div class="panel_wrapper">\r
+                       <div id="general_panel" class="panel current">\r
+                               <fieldset>\r
+                                               <legend>{#advimage_dlg.general}</legend>\r
+\r
+                                               <table class="properties">\r
+                                                       <tr>\r
+                                                               <td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td>\r
+                                                               <td colspan="2"><table border="0" cellspacing="0" cellpadding="0">\r
+                                                                       <tr> \r
+                                                                         <td><input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" /></td> \r
+                                                                         <td id="srcbrowsercontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                                 </table></td>\r
+                                                       </tr>\r
+                                                       <tr>\r
+                                                               <td><label for="src_list">{#advimage_dlg.image_list}</label></td>\r
+                                                               <td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"><option value=""></option></select></td>\r
+                                                       </tr>\r
+                                                       <tr> \r
+                                                               <td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td> \r
+                                                               <td colspan="2"><input id="alt" name="alt" type="text" value="" /></td> \r
+                                                       </tr> \r
+                                                       <tr> \r
+                                                               <td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td> \r
+                                                               <td colspan="2"><input id="title" name="title" type="text" value="" /></td> \r
+                                                       </tr>\r
+                                               </table>\r
+                               </fieldset>\r
+\r
+                               <fieldset>\r
+                                       <legend>{#advimage_dlg.preview}</legend>\r
+                                       <div id="prev"></div>\r
+                               </fieldset>\r
+                       </div>\r
+\r
+                       <div id="appearance_panel" class="panel">\r
+                               <fieldset>\r
+                                       <legend>{#advimage_dlg.tab_appearance}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr> \r
+                                                       <td class="column1"><label id="alignlabel" for="align">{#advimage_dlg.align}</label></td> \r
+                                                       <td><select id="align" name="align" onchange="ImageDialog.updateStyle('align');ImageDialog.changeAppearance();"> \r
+                                                                       <option value="">{#not_set}</option> \r
+                                                                       <option value="baseline">{#advimage_dlg.align_baseline}</option>\r
+                                                                       <option value="top">{#advimage_dlg.align_top}</option>\r
+                                                                       <option value="middle">{#advimage_dlg.align_middle}</option>\r
+                                                                       <option value="bottom">{#advimage_dlg.align_bottom}</option>\r
+                                                                       <option value="text-top">{#advimage_dlg.align_texttop}</option>\r
+                                                                       <option value="text-bottom">{#advimage_dlg.align_textbottom}</option>\r
+                                                                       <option value="left">{#advimage_dlg.align_left}</option>\r
+                                                                       <option value="right">{#advimage_dlg.align_right}</option>\r
+                                                               </select> \r
+                                                       </td>\r
+                                                       <td rowspan="6" valign="top">\r
+                                                               <div class="alignPreview">\r
+                                                                       <img id="alignSampleImg" src="img/sample.gif" alt="{#advimage_dlg.example_img}" />\r
+                                                                       Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam\r
+                                                                       nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum\r
+                                                                       edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam\r
+                                                                       erat volutpat.\r
+                                                               </div>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td>\r
+                                                       <td class="nowrap">\r
+                                                               <input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" /> x \r
+                                                               <input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" /> px\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td>&nbsp;</td>\r
+                                                       <td><table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>\r
+                                                                               <td><label id="constrainlabel" for="constrain">{#advimage_dlg.constrain_proportions}</label></td>\r
+                                                                       </tr>\r
+                                                               </table></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label id="vspacelabel" for="vspace">{#advimage_dlg.vspace}</label></td> \r
+                                                       <td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" />\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr> \r
+                                                       <td class="column1"><label id="hspacelabel" for="hspace">{#advimage_dlg.hspace}</label></td> \r
+                                                       <td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label id="borderlabel" for="border">{#advimage_dlg.border}</label></td> \r
+                                                       <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="class_list">{#class_name}</label></td>\r
+                                                       <td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"><option value=""></option></select></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label id="stylelabel" for="style">{#advimage_dlg.style}</label></td> \r
+                                                       <td colspan="2"><input id="style" name="style" type="text" value="" onchange="ImageDialog.changeAppearance();" /></td> \r
+                                               </tr>\r
+\r
+                                               <!-- <tr>\r
+                                                       <td class="column1"><label id="classeslabel" for="classes">{#advimage_dlg.classes}</label></td> \r
+                                                       <td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td> \r
+                                               </tr> -->\r
+                                       </table>\r
+                               </fieldset>\r
+                       </div>\r
+\r
+                       <div id="advanced_panel" class="panel">\r
+                               <fieldset>\r
+                                       <legend>{#advimage_dlg.swap_image}</legend>\r
+\r
+                                       <input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="ImageDialog.setSwapImage(this.checked);" />\r
+                                       <label id="onmousemovechecklabel" for="onmousemovecheck">{#advimage_dlg.alt_image}</label>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0" width="100%">\r
+                                                       <tr>\r
+                                                               <td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{#advimage_dlg.mouseover}</label></td> \r
+                                                               <td><table border="0" cellspacing="0" cellpadding="0"> \r
+                                                                       <tr> \r
+                                                                         <td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td> \r
+                                                                         <td id="onmouseoversrccontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                                 </table></td>\r
+                                                       </tr>\r
+                                                       <tr>\r
+                                                               <td><label for="over_list">{#advimage_dlg.image_list}</label></td>\r
+                                                               <td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>\r
+                                                       </tr>\r
+                                                       <tr> \r
+                                                               <td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td> \r
+                                                               <td class="column2"><table border="0" cellspacing="0" cellpadding="0"> \r
+                                                                       <tr> \r
+                                                                         <td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td> \r
+                                                                         <td id="onmouseoutsrccontainer">&nbsp;</td>\r
+                                                                       </tr> \r
+                                                                 </table></td> \r
+                                                       </tr>\r
+                                                       <tr>\r
+                                                               <td><label for="out_list">{#advimage_dlg.image_list}</label></td>\r
+                                                               <td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>\r
+                                                       </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+\r
+                               <fieldset>\r
+                                       <legend>{#advimage_dlg.misc}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td> \r
+                                                       <td><input id="id" name="id" type="text" value="" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td> \r
+                                                       <td>\r
+                                                               <select id="dir" name="dir" onchange="ImageDialog.changeAppearance();"> \r
+                                                                               <option value="">{#not_set}</option> \r
+                                                                               <option value="ltr">{#advimage_dlg.ltr}</option> \r
+                                                                               <option value="rtl">{#advimage_dlg.rtl}</option> \r
+                                                               </select>\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label id="langlabel" for="lang">{#advimage_dlg.langcode}</label></td> \r
+                                                       <td>\r
+                                                               <input id="lang" name="lang" type="text" value="" />\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label id="usemaplabel" for="usemap">{#advimage_dlg.map}</label></td> \r
+                                                       <td>\r
+                                                               <input id="usemap" name="usemap" type="text" value="" />\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label id="longdesclabel" for="longdesc">{#advimage_dlg.long_desc}</label></td>\r
+                                                       <td><table border="0" cellspacing="0" cellpadding="0">\r
+                                                                       <tr>\r
+                                                                         <td><input id="longdesc" name="longdesc" type="text" value="" /></td>\r
+                                                                         <td id="longdesccontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table></td> \r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+                       </div>\r
+               </div>\r
+\r
+               <div class="mceActionPanel">\r
+                       <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+                       <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+               </div>\r
+    </form>\r
+</body> \r
+</html> \r
diff --git a/docs/include/jscripts/tiny_mce/plugins/advimage/img/sample.gif b/docs/include/jscripts/tiny_mce/plugins/advimage/img/sample.gif
new file mode 100644 (file)
index 0000000..53bf689
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/advimage/img/sample.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/advimage/js/image.js b/docs/include/jscripts/tiny_mce/plugins/advimage/js/image.js
new file mode 100644 (file)
index 0000000..3bda86a
--- /dev/null
@@ -0,0 +1,443 @@
+var ImageDialog = {\r
+       preInit : function() {\r
+               var url;\r
+\r
+               tinyMCEPopup.requireLangPack();\r
+\r
+               if (url = tinyMCEPopup.getParam("external_image_list_url"))\r
+                       document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
+       },\r
+\r
+       init : function(ed) {\r
+               var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode();\r
+\r
+               tinyMCEPopup.resizeToInnerSize();\r
+               this.fillClassList('class_list');\r
+               this.fillFileList('src_list', 'tinyMCEImageList');\r
+               this.fillFileList('over_list', 'tinyMCEImageList');\r
+               this.fillFileList('out_list', 'tinyMCEImageList');\r
+               TinyMCE_EditableSelects.init();\r
+\r
+               if (n.nodeName == 'IMG') {\r
+                       nl.src.value = dom.getAttrib(n, 'src');\r
+                       nl.width.value = dom.getAttrib(n, 'width');\r
+                       nl.height.value = dom.getAttrib(n, 'height');\r
+                       nl.alt.value = dom.getAttrib(n, 'alt');\r
+                       nl.title.value = dom.getAttrib(n, 'title');\r
+                       nl.vspace.value = this.getAttrib(n, 'vspace');\r
+                       nl.hspace.value = this.getAttrib(n, 'hspace');\r
+                       nl.border.value = this.getAttrib(n, 'border');\r
+                       selectByValue(f, 'align', this.getAttrib(n, 'align'));\r
+                       selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true);\r
+                       nl.style.value = dom.getAttrib(n, 'style');\r
+                       nl.id.value = dom.getAttrib(n, 'id');\r
+                       nl.dir.value = dom.getAttrib(n, 'dir');\r
+                       nl.lang.value = dom.getAttrib(n, 'lang');\r
+                       nl.usemap.value = dom.getAttrib(n, 'usemap');\r
+                       nl.longdesc.value = dom.getAttrib(n, 'longdesc');\r
+                       nl.insert.value = ed.getLang('update');\r
+\r
+                       if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover')))\r
+                               nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');\r
+\r
+                       if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout')))\r
+                               nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');\r
+\r
+                       if (ed.settings.inline_styles) {\r
+                               // Move attribs to styles\r
+                               if (dom.getAttrib(n, 'align'))\r
+                                       this.updateStyle('align');\r
+\r
+                               if (dom.getAttrib(n, 'hspace'))\r
+                                       this.updateStyle('hspace');\r
+\r
+                               if (dom.getAttrib(n, 'border'))\r
+                                       this.updateStyle('border');\r
+\r
+                               if (dom.getAttrib(n, 'vspace'))\r
+                                       this.updateStyle('vspace');\r
+                       }\r
+               }\r
+\r
+               // Setup browse button\r
+               document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');\r
+               if (isVisible('srcbrowser'))\r
+                       document.getElementById('src').style.width = '260px';\r
+\r
+               // Setup browse button\r
+               document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image');\r
+               if (isVisible('overbrowser'))\r
+                       document.getElementById('onmouseoversrc').style.width = '260px';\r
+\r
+               // Setup browse button\r
+               document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image');\r
+               if (isVisible('outbrowser'))\r
+                       document.getElementById('onmouseoutsrc').style.width = '260px';\r
+\r
+               // If option enabled default contrain proportions to checked\r
+               if (ed.getParam("advimage_constrain_proportions", true))\r
+                       f.constrain.checked = true;\r
+\r
+               // Check swap image if valid data\r
+               if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value)\r
+                       this.setSwapImage(true);\r
+               else\r
+                       this.setSwapImage(false);\r
+\r
+               this.changeAppearance();\r
+               this.showPreviewImage(nl.src.value, 1);\r
+       },\r
+\r
+       insert : function(file, title) {\r
+               var ed = tinyMCEPopup.editor, t = this, f = document.forms[0];\r
+\r
+               if (f.src.value === '') {\r
+                       if (ed.selection.getNode().nodeName == 'IMG') {\r
+                               ed.dom.remove(ed.selection.getNode());\r
+                               ed.execCommand('mceRepaint');\r
+                       }\r
+\r
+                       tinyMCEPopup.close();\r
+                       return;\r
+               }\r
+\r
+               if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {\r
+                       if (!f.alt.value) {\r
+                               tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {\r
+                                       if (s)\r
+                                               t.insertAndClose();\r
+                               });\r
+\r
+                               return;\r
+                       }\r
+               }\r
+\r
+               t.insertAndClose();\r
+       },\r
+\r
+       insertAndClose : function() {\r
+               var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el;\r
+\r
+               tinyMCEPopup.restoreSelection();\r
+\r
+               // Fixes crash in Safari\r
+               if (tinymce.isWebKit)\r
+                       ed.getWin().focus();\r
+\r
+               if (!ed.settings.inline_styles) {\r
+                       args = {\r
+                               vspace : nl.vspace.value,\r
+                               hspace : nl.hspace.value,\r
+                               border : nl.border.value,\r
+                               align : getSelectValue(f, 'align')\r
+                       };\r
+               } else {\r
+                       // Remove deprecated values\r
+                       args = {\r
+                               vspace : '',\r
+                               hspace : '',\r
+                               border : '',\r
+                               align : ''\r
+                       };\r
+               }\r
+\r
+               tinymce.extend(args, {\r
+                       src : nl.src.value,\r
+                       width : nl.width.value,\r
+                       height : nl.height.value,\r
+                       alt : nl.alt.value,\r
+                       title : nl.title.value,\r
+                       'class' : getSelectValue(f, 'class_list'),\r
+                       style : nl.style.value,\r
+                       id : nl.id.value,\r
+                       dir : nl.dir.value,\r
+                       lang : nl.lang.value,\r
+                       usemap : nl.usemap.value,\r
+                       longdesc : nl.longdesc.value\r
+               });\r
+\r
+               args.onmouseover = args.onmouseout = '';\r
+\r
+               if (f.onmousemovecheck.checked) {\r
+                       if (nl.onmouseoversrc.value)\r
+                               args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';";\r
+\r
+                       if (nl.onmouseoutsrc.value)\r
+                               args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';";\r
+               }\r
+\r
+               el = ed.selection.getNode();\r
+\r
+               if (el && el.nodeName == 'IMG') {\r
+                       ed.dom.setAttribs(el, args);\r
+               } else {\r
+                       ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});\r
+                       ed.dom.setAttribs('__mce_tmp', args);\r
+                       ed.dom.setAttrib('__mce_tmp', 'id', '');\r
+                       ed.undoManager.add();\r
+               }\r
+\r
+               tinyMCEPopup.close();\r
+       },\r
+\r
+       getAttrib : function(e, at) {\r
+               var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;\r
+\r
+               if (ed.settings.inline_styles) {\r
+                       switch (at) {\r
+                               case 'align':\r
+                                       if (v = dom.getStyle(e, 'float'))\r
+                                               return v;\r
+\r
+                                       if (v = dom.getStyle(e, 'vertical-align'))\r
+                                               return v;\r
+\r
+                                       break;\r
+\r
+                               case 'hspace':\r
+                                       v = dom.getStyle(e, 'margin-left')\r
+                                       v2 = dom.getStyle(e, 'margin-right');\r
+\r
+                                       if (v && v == v2)\r
+                                               return parseInt(v.replace(/[^0-9]/g, ''));\r
+\r
+                                       break;\r
+\r
+                               case 'vspace':\r
+                                       v = dom.getStyle(e, 'margin-top')\r
+                                       v2 = dom.getStyle(e, 'margin-bottom');\r
+                                       if (v && v == v2)\r
+                                               return parseInt(v.replace(/[^0-9]/g, ''));\r
+\r
+                                       break;\r
+\r
+                               case 'border':\r
+                                       v = 0;\r
+\r
+                                       tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {\r
+                                               sv = dom.getStyle(e, 'border-' + sv + '-width');\r
+\r
+                                               // False or not the same as prev\r
+                                               if (!sv || (sv != v && v !== 0)) {\r
+                                                       v = 0;\r
+                                                       return false;\r
+                                               }\r
+\r
+                                               if (sv)\r
+                                                       v = sv;\r
+                                       });\r
+\r
+                                       if (v)\r
+                                               return parseInt(v.replace(/[^0-9]/g, ''));\r
+\r
+                                       break;\r
+                       }\r
+               }\r
+\r
+               if (v = dom.getAttrib(e, at))\r
+                       return v;\r
+\r
+               return '';\r
+       },\r
+\r
+       setSwapImage : function(st) {\r
+               var f = document.forms[0];\r
+\r
+               f.onmousemovecheck.checked = st;\r
+               setBrowserDisabled('overbrowser', !st);\r
+               setBrowserDisabled('outbrowser', !st);\r
+\r
+               if (f.over_list)\r
+                       f.over_list.disabled = !st;\r
+\r
+               if (f.out_list)\r
+                       f.out_list.disabled = !st;\r
+\r
+               f.onmouseoversrc.disabled = !st;\r
+               f.onmouseoutsrc.disabled  = !st;\r
+       },\r
+\r
+       fillClassList : function(id) {\r
+               var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
+\r
+               if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {\r
+                       cl = [];\r
+\r
+                       tinymce.each(v.split(';'), function(v) {\r
+                               var p = v.split('=');\r
+\r
+                               cl.push({'title' : p[0], 'class' : p[1]});\r
+                       });\r
+               } else\r
+                       cl = tinyMCEPopup.editor.dom.getClasses();\r
+\r
+               if (cl.length > 0) {\r
+                       lst.options.length = 0;\r
+                       lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');\r
+\r
+                       tinymce.each(cl, function(o) {\r
+                               lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);\r
+                       });\r
+               } else\r
+                       dom.remove(dom.getParent(id, 'tr'));\r
+       },\r
+\r
+       fillFileList : function(id, l) {\r
+               var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
+\r
+               l = window[l];\r
+               lst.options.length = 0;\r
+\r
+               if (l && l.length > 0) {\r
+                       lst.options[lst.options.length] = new Option('', '');\r
+\r
+                       tinymce.each(l, function(o) {\r
+                               lst.options[lst.options.length] = new Option(o[0], o[1]);\r
+                       });\r
+               } else\r
+                       dom.remove(dom.getParent(id, 'tr'));\r
+       },\r
+\r
+       resetImageData : function() {\r
+               var f = document.forms[0];\r
+\r
+               f.elements.width.value = f.elements.height.value = '';\r
+       },\r
+\r
+       updateImageData : function(img, st) {\r
+               var f = document.forms[0];\r
+\r
+               if (!st) {\r
+                       f.elements.width.value = img.width;\r
+                       f.elements.height.value = img.height;\r
+               }\r
+\r
+               this.preloadImg = img;\r
+       },\r
+\r
+       changeAppearance : function() {\r
+               var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg');\r
+\r
+               if (img) {\r
+                       if (ed.getParam('inline_styles')) {\r
+                               ed.dom.setAttrib(img, 'style', f.style.value);\r
+                       } else {\r
+                               img.align = f.align.value;\r
+                               img.border = f.border.value;\r
+                               img.hspace = f.hspace.value;\r
+                               img.vspace = f.vspace.value;\r
+                       }\r
+               }\r
+       },\r
+\r
+       changeHeight : function() {\r
+               var f = document.forms[0], tp, t = this;\r
+\r
+               if (!f.constrain.checked || !t.preloadImg) {\r
+                       return;\r
+               }\r
+\r
+               if (f.width.value == "" || f.height.value == "")\r
+                       return;\r
+\r
+               tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height;\r
+               f.height.value = tp.toFixed(0);\r
+       },\r
+\r
+       changeWidth : function() {\r
+               var f = document.forms[0], tp, t = this;\r
+\r
+               if (!f.constrain.checked || !t.preloadImg) {\r
+                       return;\r
+               }\r
+\r
+               if (f.width.value == "" || f.height.value == "")\r
+                       return;\r
+\r
+               tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width;\r
+               f.width.value = tp.toFixed(0);\r
+       },\r
+\r
+       updateStyle : function(ty) {\r
+               var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});\r
+\r
+               if (tinyMCEPopup.editor.settings.inline_styles) {\r
+                       // Handle align\r
+                       if (ty == 'align') {\r
+                               dom.setStyle(img, 'float', '');\r
+                               dom.setStyle(img, 'vertical-align', '');\r
+\r
+                               v = getSelectValue(f, 'align');\r
+                               if (v) {\r
+                                       if (v == 'left' || v == 'right')\r
+                                               dom.setStyle(img, 'float', v);\r
+                                       else\r
+                                               img.style.verticalAlign = v;\r
+                               }\r
+                       }\r
+\r
+                       // Handle border\r
+                       if (ty == 'border') {\r
+                               dom.setStyle(img, 'border', '');\r
+\r
+                               v = f.border.value;\r
+                               if (v || v == '0') {\r
+                                       if (v == '0')\r
+                                               img.style.border = '0';\r
+                                       else\r
+                                               img.style.border = v + 'px solid black';\r
+                               }\r
+                       }\r
+\r
+                       // Handle hspace\r
+                       if (ty == 'hspace') {\r
+                               dom.setStyle(img, 'marginLeft', '');\r
+                               dom.setStyle(img, 'marginRight', '');\r
+\r
+                               v = f.hspace.value;\r
+                               if (v) {\r
+                                       img.style.marginLeft = v + 'px';\r
+                                       img.style.marginRight = v + 'px';\r
+                               }\r
+                       }\r
+\r
+                       // Handle vspace\r
+                       if (ty == 'vspace') {\r
+                               dom.setStyle(img, 'marginTop', '');\r
+                               dom.setStyle(img, 'marginBottom', '');\r
+\r
+                               v = f.vspace.value;\r
+                               if (v) {\r
+                                       img.style.marginTop = v + 'px';\r
+                                       img.style.marginBottom = v + 'px';\r
+                               }\r
+                       }\r
+\r
+                       // Merge\r
+                       dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img');\r
+               }\r
+       },\r
+\r
+       changeMouseMove : function() {\r
+       },\r
+\r
+       showPreviewImage : function(u, st) {\r
+               if (!u) {\r
+                       tinyMCEPopup.dom.setHTML('prev', '');\r
+                       return;\r
+               }\r
+\r
+               if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true))\r
+                       this.resetImageData();\r
+\r
+               u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u);\r
+\r
+               if (!st)\r
+                       tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />');\r
+               else\r
+                       tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />');\r
+       }\r
+};\r
+\r
+ImageDialog.preInit();\r
+tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js b/docs/include/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js
new file mode 100644 (file)
index 0000000..f493d19
--- /dev/null
@@ -0,0 +1,43 @@
+tinyMCE.addI18n('en.advimage_dlg',{\r
+tab_general:"General",\r
+tab_appearance:"Appearance",\r
+tab_advanced:"Advanced",\r
+general:"General",\r
+title:"Title",\r
+preview:"Preview",\r
+constrain_proportions:"Constrain proportions",\r
+langdir:"Language direction",\r
+langcode:"Language code",\r
+long_desc:"Long description link",\r
+style:"Style",\r
+classes:"Classes",\r
+ltr:"Left to right",\r
+rtl:"Right to left",\r
+id:"Id",\r
+map:"Image map",\r
+swap_image:"Swap image",\r
+alt_image:"Alternative image",\r
+mouseover:"for mouse over",\r
+mouseout:"for mouse out",\r
+misc:"Miscellaneous",\r
+example_img:"Appearance preview image",\r
+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.",\r
+dialog_title:"Insert/edit image",\r
+src:"Image URL",\r
+alt:"Image description",\r
+list:"Image list",\r
+border:"Border",\r
+dimensions:"Dimensions",\r
+vspace:"Vertical space",\r
+hspace:"Horizontal space",\r
+align:"Alignment",\r
+align_baseline:"Baseline",\r
+align_top:"Top",\r
+align_middle:"Middle",\r
+align_bottom:"Bottom",\r
+align_texttop:"Text top",\r
+align_textbottom:"Text bottom",\r
+align_left:"Left",\r
+align_right:"Right",\r
+image_list:"Image list"\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/advlink/css/advlink.css b/docs/include/jscripts/tiny_mce/plugins/advlink/css/advlink.css
new file mode 100644 (file)
index 0000000..1436431
--- /dev/null
@@ -0,0 +1,8 @@
+.mceLinkList, .mceAnchorList, #targetlist {width:280px;}\r
+.mceActionPanel {margin-top:7px;}\r
+.panel_wrapper div.current {height:320px;}\r
+#classlist, #title, #href {width:280px;}\r
+#popupurl, #popupname {width:200px;}\r
+#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}\r
+#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}\r
+#events_panel input {width:200px;}\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/advlink/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/advlink/editor_plugin.js
new file mode 100644 (file)
index 0000000..983fe5a
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..14e46a7
--- /dev/null
@@ -0,0 +1,61 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.AdvancedLinkPlugin', {\r
+               init : function(ed, url) {\r
+                       this.editor = ed;\r
+\r
+                       // Register commands\r
+                       ed.addCommand('mceAdvLink', function() {\r
+                               var se = ed.selection;\r
+\r
+                               // No selection and not in link\r
+                               if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))\r
+                                       return;\r
+\r
+                               ed.windowManager.open({\r
+                                       file : url + '/link.htm',\r
+                                       width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)),\r
+                                       height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)),\r
+                                       inline : 1\r
+                               }, {\r
+                                       plugin_url : url\r
+                               });\r
+                       });\r
+\r
+                       // Register buttons\r
+                       ed.addButton('link', {\r
+                               title : 'advlink.link_desc',\r
+                               cmd : 'mceAdvLink'\r
+                       });\r
+\r
+                       ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink');\r
+\r
+                       ed.onNodeChange.add(function(ed, cm, n, co) {\r
+                               cm.setDisabled('link', co && n.nodeName != 'A');\r
+                               cm.setActive('link', n.nodeName == 'A' && !n.name);\r
+                       });\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Advanced link',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/advlink/js/advlink.js b/docs/include/jscripts/tiny_mce/plugins/advlink/js/advlink.js
new file mode 100644 (file)
index 0000000..b78e82f
--- /dev/null
@@ -0,0 +1,528 @@
+/* Functions for the advlink plugin popup */\r
+\r
+tinyMCEPopup.requireLangPack();\r
+\r
+var templates = {\r
+       "window.open" : "window.open('${url}','${target}','${options}')"\r
+};\r
+\r
+function preinit() {\r
+       var url;\r
+\r
+       if (url = tinyMCEPopup.getParam("external_link_list_url"))\r
+               document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
+}\r
+\r
+function changeClass() {\r
+       var f = document.forms[0];\r
+\r
+       f.classes.value = getSelectValue(f, 'classlist');\r
+}\r
+\r
+function init() {\r
+       tinyMCEPopup.resizeToInnerSize();\r
+\r
+       var formObj = document.forms[0];\r
+       var inst = tinyMCEPopup.editor;\r
+       var elm = inst.selection.getNode();\r
+       var action = "insert";\r
+       var html;\r
+\r
+       document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');\r
+       document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');\r
+       document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href');\r
+       document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href');\r
+       document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');\r
+\r
+       // Link list\r
+       html = getLinkListHTML('linklisthref','href');\r
+       if (html == "")\r
+               document.getElementById("linklisthrefrow").style.display = 'none';\r
+       else\r
+               document.getElementById("linklisthrefcontainer").innerHTML = html;\r
+\r
+       // Resize some elements\r
+       if (isVisible('hrefbrowser'))\r
+               document.getElementById('href').style.width = '260px';\r
+\r
+       if (isVisible('popupurlbrowser'))\r
+               document.getElementById('popupurl').style.width = '180px';\r
+\r
+       elm = inst.dom.getParent(elm, "A");\r
+       if (elm != null && elm.nodeName == "A")\r
+               action = "update";\r
+\r
+       formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); \r
+\r
+       setPopupControlsDisabled(true);\r
+\r
+       if (action == "update") {\r
+               var href = inst.dom.getAttrib(elm, 'href');\r
+               var onclick = inst.dom.getAttrib(elm, 'onclick');\r
+\r
+               // Setup form data\r
+               setFormValue('href', href);\r
+               setFormValue('title', inst.dom.getAttrib(elm, 'title'));\r
+               setFormValue('id', inst.dom.getAttrib(elm, 'id'));\r
+               setFormValue('style', inst.dom.getAttrib(elm, "style"));\r
+               setFormValue('rel', inst.dom.getAttrib(elm, 'rel'));\r
+               setFormValue('rev', inst.dom.getAttrib(elm, 'rev'));\r
+               setFormValue('charset', inst.dom.getAttrib(elm, 'charset'));\r
+               setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang'));\r
+               setFormValue('dir', inst.dom.getAttrib(elm, 'dir'));\r
+               setFormValue('lang', inst.dom.getAttrib(elm, 'lang'));\r
+               setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));\r
+               setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));\r
+               setFormValue('type', inst.dom.getAttrib(elm, 'type'));\r
+               setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus'));\r
+               setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur'));\r
+               setFormValue('onclick', onclick);\r
+               setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick'));\r
+               setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown'));\r
+               setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup'));\r
+               setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover'));\r
+               setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove'));\r
+               setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout'));\r
+               setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));\r
+               setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));\r
+               setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));\r
+               setFormValue('target', inst.dom.getAttrib(elm, 'target'));\r
+               setFormValue('classes', inst.dom.getAttrib(elm, 'class'));\r
+\r
+               // Parse onclick data\r
+               if (onclick != null && onclick.indexOf('window.open') != -1)\r
+                       parseWindowOpen(onclick);\r
+               else\r
+                       parseFunction(onclick);\r
+\r
+               // Select by the values\r
+               selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir'));\r
+               selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel'));\r
+               selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev'));\r
+               selectByValue(formObj, 'linklisthref', href);\r
+\r
+               if (href.charAt(0) == '#')\r
+                       selectByValue(formObj, 'anchorlist', href);\r
+\r
+               addClassesToList('classlist', 'advlink_styles');\r
+\r
+               selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);\r
+               selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true);\r
+       } else\r
+               addClassesToList('classlist', 'advlink_styles');\r
+}\r
+\r
+function checkPrefix(n) {\r
+       if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))\r
+               n.value = 'mailto:' + n.value;\r
+\r
+       if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))\r
+               n.value = 'http://' + n.value;\r
+}\r
+\r
+function setFormValue(name, value) {\r
+       document.forms[0].elements[name].value = value;\r
+}\r
+\r
+function parseWindowOpen(onclick) {\r
+       var formObj = document.forms[0];\r
+\r
+       // Preprocess center code\r
+       if (onclick.indexOf('return false;') != -1) {\r
+               formObj.popupreturn.checked = true;\r
+               onclick = onclick.replace('return false;', '');\r
+       } else\r
+               formObj.popupreturn.checked = false;\r
+\r
+       var onClickData = parseLink(onclick);\r
+\r
+       if (onClickData != null) {\r
+               formObj.ispopup.checked = true;\r
+               setPopupControlsDisabled(false);\r
+\r
+               var onClickWindowOptions = parseOptions(onClickData['options']);\r
+               var url = onClickData['url'];\r
+\r
+               formObj.popupname.value = onClickData['target'];\r
+               formObj.popupurl.value = url;\r
+               formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');\r
+               formObj.popupheight.value = getOption(onClickWindowOptions, 'height');\r
+\r
+               formObj.popupleft.value = getOption(onClickWindowOptions, 'left');\r
+               formObj.popuptop.value = getOption(onClickWindowOptions, 'top');\r
+\r
+               if (formObj.popupleft.value.indexOf('screen') != -1)\r
+                       formObj.popupleft.value = "c";\r
+\r
+               if (formObj.popuptop.value.indexOf('screen') != -1)\r
+                       formObj.popuptop.value = "c";\r
+\r
+               formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";\r
+               formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";\r
+               formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";\r
+               formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";\r
+               formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";\r
+               formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";\r
+               formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";\r
+\r
+               buildOnClick();\r
+       }\r
+}\r
+\r
+function parseFunction(onclick) {\r
+       var formObj = document.forms[0];\r
+       var onClickData = parseLink(onclick);\r
+\r
+       // TODO: Add stuff here\r
+}\r
+\r
+function getOption(opts, name) {\r
+       return typeof(opts[name]) == "undefined" ? "" : opts[name];\r
+}\r
+\r
+function setPopupControlsDisabled(state) {\r
+       var formObj = document.forms[0];\r
+\r
+       formObj.popupname.disabled = state;\r
+       formObj.popupurl.disabled = state;\r
+       formObj.popupwidth.disabled = state;\r
+       formObj.popupheight.disabled = state;\r
+       formObj.popupleft.disabled = state;\r
+       formObj.popuptop.disabled = state;\r
+       formObj.popuplocation.disabled = state;\r
+       formObj.popupscrollbars.disabled = state;\r
+       formObj.popupmenubar.disabled = state;\r
+       formObj.popupresizable.disabled = state;\r
+       formObj.popuptoolbar.disabled = state;\r
+       formObj.popupstatus.disabled = state;\r
+       formObj.popupreturn.disabled = state;\r
+       formObj.popupdependent.disabled = state;\r
+\r
+       setBrowserDisabled('popupurlbrowser', state);\r
+}\r
+\r
+function parseLink(link) {\r
+       link = link.replace(new RegExp('&#39;', 'g'), "'");\r
+\r
+       var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");\r
+\r
+       // Is function name a template function\r
+       var template = templates[fnName];\r
+       if (template) {\r
+               // Build regexp\r
+               var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));\r
+               var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";\r
+               var replaceStr = "";\r
+               for (var i=0; i<variableNames.length; i++) {\r
+                       // Is string value\r
+                       if (variableNames[i].indexOf("'${") != -1)\r
+                               regExp += "'(.*)'";\r
+                       else // Number value\r
+                               regExp += "([0-9]*)";\r
+\r
+                       replaceStr += "$" + (i+1);\r
+\r
+                       // Cleanup variable name\r
+                       variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");\r
+\r
+                       if (i != variableNames.length-1) {\r
+                               regExp += "\\s*,\\s*";\r
+                               replaceStr += "<delim>";\r
+                       } else\r
+                               regExp += ".*";\r
+               }\r
+\r
+               regExp += "\\);?";\r
+\r
+               // Build variable array\r
+               var variables = [];\r
+               variables["_function"] = fnName;\r
+               var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');\r
+               for (var i=0; i<variableNames.length; i++)\r
+                       variables[variableNames[i]] = variableValues[i];\r
+\r
+               return variables;\r
+       }\r
+\r
+       return null;\r
+}\r
+\r
+function parseOptions(opts) {\r
+       if (opts == null || opts == "")\r
+               return [];\r
+\r
+       // Cleanup the options\r
+       opts = opts.toLowerCase();\r
+       opts = opts.replace(/;/g, ",");\r
+       opts = opts.replace(/[^0-9a-z=,]/g, "");\r
+\r
+       var optionChunks = opts.split(',');\r
+       var options = [];\r
+\r
+       for (var i=0; i<optionChunks.length; i++) {\r
+               var parts = optionChunks[i].split('=');\r
+\r
+               if (parts.length == 2)\r
+                       options[parts[0]] = parts[1];\r
+       }\r
+\r
+       return options;\r
+}\r
+\r
+function buildOnClick() {\r
+       var formObj = document.forms[0];\r
+\r
+       if (!formObj.ispopup.checked) {\r
+               formObj.onclick.value = "";\r
+               return;\r
+       }\r
+\r
+       var onclick = "window.open('";\r
+       var url = formObj.popupurl.value;\r
+\r
+       onclick += url + "','";\r
+       onclick += formObj.popupname.value + "','";\r
+\r
+       if (formObj.popuplocation.checked)\r
+               onclick += "location=yes,";\r
+\r
+       if (formObj.popupscrollbars.checked)\r
+               onclick += "scrollbars=yes,";\r
+\r
+       if (formObj.popupmenubar.checked)\r
+               onclick += "menubar=yes,";\r
+\r
+       if (formObj.popupresizable.checked)\r
+               onclick += "resizable=yes,";\r
+\r
+       if (formObj.popuptoolbar.checked)\r
+               onclick += "toolbar=yes,";\r
+\r
+       if (formObj.popupstatus.checked)\r
+               onclick += "status=yes,";\r
+\r
+       if (formObj.popupdependent.checked)\r
+               onclick += "dependent=yes,";\r
+\r
+       if (formObj.popupwidth.value != "")\r
+               onclick += "width=" + formObj.popupwidth.value + ",";\r
+\r
+       if (formObj.popupheight.value != "")\r
+               onclick += "height=" + formObj.popupheight.value + ",";\r
+\r
+       if (formObj.popupleft.value != "") {\r
+               if (formObj.popupleft.value != "c")\r
+                       onclick += "left=" + formObj.popupleft.value + ",";\r
+               else\r
+                       onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";\r
+       }\r
+\r
+       if (formObj.popuptop.value != "") {\r
+               if (formObj.popuptop.value != "c")\r
+                       onclick += "top=" + formObj.popuptop.value + ",";\r
+               else\r
+                       onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";\r
+       }\r
+\r
+       if (onclick.charAt(onclick.length-1) == ',')\r
+               onclick = onclick.substring(0, onclick.length-1);\r
+\r
+       onclick += "');";\r
+\r
+       if (formObj.popupreturn.checked)\r
+               onclick += "return false;";\r
+\r
+       // tinyMCE.debug(onclick);\r
+\r
+       formObj.onclick.value = onclick;\r
+\r
+       if (formObj.href.value == "")\r
+               formObj.href.value = url;\r
+}\r
+\r
+function setAttrib(elm, attrib, value) {\r
+       var formObj = document.forms[0];\r
+       var valueElm = formObj.elements[attrib.toLowerCase()];\r
+       var dom = tinyMCEPopup.editor.dom;\r
+\r
+       if (typeof(value) == "undefined" || value == null) {\r
+               value = "";\r
+\r
+               if (valueElm)\r
+                       value = valueElm.value;\r
+       }\r
+\r
+       // Clean up the style\r
+       if (attrib == 'style')\r
+               value = dom.serializeStyle(dom.parseStyle(value), 'a');\r
+\r
+       dom.setAttrib(elm, attrib, value);\r
+}\r
+\r
+function getAnchorListHTML(id, target) {\r
+       var inst = tinyMCEPopup.editor;\r
+       var nodes = inst.dom.select('a.mceItemAnchor,img.mceItemAnchor'), name, i;\r
+       var html = "";\r
+\r
+       html += '<select id="' + id + '" name="' + id + '" class="mceAnchorList" o2nfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target + '.value=';\r
+       html += 'this.options[this.selectedIndex].value;">';\r
+       html += '<option value="">---</option>';\r
+\r
+       for (i=0; i<nodes.length; i++) {\r
+               if ((name = inst.dom.getAttrib(nodes[i], "name")) != "")\r
+                       html += '<option value="#' + name + '">' + name + '</option>';\r
+       }\r
+\r
+       html += '</select>';\r
+\r
+       return html;\r
+}\r
+\r
+function insertAction() {\r
+       var inst = tinyMCEPopup.editor;\r
+       var elm, elementArray, i;\r
+\r
+       elm = inst.selection.getNode();\r
+       checkPrefix(document.forms[0].href);\r
+\r
+       elm = inst.dom.getParent(elm, "A");\r
+\r
+       // Remove element if there is no href\r
+       if (!document.forms[0].href.value) {\r
+               tinyMCEPopup.execCommand("mceBeginUndoLevel");\r
+               i = inst.selection.getBookmark();\r
+               inst.dom.remove(elm, 1);\r
+               inst.selection.moveToBookmark(i);\r
+               tinyMCEPopup.execCommand("mceEndUndoLevel");\r
+               tinyMCEPopup.close();\r
+               return;\r
+       }\r
+\r
+       tinyMCEPopup.execCommand("mceBeginUndoLevel");\r
+\r
+       // Create new anchor elements\r
+       if (elm == null) {\r
+               inst.getDoc().execCommand("unlink", false, null);\r
+               tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});\r
+\r
+               elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});\r
+               for (i=0; i<elementArray.length; i++)\r
+                       setAllAttribs(elm = elementArray[i]);\r
+       } else\r
+               setAllAttribs(elm);\r
+\r
+       // Don't move caret if selection was image\r
+       if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') {\r
+               inst.focus();\r
+               inst.selection.select(elm);\r
+               inst.selection.collapse(0);\r
+               tinyMCEPopup.storeSelection();\r
+       }\r
+\r
+       tinyMCEPopup.execCommand("mceEndUndoLevel");\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function setAllAttribs(elm) {\r
+       var formObj = document.forms[0];\r
+       var href = formObj.href.value;\r
+       var target = getSelectValue(formObj, 'targetlist');\r
+\r
+       setAttrib(elm, 'href', href);\r
+       setAttrib(elm, 'title');\r
+       setAttrib(elm, 'target', target == '_self' ? '' : target);\r
+       setAttrib(elm, 'id');\r
+       setAttrib(elm, 'style');\r
+       setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));\r
+       setAttrib(elm, 'rel');\r
+       setAttrib(elm, 'rev');\r
+       setAttrib(elm, 'charset');\r
+       setAttrib(elm, 'hreflang');\r
+       setAttrib(elm, 'dir');\r
+       setAttrib(elm, 'lang');\r
+       setAttrib(elm, 'tabindex');\r
+       setAttrib(elm, 'accesskey');\r
+       setAttrib(elm, 'type');\r
+       setAttrib(elm, 'onfocus');\r
+       setAttrib(elm, 'onblur');\r
+       setAttrib(elm, 'onclick');\r
+       setAttrib(elm, 'ondblclick');\r
+       setAttrib(elm, 'onmousedown');\r
+       setAttrib(elm, 'onmouseup');\r
+       setAttrib(elm, 'onmouseover');\r
+       setAttrib(elm, 'onmousemove');\r
+       setAttrib(elm, 'onmouseout');\r
+       setAttrib(elm, 'onkeypress');\r
+       setAttrib(elm, 'onkeydown');\r
+       setAttrib(elm, 'onkeyup');\r
+\r
+       // Refresh in old MSIE\r
+       if (tinyMCE.isMSIE5)\r
+               elm.outerHTML = elm.outerHTML;\r
+}\r
+\r
+function getSelectValue(form_obj, field_name) {\r
+       var elm = form_obj.elements[field_name];\r
+\r
+       if (!elm || elm.options == null || elm.selectedIndex == -1)\r
+               return "";\r
+\r
+       return elm.options[elm.selectedIndex].value;\r
+}\r
+\r
+function getLinkListHTML(elm_id, target_form_element, onchange_func) {\r
+       if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)\r
+               return "";\r
+\r
+       var html = "";\r
+\r
+       html += '<select id="' + elm_id + '" name="' + elm_id + '"';\r
+       html += ' class="mceLinkList" onfoc2us="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';\r
+       html += 'this.options[this.selectedIndex].value;';\r
+\r
+       if (typeof(onchange_func) != "undefined")\r
+               html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';\r
+\r
+       html += '"><option value="">---</option>';\r
+\r
+       for (var i=0; i<tinyMCELinkList.length; i++)\r
+               html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';\r
+\r
+       html += '</select>';\r
+\r
+       return html;\r
+\r
+       // tinyMCE.debug('-- image list start --', html, '-- image list end --');\r
+}\r
+\r
+function getTargetListHTML(elm_id, target_form_element) {\r
+       var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';');\r
+       var html = '';\r
+\r
+       html += '<select id="' + elm_id + '" name="' + elm_id + '" onf2ocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';\r
+       html += 'this.options[this.selectedIndex].value;">';\r
+       html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>';\r
+       html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>';\r
+       html += '<option value="_parent">' + tinyMCEPopup.getLang('advlink_dlg.target_parent') + ' (_parent)</option>';\r
+       html += '<option value="_top">' + tinyMCEPopup.getLang('advlink_dlg.target_top') + ' (_top)</option>';\r
+\r
+       for (var i=0; i<targets.length; i++) {\r
+               var key, value;\r
+\r
+               if (targets[i] == "")\r
+                       continue;\r
+\r
+               key = targets[i].split('=')[0];\r
+               value = targets[i].split('=')[1];\r
+\r
+               html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';\r
+       }\r
+\r
+       html += '</select>';\r
+\r
+       return html;\r
+}\r
+\r
+// While loading\r
+preinit();\r
+tinyMCEPopup.onInit.add(init);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js b/docs/include/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js
new file mode 100644 (file)
index 0000000..c71ffbd
--- /dev/null
@@ -0,0 +1,52 @@
+tinyMCE.addI18n('en.advlink_dlg',{\r
+title:"Insert/edit link",\r
+url:"Link URL",\r
+target:"Target",\r
+titlefield:"Title",\r
+is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",\r
+is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",\r
+list:"Link list",\r
+general_tab:"General",\r
+popup_tab:"Popup",\r
+events_tab:"Events",\r
+advanced_tab:"Advanced",\r
+general_props:"General properties",\r
+popup_props:"Popup properties",\r
+event_props:"Events",\r
+advanced_props:"Advanced properties",\r
+popup_opts:"Options",\r
+anchor_names:"Anchors",\r
+target_same:"Open in this window / frame",\r
+target_parent:"Open in parent window / frame",\r
+target_top:"Open in top frame (replaces all frames)",\r
+target_blank:"Open in new window",\r
+popup:"Javascript popup",\r
+popup_url:"Popup URL",\r
+popup_name:"Window name",\r
+popup_return:"Insert 'return false'",\r
+popup_scrollbars:"Show scrollbars",\r
+popup_statusbar:"Show status bar",\r
+popup_toolbar:"Show toolbars",\r
+popup_menubar:"Show menu bar",\r
+popup_location:"Show location bar",\r
+popup_resizable:"Make window resizable",\r
+popup_dependent:"Dependent (Mozilla/Firefox only)",\r
+popup_size:"Size",\r
+popup_position:"Position (X/Y)",\r
+id:"Id",\r
+style:"Style",\r
+classes:"Classes",\r
+target_name:"Target name",\r
+langdir:"Language direction",\r
+target_langcode:"Target language",\r
+langcode:"Language code",\r
+encoding:"Target character encoding",\r
+mime:"Target MIME type",\r
+rel:"Relationship page to target",\r
+rev:"Relationship target to page",\r
+tabindex:"Tabindex",\r
+accesskey:"Accesskey",\r
+ltr:"Left to right",\r
+rtl:"Right to left",\r
+link_list:"Link list"\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/advlink/link.htm b/docs/include/jscripts/tiny_mce/plugins/advlink/link.htm
new file mode 100644 (file)
index 0000000..876669c
--- /dev/null
@@ -0,0 +1,333 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#advlink_dlg.title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <script type="text/javascript" src="../../utils/validate.js"></script>\r
+       <script type="text/javascript" src="js/advlink.js"></script>\r
+       <link href="css/advlink.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body id="advlink" style="display: none">\r
+    <form onsubmit="insertAction();return false;" action="#">\r
+               <div class="tabs">\r
+                       <ul>\r
+                               <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advlink_dlg.general_tab}</a></span></li>\r
+                               <li id="popup_tab"><span><a href="javascript:mcTabs.displayTab('popup_tab','popup_panel');" onmousedown="return false;">{#advlink_dlg.popup_tab}</a></span></li>\r
+                               <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#advlink_dlg.events_tab}</a></span></li>\r
+                               <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advlink_dlg.advanced_tab}</a></span></li>\r
+                       </ul>\r
+               </div>\r
+\r
+               <div class="panel_wrapper">\r
+                       <div id="general_panel" class="panel current">\r
+                               <fieldset>\r
+                                       <legend>{#advlink_dlg.general_props}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                 <td class="nowrap"><label id="hreflabel" for="href">{#advlink_dlg.url}</label></td>\r
+                                                 <td><table border="0" cellspacing="0" cellpadding="0">\r
+                                                               <tr>\r
+                                                                 <td><input id="href" name="href" type="text" class="mceFocus" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" /></td>\r
+                                                                 <td id="hrefbrowsercontainer">&nbsp;</td>\r
+                                                               </tr>\r
+                                                         </table></td>\r
+                                               </tr>\r
+                                               <tr id="linklisthrefrow">\r
+                                                       <td class="column1"><label for="linklisthref">{#advlink_dlg.list}</label></td>\r
+                                                       <td colspan="2" id="linklisthrefcontainer"><select id="linklisthref"><option value=""></option></select></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td>\r
+                                                       <td colspan="2" id="anchorlistcontainer"><select id="anchorlist"><option value=""></option></select></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td><label id="targetlistlabel" for="targetlist">{#advlink_dlg.target}</label></td>\r
+                                                       <td id="targetlistcontainer"><select id="targetlist"><option value=""></option></select></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="nowrap"><label id="titlelabel" for="title">{#advlink_dlg.titlefield}</label></td>\r
+                                                       <td><input id="title" name="title" type="text" value="" /></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td><label id="classlabel" for="classlist">{#class_name}</label></td>\r
+                                                       <td>\r
+                                                                <select id="classlist" name="classlist" onchange="changeClass();">\r
+                                                                       <option value="" selected="selected">{#not_set}</option>\r
+                                                                </select>\r
+                                                       </td>\r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+                       </div>\r
+\r
+                       <div id="popup_panel" class="panel">\r
+                               <fieldset>\r
+                                       <legend>{#advlink_dlg.popup_props}</legend>\r
+\r
+                                       <input type="checkbox" id="ispopup" name="ispopup" class="radio" onclick="setPopupControlsDisabled(!this.checked);buildOnClick();" />\r
+                                       <label id="ispopuplabel" for="ispopup">{#advlink_dlg.popup}</label>\r
+\r
+                                       <table border="0" cellpadding="0" cellspacing="4">\r
+                                               <tr>\r
+                                                       <td class="nowrap"><label for="popupurl">{#advlink_dlg.popup_url}</label>&nbsp;</td>\r
+                                                       <td>\r
+                                                               <table border="0" cellspacing="0" cellpadding="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="text" name="popupurl" id="popupurl" value="" onchange="buildOnClick();" /></td>\r
+                                                                               <td id="popupurlbrowsercontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="nowrap"><label for="popupname">{#advlink_dlg.popup_name}</label>&nbsp;</td>\r
+                                                       <td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="nowrap"><label>{#advlink_dlg.popup_size}</label>&nbsp;</td>\r
+                                                       <td class="nowrap">\r
+                                                               <input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" /> x\r
+                                                               <input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" /> px\r
+                                                       </td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="nowrap" id="labelleft"><label>{#advlink_dlg.popup_position}</label>&nbsp;</td>\r
+                                                       <td class="nowrap">\r
+                                                               <input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" /> /                                \r
+                                                               <input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" /> (c /c = center)\r
+                                                       </td>\r
+                                               </tr>\r
+                                       </table>\r
+\r
+                                       <fieldset>\r
+                                               <legend>{#advlink_dlg.popup_opts}</legend>\r
+\r
+                                               <table border="0" cellpadding="0" cellspacing="4">\r
+                                                       <tr>\r
+                                                               <td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>\r
+                                                               <td class="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td>\r
+                                                               <td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>\r
+                                                               <td class="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td>\r
+                                                       </tr>\r
+                                                       <tr>\r
+                                                               <td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>\r
+                                                               <td class="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td>\r
+                                                               <td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>\r
+                                                               <td class="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td>\r
+                                                       </tr>\r
+                                                       <tr>\r
+                                                               <td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>\r
+                                                               <td class="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td>\r
+                                                               <td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>\r
+                                                               <td class="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td>\r
+                                                       </tr>\r
+                                                       <tr>\r
+                                                               <td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>\r
+                                                               <td class="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td>\r
+                                                               <td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>\r
+                                                               <td class="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td>\r
+                                                       </tr>\r
+                                               </table>\r
+                                       </fieldset>\r
+                               </fieldset>\r
+                       </div>\r
+\r
+                       <div id="advanced_panel" class="panel">\r
+                       <fieldset>\r
+                                       <legend>{#advlink_dlg.advanced_props}</legend>\r
+\r
+                                       <table border="0" cellpadding="0" cellspacing="4">\r
+                                               <tr>\r
+                                                       <td class="column1"><label id="idlabel" for="id">{#advlink_dlg.id}</label></td> \r
+                                                       <td><input id="id" name="id" type="text" value="" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label id="stylelabel" for="style">{#advlink_dlg.style}</label></td>\r
+                                                       <td><input type="text" id="style" name="style" value="" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label id="classeslabel" for="classes">{#advlink_dlg.classes}</label></td>\r
+                                                       <td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label id="targetlabel" for="target">{#advlink_dlg.target_name}</label></td>\r
+                                                       <td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label id="dirlabel" for="dir">{#advlink_dlg.langdir}</label></td> \r
+                                                       <td>\r
+                                                               <select id="dir" name="dir"> \r
+                                                                               <option value="">{#not_set}</option> \r
+                                                                               <option value="ltr">{#advlink_dlg.ltr}</option> \r
+                                                                               <option value="rtl">{#advlink_dlg.rtl}</option> \r
+                                                               </select>\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label id="hreflanglabel" for="hreflang">{#advlink_dlg.target_langcode}</label></td>\r
+                                                       <td><input type="text" id="hreflang" name="hreflang" value="" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label id="langlabel" for="lang">{#advlink_dlg.langcode}</label></td> \r
+                                                       <td>\r
+                                                               <input id="lang" name="lang" type="text" value="" />\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label id="charsetlabel" for="charset">{#advlink_dlg.encoding}</label></td>\r
+                                                       <td><input type="text" id="charset" name="charset" value="" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label id="typelabel" for="type">{#advlink_dlg.mime}</label></td>\r
+                                                       <td><input type="text" id="type" name="type" value="" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label id="rellabel" for="rel">{#advlink_dlg.rel}</label></td>\r
+                                                       <td><select id="rel" name="rel"> \r
+                                                                       <option value="">{#not_set}</option> \r
+                                                                       <option value="lightbox">Lightbox</option> \r
+                                                                       <option value="alternate">Alternate</option> \r
+                                                                       <option value="designates">Designates</option> \r
+                                                                       <option value="stylesheet">Stylesheet</option> \r
+                                                                       <option value="start">Start</option> \r
+                                                                       <option value="next">Next</option> \r
+                                                                       <option value="prev">Prev</option> \r
+                                                                       <option value="contents">Contents</option> \r
+                                                                       <option value="index">Index</option> \r
+                                                                       <option value="glossary">Glossary</option> \r
+                                                                       <option value="copyright">Copyright</option> \r
+                                                                       <option value="chapter">Chapter</option> \r
+                                                                       <option value="subsection">Subsection</option> \r
+                                                                       <option value="appendix">Appendix</option> \r
+                                                                       <option value="help">Help</option> \r
+                                                                       <option value="bookmark">Bookmark</option>\r
+                                                                       <option value="nofollow">No Follow</option>\r
+                                                                       <option value="tag">Tag</option>\r
+                                                               </select> \r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label id="revlabel" for="rev">{#advlink_dlg.rev}</label></td>\r
+                                                       <td><select id="rev" name="rev"> \r
+                                                                       <option value="">{#not_set}</option> \r
+                                                                       <option value="alternate">Alternate</option> \r
+                                                                       <option value="designates">Designates</option> \r
+                                                                       <option value="stylesheet">Stylesheet</option> \r
+                                                                       <option value="start">Start</option> \r
+                                                                       <option value="next">Next</option> \r
+                                                                       <option value="prev">Prev</option> \r
+                                                                       <option value="contents">Contents</option> \r
+                                                                       <option value="index">Index</option> \r
+                                                                       <option value="glossary">Glossary</option> \r
+                                                                       <option value="copyright">Copyright</option> \r
+                                                                       <option value="chapter">Chapter</option> \r
+                                                                       <option value="subsection">Subsection</option> \r
+                                                                       <option value="appendix">Appendix</option> \r
+                                                                       <option value="help">Help</option> \r
+                                                                       <option value="bookmark">Bookmark</option> \r
+                                                               </select> \r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label id="tabindexlabel" for="tabindex">{#advlink_dlg.tabindex}</label></td>\r
+                                                       <td><input type="text" id="tabindex" name="tabindex" value="" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label id="accesskeylabel" for="accesskey">{#advlink_dlg.accesskey}</label></td>\r
+                                                       <td><input type="text" id="accesskey" name="accesskey" value="" /></td>\r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+                       </div>\r
+\r
+                       <div id="events_panel" class="panel">\r
+                       <fieldset>\r
+                                       <legend>{#advlink_dlg.event_props}</legend>\r
+\r
+                                       <table border="0" cellpadding="0" cellspacing="4">\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="onfocus">onfocus</label></td> \r
+                                                       <td><input id="onfocus" name="onfocus" type="text" value="" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="onblur">onblur</label></td> \r
+                                                       <td><input id="onblur" name="onblur" type="text" value="" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="onclick">onclick</label></td> \r
+                                                       <td><input id="onclick" name="onclick" type="text" value="" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="ondblclick">ondblclick</label></td> \r
+                                                       <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="onmousedown">onmousedown</label></td> \r
+                                                       <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="onmouseup">onmouseup</label></td> \r
+                                                       <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="onmouseover">onmouseover</label></td> \r
+                                                       <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="onmousemove">onmousemove</label></td> \r
+                                                       <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="onmouseout">onmouseout</label></td> \r
+                                                       <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="onkeypress">onkeypress</label></td> \r
+                                                       <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="onkeydown">onkeydown</label></td> \r
+                                                       <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="onkeyup">onkeyup</label></td> \r
+                                                       <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td> \r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+                       </div>\r
+               </div>\r
+\r
+               <div class="mceActionPanel">\r
+                       <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+                       <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+               </div>\r
+    </form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/advlist/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/advlist/editor_plugin.js
new file mode 100644 (file)
index 0000000..02d1697
--- /dev/null
@@ -0,0 +1 @@
+(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square")},createControl:function(d,b){var f=this,e,h;if(d=="numlist"||d=="bullist"){if(f[d][0].title=="advlist.def"){h=f[d][0]}function c(i,k){var j=true;a(k.styles,function(m,l){if(f.editor.dom.getStyle(i,l)!=m){j=false;return false}});return j}function g(){var k,i=f.editor,l=i.dom,j=i.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(d=="bullist"?"OL":"UL")||c(k,h)){i.execCommand(d=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(h){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,h.styles);k.removeAttribute("_mce_style")}}}e=b.createSplitButton(d,{title:"advanced."+d+"_desc","class":"mce_"+d,onclick:function(){g()}});e.onRenderMenu.add(function(i,j){j.onShowMenu.add(function(){var m=f.editor.dom,l=m.getParent(f.editor.selection.getNode(),"ol,ul"),k;if(l||h){k=f[d];a(j.items,function(n){var o=true;n.setSelected(0);if(l&&!n.isDisabled()){a(k,function(p){if(p.id==n.id){if(!c(l,p)){o=false;return false}}});if(o){n.setSelected(1)}}});if(!l){j.items[h.id].setSelected(1)}}});j.add({id:f.editor.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle"}).setDisabled(1);a(f[d],function(k){k.id=f.editor.dom.uniqueId();j.add({id:k.id,title:k.title,onclick:function(){h=k;g()}})})});return e}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/advlist/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/advlist/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..a61887a
--- /dev/null
@@ -0,0 +1,154 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       var each = tinymce.each;\r
+\r
+       tinymce.create('tinymce.plugins.AdvListPlugin', {\r
+               init : function(ed, url) {\r
+                       var t = this;\r
+\r
+                       t.editor = ed;\r
+\r
+                       function buildFormats(str) {\r
+                               var formats = [];\r
+\r
+                               each(str.split(/,/), function(type) {\r
+                                       formats.push({\r
+                                               title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')),\r
+                                               styles : {\r
+                                                       listStyleType : type == 'default' ? '' : type\r
+                                               }\r
+                                       });\r
+                               });\r
+\r
+                               return formats;\r
+                       };\r
+\r
+                       // Setup number formats from config or default\r
+                       t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");\r
+                       t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square");\r
+               },\r
+\r
+               createControl: function(name, cm) {\r
+                       var t = this, btn, format;\r
+\r
+                       if (name == 'numlist' || name == 'bullist') {\r
+                               // Default to first item if it's a default item\r
+                               if (t[name][0].title == 'advlist.def')\r
+                                       format = t[name][0];\r
+\r
+                               function hasFormat(node, format) {\r
+                                       var state = true;\r
+\r
+                                       each(format.styles, function(value, name) {\r
+                                               // Format doesn't match\r
+                                               if (t.editor.dom.getStyle(node, name) != value) {\r
+                                                       state = false;\r
+                                                       return false;\r
+                                               }\r
+                                       });\r
+\r
+                                       return state;\r
+                               };\r
+\r
+                               function applyListFormat() {\r
+                                       var list, ed = t.editor, dom = ed.dom, sel = ed.selection;\r
+\r
+                                       // Check for existing list element\r
+                                       list = dom.getParent(sel.getNode(), 'ol,ul');\r
+\r
+                                       // Switch/add list type if needed\r
+                                       if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format))\r
+                                               ed.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList');\r
+\r
+                                       // Append styles to new list element\r
+                                       if (format) {\r
+                                               list = dom.getParent(sel.getNode(), 'ol,ul');\r
+\r
+                                               if (list) {\r
+                                                       dom.setStyles(list, format.styles);\r
+                                                       list.removeAttribute('_mce_style');\r
+                                               }\r
+                                       }\r
+                               };\r
+\r
+                               btn = cm.createSplitButton(name, {\r
+                                       title : 'advanced.' + name + '_desc',\r
+                                       'class' : 'mce_' + name,\r
+                                       onclick : function() {\r
+                                               applyListFormat();\r
+                                       }\r
+                               });\r
+\r
+                               btn.onRenderMenu.add(function(btn, menu) {\r
+                                       menu.onShowMenu.add(function() {\r
+                                               var dom = t.editor.dom, list = dom.getParent(t.editor.selection.getNode(), 'ol,ul'), fmtList;\r
+\r
+                                               if (list || format) {\r
+                                                       fmtList = t[name];\r
+\r
+                                                       // Unselect existing items\r
+                                                       each(menu.items, function(item) {\r
+                                                               var state = true;\r
+\r
+                                                               item.setSelected(0);\r
+\r
+                                                               if (list && !item.isDisabled()) {\r
+                                                                       each(fmtList, function(fmt) {\r
+                                                                               if (fmt.id == item.id) {\r
+                                                                                       if (!hasFormat(list, fmt)) {\r
+                                                                                               state = false;\r
+                                                                                               return false;\r
+                                                                                       }\r
+                                                                               }\r
+                                                                       });\r
+\r
+                                                                       if (state)\r
+                                                                               item.setSelected(1);\r
+                                                               }\r
+                                                       });\r
+\r
+                                                       // Select the current format\r
+                                                       if (!list)\r
+                                                               menu.items[format.id].setSelected(1);\r
+                                               }\r
+                                       });\r
+\r
+                                       menu.add({id : t.editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle'}).setDisabled(1);\r
+\r
+                                       each(t[name], function(item) {\r
+                                               item.id = t.editor.dom.uniqueId();\r
+\r
+                                               menu.add({id : item.id, title : item.title, onclick : function() {\r
+                                                       format = item;\r
+                                                       applyListFormat();\r
+                                               }});\r
+                                       });\r
+                               });\r
+\r
+                               return btn;\r
+                       }\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Advanced lists',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/autoresize/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/autoresize/editor_plugin.js
new file mode 100644 (file)
index 0000000..220b84a
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this;if(a.getParam("fullscreen_is_enabled")){return}function b(){var h=a.getDoc(),e=h.body,j=h.documentElement,g=tinymce.DOM,i=d.autoresize_min_height,f;f=tinymce.isIE?e.scrollHeight:j.offsetHeight;if(f>d.autoresize_min_height){i=f}g.setStyle(g.get(a.id+"_ifr"),"height",i+"px");if(d.throbbing){a.setProgressState(false);a.setProgressState(true)}}d.editor=a;d.autoresize_min_height=a.getElement().offsetHeight;a.onInit.add(function(f,e){f.setProgressState(true);d.throbbing=true;f.getBody().style.overflowY="hidden"});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);a.onLoadContent.add(function(f,e){b();setTimeout(function(){b();f.setProgressState(false);d.throbbing=false},1250)});a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..37709f5
--- /dev/null
@@ -0,0 +1,117 @@
+/**
+ * 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() {
+       /**
+        * Auto Resize
+        * 
+        * This plugin automatically resizes the content area to fit its content height.
+        * It will retain a minimum height, which is the height of the content area when
+        * it's initialized.
+        */
+       tinymce.create('tinymce.plugins.AutoResizePlugin', {
+               /**
+                * Initializes the plugin, this will be executed after the plugin has been created.
+                * This call is done before the editor instance has finished it's initialization so use the onInit event
+                * of the editor instance to intercept that event.
+                *
+                * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
+                * @param {string} url Absolute URL to where the plugin is located.
+                */
+               init : function(ed, url) {
+                       var t = this;
+
+                       if (ed.getParam('fullscreen_is_enabled'))
+                               return;
+
+                       /**
+                        * This method gets executed each time the editor needs to resize.
+                        */
+                       function resize() {
+                               var d = ed.getDoc(), b = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
+
+                               // Get height differently depending on the browser used
+                               myHeight = tinymce.isIE ? b.scrollHeight : de.offsetHeight;
+
+                               // Don't make it smaller than the minimum height
+                               if (myHeight > t.autoresize_min_height)
+                                       resizeHeight = myHeight;
+
+                               // Resize content element
+                               DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
+
+                               // if we're throbbing, we'll re-throb to match the new size
+                               if (t.throbbing) {
+                                       ed.setProgressState(false);
+                                       ed.setProgressState(true);
+                               }
+                       };
+
+                       t.editor = ed;
+
+                       // Define minimum height
+                       t.autoresize_min_height = ed.getElement().offsetHeight;
+
+                       // Things to do when the editor is ready
+                       ed.onInit.add(function(ed, l) {
+                               // Show throbber until content area is resized properly
+                               ed.setProgressState(true);
+                               t.throbbing = true;
+
+                               // Hide scrollbars
+                               ed.getBody().style.overflowY = "hidden";
+                       });
+
+                       // Add appropriate listeners for resizing content area
+                       ed.onChange.add(resize);
+                       ed.onSetContent.add(resize);
+                       ed.onPaste.add(resize);
+                       ed.onKeyUp.add(resize);
+                       ed.onPostRender.add(resize);
+
+                       ed.onLoadContent.add(function(ed, l) {
+                               resize();
+
+                               // Because the content area resizes when its content CSS loads,
+                               // and we can't easily add a listener to its onload event,
+                               // we'll just trigger a resize after a short loading period
+                               setTimeout(function() {
+                                       resize();
+
+                                       // Disable throbber
+                                       ed.setProgressState(false);
+                                       t.throbbing = false;
+                               }, 1250);
+                       });
+
+                       // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
+                       ed.addCommand('mceAutoResize', resize);
+               },
+
+               /**
+                * Returns information about the plugin as a name/value array.
+                * The current keys are longname, author, authorurl, infourl and version.
+                *
+                * @return {Object} Name/value array containing information about the plugin.
+                */
+               getInfo : function() {
+                       return {
+                               longname : 'Auto Resize',
+                               author : 'Moxiecode Systems AB',
+                               authorurl : 'http://tinymce.moxiecode.com',
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion
+                       };
+               }
+       });
+
+       // Register plugin
+       tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/autosave/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/autosave/editor_plugin.js
new file mode 100644 (file)
index 0000000..b33ebfb
--- /dev/null
@@ -0,0 +1 @@
+(function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent().replace(/\s|&nbsp;|<\/?p[^>]*>|<br[^>]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){h.storeDraft();i.nodeChanged()},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();m.save("TinyMCE")},getItem:function(l){var m=i.getElement();m.load("TinyMCE");return m.getAttribute(l)},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent();if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,i=h.storage;if(i){content=i.getItem(h.key);if(content){h.editor.setContent(content);h.onRestoreDraft.dispatch(h,{content:content})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()<i.getTime()){return b}h.removeDraft()}else{return b}}}return false},removeDraft:function(){var h=this,k=h.storage,i=h.key,j;if(k){j=k.getItem(i);k.removeItem(i);k.removeItem(i+"_expires");if(j){h.onRemoveDraft.dispatch(h,{content:j})}}},"static":{_beforeUnloadHandler:function(h){var i;e.each(tinyMCE.editors,function(j){if(j.plugins.autosave){j.plugins.autosave.storeDraft()}if(j.getParam("fullscreen_is_enabled")){return}if(!i&&j.isDirty()&&j.getParam("autosave_ask_before_unload")){i=j.getLang("autosave.unload_msg")}});return i}}});e.PluginManager.add("autosave",e.plugins.AutoSave)})(tinymce);
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..d8cc112
--- /dev/null
@@ -0,0 +1,422 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ *\r
+ * Adds auto-save capability to the TinyMCE text editor to rescue content\r
+ * inadvertently lost. This plugin was originally developed by Speednet\r
+ * and that project can be found here: http://code.google.com/p/tinyautosave/\r
+ *\r
+ * TECHNOLOGY DISCUSSION:\r
+ * \r
+ * The plugin attempts to use the most advanced features available in the current browser to save\r
+ * as much content as possible.  There are a total of four different methods used to autosave the\r
+ * content.  In order of preference, they are:\r
+ * \r
+ * 1. localStorage - A new feature of HTML 5, localStorage can store megabytes of data per domain\r
+ * on the client computer. Data stored in the localStorage area has no expiration date, so we must\r
+ * manage expiring the data ourselves.  localStorage is fully supported by IE8, and it is supposed\r
+ * to be working in Firefox 3 and Safari 3.2, but in reality is is flaky in those browsers.  As\r
+ * HTML 5 gets wider support, the AutoSave plugin will use it automatically. In Windows Vista/7,\r
+ * localStorage is stored in the following folder:\r
+ * C:\Users\[username]\AppData\Local\Microsoft\Internet Explorer\DOMStore\[tempFolder]\r
+ * \r
+ * 2. sessionStorage - A new feature of HTML 5, sessionStorage works similarly to localStorage,\r
+ * except it is designed to expire after a certain amount of time.  Because the specification\r
+ * around expiration date/time is very loosely-described, it is preferrable to use locaStorage and\r
+ * manage the expiration ourselves.  sessionStorage has similar storage characteristics to\r
+ * localStorage, although it seems to have better support by Firefox 3 at the moment.  (That will\r
+ * certainly change as Firefox continues getting better at HTML 5 adoption.)\r
+ * \r
+ * 3. UserData - A very under-exploited feature of Microsoft Internet Explorer, UserData is a\r
+ * way to store up to 128K of data per "document", or up to 1MB of data per domain, on the client\r
+ * computer.  The feature is available for IE 5+, which makes it available for every version of IE\r
+ * supported by TinyMCE.  The content is persistent across browser restarts and expires on the\r
+ * date/time specified, just like a cookie.  However, the data is not cleared when the user clears\r
+ * cookies on the browser, which makes it well-suited for rescuing autosaved content.  UserData,\r
+ * like other Microsoft IE browser technologies, is implemented as a behavior attached to a\r
+ * specific DOM object, so in this case we attach the behavior to the same DOM element that the\r
+ * TinyMCE editor instance is attached to.\r
+ */\r
+\r
+(function(tinymce) {\r
+       // Setup constants to help the compressor to reduce script size\r
+       var PLUGIN_NAME = 'autosave',\r
+               RESTORE_DRAFT = 'restoredraft',\r
+               TRUE = true,\r
+               undefined,\r
+               unloadHandlerAdded,\r
+               Dispatcher = tinymce.util.Dispatcher;\r
+\r
+       /**\r
+        * This plugin adds auto-save capability to the TinyMCE text editor to rescue content\r
+        * inadvertently lost. By using localStorage.\r
+        *\r
+        * @class tinymce.plugins.AutoSave\r
+        */\r
+       tinymce.create('tinymce.plugins.AutoSave', {\r
+               /**\r
+                * Initializes the plugin, this will be executed after the plugin has been created.\r
+                * This call is done before the editor instance has finished it's initialization so use the onInit event\r
+                * of the editor instance to intercept that event.\r
+                *\r
+                * @method init\r
+                * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.\r
+                * @param {string} url Absolute URL to where the plugin is located.\r
+                */\r
+               init : function(ed, url) {\r
+                       var self = this, settings = ed.settings;\r
+\r
+                       self.editor = ed;\r
+\r
+                       // Parses the specified time string into a milisecond number 10m, 10s etc.\r
+                       function parseTime(time) {\r
+                               var multipels = {\r
+                                       s : 1000,\r
+                                       m : 60000\r
+                               };\r
+\r
+                               time = /^(\d+)([ms]?)$/.exec('' + time);\r
+\r
+                               return (time[2] ? multipels[time[2]] : 1) * parseInt(time);\r
+                       };\r
+\r
+                       // Default config\r
+                       tinymce.each({\r
+                               ask_before_unload : TRUE,\r
+                               interval : '30s',\r
+                               retention : '20m',\r
+                               minlength : 50\r
+                       }, function(value, key) {\r
+                               key = PLUGIN_NAME + '_' + key;\r
+\r
+                               if (settings[key] === undefined)\r
+                                       settings[key] = value;\r
+                       });\r
+\r
+                       // Parse times\r
+                       settings.autosave_interval = parseTime(settings.autosave_interval);\r
+                       settings.autosave_retention = parseTime(settings.autosave_retention);\r
+\r
+                       // Register restore button\r
+                       ed.addButton(RESTORE_DRAFT, {\r
+                               title : PLUGIN_NAME + ".restore_content",\r
+                               onclick : function() {\r
+                                       if (ed.getContent().replace(/\s|&nbsp;|<\/?p[^>]*>|<br[^>]*>/gi, "").length > 0) {\r
+                                               // Show confirm dialog if the editor isn't empty\r
+                                               ed.windowManager.confirm(\r
+                                                       PLUGIN_NAME + ".warning_message",\r
+                                                       function(ok) {\r
+                                                               if (ok)\r
+                                                                       self.restoreDraft();\r
+                                                       }\r
+                                               );\r
+                                       } else\r
+                                               self.restoreDraft();\r
+                               }\r
+                       });\r
+\r
+                       // Enable/disable restoredraft button depending on if there is a draft stored or not\r
+                       ed.onNodeChange.add(function() {\r
+                               var controlManager = ed.controlManager;\r
+\r
+                               if (controlManager.get(RESTORE_DRAFT))\r
+                                       controlManager.setDisabled(RESTORE_DRAFT, !self.hasDraft());\r
+                       });\r
+\r
+                       ed.onInit.add(function() {\r
+                               // Check if the user added the restore button, then setup auto storage logic\r
+                               if (ed.controlManager.get(RESTORE_DRAFT)) {\r
+                                       // Setup storage engine\r
+                                       self.setupStorage(ed);\r
+\r
+                                       // Auto save contents each interval time\r
+                                       setInterval(function() {\r
+                                               self.storeDraft();\r
+                                               ed.nodeChanged();\r
+                                       }, settings.autosave_interval);\r
+                               }\r
+                       });\r
+\r
+                       /**\r
+                        * This event gets fired when a draft is stored to local storage.\r
+                        *\r
+                        * @event onStoreDraft\r
+                        * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.\r
+                        * @param {Object} draft Draft object containing the HTML contents of the editor.\r
+                        */\r
+                       self.onStoreDraft = new Dispatcher(self);\r
+\r
+                       /**\r
+                        * This event gets fired when a draft is restored from local storage.\r
+                        *\r
+                        * @event onStoreDraft\r
+                        * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.\r
+                        * @param {Object} draft Draft object containing the HTML contents of the editor.\r
+                        */\r
+                       self.onRestoreDraft = new Dispatcher(self);\r
+\r
+                       /**\r
+                        * This event gets fired when a draft removed/expired.\r
+                        *\r
+                        * @event onRemoveDraft\r
+                        * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.\r
+                        * @param {Object} draft Draft object containing the HTML contents of the editor.\r
+                        */\r
+                       self.onRemoveDraft = new Dispatcher(self);\r
+\r
+                       // Add ask before unload dialog only add one unload handler\r
+                       if (!unloadHandlerAdded) {\r
+                               window.onbeforeunload = tinymce.plugins.AutoSave._beforeUnloadHandler;\r
+                               unloadHandlerAdded = TRUE;\r
+                       }\r
+               },\r
+\r
+               /**\r
+                * Returns information about the plugin as a name/value array.\r
+                * The current keys are longname, author, authorurl, infourl and version.\r
+                *\r
+                * @method getInfo\r
+                * @return {Object} Name/value array containing information about the plugin.\r
+                */\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Auto save',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               },\r
+\r
+               /**\r
+                * Returns an expiration date UTC string.\r
+                *\r
+                * @method getExpDate\r
+                * @return {String} Expiration date UTC string.\r
+                */\r
+               getExpDate : function() {\r
+                       return new Date(\r
+                               new Date().getTime() + this.editor.settings.autosave_retention\r
+                       ).toUTCString();\r
+               },\r
+\r
+               /**\r
+                * This method will setup the storage engine. If the browser has support for it.\r
+                *\r
+                * @method setupStorage\r
+                */\r
+               setupStorage : function(ed) {\r
+                       var self = this, testKey = PLUGIN_NAME + '_test', testVal = "OK";\r
+\r
+                       self.key = PLUGIN_NAME + ed.id;\r
+\r
+                       // Loop though each storage engine type until we find one that works\r
+                       tinymce.each([\r
+                               function() {\r
+                                       // Try HTML5 Local Storage\r
+                                       if (localStorage) {\r
+                                               localStorage.setItem(testKey, testVal);\r
+\r
+                                               if (localStorage.getItem(testKey) === testVal) {\r
+                                                       localStorage.removeItem(testKey);\r
+\r
+                                                       return localStorage;\r
+                                               }\r
+                                       }\r
+                               },\r
+\r
+                               function() {\r
+                                       // Try HTML5 Session Storage\r
+                                       if (sessionStorage) {\r
+                                               sessionStorage.setItem(testKey, testVal);\r
+\r
+                                               if (sessionStorage.getItem(testKey) === testVal) {\r
+                                                       sessionStorage.removeItem(testKey);\r
+\r
+                                                       return sessionStorage;\r
+                                               }\r
+                                       }\r
+                               },\r
+\r
+                               function() {\r
+                                       // Try IE userData\r
+                                       if (tinymce.isIE) {\r
+                                               ed.getElement().style.behavior = "url('#default#userData')";\r
+\r
+                                               // Fake localStorage on old IE\r
+                                               return {\r
+                                                       autoExpires : TRUE,\r
+\r
+                                                       setItem : function(key, value) {\r
+                                                               var userDataElement = ed.getElement();\r
+\r
+                                                               userDataElement.setAttribute(key, value);\r
+                                                               userDataElement.expires = self.getExpDate();\r
+                                                               userDataElement.save("TinyMCE");\r
+                                                       },\r
+\r
+                                                       getItem : function(key) {\r
+                                                               var userDataElement = ed.getElement();\r
+\r
+                                                               userDataElement.load("TinyMCE");\r
+\r
+                                                               return userDataElement.getAttribute(key);\r
+                                                       },\r
+\r
+                                                       removeItem : function(key) {\r
+                                                               ed.getElement().removeAttribute(key);\r
+                                                       }\r
+                                               };\r
+                                       }\r
+                               },\r
+                       ], function(setup) {\r
+                               // Try executing each function to find a suitable storage engine\r
+                               try {\r
+                                       self.storage = setup();\r
+\r
+                                       if (self.storage)\r
+                                               return false;\r
+                               } catch (e) {\r
+                                       // Ignore\r
+                               }\r
+                       });\r
+               },\r
+\r
+               /**\r
+                * This method will store the current contents in the the storage engine.\r
+                *\r
+                * @method storeDraft\r
+                */\r
+               storeDraft : function() {\r
+                       var self = this, storage = self.storage, editor = self.editor, expires, content;\r
+\r
+                       // Is the contents dirty\r
+                       if (storage) {\r
+                               // If there is no existing key and the contents hasn't been changed since\r
+                               // it's original value then there is no point in saving a draft\r
+                               if (!storage.getItem(self.key) && !editor.isDirty())\r
+                                       return;\r
+\r
+                               // Store contents if the contents if longer than the minlength of characters\r
+                               content = editor.getContent();\r
+                               if (content.length > editor.settings.autosave_minlength) {\r
+                                       expires = self.getExpDate();\r
+\r
+                                       // Store expiration date if needed IE userData has auto expire built in\r
+                                       if (!self.storage.autoExpires)\r
+                                               self.storage.setItem(self.key + "_expires", expires);\r
+\r
+                                       self.storage.setItem(self.key, content);\r
+                                       self.onStoreDraft.dispatch(self, {\r
+                                               expires : expires,\r
+                                               content : content\r
+                                       });\r
+                               }\r
+                       }\r
+               },\r
+\r
+               /**\r
+                * This method will restore the contents from the storage engine back to the editor.\r
+                *\r
+                * @method restoreDraft\r
+                */\r
+               restoreDraft : function() {\r
+                       var self = this, storage = self.storage;\r
+\r
+                       if (storage) {\r
+                               content = storage.getItem(self.key);\r
+\r
+                               if (content) {\r
+                                       self.editor.setContent(content);\r
+                                       self.onRestoreDraft.dispatch(self, {\r
+                                               content : content\r
+                                       });\r
+                               }\r
+                       }\r
+               },\r
+\r
+               /**\r
+                * This method will return true/false if there is a local storage draft available.\r
+                *\r
+                * @method hasDraft\r
+                * @return {boolean} true/false state if there is a local draft.\r
+                */\r
+               hasDraft : function() {\r
+                       var self = this, storage = self.storage, expDate, exists;\r
+\r
+                       if (storage) {\r
+                               // Does the item exist at all\r
+                               exists = !!storage.getItem(self.key);\r
+                               if (exists) {\r
+                                       // Storage needs autoexpire\r
+                                       if (!self.storage.autoExpires) {\r
+                                               expDate = new Date(storage.getItem(self.key + "_expires"));\r
+\r
+                                               // Contents hasn't expired\r
+                                               if (new Date().getTime() < expDate.getTime())\r
+                                                       return TRUE;\r
+\r
+                                               // Remove it if it has\r
+                                               self.removeDraft();\r
+                                       } else\r
+                                               return TRUE;\r
+                               }\r
+                       }\r
+\r
+                       return false;\r
+               },\r
+\r
+               /**\r
+                * Removes the currently stored draft.\r
+                *\r
+                * @method removeDraft\r
+                */\r
+               removeDraft : function() {\r
+                       var self = this, storage = self.storage, key = self.key, content;\r
+\r
+                       if (storage) {\r
+                               // Get current contents and remove the existing draft\r
+                               content = storage.getItem(key);\r
+                               storage.removeItem(key);\r
+                               storage.removeItem(key + "_expires");\r
+\r
+                               // Dispatch remove event if we had any contents\r
+                               if (content) {\r
+                                       self.onRemoveDraft.dispatch(self, {\r
+                                               content : content\r
+                                       });\r
+                               }\r
+                       }\r
+               },\r
+\r
+               "static" : {\r
+                       // Internal unload handler will be called before the page is unloaded\r
+                       _beforeUnloadHandler : function(e) {\r
+                               var msg;\r
+\r
+                               tinymce.each(tinyMCE.editors, function(ed) {\r
+                                       // Store a draft for each editor instance\r
+                                       if (ed.plugins.autosave)\r
+                                               ed.plugins.autosave.storeDraft();\r
+\r
+                                       // Never ask in fullscreen mode\r
+                                       if (ed.getParam("fullscreen_is_enabled"))\r
+                                               return;\r
+\r
+                                       // Setup a return message if the editor is dirty\r
+                                       if (!msg && ed.isDirty() && ed.getParam("autosave_ask_before_unload"))\r
+                                               msg = ed.getLang("autosave.unload_msg");\r
+                               });\r
+\r
+                               return msg;\r
+                       }\r
+               }\r
+       });\r
+\r
+       tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSave);\r
+})(tinymce);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/autosave/langs/en.js b/docs/include/jscripts/tiny_mce/plugins/autosave/langs/en.js
new file mode 100644 (file)
index 0000000..fce6bd3
--- /dev/null
@@ -0,0 +1,4 @@
+tinyMCE.addI18n('en.autosave',{\r
+restore_content: "Restore auto-saved content",\r
+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?"\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js
new file mode 100644 (file)
index 0000000..930fdff
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.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}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/<font>(.*?)<\/font>/gi,"$1");b(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");b(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");b(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");b(/<u>/gi,"[u]");b(/<blockquote[^>]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/<br \/>/gi,"\n");b(/<br\/>/gi,"\n");b(/<br>/gi,"\n");b(/<p>/gi,"");b(/<\/p>/gi,"\n");b(/&nbsp;/gi," ");b(/&quot;/gi,'"');b(/&lt;/gi,"<");b(/&gt;/gi,">");b(/&amp;/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"<br />");b(/\[b\]/gi,"<strong>");b(/\[\/b\]/gi,"</strong>");b(/\[i\]/gi,"<em>");b(/\[\/i\]/gi,"</em>");b(/\[u\]/gi,"<u>");b(/\[\/u\]/gi,"</u>");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');b(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>');b(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>');b(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..5586637
--- /dev/null
@@ -0,0 +1,120 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.BBCodePlugin', {\r
+               init : function(ed, url) {\r
+                       var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();\r
+\r
+                       ed.onBeforeSetContent.add(function(ed, o) {\r
+                               o.content = t['_' + dialect + '_bbcode2html'](o.content);\r
+                       });\r
+\r
+                       ed.onPostProcess.add(function(ed, o) {\r
+                               if (o.set)\r
+                                       o.content = t['_' + dialect + '_bbcode2html'](o.content);\r
+\r
+                               if (o.get)\r
+                                       o.content = t['_' + dialect + '_html2bbcode'](o.content);\r
+                       });\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'BBCode Plugin',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               },\r
+\r
+               // Private methods\r
+\r
+               // HTML -> BBCode in PunBB dialect\r
+               _punbb_html2bbcode : function(s) {\r
+                       s = tinymce.trim(s);\r
+\r
+                       function rep(re, str) {\r
+                               s = s.replace(re, str);\r
+                       };\r
+\r
+                       // example: <strong> to [b]\r
+                       rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");\r
+                       rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");\r
+                       rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");\r
+                       rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");\r
+                       rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");\r
+                       rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");\r
+                       rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");\r
+                       rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");\r
+                       rep(/<font>(.*?)<\/font>/gi,"$1");\r
+                       rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");\r
+                       rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");\r
+                       rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");\r
+                       rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");\r
+                       rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");\r
+                       rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");\r
+                       rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");\r
+                       rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");\r
+                       rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");\r
+                       rep(/<\/(strong|b)>/gi,"[/b]");\r
+                       rep(/<(strong|b)>/gi,"[b]");\r
+                       rep(/<\/(em|i)>/gi,"[/i]");\r
+                       rep(/<(em|i)>/gi,"[i]");\r
+                       rep(/<\/u>/gi,"[/u]");\r
+                       rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");\r
+                       rep(/<u>/gi,"[u]");\r
+                       rep(/<blockquote[^>]*>/gi,"[quote]");\r
+                       rep(/<\/blockquote>/gi,"[/quote]");\r
+                       rep(/<br \/>/gi,"\n");\r
+                       rep(/<br\/>/gi,"\n");\r
+                       rep(/<br>/gi,"\n");\r
+                       rep(/<p>/gi,"");\r
+                       rep(/<\/p>/gi,"\n");\r
+                       rep(/&nbsp;/gi," ");\r
+                       rep(/&quot;/gi,"\"");\r
+                       rep(/&lt;/gi,"<");\r
+                       rep(/&gt;/gi,">");\r
+                       rep(/&amp;/gi,"&");\r
+\r
+                       return s; \r
+               },\r
+\r
+               // BBCode -> HTML from PunBB dialect\r
+               _punbb_bbcode2html : function(s) {\r
+                       s = tinymce.trim(s);\r
+\r
+                       function rep(re, str) {\r
+                               s = s.replace(re, str);\r
+                       };\r
+\r
+                       // example: [b] to <strong>\r
+                       rep(/\n/gi,"<br />");\r
+                       rep(/\[b\]/gi,"<strong>");\r
+                       rep(/\[\/b\]/gi,"</strong>");\r
+                       rep(/\[i\]/gi,"<em>");\r
+                       rep(/\[\/i\]/gi,"</em>");\r
+                       rep(/\[u\]/gi,"<u>");\r
+                       rep(/\[\/u\]/gi,"</u>");\r
+                       rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");\r
+                       rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");\r
+                       rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");\r
+                       rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");\r
+                       rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span>&nbsp;");\r
+                       rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span>&nbsp;");\r
+\r
+                       return s; \r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/compat2x/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/compat2x/editor_plugin.js
new file mode 100644 (file)
index 0000000..d921728
--- /dev/null
@@ -0,0 +1 @@
+(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.is;tinymce.create("tinymce.plugins.Compat2x",{getInfo:function(){return{longname:"Compat2x",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/compat2x",version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}}});(function(){tinymce.extend(tinyMCE,{addToLang:function(f,e){d(e,function(h,g){tinyMCE.i18n[(tinyMCE.settings.language||"en")+"."+(f?f+"_":"")+g]=h})},getInstanceById:function(e){return this.get(e)}})})();(function(){var e=tinymce.EditorManager;tinyMCE.instances={};tinyMCE.plugins={};tinymce.PluginManager.onAdd.add(function(f,h,g){tinyMCE.plugins[h]=g});tinyMCE.majorVersion=tinymce.majorVersion;tinyMCE.minorVersion=tinymce.minorVersion;tinyMCE.releaseDate=tinymce.releaseDate;tinyMCE.baseURL=tinymce.baseURL;tinyMCE.isIE=tinyMCE.isMSIE=tinymce.isIE||tinymce.isOpera;tinyMCE.isMSIE5=tinymce.isIE;tinyMCE.isMSIE5_0=tinymce.isIE;tinyMCE.isMSIE7=tinymce.isIE;tinyMCE.isGecko=tinymce.isGecko;tinyMCE.isSafari=tinymce.isWebKit;tinyMCE.isOpera=tinymce.isOpera;tinyMCE.isMac=false;tinyMCE.isNS7=false;tinyMCE.isNS71=false;tinyMCE.compat=true;TinyMCE_Engine=tinyMCE;tinymce.extend(tinyMCE,{getParam:function(g,f){return this.activeEditor.getParam(g,f)},addEvent:function(i,g,h,j){tinymce.dom.Event.add(i,g,h,j||this)},getControlHTML:function(f){return e.activeEditor.controlManager.createControl(f)},loadCSS:function(f){tinymce.DOM.loadCSS(f)},importCSS:function(g,f){if(g==document){this.loadCSS(f)}else{new tinymce.dom.DOMUtils(g).loadCSS(f)}},log:function(){console.debug.apply(console,arguments)},getLang:function(h,g){var f=e.activeEditor.getLang(h.replace(/^lang_/g,""),g);if(/^[0-9\-.]+$/g.test(f)){return parseInt(f)}return f},isInstance:function(f){return f!=null&&typeof(f)=="object"&&f.execCommand},triggerNodeChange:function(){e.activeEditor.nodeChanged()},regexpReplace:function(j,f,h,i){var g;if(j==null){return j}if(typeof(i)=="undefined"){i="g"}g=new RegExp(f,i);return j.replace(g,h)},trim:function(f){return tinymce.trim(f)},xmlEncode:function(f){return tinymce.DOM.encode(f)},explode:function(f,h){var g=[];tinymce.each(f.split(h),function(i){if(i!=""){g.push(i)}});return g},switchClass:function(h,g){var f;if(/^mceButton/.test(g)){f=e.activeEditor.controlManager.get(h);if(!f){return}switch(g){case"mceButtonNormal":f.setDisabled(false);f.setActive(false);return;case"mceButtonDisabled":f.setDisabled(true);return;case"mceButtonSelected":f.setActive(true);f.setDisabled(false);return}}},addCSSClass:function(g,h,f){return tinymce.DOM.addClass(g,h,f)},hasCSSClass:function(f,g){return tinymce.DOM.hasClass(f,g)},removeCSSClass:function(f,g){return tinymce.DOM.removeClass(f,g)},getCSSClasses:function(){var f=e.activeEditor.dom.getClasses(),g=[];d(f,function(h){g.push(h["class"])});return g},setWindowArg:function(g,f){e.activeEditor.windowManager.params[g]=f},getWindowArg:function(i,g){var h=e.activeEditor.windowManager,f;f=h.getParam(i);if(f===""){return""}return f||h.getFeature(i)||g},getParentNode:function(h,g){return this._getDOM().getParent(h,g)},selectElements:function(o,k,m){var l,j=[],h,g;for(g=0,k=k.split(",");g<k.length;g++){for(l=0,h=o.getElementsByTagName(k[g]);l<h.length;l++){(!m||m(h[l]))&&j.push(h[l])}}return j},getNodeTree:function(i,f,g,h){return this.selectNodes(i,function(j){return(!g||j.nodeType==g)&&(!h||j.nodeName==h)},f?f:[])},getAttrib:function(g,h,f){return this._getDOM().getAttrib(g,h,f)},setAttrib:function(g,h,f){return this._getDOM().setAttrib(g,h,f)},getElementsByAttributeValue:function(m,k,g,h){var j,f=m.getElementsByTagName(k),l=[];for(j=0;j<f.length;j++){if(tinyMCE.getAttrib(f[j],g).indexOf(h)!=-1){l[l.length]=f[j]}}return l},selectNodes:function(k,j,g){var h;if(!g){g=[]}if(j(k)){g[g.length]=k}if(k.hasChildNodes()){for(h=0;h<k.childNodes.length;h++){tinyMCE.selectNodes(k.childNodes[h],j,g)}}return g},getContent:function(){return e.activeEditor.getContent()},getParentElement:function(i,g,h){if(g){g=new RegExp("^("+g.toUpperCase().replace(/,/g,"|")+")$","g")}return this._getDOM().getParent(i,function(f){return f.nodeType==1&&(!g||g.test(f.nodeName))&&(!h||h(f))},this.activeEditor.getBody())},importPluginLanguagePack:function(f){tinymce.PluginManager.requireLangPack(f)},getButtonHTML:function(l,j,h,k,i,g){var f=e.activeEditor;h=h.replace(/\{\$pluginurl\}/g,tinyMCE.pluginURL);h=h.replace(/\{\$themeurl\}/g,tinyMCE.themeURL);j=j.replace(/^lang_/g,"");return f.controlManager.createButton(l,{title:j,command:k,ui:i,value:g,scope:this,"class":"compat",image:h})},addSelectAccessibility:function(h,g,f){if(!g._isAccessible){g.onkeydown=tinyMCE.accessibleEventHandler;g.onblur=tinyMCE.accessibleEventHandler;g._isAccessible=true;g._win=f}return false},accessibleEventHandler:function(g){var h,f=this._win;g=tinymce.isIE?f.event:g;h=tinymce.isIE?g.srcElement:g.target;if(g.type=="blur"){if(h.oldonchange){h.onchange=h.oldonchange;h.oldonchange=null}return true}if(h.nodeName=="SELECT"&&!h.oldonchange){h.oldonchange=h.onchange;h.onchange=null}if(g.keyCode==13||g.keyCode==32){h.onchange=h.oldonchange;h.onchange();h.oldonchange=null;tinyMCE.cancelEvent(g);return false}return true},cancelEvent:function(f){return tinymce.dom.Event.cancel(f)},handleVisualAid:function(f){e.activeEditor.addVisual(f)},getAbsPosition:function(g,f){return tinymce.DOM.getPos(g,f)},cleanupEventStr:function(f){f=""+f;f=f.replace("function anonymous()\n{\n","");f=f.replace("\n}","");f=f.replace(/^return true;/gi,"");return f},getVisualAidClass:function(f){return f},parseStyle:function(f){return this._getDOM().parseStyle(f)},serializeStyle:function(f){return this._getDOM().serializeStyle(f)},openWindow:function(h,g){var f=e.activeEditor,i={},j;for(j in h){i[j]=h[j]}h=i;g=g||{};h.url=new tinymce.util.URI(tinymce.ThemeManager.themeURLs[f.settings.theme]).toAbsolute(h.file);h.inline=h.inline||g.inline;f.windowManager.open(h,g)},closeWindow:function(f){e.activeEditor.windowManager.close(f)},getOuterHTML:function(f){return tinymce.DOM.getOuterHTML(f)},setOuterHTML:function(g,f,i){return tinymce.DOM.setOuterHTML(g,f,i)},hasPlugin:function(f){return tinymce.PluginManager.get(f)!=null},_setEventsEnabled:function(){},addPlugin:function(g,i){var h=this;function j(f){tinyMCE.selectedInstance=f;f.onInit.add(function(){h.settings=f.settings;h.settings.base_href=tinyMCE.documentBasePath;tinyMCE.settings=h.settings;tinyMCE.documentBasePath=f.documentBasePath;if(i.initInstance){i.initInstance(f)}f.contentDocument=f.getDoc();f.contentWindow=f.getWin();f.undoRedo=f.undoManager;f.startContent=f.getContent({format:"raw"});tinyMCE.instances[f.id]=f;tinyMCE.loadedFiles=[]});f.onActivate.add(function(){tinyMCE.settings=f.settings;tinyMCE.selectedInstance=f});if(i.handleNodeChange){f.onNodeChange.add(function(l,k,m){i.handleNodeChange(l.id,m,0,0,false,!l.selection.isCollapsed())})}if(i.onChange){f.onChange.add(function(k,l){return i.onChange(k)})}if(i.cleanup){f.onGetContent.add(function(){})}this.getInfo=function(){return i.getInfo()};this.createControl=function(k){tinyMCE.pluginURL=tinymce.baseURL+"/plugins/"+g;tinyMCE.themeURL=tinymce.baseURL+"/themes/"+tinyMCE.activeEditor.settings.theme;if(i.getControlHTML){return i.getControlHTML(k)}return null};this.execCommand=function(l,k,m){if(i.execCommand){return i.execCommand(f.id,f.getBody(),l,k,m)}return false}}tinymce.PluginManager.add(g,j)},_getDOM:function(){return tinyMCE.activeEditor?tinyMCE.activeEditor.dom:tinymce.DOM},convertRelativeToAbsoluteURL:function(f,g){return new tinymce.util.URI(f).toAbsolute(g)},convertAbsoluteURLToRelativeURL:function(f,g){return new tinymce.util.URI(f).toRelative(g)}});tinymce.extend(tinymce.Editor.prototype,{getFocusElement:function(){return this.selection.getNode()},getData:function(f){if(!this.data){this.data=[]}if(!this.data[f]){this.data[f]=[]}return this.data[f]},hasPlugin:function(f){return this.plugins[f]!=null},getContainerWin:function(){return window},getHTML:function(f){return this.getContent({format:f?"raw":"html"})},setHTML:function(f){this.setContent(f)},getSel:function(){return this.selection.getSel()},getRng:function(){return this.selection.getRng()},isHidden:function(){var f;if(!tinymce.isGecko){return false}f=this.getSel();return(!f||!f.rangeCount||f.rangeCount==0)},translate:function(f){var h=this.settings.language,g;if(!f){return f}g=tinymce.EditorManager.i18n[h+"."+f]||f.replace(/{\#([^}]+)\}/g,function(j,i){return tinymce.EditorManager.i18n[h+"."+i]||"{#"+i+"}"});g=g.replace(/{\$lang_([^}]+)\}/g,function(j,i){return tinymce.EditorManager.i18n[h+"."+i]||"{$lang_"+i+"}"});return g},repaint:function(){this.execCommand("mceRepaint")}});tinymce.extend(tinymce.dom.Selection.prototype,{getSelectedText:function(){return this.getContent({format:"text"})},getSelectedHTML:function(){return this.getContent({format:"html"})},getFocusElement:function(){return this.getNode()},selectNode:function(i,j,g,f){var h=this;h.select(i,g||0);if(!b(j)){j=true}if(j){if(!b(f)){f=true}h.collapse(f)}}})}).call(this);tinymce.PluginManager.add("compat2x",tinymce.plugins.Compat2x)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/compat2x/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/compat2x/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..60d4f2d
--- /dev/null
@@ -0,0 +1,616 @@
+/**\r
+ * $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $\r
+ *\r
+ * @author Moxiecode\r
+ * @copyright Copyright Â© 2004-2008, Moxiecode Systems AB, All rights reserved.\r
+ */\r
+\r
+(function() {\r
+       var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is;\r
+\r
+       tinymce.create('tinymce.plugins.Compat2x', {\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Compat2x',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/compat2x',\r
+                               version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion\r
+                       };\r
+               }\r
+       });\r
+\r
+       (function() {\r
+               // Extend tinyMCE/EditorManager\r
+               tinymce.extend(tinyMCE, {\r
+                       addToLang : function(p, l) {\r
+                               each(l, function(v, k) {\r
+                                       tinyMCE.i18n[(tinyMCE.settings.language || 'en') + '.' + (p ? p + '_' : '') + k] = v;\r
+                               });\r
+                       },\r
+\r
+                       getInstanceById : function(n) {\r
+                               return this.get(n);\r
+                       }\r
+               });\r
+       })();\r
+\r
+       (function() {\r
+               var EditorManager = tinymce.EditorManager;\r
+\r
+               tinyMCE.instances = {};\r
+               tinyMCE.plugins = {};\r
+               tinymce.PluginManager.onAdd.add(function(pm, n, p) {\r
+                       tinyMCE.plugins[n] = p;\r
+               });\r
+\r
+               tinyMCE.majorVersion = tinymce.majorVersion;\r
+               tinyMCE.minorVersion = tinymce.minorVersion;\r
+               tinyMCE.releaseDate = tinymce.releaseDate;\r
+               tinyMCE.baseURL = tinymce.baseURL;\r
+               tinyMCE.isIE = tinyMCE.isMSIE = tinymce.isIE || tinymce.isOpera;\r
+               tinyMCE.isMSIE5 = tinymce.isIE;\r
+               tinyMCE.isMSIE5_0 = tinymce.isIE;\r
+               tinyMCE.isMSIE7 = tinymce.isIE;\r
+               tinyMCE.isGecko = tinymce.isGecko;\r
+               tinyMCE.isSafari = tinymce.isWebKit;\r
+               tinyMCE.isOpera = tinymce.isOpera;\r
+               tinyMCE.isMac = false;\r
+               tinyMCE.isNS7 = false;\r
+               tinyMCE.isNS71 = false;\r
+               tinyMCE.compat = true;\r
+\r
+               // Extend tinyMCE class\r
+               TinyMCE_Engine = tinyMCE;\r
+               tinymce.extend(tinyMCE, {\r
+                       getParam : function(n, dv) {\r
+                               return this.activeEditor.getParam(n, dv);\r
+                       },\r
+\r
+                       addEvent : function(e, na, f, sc) {\r
+                               tinymce.dom.Event.add(e, na, f, sc || this);\r
+                       },\r
+\r
+                       getControlHTML : function(n) {\r
+                               return EditorManager.activeEditor.controlManager.createControl(n);\r
+                       },\r
+\r
+                       loadCSS : function(u) {\r
+                               tinymce.DOM.loadCSS(u);\r
+                       },\r
+\r
+                       importCSS : function(doc, u) {\r
+                               if (doc == document)\r
+                                       this.loadCSS(u);\r
+                               else\r
+                                       new tinymce.dom.DOMUtils(doc).loadCSS(u);\r
+                       },\r
+\r
+                       log : function() {\r
+                               console.debug.apply(console, arguments);\r
+                       },\r
+\r
+                       getLang : function(n, dv) {\r
+                               var v = EditorManager.activeEditor.getLang(n.replace(/^lang_/g, ''), dv);\r
+\r
+                               // Is number\r
+                               if (/^[0-9\-.]+$/g.test(v))\r
+                                       return parseInt(v);\r
+\r
+                               return v;\r
+                       },\r
+\r
+                       isInstance : function(o) {\r
+                               return o != null && typeof(o) == "object" && o.execCommand;\r
+                       },\r
+\r
+                       triggerNodeChange : function() {\r
+                               EditorManager.activeEditor.nodeChanged();\r
+                       },\r
+\r
+                       regexpReplace : function(in_str, reg_exp, replace_str, opts) {\r
+                               var re;\r
+\r
+                               if (in_str == null)\r
+                                       return in_str;\r
+\r
+                               if (typeof(opts) == "undefined")\r
+                                       opts = 'g';\r
+\r
+                               re = new RegExp(reg_exp, opts);\r
+\r
+                               return in_str.replace(re, replace_str);\r
+                       },\r
+\r
+                       trim : function(s) {\r
+                               return tinymce.trim(s);\r
+                       },\r
+\r
+                       xmlEncode : function(s) {\r
+                               return tinymce.DOM.encode(s);\r
+                       },\r
+\r
+                       explode : function(s, d) {\r
+                               var o = [];\r
+\r
+                               tinymce.each(s.split(d), function(v) {\r
+                                       if (v != '')\r
+                                               o.push(v);\r
+                               });\r
+\r
+                               return o;\r
+                       },\r
+\r
+                       switchClass : function(id, cls) {\r
+                               var b;\r
+\r
+                               if (/^mceButton/.test(cls)) {\r
+                                       b = EditorManager.activeEditor.controlManager.get(id);\r
+\r
+                                       if (!b)\r
+                                               return;\r
+\r
+                                       switch (cls) {\r
+                                               case "mceButtonNormal":\r
+                                                       b.setDisabled(false);\r
+                                                       b.setActive(false);\r
+                                                       return;\r
+\r
+                                               case "mceButtonDisabled":\r
+                                                       b.setDisabled(true);\r
+                                                       return;\r
+\r
+                                               case "mceButtonSelected":\r
+                                                       b.setActive(true);\r
+                                                       b.setDisabled(false);\r
+                                                       return;\r
+                                       }\r
+                               }\r
+                       },\r
+\r
+                       addCSSClass : function(e, n, b) {\r
+                               return tinymce.DOM.addClass(e, n, b);\r
+                       },\r
+\r
+                       hasCSSClass : function(e, n) {\r
+                               return tinymce.DOM.hasClass(e, n);\r
+                       },\r
+\r
+                       removeCSSClass : function(e, n) {\r
+                               return tinymce.DOM.removeClass(e, n);\r
+                       },\r
+\r
+                       getCSSClasses : function() {\r
+                               var cl = EditorManager.activeEditor.dom.getClasses(), o = [];\r
+\r
+                               each(cl, function(c) {\r
+                                       o.push(c['class']);\r
+                               });\r
+\r
+                               return o;\r
+                       },\r
+\r
+                       setWindowArg : function(n, v) {\r
+                               EditorManager.activeEditor.windowManager.params[n] = v;\r
+                       },\r
+\r
+                       getWindowArg : function(n, dv) {\r
+                               var wm = EditorManager.activeEditor.windowManager, v;\r
+\r
+                               v = wm.getParam(n);\r
+                               if (v === '')\r
+                                       return '';\r
+\r
+                               return v || wm.getFeature(n) || dv;\r
+                       },\r
+\r
+                       getParentNode : function(n, f) {\r
+                               return this._getDOM().getParent(n, f);\r
+                       },\r
+\r
+                       selectElements : function(n, na, f) {\r
+                               var i, a = [], nl, x;\r
+\r
+                               for (x=0, na = na.split(','); x<na.length; x++)\r
+                                       for (i=0, nl = n.getElementsByTagName(na[x]); i<nl.length; i++)\r
+                                               (!f || f(nl[i])) && a.push(nl[i]);\r
+\r
+                               return a;\r
+                       },\r
+\r
+                       getNodeTree : function(n, na, t, nn) {\r
+                               return this.selectNodes(n, function(n) {\r
+                                       return (!t || n.nodeType == t) && (!nn || n.nodeName == nn);\r
+                               }, na ? na : []);\r
+                       },\r
+\r
+                       getAttrib : function(e, n, dv) {\r
+                               return this._getDOM().getAttrib(e, n, dv);\r
+                       },\r
+\r
+                       setAttrib : function(e, n, v) {\r
+                               return this._getDOM().setAttrib(e, n, v);\r
+                       },\r
+\r
+                       getElementsByAttributeValue : function(n, e, a, v) {\r
+                               var i, nl = n.getElementsByTagName(e), o = [];\r
+\r
+                               for (i=0; i<nl.length; i++) {\r
+                                       if (tinyMCE.getAttrib(nl[i], a).indexOf(v) != -1)\r
+                                               o[o.length] = nl[i];\r
+                               }\r
+\r
+                               return o;\r
+                       },\r
+\r
+                       selectNodes : function(n, f, a) {\r
+                               var i;\r
+\r
+                               if (!a)\r
+                                       a = [];\r
+\r
+                               if (f(n))\r
+                                       a[a.length] = n;\r
+\r
+                               if (n.hasChildNodes()) {\r
+                                       for (i=0; i<n.childNodes.length; i++)\r
+                                               tinyMCE.selectNodes(n.childNodes[i], f, a);\r
+                               }\r
+\r
+                               return a;\r
+                       },\r
+\r
+                       getContent : function() {\r
+                               return EditorManager.activeEditor.getContent();\r
+                       },\r
+\r
+                       getParentElement : function(n, na, f) {\r
+                               if (na)\r
+                                       na = new RegExp('^(' + na.toUpperCase().replace(/,/g, '|') + ')$', 'g');\r
+\r
+                               return this._getDOM().getParent(n, function(n) {\r
+                                       return n.nodeType == 1 && (!na || na.test(n.nodeName)) && (!f || f(n));\r
+                               }, this.activeEditor.getBody());\r
+                       },\r
+\r
+                       importPluginLanguagePack : function(n) {\r
+                               tinymce.PluginManager.requireLangPack(n);\r
+                       },\r
+\r
+                       getButtonHTML : function(cn, lang, img, c, u, v) {\r
+                               var ed = EditorManager.activeEditor;\r
+\r
+                               img = img.replace(/\{\$pluginurl\}/g, tinyMCE.pluginURL);\r
+                               img = img.replace(/\{\$themeurl\}/g, tinyMCE.themeURL);\r
+                               lang = lang.replace(/^lang_/g, '');\r
+\r
+                               return ed.controlManager.createButton(cn, {\r
+                                       title : lang,\r
+                                       command : c,\r
+                                       ui : u,\r
+                                       value : v,\r
+                                       scope : this,\r
+                                       'class' : 'compat',\r
+                                       image : img\r
+                               });\r
+                       },\r
+\r
+                       addSelectAccessibility : function(e, s, w) {\r
+                               // Add event handlers \r
+                               if (!s._isAccessible) {\r
+                                       s.onkeydown = tinyMCE.accessibleEventHandler;\r
+                                       s.onblur = tinyMCE.accessibleEventHandler;\r
+                                       s._isAccessible = true;\r
+                                       s._win = w;\r
+                               }\r
+\r
+                               return false;\r
+                       },\r
+\r
+                       accessibleEventHandler : function(e) {\r
+                               var elm, win = this._win;\r
+\r
+                               e = tinymce.isIE ? win.event : e;\r
+                               elm = tinymce.isIE ? e.srcElement : e.target;\r
+\r
+                               // Unpiggyback onchange on blur\r
+                               if (e.type == "blur") {\r
+                                       if (elm.oldonchange) {\r
+                                               elm.onchange = elm.oldonchange;\r
+                                               elm.oldonchange = null;\r
+                                       }\r
+\r
+                                       return true;\r
+                               }\r
+\r
+                               // Piggyback onchange\r
+                               if (elm.nodeName == "SELECT" && !elm.oldonchange) {\r
+                                       elm.oldonchange = elm.onchange;\r
+                                       elm.onchange = null;\r
+                               }\r
+\r
+                               // Execute onchange and remove piggyback\r
+                               if (e.keyCode == 13 || e.keyCode == 32) {\r
+                                       elm.onchange = elm.oldonchange;\r
+                                       elm.onchange();\r
+                                       elm.oldonchange = null;\r
+\r
+                                       tinyMCE.cancelEvent(e);\r
+                                       return false;\r
+                               }\r
+\r
+                               return true;\r
+                       },\r
+\r
+                       cancelEvent : function(e) {\r
+                               return tinymce.dom.Event.cancel(e);\r
+                       },\r
+\r
+                       handleVisualAid : function(e) {\r
+                               EditorManager.activeEditor.addVisual(e);\r
+                       },\r
+\r
+                       getAbsPosition : function(n, r) {\r
+                               return tinymce.DOM.getPos(n, r);\r
+                       },\r
+\r
+                       cleanupEventStr : function(s) {\r
+                               s = "" + s;\r
+                               s = s.replace('function anonymous()\n{\n', '');\r
+                               s = s.replace('\n}', '');\r
+                               s = s.replace(/^return true;/gi, ''); // Remove event blocker\r
+\r
+                               return s;\r
+                       },\r
+\r
+                       getVisualAidClass : function(s) {\r
+                               // TODO: Implement\r
+                               return s;\r
+                       },\r
+\r
+                       parseStyle : function(s) {\r
+                               return this._getDOM().parseStyle(s);\r
+                       },\r
+\r
+                       serializeStyle : function(s) {\r
+                               return this._getDOM().serializeStyle(s);\r
+                       },\r
+\r
+                       openWindow : function(tpl, args) {\r
+                               var ed = EditorManager.activeEditor, o = {}, n;\r
+\r
+                               // Convert name/value array to object\r
+                               for (n in tpl)\r
+                                       o[n] = tpl[n];\r
+\r
+                               tpl = o;\r
+\r
+                               args = args || {};\r
+                               tpl.url = new tinymce.util.URI(tinymce.ThemeManager.themeURLs[ed.settings.theme]).toAbsolute(tpl.file);\r
+                               tpl.inline = tpl.inline || args.inline;\r
+\r
+                               ed.windowManager.open(tpl, args);\r
+                       },\r
+\r
+                       closeWindow : function(win) {\r
+                               EditorManager.activeEditor.windowManager.close(win);\r
+                       },\r
+\r
+                       getOuterHTML : function(e) {\r
+                               return tinymce.DOM.getOuterHTML(e);\r
+                       },\r
+\r
+                       setOuterHTML : function(e, h, d) {\r
+                               return tinymce.DOM.setOuterHTML(e, h, d);\r
+                       },\r
+\r
+                       hasPlugin : function(n) {\r
+                               return tinymce.PluginManager.get(n) != null;\r
+                       },\r
+\r
+                       _setEventsEnabled : function() {\r
+                               // Ignore it!!\r
+                       },\r
+\r
+                       addPlugin : function(pn, f) {\r
+                               var t = this;\r
+\r
+                               function PluginWrapper(ed) {\r
+                                       tinyMCE.selectedInstance = ed;\r
+\r
+                                       ed.onInit.add(function() {\r
+                                               t.settings = ed.settings;\r
+                                               t.settings['base_href'] = tinyMCE.documentBasePath;\r
+                                               tinyMCE.settings = t.settings;\r
+                                               tinyMCE.documentBasePath = ed.documentBasePath;\r
+                                               //ed.formElement = DOM.get(ed.id);\r
+\r
+                                               if (f.initInstance)\r
+                                                       f.initInstance(ed);\r
+\r
+                                               ed.contentDocument = ed.getDoc();\r
+                                               ed.contentWindow = ed.getWin();\r
+                                               ed.undoRedo = ed.undoManager;\r
+                                               ed.startContent = ed.getContent({format : 'raw'});\r
+\r
+                                               tinyMCE.instances[ed.id] = ed;\r
+                                               tinyMCE.loadedFiles = [];\r
+                                       });\r
+\r
+                                       ed.onActivate.add(function() {\r
+                                               tinyMCE.settings = ed.settings;\r
+                                               tinyMCE.selectedInstance = ed;\r
+                                       });\r
+\r
+                               /*      if (f.removeInstance) {\r
+                                               ed.onDestroy.add(function() {\r
+                                                       return f.removeInstance(ed.id);\r
+                                               });\r
+                                       }*/\r
+\r
+                                       if (f.handleNodeChange) {\r
+                                               ed.onNodeChange.add(function(ed, cm, n) {\r
+                                                       f.handleNodeChange(ed.id, n, 0, 0, false, !ed.selection.isCollapsed());\r
+                                               });\r
+                                       }\r
+\r
+                                       if (f.onChange) {\r
+                                               ed.onChange.add(function(ed, n) {\r
+                                                       return f.onChange(ed);\r
+                                               });\r
+                                       }\r
+\r
+                                       if (f.cleanup) {\r
+                                               ed.onGetContent.add(function() {\r
+                                                       //f.cleanup(type, content, inst);\r
+                                               });\r
+                                       }\r
+\r
+                                       this.getInfo = function() {\r
+                                               return f.getInfo();\r
+                                       };\r
+\r
+                                       this.createControl = function(n) {\r
+                                               tinyMCE.pluginURL = tinymce.baseURL + '/plugins/' + pn;\r
+                                               tinyMCE.themeURL = tinymce.baseURL + '/themes/' + tinyMCE.activeEditor.settings.theme;\r
+\r
+                                               if (f.getControlHTML)\r
+                                                       return f.getControlHTML(n);\r
+\r
+                                               return null;\r
+                                       };\r
+\r
+                                       this.execCommand = function(cmd, ui, val) {\r
+                                               if (f.execCommand)\r
+                                                       return f.execCommand(ed.id, ed.getBody(), cmd, ui, val);\r
+\r
+                                               return false;\r
+                                       };\r
+                               };\r
+\r
+                               tinymce.PluginManager.add(pn, PluginWrapper);\r
+                       },\r
+\r
+                       _getDOM : function() {\r
+                               return tinyMCE.activeEditor ? tinyMCE.activeEditor.dom : tinymce.DOM;\r
+                       },\r
+\r
+                       convertRelativeToAbsoluteURL : function(b, u) {\r
+                               return new tinymce.util.URI(b).toAbsolute(u);\r
+                       },\r
+\r
+                       convertAbsoluteURLToRelativeURL : function(b, u) {\r
+                               return new tinymce.util.URI(b).toRelative(u);\r
+                       }\r
+               });\r
+\r
+               // Extend Editor class\r
+               tinymce.extend(tinymce.Editor.prototype, {\r
+                       getFocusElement : function() {\r
+                               return this.selection.getNode();\r
+                       },\r
+\r
+                       getData : function(n) {\r
+                               if (!this.data)\r
+                                       this.data = [];\r
+\r
+                               if (!this.data[n])\r
+                                       this.data[n] = [];\r
+\r
+                               return this.data[n];\r
+                       },\r
+\r
+                       hasPlugin : function(n) {\r
+                               return this.plugins[n] != null;\r
+                       },\r
+\r
+                       getContainerWin : function() {\r
+                               return window;\r
+                       },\r
+\r
+                       getHTML : function(raw) {\r
+                               return this.getContent({ format : raw ? 'raw' : 'html'});\r
+                       },\r
+\r
+                       setHTML : function(h) {\r
+                               this.setContent(h);\r
+                       },\r
+\r
+                       getSel : function() {\r
+                               return this.selection.getSel();\r
+                       },\r
+\r
+                       getRng : function() {\r
+                               return this.selection.getRng();\r
+                       },\r
+\r
+                       isHidden : function() {\r
+                               var s;\r
+\r
+                               if (!tinymce.isGecko)\r
+                                       return false;\r
+\r
+                               s = this.getSel();\r
+\r
+                               // Weird, wheres that cursor selection?\r
+                               return (!s || !s.rangeCount || s.rangeCount == 0);\r
+                       },\r
+\r
+                       translate : function(s) {\r
+                               var c = this.settings.language, o;\r
+\r
+                               if (!s)\r
+                                       return s;\r
+\r
+                               o = tinymce.EditorManager.i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) {\r
+                                       return tinymce.EditorManager.i18n[c + '.' + b] || '{#' + b + '}';\r
+                               });\r
+\r
+                               o = o.replace(/{\$lang_([^}]+)\}/g, function(a, b) {\r
+                                       return tinymce.EditorManager.i18n[c + '.' + b] || '{$lang_' + b + '}';\r
+                               });\r
+\r
+                               return o;\r
+                       },\r
+\r
+                       repaint : function() {\r
+                               this.execCommand('mceRepaint');\r
+                       }\r
+               });\r
+\r
+               // Extend selection\r
+               tinymce.extend(tinymce.dom.Selection.prototype, {\r
+                       getSelectedText : function() {\r
+                               return this.getContent({format : 'text'});\r
+                       },\r
+\r
+                       getSelectedHTML : function() {\r
+                               return this.getContent({format : 'html'});\r
+                       },\r
+\r
+                       getFocusElement : function() {\r
+                               return this.getNode();\r
+                       },\r
+\r
+                       selectNode : function(node, collapse, select_text_node, to_start) {\r
+                               var t = this;\r
+\r
+                               t.select(node, select_text_node || 0);\r
+\r
+                               if (!is(collapse))\r
+                                       collapse = true;\r
+\r
+                               if (collapse) {\r
+                                       if (!is(to_start))\r
+                                               to_start = true;\r
+\r
+                                       t.collapse(to_start);\r
+                               }\r
+                       }\r
+               });\r
+       }).call(this);\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('compat2x', tinymce.plugins.Compat2x);\r
+})();\r
+\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js
new file mode 100644 (file)
index 0000000..24ee2eb
--- /dev/null
@@ -0,0 +1 @@
+(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(d){var f=this;f.editor=d;f.onContextMenu=new tinymce.util.Dispatcher(this);d.onContextMenu.add(function(g,h){if(!h.ctrlKey){f._getMenu(g).showMenu(h.clientX,h.clientY);a.add(g.getDoc(),"click",e);a.cancel(h)}});function e(){if(f._menu){f._menu.removeAll();f._menu.destroy();a.remove(d.getDoc(),"click",e)}}d.onMouseDown.add(e);d.onKeyDown.add(e)},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1});l._menu=f;f.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(e);f.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(e);f.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((d.nodeName=="A"&&!h.dom.getAttrib(d,"name"))||!e){f.addSeparator();f.add({title:"advanced.link_desc",icon:"link",cmd:h.plugins.advlink?"mceAdvLink":"mceLink",ui:true});f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}f.addSeparator();f.add({title:"advanced.image_desc",icon:"image",cmd:h.plugins.advimage?"mceAdvImage":"mceImage",ui:true});f.addSeparator();g=f.addMenu({title:"contextmenu.align"});g.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});g.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});g.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});g.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});l.onContextMenu.dispatch(l,f,d,e);return f}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..26e9ce2
--- /dev/null
@@ -0,0 +1,127 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM;\r
+\r
+       /**\r
+        * This plugin a context menu to TinyMCE editor instances.\r
+        *\r
+        * @class tinymce.plugins.ContextMenu\r
+        */\r
+       tinymce.create('tinymce.plugins.ContextMenu', {\r
+               /**\r
+                * Initializes the plugin, this will be executed after the plugin has been created.\r
+                * This call is done before the editor instance has finished it's initialization so use the onInit event\r
+                * of the editor instance to intercept that event.\r
+                *\r
+                * @method init\r
+                * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.\r
+                * @param {string} url Absolute URL to where the plugin is located.\r
+                */\r
+               init : function(ed) {\r
+                       var t = this;\r
+\r
+                       t.editor = ed;\r
+\r
+                       /**\r
+                        * This event gets fired when the context menu is shown.\r
+                        *\r
+                        * @event onContextMenu\r
+                        * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event.\r
+                        * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed.\r
+                        */\r
+                       t.onContextMenu = new tinymce.util.Dispatcher(this);\r
+\r
+                       ed.onContextMenu.add(function(ed, e) {\r
+                               if (!e.ctrlKey) {\r
+                                       t._getMenu(ed).showMenu(e.clientX, e.clientY);\r
+                                       Event.add(ed.getDoc(), 'click', hide);\r
+                                       Event.cancel(e);\r
+                               }\r
+                       });\r
+\r
+                       function hide() {\r
+                               if (t._menu) {\r
+                                       t._menu.removeAll();\r
+                                       t._menu.destroy();\r
+                                       Event.remove(ed.getDoc(), 'click', hide);\r
+                               }\r
+                       };\r
+\r
+                       ed.onMouseDown.add(hide);\r
+                       ed.onKeyDown.add(hide);\r
+               },\r
+\r
+               /**\r
+                * Returns information about the plugin as a name/value array.\r
+                * The current keys are longname, author, authorurl, infourl and version.\r
+                *\r
+                * @method getInfo\r
+                * @return {Object} Name/value array containing information about the plugin.\r
+                */\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Contextmenu',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               },\r
+\r
+               _getMenu : function(ed) {\r
+                       var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2;\r
+\r
+                       if (m) {\r
+                               m.removeAll();\r
+                               m.destroy();\r
+                       }\r
+\r
+                       p1 = DOM.getPos(ed.getContentAreaContainer());\r
+                       p2 = DOM.getPos(ed.getContainer());\r
+\r
+                       m = ed.controlManager.createDropMenu('contextmenu', {\r
+                               offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0),\r
+                               offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0),\r
+                               constrain : 1\r
+                       });\r
+\r
+                       t._menu = m;\r
+\r
+                       m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col);\r
+                       m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col);\r
+                       m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'});\r
+\r
+                       if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) {\r
+                               m.addSeparator();\r
+                               m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});\r
+                               m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});\r
+                       }\r
+\r
+                       m.addSeparator();\r
+                       m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});\r
+\r
+                       m.addSeparator();\r
+                       am = m.addMenu({title : 'contextmenu.align'});\r
+                       am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'});\r
+                       am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'});\r
+                       am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'});\r
+                       am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'});\r
+\r
+                       t.onContextMenu.dispatch(t, m, el, col);\r
+\r
+                       return m;\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/directionality/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/directionality/editor_plugin.js
new file mode 100644 (file)
index 0000000..bce8e73
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceDirectionLTR",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="ltr"){a.dom.setAttrib(d,"dir","ltr")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addCommand("mceDirectionRTL",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="rtl"){a.dom.setAttrib(d,"dir","rtl")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});a.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});a.onNodeChange.add(c._nodeChange,c)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..4444959
--- /dev/null
@@ -0,0 +1,82 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.Directionality', {\r
+               init : function(ed, url) {\r
+                       var t = this;\r
+\r
+                       t.editor = ed;\r
+\r
+                       ed.addCommand('mceDirectionLTR', function() {\r
+                               var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);\r
+\r
+                               if (e) {\r
+                                       if (ed.dom.getAttrib(e, "dir") != "ltr")\r
+                                               ed.dom.setAttrib(e, "dir", "ltr");\r
+                                       else\r
+                                               ed.dom.setAttrib(e, "dir", "");\r
+                               }\r
+\r
+                               ed.nodeChanged();\r
+                       });\r
+\r
+                       ed.addCommand('mceDirectionRTL', function() {\r
+                               var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);\r
+\r
+                               if (e) {\r
+                                       if (ed.dom.getAttrib(e, "dir") != "rtl")\r
+                                               ed.dom.setAttrib(e, "dir", "rtl");\r
+                                       else\r
+                                               ed.dom.setAttrib(e, "dir", "");\r
+                               }\r
+\r
+                               ed.nodeChanged();\r
+                       });\r
+\r
+                       ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});\r
+                       ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'});\r
+\r
+                       ed.onNodeChange.add(t._nodeChange, t);\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Directionality',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               },\r
+\r
+               // Private methods\r
+\r
+               _nodeChange : function(ed, cm, n) {\r
+                       var dom = ed.dom, dir;\r
+\r
+                       n = dom.getParent(n, dom.isBlock);\r
+                       if (!n) {\r
+                               cm.setDisabled('ltr', 1);\r
+                               cm.setDisabled('rtl', 1);\r
+                               return;\r
+                       }\r
+\r
+                       dir = dom.getAttrib(n, 'dir');\r
+                       cm.setActive('ltr', dir == "ltr");\r
+                       cm.setDisabled('ltr', 0);\r
+                       cm.setActive('rtl', dir == "rtl");\r
+                       cm.setDisabled('rtl', 0);\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/emotions/editor_plugin.js
new file mode 100644 (file)
index 0000000..dbdd8ff
--- /dev/null
@@ -0,0 +1 @@
+(function(a){a.create("tinymce.plugins.EmotionsPlugin",{init:function(b,c){b.addCommand("mceEmotion",function(){b.windowManager.open({file:c+"/emotions.htm",width:250+parseInt(b.getLang("emotions.delta_width",0)),height:160+parseInt(b.getLang("emotions.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("emotions",{title:"emotions.emotions_desc",cmd:"mceEmotion"})},getInfo:function(){return{longname:"Emotions",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("emotions",a.plugins.EmotionsPlugin)})(tinymce);
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..71d5416
--- /dev/null
@@ -0,0 +1,43 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function(tinymce) {\r
+       tinymce.create('tinymce.plugins.EmotionsPlugin', {\r
+               init : function(ed, url) {\r
+                       // Register commands\r
+                       ed.addCommand('mceEmotion', function() {\r
+                               ed.windowManager.open({\r
+                                       file : url + '/emotions.htm',\r
+                                       width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)),\r
+                                       height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)),\r
+                                       inline : 1\r
+                               }, {\r
+                                       plugin_url : url\r
+                               });\r
+                       });\r
+\r
+                       // Register buttons\r
+                       ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'});\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Emotions',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin);\r
+})(tinymce);
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/emotions.htm b/docs/include/jscripts/tiny_mce/plugins/emotions/emotions.htm
new file mode 100644 (file)
index 0000000..55a1d72
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#emotions_dlg.title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="js/emotions.js"></script>\r
+</head>\r
+<body style="display: none">\r
+       <div align="center">\r
+               <div class="title">{#emotions_dlg.title}:<br /><br /></div>\r
+\r
+               <table border="0" cellspacing="0" cellpadding="4">\r
+                 <tr>\r
+                       <td><a href="javascript:EmotionsDialog.insert('smiley-cool.gif','emotions_dlg.cool');"><img src="img/smiley-cool.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cool}" title="{#emotions_dlg.cool}" /></a></td>\r
+                       <td><a href="javascript:EmotionsDialog.insert('smiley-cry.gif','emotions_dlg.cry');"><img src="img/smiley-cry.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cry}" title="{#emotions_dlg.cry}" /></a></td>\r
+                       <td><a href="javascript:EmotionsDialog.insert('smiley-embarassed.gif','emotions_dlg.embarassed');"><img src="img/smiley-embarassed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.embarassed}" title="{#emotions_dlg.embarassed}" /></a></td>\r
+                       <td><a href="javascript:EmotionsDialog.insert('smiley-foot-in-mouth.gif','emotions_dlg.foot_in_mouth');"><img src="img/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.foot_in_mouth}" title="{#emotions_dlg.foot_in_mouth}" /></a></td>\r
+                 </tr>\r
+                 <tr>\r
+                       <td><a href="javascript:EmotionsDialog.insert('smiley-frown.gif','emotions_dlg.frown');"><img src="img/smiley-frown.gif" width="18" height="18" border="0" alt="{#emotions_dlg.frown}" title="{#emotions_dlg.frown}" /></a></td>\r
+                       <td><a href="javascript:EmotionsDialog.insert('smiley-innocent.gif','emotions_dlg.innocent');"><img src="img/smiley-innocent.gif" width="18" height="18" border="0" alt="{#emotions_dlg.innocent}" title="{#emotions_dlg.innocent}" /></a></td>\r
+                       <td><a href="javascript:EmotionsDialog.insert('smiley-kiss.gif','emotions_dlg.kiss');"><img src="img/smiley-kiss.gif" width="18" height="18" border="0" alt="{#emotions_dlg.kiss}" title="{#emotions_dlg.kiss}" /></a></td>\r
+                       <td><a href="javascript:EmotionsDialog.insert('smiley-laughing.gif','emotions_dlg.laughing');"><img src="img/smiley-laughing.gif" width="18" height="18" border="0" alt="{#emotions_dlg.laughing}" title="{#emotions_dlg.laughing}" /></a></td>\r
+                 </tr>\r
+                 <tr>\r
+                       <td><a href="javascript:EmotionsDialog.insert('smiley-money-mouth.gif','emotions_dlg.money_mouth');"><img src="img/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.money_mouth}" title="{#emotions_dlg.money_mouth}" /></a></td>\r
+                       <td><a href="javascript:EmotionsDialog.insert('smiley-sealed.gif','emotions_dlg.sealed');"><img src="img/smiley-sealed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.sealed}" title="{#emotions_dlg.sealed}" /></a></td>\r
+                       <td><a href="javascript:EmotionsDialog.insert('smiley-smile.gif','emotions_dlg.smile');"><img src="img/smiley-smile.gif" width="18" height="18" border="0" alt="{#emotions_dlg.smile}" title="{#emotions_dlg.smile}" /></a></td>\r
+                       <td><a href="javascript:EmotionsDialog.insert('smiley-surprised.gif','emotions_dlg.surprised');"><img src="img/smiley-surprised.gif" width="18" height="18" border="0" alt="{#emotions_dlg.surprised}" title="{#emotions_dlg.surprised}" /></a></td>\r
+                 </tr>\r
+                 <tr>\r
+                       <td><a href="javascript:EmotionsDialog.insert('smiley-tongue-out.gif','emotions_dlg.tongue_out');"><img src="img/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{#emotions_dlg.tongue-out}" title="{#emotions_dlg.tongue_out}" /></a></td>\r
+                       <td><a href="javascript:EmotionsDialog.insert('smiley-undecided.gif','emotions_dlg.undecided');"><img src="img/smiley-undecided.gif" width="18" height="18" border="0" alt="{#emotions_dlg.undecided}" title="{#emotions_dlg.undecided}" /></a></td>\r
+                       <td><a href="javascript:EmotionsDialog.insert('smiley-wink.gif','emotions_dlg.wink');"><img src="img/smiley-wink.gif" width="18" height="18" border="0" alt="{#emotions_dlg.wink}" title="{#emotions_dlg.wink}" /></a></td>\r
+                       <td><a href="javascript:EmotionsDialog.insert('smiley-yell.gif','emotions_dlg.yell');"><img src="img/smiley-yell.gif" width="18" height="18" border="0" alt="{#emotions_dlg.yell}" title="{#emotions_dlg.yell}" /></a></td>\r
+                 </tr>\r
+               </table>\r
+       </div>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif
new file mode 100644 (file)
index 0000000..ba90cc3
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif
new file mode 100644 (file)
index 0000000..74d897a
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif
new file mode 100644 (file)
index 0000000..963a96b
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif
new file mode 100644 (file)
index 0000000..16f68cc
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif
new file mode 100644 (file)
index 0000000..716f55e
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif
new file mode 100644 (file)
index 0000000..334d49e
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif
new file mode 100644 (file)
index 0000000..4efd549
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif
new file mode 100644 (file)
index 0000000..1606c11
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif
new file mode 100644 (file)
index 0000000..ca2451e
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif
new file mode 100644 (file)
index 0000000..b33d3cc
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif
new file mode 100644 (file)
index 0000000..e6a9e60
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif
new file mode 100644 (file)
index 0000000..cb99cdd
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif
new file mode 100644 (file)
index 0000000..2075dc1
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif
new file mode 100644 (file)
index 0000000..bef7e25
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif
new file mode 100644 (file)
index 0000000..9faf1af
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif
new file mode 100644 (file)
index 0000000..648e6e8
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/js/emotions.js b/docs/include/jscripts/tiny_mce/plugins/emotions/js/emotions.js
new file mode 100644 (file)
index 0000000..c549367
--- /dev/null
@@ -0,0 +1,22 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+var EmotionsDialog = {\r
+       init : function(ed) {\r
+               tinyMCEPopup.resizeToInnerSize();\r
+       },\r
+\r
+       insert : function(file, title) {\r
+               var ed = tinyMCEPopup.editor, dom = ed.dom;\r
+\r
+               tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {\r
+                       src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,\r
+                       alt : ed.getLang(title),\r
+                       title : ed.getLang(title),\r
+                       border : 0\r
+               }));\r
+\r
+               tinyMCEPopup.close();\r
+       }\r
+};\r
+\r
+tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js b/docs/include/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js
new file mode 100644 (file)
index 0000000..3b57ad9
--- /dev/null
@@ -0,0 +1,20 @@
+tinyMCE.addI18n('en.emotions_dlg',{\r
+title:"Insert emotion",\r
+desc:"Emotions",\r
+cool:"Cool",\r
+cry:"Cry",\r
+embarassed:"Embarassed",\r
+foot_in_mouth:"Foot in mouth",\r
+frown:"Frown",\r
+innocent:"Innocent",\r
+kiss:"Kiss",\r
+laughing:"Laughing",\r
+money_mouth:"Money mouth",\r
+sealed:"Sealed",\r
+smile:"Smile",\r
+surprised:"Surprised",\r
+tongue_out:"Tongue out",\r
+undecided:"Undecided",\r
+wink:"Wink",\r
+yell:"Yell"\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/example/dialog.htm b/docs/include/jscripts/tiny_mce/plugins/example/dialog.htm
new file mode 100644 (file)
index 0000000..50b2b34
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#example_dlg.title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="js/dialog.js"></script>\r
+</head>\r
+<body>\r
+\r
+<form onsubmit="ExampleDialog.insert();return false;" action="#">\r
+       <p>Here is a example dialog.</p>\r
+       <p>Selected text: <input id="someval" name="someval" type="text" class="text" /></p>\r
+       <p>Custom arg: <input id="somearg" name="somearg" type="text" class="text" /></p>\r
+\r
+       <div class="mceActionPanel">\r
+               <input type="button" id="insert" name="insert" value="{#insert}" onclick="ExampleDialog.insert();" />\r
+               <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+       </div>\r
+</form>\r
+\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/example/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/example/editor_plugin.js
new file mode 100644 (file)
index 0000000..ec1f81e
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/example/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/example/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..9a0e7da
--- /dev/null
@@ -0,0 +1,84 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       // Load plugin specific language pack\r
+       tinymce.PluginManager.requireLangPack('example');\r
+\r
+       tinymce.create('tinymce.plugins.ExamplePlugin', {\r
+               /**\r
+                * Initializes the plugin, this will be executed after the plugin has been created.\r
+                * This call is done before the editor instance has finished it's initialization so use the onInit event\r
+                * of the editor instance to intercept that event.\r
+                *\r
+                * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.\r
+                * @param {string} url Absolute URL to where the plugin is located.\r
+                */\r
+               init : function(ed, url) {\r
+                       // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');\r
+                       ed.addCommand('mceExample', function() {\r
+                               ed.windowManager.open({\r
+                                       file : url + '/dialog.htm',\r
+                                       width : 320 + parseInt(ed.getLang('example.delta_width', 0)),\r
+                                       height : 120 + parseInt(ed.getLang('example.delta_height', 0)),\r
+                                       inline : 1\r
+                               }, {\r
+                                       plugin_url : url, // Plugin absolute URL\r
+                                       some_custom_arg : 'custom arg' // Custom argument\r
+                               });\r
+                       });\r
+\r
+                       // Register example button\r
+                       ed.addButton('example', {\r
+                               title : 'example.desc',\r
+                               cmd : 'mceExample',\r
+                               image : url + '/img/example.gif'\r
+                       });\r
+\r
+                       // Add a node change handler, selects the button in the UI when a image is selected\r
+                       ed.onNodeChange.add(function(ed, cm, n) {\r
+                               cm.setActive('example', n.nodeName == 'IMG');\r
+                       });\r
+               },\r
+\r
+               /**\r
+                * Creates control instances based in the incomming name. This method is normally not\r
+                * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons\r
+                * but you sometimes need to create more complex controls like listboxes, split buttons etc then this\r
+                * method can be used to create those.\r
+                *\r
+                * @param {String} n Name of the control to create.\r
+                * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.\r
+                * @return {tinymce.ui.Control} New control instance or null if no control was created.\r
+                */\r
+               createControl : function(n, cm) {\r
+                       return null;\r
+               },\r
+\r
+               /**\r
+                * Returns information about the plugin as a name/value array.\r
+                * The current keys are longname, author, authorurl, infourl and version.\r
+                *\r
+                * @return {Object} Name/value array containing information about the plugin.\r
+                */\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Example plugin',\r
+                               author : 'Some author',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',\r
+                               version : "1.0"\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/example/img/example.gif b/docs/include/jscripts/tiny_mce/plugins/example/img/example.gif
new file mode 100644 (file)
index 0000000..1ab5da4
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/example/img/example.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/example/js/dialog.js b/docs/include/jscripts/tiny_mce/plugins/example/js/dialog.js
new file mode 100644 (file)
index 0000000..fa83411
--- /dev/null
@@ -0,0 +1,19 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+var ExampleDialog = {\r
+       init : function() {\r
+               var f = document.forms[0];\r
+\r
+               // Get the selected contents as text and place it in the input\r
+               f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'});\r
+               f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg');\r
+       },\r
+\r
+       insert : function() {\r
+               // Insert the contents from the input into the document\r
+               tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value);\r
+               tinyMCEPopup.close();\r
+       }\r
+};\r
+\r
+tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/example/langs/en.js b/docs/include/jscripts/tiny_mce/plugins/example/langs/en.js
new file mode 100644 (file)
index 0000000..e0784f8
--- /dev/null
@@ -0,0 +1,3 @@
+tinyMCE.addI18n('en.example',{\r
+       desc : 'This is just a template button'\r
+});\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/example/langs/en_dlg.js b/docs/include/jscripts/tiny_mce/plugins/example/langs/en_dlg.js
new file mode 100644 (file)
index 0000000..ebcf948
--- /dev/null
@@ -0,0 +1,3 @@
+tinyMCE.addI18n('en.example_dlg',{\r
+       title : 'This is just a example title'\r
+});\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css b/docs/include/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css
new file mode 100644 (file)
index 0000000..7a3334f
--- /dev/null
@@ -0,0 +1,182 @@
+/* Hide the advanced tab */\r
+#advanced_tab {\r
+       display: none;\r
+}\r
+\r
+#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright {\r
+       width: 280px;\r
+}\r
+\r
+#doctype, #docencoding {\r
+       width: 200px;\r
+}\r
+\r
+#langcode {\r
+       width: 30px;\r
+}\r
+\r
+#bgimage {\r
+       width: 220px;   \r
+}\r
+\r
+#fontface {\r
+       width: 240px;\r
+}\r
+\r
+#leftmargin, #rightmargin, #topmargin, #bottommargin {\r
+       width: 50px;\r
+}\r
+\r
+.panel_wrapper div.current {\r
+       height: 400px;\r
+}\r
+\r
+#stylesheet, #style {\r
+       width: 240px;\r
+}\r
+\r
+/* Head list classes */\r
+\r
+.headlistwrapper {\r
+       width: 100%;\r
+}\r
+\r
+.addbutton, .removebutton, .moveupbutton, .movedownbutton {\r
+       border-top: 1px solid;\r
+       border-left: 1px solid;\r
+       border-bottom: 1px solid;\r
+       border-right: 1px solid;\r
+       border-color: #F0F0EE;\r
+       cursor: default;\r
+       display: block;\r
+       width: 20px;\r
+       height: 20px;\r
+}\r
+\r
+#doctypes {\r
+       width: 200px;\r
+}\r
+\r
+.addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover {\r
+       border: 1px solid #0A246A;\r
+       background-color: #B6BDD2;\r
+}\r
+\r
+.addbutton {\r
+       background-image: url('../images/add.gif');\r
+       float: left;\r
+       margin-right: 3px;\r
+}\r
+\r
+.removebutton {\r
+       background-image: url('../images/remove.gif');\r
+       float: left;\r
+}\r
+\r
+.moveupbutton {\r
+       background-image: url('../images/move_up.gif');\r
+       float: left;\r
+       margin-right: 3px;\r
+}\r
+\r
+.movedownbutton {\r
+       background-image: url('../images/move_down.gif');\r
+       float: left;\r
+}\r
+\r
+.selected {\r
+       border: 1px solid #0A246A;\r
+       background-color: #B6BDD2;\r
+}\r
+\r
+.toolbar {\r
+       width: 100%;\r
+}\r
+\r
+#headlist {\r
+       width: 100%;\r
+       margin-top: 3px;\r
+       font-size: 11px;\r
+}\r
+\r
+#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element {\r
+       display: none;\r
+}\r
+\r
+#addmenu {\r
+       position: absolute;\r
+       border: 1px solid gray;\r
+       display: none;\r
+       z-index: 100;\r
+       background-color: white;\r
+}\r
+\r
+#addmenu a {\r
+       display: block;\r
+       width: 100%;\r
+       line-height: 20px;\r
+       text-decoration: none;\r
+       background-color: white;\r
+}\r
+\r
+#addmenu a:hover {\r
+       background-color: #B6BDD2;\r
+       color: black;\r
+}\r
+\r
+#addmenu span {\r
+       padding-left: 10px;\r
+       padding-right: 10px;\r
+}\r
+\r
+#updateElementPanel {\r
+       display: none;\r
+}\r
+\r
+#script_element .panel_wrapper div.current {\r
+       height: 108px;\r
+}\r
+\r
+#style_element .panel_wrapper div.current {\r
+       height: 108px;\r
+}\r
+\r
+#link_element  .panel_wrapper div.current {\r
+       height: 140px;\r
+}\r
+\r
+#element_script_value {\r
+       width: 100%;\r
+       height: 100px;\r
+}\r
+\r
+#element_comment_value {\r
+       width: 100%;\r
+       height: 120px;\r
+}\r
+\r
+#element_style_value {\r
+       width: 100%;\r
+       height: 100px;\r
+}\r
+\r
+#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title {\r
+       width: 250px;\r
+}\r
+\r
+.updateElementButton {\r
+       margin-top: 3px;\r
+}\r
+\r
+/* MSIE specific styles */\r
+\r
+* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton {\r
+       width: 22px;\r
+       height: 22px;\r
+}\r
+\r
+textarea {\r
+       height: 55px;\r
+}\r
+\r
+.panel_wrapper div.current {height:420px;}
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js
new file mode 100644 (file)
index 0000000..8e11bfc
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceFullPageProperties",function(){a.windowManager.open({file:b+"/fullpage.htm",width:430+parseInt(a.getLang("fullpage.delta_width",0)),height:495+parseInt(a.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:b,head_html:c.head})});a.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});a.onBeforeSetContent.add(c._setContent,c);a.onSetContent.add(c._setBodyAttribs,c);a.onGetContent.add(c._getContent,c)},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}},_setBodyAttribs:function(d,a){var l,c,e,g,b,h,j,f=this.head.match(/body(.*?)>/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<e;c++){g=l[c].split("=");b=g[0].replace(/\s/,"");h=g[1];if(h){h=h.replace(/^\s+/,"").replace(/\s+$/,"");j=h.match(/^["'](.*)["']$/);if(j){h=j[1]}}else{h=b}d.dom.setAttrib(d.getBody(),"style",h)}}}},_createSerializer:function(){return new tinymce.dom.Serializer({dom:this.editor.dom,apply_source_formatting:true})},_setContent:function(d,b){var h=this,a,j,f=b.content,g,i="";if(b.source_view&&d.getParam("fullpage_hide_in_source_view")){return}f=f.replace(/<(\/?)BODY/gi,"<$1body");a=f.indexOf("<body");if(a!=-1){a=f.indexOf(">",a);h.head=f.substring(0,a+1);j=f.indexOf("</body",a);if(j==-1){j=f.indexOf("</body",j)}b.content=f.substring(a+1,j);h.foot=f.substring(j);function e(c){return c.replace(/<\/?[A-Z]+/g,function(k){return k.toLowerCase()})}h.head=e(h.head);h.foot=e(h.foot)}else{h.head="";if(d.getParam("fullpage_default_xml_pi")){h.head+='<?xml version="1.0" encoding="'+d.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'}h.head+=d.getParam("fullpage_default_doctype",'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');h.head+="\n<html>\n<head>\n<title>"+d.getParam("fullpage_default_title","Untitled document")+"</title>\n";if(g=d.getParam("fullpage_default_encoding")){h.head+='<meta http-equiv="Content-Type" content="'+g+'" />\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+="</head>\n<body"+(i?' style="'+i+'"':"")+">\n";h.foot="\n</body>\n</html>"}},_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
diff --git a/docs/include/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..b7d51d5
--- /dev/null
@@ -0,0 +1,149 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.FullPagePlugin', {\r
+               init : function(ed, url) {\r
+                       var t = this;\r
+\r
+                       t.editor = ed;\r
+\r
+                       // Register commands\r
+                       ed.addCommand('mceFullPageProperties', function() {\r
+                               ed.windowManager.open({\r
+                                       file : url + '/fullpage.htm',\r
+                                       width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)),\r
+                                       height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)),\r
+                                       inline : 1\r
+                               }, {\r
+                                       plugin_url : url,\r
+                                       head_html : t.head\r
+                               });\r
+                       });\r
+\r
+                       // Register buttons\r
+                       ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'});\r
+\r
+                       ed.onBeforeSetContent.add(t._setContent, t);\r
+                       ed.onSetContent.add(t._setBodyAttribs, t);\r
+                       ed.onGetContent.add(t._getContent, t);\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Fullpage',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               },\r
+\r
+               // Private plugin internal methods\r
+\r
+               _setBodyAttribs : function(ed, o) {\r
+                       var bdattr, i, len, kv, k, v, t, attr = this.head.match(/body(.*?)>/i);\r
+\r
+                       if (attr && attr[1]) {\r
+                               bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);\r
+\r
+                               if (bdattr) {\r
+                                       for(i = 0, len = bdattr.length; i < len; i++) {\r
+                                               kv = bdattr[i].split('=');\r
+                                               k = kv[0].replace(/\s/,'');\r
+                                               v = kv[1];\r
+\r
+                                               if (v) {\r
+                                                       v = v.replace(/^\s+/,'').replace(/\s+$/,'');\r
+                                                       t = v.match(/^["'](.*)["']$/);\r
+\r
+                                                       if (t)\r
+                                                               v = t[1];\r
+                                               } else\r
+                                                       v = k;\r
+\r
+                                               ed.dom.setAttrib(ed.getBody(), 'style', v);\r
+                                       }\r
+                               }\r
+                       }\r
+               },\r
+\r
+               _createSerializer : function() {\r
+                       return new tinymce.dom.Serializer({\r
+                               dom : this.editor.dom,\r
+                               apply_source_formatting : true\r
+                       });\r
+               },\r
+\r
+               _setContent : function(ed, o) {\r
+                       var t = this, sp, ep, c = o.content, v, st = '';\r
+\r
+                       if (o.source_view && ed.getParam('fullpage_hide_in_source_view'))\r
+                               return;\r
+\r
+                       // Parse out head, body and footer\r
+                       c = c.replace(/<(\/?)BODY/gi, '<$1body');\r
+                       sp = c.indexOf('<body');\r
+\r
+                       if (sp != -1) {\r
+                               sp = c.indexOf('>', sp);\r
+                               t.head = c.substring(0, sp + 1);\r
+\r
+                               ep = c.indexOf('</body', sp);\r
+                               if (ep == -1)\r
+                                       ep = c.indexOf('</body', ep);\r
+\r
+                               o.content = c.substring(sp + 1, ep);\r
+                               t.foot = c.substring(ep);\r
+\r
+                               function low(s) {\r
+                                       return s.replace(/<\/?[A-Z]+/g, function(a) {\r
+                                               return a.toLowerCase();\r
+                                       })\r
+                               };\r
+\r
+                               t.head = low(t.head);\r
+                               t.foot = low(t.foot);\r
+                       } else {\r
+                               t.head = '';\r
+                               if (ed.getParam('fullpage_default_xml_pi'))\r
+                                       t.head += '<?xml version="1.0" encoding="' + ed.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';\r
+\r
+                               t.head += ed.getParam('fullpage_default_doctype', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');\r
+                               t.head += '\n<html>\n<head>\n<title>' + ed.getParam('fullpage_default_title', 'Untitled document') + '</title>\n';\r
+\r
+                               if (v = ed.getParam('fullpage_default_encoding'))\r
+                                       t.head += '<meta http-equiv="Content-Type" content="' + v + '" />\n';\r
+\r
+                               if (v = ed.getParam('fullpage_default_font_family'))\r
+                                       st += 'font-family: ' + v + ';';\r
+\r
+                               if (v = ed.getParam('fullpage_default_font_size'))\r
+                                       st += 'font-size: ' + v + ';';\r
+\r
+                               if (v = ed.getParam('fullpage_default_text_color'))\r
+                                       st += 'color: ' + v + ';';\r
+\r
+                               t.head += '</head>\n<body' + (st ? ' style="' + st + '"' : '') + '>\n';\r
+                               t.foot = '\n</body>\n</html>';\r
+                       }\r
+               },\r
+\r
+               _getContent : function(ed, o) {\r
+                       var t = this;\r
+\r
+                       if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view'))\r
+                               o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot);\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/fullpage/fullpage.htm b/docs/include/jscripts/tiny_mce/plugins/fullpage/fullpage.htm
new file mode 100644 (file)
index 0000000..c32afaf
--- /dev/null
@@ -0,0 +1,571 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#fullpage_dlg.title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <script type="text/javascript" src="js/fullpage.js"></script>\r
+       <link href="css/fullpage.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body id="advlink" style="display: none">\r
+    <form onsubmit="updateAction();return false;" name="fullpage" action="#">\r
+               <div class="tabs">\r
+                       <ul>\r
+                               <li id="meta_tab" class="current"><span><a href="javascript:mcTabs.displayTab('meta_tab','meta_panel');" onmousedown="return false;">{#fullpage_dlg.meta_tab}</a></span></li>\r
+                               <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#fullpage_dlg.appearance_tab}</a></span></li>\r
+                               <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#fullpage_dlg.advanced_tab}</a></span></li>\r
+                       </ul>\r
+               </div>\r
+\r
+               <div class="panel_wrapper">\r
+                       <div id="meta_panel" class="panel current">\r
+                               <fieldset>\r
+                                       <legend>{#fullpage_dlg.meta_props}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td class="nowrap"><label for="metatitle">{#fullpage_dlg.meta_title}</label>&nbsp;</td>\r
+                                                       <td><input type="text" id="metatitle" name="metatitle" value="" class="mceFocus" /></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="nowrap"><label for="metakeywords">{#fullpage_dlg.meta_keywords}</label>&nbsp;</td>\r
+                                                       <td><textarea id="metakeywords" name="metakeywords" rows="4"></textarea></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="nowrap"><label for="metadescription">{#fullpage_dlg.meta_description}</label>&nbsp;</td>\r
+                                                       <td><textarea id="metadescription" name="metadescription" rows="4"></textarea></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="nowrap"><label for="metaauthor">{#fullpage_dlg.author}</label>&nbsp;</td>\r
+                                                       <td><input type="text" id="metaauthor" name="metaauthor" value="" /></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="nowrap"><label for="metacopyright">{#fullpage_dlg.copyright}</label>&nbsp;</td>\r
+                                                       <td><input type="text" id="metacopyright" name="metacopyright" value="" /></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="nowrap"><label for="metarobots">{#fullpage_dlg.meta_robots}</label>&nbsp;</td>\r
+                                                       <td>\r
+                                                               <select id="metarobots" name="metarobots">\r
+                                                                                       <option value="">{#not_set}</option> \r
+                                                                                       <option value="index,follow">{#fullpage_dlg.meta_index_follow}</option>\r
+                                                                                       <option value="index,nofollow">{#fullpage_dlg.meta_index_nofollow}</option>\r
+                                                                                       <option value="noindex,follow">{#fullpage_dlg.meta_noindex_follow}</option>\r
+                                                                                       <option value="noindex,nofollow">{#fullpage_dlg.meta_noindex_nofollow}</option>\r
+                                                               </select>\r
+                                                       </td>\r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+\r
+                               <fieldset>\r
+                                       <legend>{#fullpage_dlg.langprops}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="docencoding">{#fullpage_dlg.encoding}</label></td> \r
+                                                       <td>\r
+                                                               <select id="docencoding" name="docencoding"> \r
+                                                                               <option value="">{#not_set}</option>\r
+                                                               </select>\r
+                                                       </td> \r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="nowrap"><label for="doctypes">{#fullpage_dlg.doctypes}</label>&nbsp;</td>\r
+                                                       <td>\r
+                                                               <select id="doctypes" name="doctypes">\r
+                                                                               <option value="">{#not_set}</option>\r
+                                                               </select>\r
+                                                       </td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="nowrap"><label for="langcode">{#fullpage_dlg.langcode}</label>&nbsp;</td>\r
+                                                       <td><input type="text" id="langcode" name="langcode" value="" /></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="langdir">{#fullpage_dlg.langdir}</label></td> \r
+                                                       <td>\r
+                                                               <select id="langdir" name="langdir"> \r
+                                                                               <option value="">{#not_set}</option> \r
+                                                                               <option value="ltr">{#fullpage_dlg.ltr}</option> \r
+                                                                               <option value="rtl">{#fullpage_dlg.rtl}</option> \r
+                                                               </select>\r
+                                                       </td> \r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="nowrap"><label for="xml_pi">{#fullpage_dlg.xml_pi}</label>&nbsp;</td>\r
+                                                       <td><input type="checkbox" id="xml_pi" name="xml_pi" class="checkbox" /></td>\r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+                       </div>\r
+\r
+                       <div id="appearance_panel" class="panel">\r
+                               <fieldset>\r
+                                       <legend>{#fullpage_dlg.appearance_textprops}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="fontface">{#fullpage_dlg.fontface}</label></td> \r
+                                                       <td>\r
+                                                               <select id="fontface" name="fontface" onchange="changedStyleField(this);">\r
+                                                                               <option value="">{#not_set}</option>\r
+                                                               </select>\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="fontsize">{#fullpage_dlg.fontsize}</label></td> \r
+                                                       <td>\r
+                                                               <select id="fontsize" name="fontsize" onchange="changedStyleField(this);">\r
+                                                                               <option value="">{#not_set}</option>\r
+                                                               </select>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="textcolor">{#fullpage_dlg.textcolor}</label></td> \r
+                                                       <td>\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="textcolor" name="textcolor" type="text" value="" size="9" onchange="updateColor('textcolor_pick','textcolor');changedStyleField(this);" /></td>\r
+                                                                               <td id="textcolor_pickcontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+\r
+                               <fieldset>\r
+                                       <legend>{#fullpage_dlg.appearance_bgprops}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="bgimage">{#fullpage_dlg.bgimage}</label></td> \r
+                                                       <td>\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="bgimage" name="bgimage" type="text" value="" onchange="changedStyleField(this);" /></td>\r
+                                                                               <td id="bgimage_pickcontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="bgcolor">{#fullpage_dlg.bgcolor}</label></td> \r
+                                                       <td>\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedStyleField(this);" /></td>\r
+                                                                               <td id="bgcolor_pickcontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td> \r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+\r
+                               <fieldset>\r
+                                       <legend>{#fullpage_dlg.appearance_marginprops}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="leftmargin">{#fullpage_dlg.left_margin}</label></td> \r
+                                                       <td><input id="leftmargin" name="leftmargin" type="text" value="" onchange="changedStyleField(this);" /></td>\r
+                                                       <td class="column1"><label for="rightmargin">{#fullpage_dlg.right_margin}</label></td> \r
+                                                       <td><input id="rightmargin" name="rightmargin" type="text" value="" onchange="changedStyleField(this);" /></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="topmargin">{#fullpage_dlg.top_margin}</label></td> \r
+                                                       <td><input id="topmargin" name="topmargin" type="text" value="" onchange="changedStyleField(this);" /></td>\r
+                                                       <td class="column1"><label for="bottommargin">{#fullpage_dlg.bottom_margin}</label></td> \r
+                                                       <td><input id="bottommargin" name="bottommargin" type="text" value="" onchange="changedStyleField(this);" /></td>\r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+\r
+                               <fieldset>\r
+                                       <legend>{#fullpage_dlg.appearance_linkprops}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="link_color">{#fullpage_dlg.link_color}</label></td> \r
+                                                       <td>\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="link_color" name="link_color" type="text" value="" size="9" onchange="updateColor('link_color_pick','link_color');changedStyleField(this);" /></td>\r
+                                                                               <td id="link_color_pickcontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td class="column1"><label for="visited_color">{#fullpage_dlg.visited_color}</label></td> \r
+                                                       <td>\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="visited_color" name="visited_color" type="text" value="" size="9" onchange="updateColor('visited_color_pick','visited_color');changedStyleField(this);" /></td>\r
+                                                                               <td id="visited_color_pickcontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="active_color">{#fullpage_dlg.active_color}</label></td> \r
+                                                       <td>\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="active_color" name="active_color" type="text" value="" size="9" onchange="updateColor('active_color_pick','active_color');changedStyleField(this);" /></td>\r
+                                                                               <td id="active_color_pickcontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td>&nbsp;</td>\r
+                                                       <td>&nbsp;</td>\r
+\r
+<!--                                                   <td class="column1"><label for="hover_color">{#fullpage_dlg.hover_color}</label></td> \r
+                                                       <td>\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="hover_color" name="hover_color" type="text" value="" size="9" onchange="changedStyleField(this);" /></td>\r
+                                                                               <td id="hover_color_pickcontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td> -->\r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+\r
+                               <fieldset>\r
+                                       <legend>{#fullpage_dlg.appearance_style}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="stylesheet">{#fullpage_dlg.stylesheet}</label></td> \r
+                                                       <td><table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="stylesheet" name="stylesheet" type="text" value="" /></td>\r
+                                                                               <td id="stylesheet_browsercontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="style">{#fullpage_dlg.style}</label></td> \r
+                                                       <td><input id="style" name="style" type="text" value="" onchange="changedStyleField(this);" /></td>\r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+                       </div>\r
+\r
+                       <div id="advanced_panel" class="panel">\r
+                               <div id="addmenu">\r
+                                       <table border="0" cellpadding="0" cellspacing="0">\r
+                                               <tr><td><a href="javascript:addHeadElm('title');" onmousedown="return false;"><span>{#fullpage_dlg.add_title}</span></a></td></tr>\r
+                                               <tr><td><a href="javascript:addHeadElm('meta');" onmousedown="return false;"><span>{#fullpage_dlg.add_meta}</span></a></td></tr>\r
+                                               <tr><td><a href="javascript:addHeadElm('script');" onmousedown="return false;"><span>{#fullpage_dlg.add_script}</span></a></td></tr>\r
+                                               <tr><td><a href="javascript:addHeadElm('style');" onmousedown="return false;"><span>{#fullpage_dlg.add_style}</span></a></td></tr>\r
+                                               <tr><td><a href="javascript:addHeadElm('link');" onmousedown="return false;"><span>{#fullpage_dlg.add_link}</span></a></td></tr>\r
+                                               <tr><td><a href="javascript:addHeadElm('base');" onmousedown="return false;"><span>{#fullpage_dlg.add_base}</span></a></td></tr>\r
+                                               <tr><td><a href="javascript:addHeadElm('comment');" onmousedown="return false;"><span>{#fullpage_dlg.add_comment}</span></a></td></tr>\r
+                                       </table>\r
+                               </div>\r
+\r
+                               <fieldset>\r
+                                       <legend>{#fullpage_dlg.head_elements}</legend>\r
+\r
+                                       <div class="headlistwrapper">\r
+                                               <div class="toolbar">\r
+                                                       <div style="float: left">\r
+                                                               <a id="addbutton" href="javascript:showAddMenu();" onmousedown="return false;" class="addbutton" title="{#fullpage_dlg.add}"></a>\r
+                                                               <a href="#" onmousedown="return false;" class="removebutton" title="{#fullpage_dlg.remove}"></a>\r
+                                                       </div>\r
+                                                       <div style="float: right">\r
+                                                               <a href="#" onmousedown="return false;" class="moveupbutton" title="{#fullpage_dlg.moveup}"></a>\r
+                                                               <a href="#" onmousedown="return false;" class="movedownbutton" title="{#fullpage_dlg.movedown}"></a>\r
+                                                       </div>\r
+                                                       <br style="clear: both" />\r
+                                               </div>\r
+                                               <select id="headlist" size="26" onchange="updateHeadElm(this.options[this.selectedIndex].value);">\r
+                                                       <option value="title_0">&lt;title&gt;Some title bla bla bla&lt;/title&gt;</option>\r
+                                                       <option value="meta_1">&lt;meta name="keywords"&gt;Some bla bla bla&lt;/meta&gt;</option>\r
+                                                       <option value="meta_2">&lt;meta name="description"&gt;Some bla bla bla bla bla bla bla bla bla&lt;/meta&gt;</option>\r
+                                                       <option value="script_3">&lt;script language=&quot;javascript&quot;&gt;...&lt;/script&gt;</option>\r
+                                                       <option value="style_4">&lt;style&gt;...&lt;/style&gt;</option>\r
+                                                       <option value="base_5">&lt;base href="." /&gt;</option>\r
+                                                       <option value="comment_6">&lt;!-- ... --&gt;</option>\r
+                                                       <option value="link_7">&lt;link href="." /&gt;</option>\r
+                                               </select>\r
+                                       </div>\r
+                               </fieldset>\r
+\r
+                               <fieldset id="meta_element">\r
+                                       <legend>{#fullpage_dlg.meta_element}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="element_meta_type">{#fullpage_dlg.type}</label></td> \r
+                                                       <td><select id="element_meta_type">\r
+                                                                               <option value="name">name</option>\r
+                                                                               <option value="http-equiv">http-equiv</option>\r
+                                                               </select></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="element_meta_name">{#fullpage_dlg.name}</label></td> \r
+                                                       <td><input id="element_meta_name" name="element_meta_name" type="text" value="" /></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="element_meta_content">{#fullpage_dlg.content}</label></td> \r
+                                                       <td><input id="element_meta_content" name="element_meta_content" type="text" value="" /></td>\r
+                                               </tr>\r
+                                       </table>\r
+\r
+                                       <input type="button" id="meta_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />\r
+                               </fieldset>\r
+\r
+                               <fieldset id="title_element">\r
+                                       <legend>{#fullpage_dlg.title_element}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="element_title">{#fullpage_dlg.meta_title}</label></td> \r
+                                                       <td><input id="element_title" name="element_title" type="text" value="" /></td>\r
+                                               </tr>\r
+                                       </table>\r
+\r
+                                       <input type="button" id="title_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />\r
+                               </fieldset>\r
+\r
+                               <fieldset id="script_element">\r
+                                       <legend>{#fullpage_dlg.script_element}</legend>\r
+\r
+                                       <div class="tabs">\r
+                                               <ul>\r
+                                                       <li id="script_props_tab" class="current"><span><a href="javascript:mcTabs.displayTab('script_props_tab','script_props_panel');" onmousedown="return false;">{#fullpage_dlg.properties}</a></span></li>\r
+                                                       <li id="script_value_tab"><span><a href="javascript:mcTabs.displayTab('script_value_tab','script_value_panel');" onmousedown="return false;">{#fullpage_dlg.value}</a></span></li>\r
+                                               </ul>\r
+                                       </div>\r
+\r
+                                       <br style="clear: both" />\r
+\r
+                                       <div class="panel_wrapper">\r
+                                               <div id="script_props_panel" class="panel current">\r
+                                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                                               <tr>\r
+                                                                       <td class="column1"><label for="element_script_type">{#fullpage_dlg.type}</label></td> \r
+                                                                       <td><select id="element_script_type">\r
+                                                                               <option value="text/javascript">text/javascript</option>\r
+                                                                               <option value="text/jscript">text/jscript</option>\r
+                                                                               <option value="text/vbscript">text/vbscript</option>\r
+                                                                               <option value="text/vbs">text/vbs</option>\r
+                                                                               <option value="text/ecmascript">text/ecmascript</option>\r
+                                                                               <option value="text/xml">text/xml</option>\r
+                                                                       </select></td>\r
+                                                               </tr>\r
+                                                               <tr>\r
+                                                                       <td class="column1"><label for="element_script_src">{#fullpage_dlg.src}</label></td> \r
+                                                                       <td><table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="element_script_src" name="element_script_src" type="text" value="" /></td>\r
+                                                                               <td id="script_src_pickcontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table></td>\r
+                                                               </tr>\r
+                                                               <tr>\r
+                                                                       <td class="column1"><label for="element_script_charset">{#fullpage_dlg.charset}</label></td> \r
+                                                                       <td><select id="element_script_charset"><option value="">{#not_set}</option></select></td>\r
+                                                               </tr>\r
+                                                               <tr>\r
+                                                                       <td class="column1"><label for="element_script_defer">{#fullpage_dlg.defer}</label></td> \r
+                                                                       <td><input type="checkbox" id="element_script_defer" name="element_script_defer" class="checkbox" /></td>\r
+                                                               </tr>\r
+                                                       </table>\r
+                                               </div>\r
+\r
+                                               <div id="script_value_panel" class="panel">\r
+                                                       <textarea id="element_script_value"></textarea>\r
+                                               </div>\r
+                                       </div>\r
+\r
+                                       <input type="button" id="script_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />\r
+                               </fieldset>\r
+\r
+                               <fieldset id="style_element">\r
+                                       <legend>{#fullpage_dlg.style_element}</legend>\r
+\r
+                                       <div class="tabs">\r
+                                               <ul>\r
+                                                       <li id="style_props_tab" class="current"><span><a href="javascript:mcTabs.displayTab('style_props_tab','style_props_panel');" onmousedown="return false;">{#fullpage_dlg.properties}</a></span></li>\r
+                                                       <li id="style_value_tab"><span><a href="javascript:mcTabs.displayTab('style_value_tab','style_value_panel');" onmousedown="return false;">{#fullpage_dlg.value}</a></span></li>\r
+                                               </ul>\r
+                                       </div>\r
+\r
+                                       <br style="clear: both" />\r
+\r
+                                       <div class="panel_wrapper">\r
+                                               <div id="style_props_panel" class="panel current">\r
+                                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                                               <tr>\r
+                                                                       <td class="column1"><label for="element_style_type">{#fullpage_dlg.type}</label></td> \r
+                                                                       <td><select id="element_style_type">\r
+                                                                               <option value="text/css">text/css</option>\r
+                                                                       </select></td>\r
+                                                               </tr>\r
+                                                               <tr>\r
+                                                                       <td class="column1"><label for="element_style_media">{#fullpage_dlg.media}</label></td> \r
+                                                                       <td><select id="element_style_media"></select></td>\r
+                                                               </tr>\r
+                                                       </table>\r
+                                               </div>\r
+\r
+                                               <div id="style_value_panel" class="panel">\r
+                                                       <textarea id="element_style_value"></textarea>\r
+                                               </div>\r
+                                       </div>\r
+\r
+                                       <input type="button" id="style_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />\r
+                               </fieldset>\r
+\r
+                               <fieldset id="base_element">\r
+                                       <legend>{#fullpage_dlg.base_element}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="element_base_href">{#fullpage_dlg.href}</label></td> \r
+                                                       <td><input id="element_base_href" name="element_base_href" type="text" value="" /></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="element_base_target">{#fullpage_dlg.target}</label></td> \r
+                                                       <td><input id="element_base_target" name="element_base_target" type="text" value="" /></td>\r
+                                               </tr>\r
+                                       </table>\r
+\r
+                                       <input type="button" id="base_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />\r
+                               </fieldset>\r
+\r
+                               <fieldset id="link_element">\r
+                                       <legend>{#fullpage_dlg.link_element}</legend>\r
+\r
+                                       <div class="tabs">\r
+                                               <ul>\r
+                                                       <li id="link_general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('link_general_tab','link_general_panel');" onmousedown="return false;">{#fullpage_dlg.general_props}</a></span></li>\r
+                                                       <li id="link_advanced_tab"><span><a href="javascript:mcTabs.displayTab('link_advanced_tab','link_advanced_panel');" onmousedown="return false;">{#fullpage_dlg.advanced_props}</a></span></li>\r
+                                               </ul>\r
+                                       </div>\r
+\r
+                                       <br style="clear: both" />\r
+\r
+                                       <div class="panel_wrapper">\r
+                                               <div id="link_general_panel" class="panel current">\r
+                                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                                               <tr>\r
+                                                                       <td class="column1"><label for="element_link_href">{#fullpage_dlg.href}</label></td> \r
+                                                                       <td><table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="element_link_href" name="element_link_href" type="text" value="" /></td>\r
+                                                                               <td id="link_href_pickcontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table></td>\r
+                                                               </tr>\r
+                                                               <tr>\r
+                                                                       <td class="column1"><label for="element_link_title">{#fullpage_dlg.meta_title}</label></td> \r
+                                                                       <td><input id="element_link_title" name="element_link_title" type="text" value="" /></td>\r
+                                                               </tr>\r
+                                                               <tr>\r
+                                                                       <td class="column1"><label for="element_link_type">{#fullpage_dlg.type}</label></td> \r
+                                                                       <td><select id="element_link_type" name="element_link_type">\r
+                                                                               <option value="text/css">text/css</option>\r
+                                                                               <option value="text/javascript">text/javascript</option>\r
+                                                                       </select></td>\r
+                                                               </tr>\r
+                                                               <tr>\r
+                                                                       <td class="column1"><label for="element_link_media">{#fullpage_dlg.media}</label></td> \r
+                                                                       <td><select id="element_link_media" name="element_link_media"></select></td>\r
+                                                               </tr>\r
+                                                               <tr>\r
+                                                                       <td><label for="element_style_rel">{#fullpage_dlg.rel}</label></td>\r
+                                                                       <td><select id="element_style_rel" name="element_style_rel"> \r
+                                                                                       <option value="">{#not_set}</option> \r
+                                                                                       <option value="stylesheet">Stylesheet</option>\r
+                                                                                       <option value="alternate">Alternate</option>\r
+                                                                                       <option value="designates">Designates</option>\r
+                                                                                       <option value="start">Start</option>\r
+                                                                                       <option value="next">Next</option>\r
+                                                                                       <option value="prev">Prev</option>\r
+                                                                                       <option value="contents">Contents</option>\r
+                                                                                       <option value="index">Index</option>\r
+                                                                                       <option value="glossary">Glossary</option>\r
+                                                                                       <option value="copyright">Copyright</option>\r
+                                                                                       <option value="chapter">Chapter</option>\r
+                                                                                       <option value="subsection">Subsection</option>\r
+                                                                                       <option value="appendix">Appendix</option>\r
+                                                                                       <option value="help">Help</option>\r
+                                                                                       <option value="bookmark">Bookmark</option>\r
+                                                                               </select> \r
+                                                                       </td>\r
+                                                               </tr>\r
+                                                       </table>\r
+                                               </div>\r
+\r
+                                               <div id="link_advanced_panel" class="panel">\r
+                                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                                               <tr>\r
+                                                                       <td class="column1"><label for="element_link_charset">{#fullpage_dlg.charset}</label></td> \r
+                                                                       <td><select id="element_link_charset"><option value="">{#not_set}</option></select></td>\r
+                                                               </tr>\r
+                                                               <tr>\r
+                                                                       <td class="column1"><label for="element_link_hreflang">{#fullpage_dlg.hreflang}</label></td> \r
+                                                                       <td><input id="element_link_hreflang" name="element_link_hreflang" type="text" value="" /></td>\r
+                                                               </tr>\r
+                                                               <tr>\r
+                                                                       <td class="column1"><label for="element_link_target">{#fullpage_dlg.target}</label></td> \r
+                                                                       <td><input id="element_link_target" name="element_link_target" type="text" value="" /></td>\r
+                                                               </tr>\r
+                                                               <tr>\r
+                                                                       <td><label for="element_style_rev">{#fullpage_dlg.rev}</label></td>\r
+                                                                       <td><select id="element_style_rev" name="element_style_rev"> \r
+                                                                                       <option value="">{#not_set}</option> \r
+                                                                                       <option value="alternate">Alternate</option> \r
+                                                                                       <option value="designates">Designates</option> \r
+                                                                                       <option value="stylesheet">Stylesheet</option> \r
+                                                                                       <option value="start">Start</option> \r
+                                                                                       <option value="next">Next</option> \r
+                                                                                       <option value="prev">Prev</option> \r
+                                                                                       <option value="contents">Contents</option> \r
+                                                                                       <option value="index">Index</option> \r
+                                                                                       <option value="glossary">Glossary</option> \r
+                                                                                       <option value="copyright">Copyright</option> \r
+                                                                                       <option value="chapter">Chapter</option> \r
+                                                                                       <option value="subsection">Subsection</option> \r
+                                                                                       <option value="appendix">Appendix</option> \r
+                                                                                       <option value="help">Help</option> \r
+                                                                                       <option value="bookmark">Bookmark</option> \r
+                                                                               </select> \r
+                                                                       </td>\r
+                                                               </tr>\r
+                                                       </table>\r
+                                               </div>\r
+                                       </div>\r
+\r
+                                       <input type="button" id="link_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />\r
+                               </fieldset>\r
+\r
+                               <fieldset id="comment_element">\r
+                                       <legend>{#fullpage_dlg.comment_element}</legend>\r
+\r
+                                       <textarea id="element_comment_value"></textarea>\r
+\r
+                                       <input type="button" id="comment_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />\r
+                               </fieldset>\r
+                       </div>\r
+               </div>\r
+\r
+               <div class="mceActionPanel">\r
+                       <input type="submit" id="insert" name="update" value="{#update}" />\r
+                       <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+               </div>\r
+    </form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js b/docs/include/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js
new file mode 100644 (file)
index 0000000..a1bb719
--- /dev/null
@@ -0,0 +1,471 @@
+/**\r
+ * fullpage.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+tinyMCEPopup.requireLangPack();\r
+\r
+var doc;\r
+\r
+var defaultDocTypes = \r
+       'XHTML 1.0 Transitional=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,' +\r
+       'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' +\r
+       'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' +\r
+       'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' +\r
+       'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' +\r
+       'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' +\r
+       'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';\r
+\r
+var defaultEncodings = \r
+       'Western european (iso-8859-1)=iso-8859-1,' +\r
+       'Central European (iso-8859-2)=iso-8859-2,' +\r
+       'Unicode (UTF-8)=utf-8,' +\r
+       'Chinese traditional (Big5)=big5,' +\r
+       'Cyrillic (iso-8859-5)=iso-8859-5,' +\r
+       'Japanese (iso-2022-jp)=iso-2022-jp,' +\r
+       'Greek (iso-8859-7)=iso-8859-7,' +\r
+       'Korean (iso-2022-kr)=iso-2022-kr,' +\r
+       'ASCII (us-ascii)=us-ascii';\r
+\r
+var defaultMediaTypes = \r
+       'all=all,' +\r
+       'screen=screen,' +\r
+       'print=print,' +\r
+       'tty=tty,' +\r
+       'tv=tv,' +\r
+       'projection=projection,' +\r
+       'handheld=handheld,' +\r
+       'braille=braille,' +\r
+       'aural=aural';\r
+\r
+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';\r
+var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px';\r
+\r
+function init() {\r
+       var f = document.forms['fullpage'], el = f.elements, e, i, p, doctypes, encodings, mediaTypes, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style;\r
+\r
+       // Setup doctype select box\r
+       doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(',');\r
+       for (i=0; i<doctypes.length; i++) {\r
+               p = doctypes[i].split('=');\r
+\r
+               if (p.length > 1)\r
+                       addSelectValue(f, 'doctypes', p[0], p[1]);\r
+       }\r
+\r
+       // Setup fonts select box\r
+       fonts = ed.getParam("fullpage_fonts", defaultFontNames).split(';');\r
+       for (i=0; i<fonts.length; i++) {\r
+               p = fonts[i].split('=');\r
+\r
+               if (p.length > 1)\r
+                       addSelectValue(f, 'fontface', p[0], p[1]);\r
+       }\r
+\r
+       // Setup fontsize select box\r
+       fonts = ed.getParam("fullpage_fontsizes", defaultFontSizes).split(',');\r
+       for (i=0; i<fonts.length; i++)\r
+               addSelectValue(f, 'fontsize', fonts[i], fonts[i]);\r
+\r
+       // Setup mediatype select boxs\r
+       mediaTypes = ed.getParam("fullpage_media_types", defaultMediaTypes).split(',');\r
+       for (i=0; i<mediaTypes.length; i++) {\r
+               p = mediaTypes[i].split('=');\r
+\r
+               if (p.length > 1) {\r
+                       addSelectValue(f, 'element_style_media', p[0], p[1]);\r
+                       addSelectValue(f, 'element_link_media', p[0], p[1]);\r
+               }\r
+       }\r
+\r
+       // Setup encodings select box\r
+       encodings = ed.getParam("fullpage_encodings", defaultEncodings).split(',');\r
+       for (i=0; i<encodings.length; i++) {\r
+               p = encodings[i].split('=');\r
+\r
+               if (p.length > 1) {\r
+                       addSelectValue(f, 'docencoding', p[0], p[1]);\r
+                       addSelectValue(f, 'element_script_charset', p[0], p[1]);\r
+                       addSelectValue(f, 'element_link_charset', p[0], p[1]);\r
+               }\r
+       }\r
+\r
+       document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');\r
+       document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color');\r
+       //document.getElementById('hover_color_pickcontainer').innerHTML = getColorPickerHTML('hover_color_pick','hover_color');\r
+       document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color');\r
+       document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color');\r
+       document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor');\r
+       document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage');\r
+       document.getElementById('link_href_pickcontainer').innerHTML = getBrowserHTML('link_href_browser','element_link_href','file','fullpage');\r
+       document.getElementById('script_src_pickcontainer').innerHTML = getBrowserHTML('script_src_browser','element_script_src','file','fullpage');\r
+       document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage');\r
+\r
+       // Resize some elements\r
+       if (isVisible('stylesheetbrowser'))\r
+               document.getElementById('stylesheet').style.width = '220px';\r
+\r
+       if (isVisible('link_href_browser'))\r
+               document.getElementById('element_link_href').style.width = '230px';\r
+\r
+       if (isVisible('bgimage_browser'))\r
+               document.getElementById('bgimage').style.width = '210px';\r
+\r
+       // Add iframe\r
+       dom.add(document.body, 'iframe', {id : 'documentIframe', src : 'javascript:""', style : {display : 'none'}});\r
+       doc = dom.get('documentIframe').contentWindow.document;\r
+       h = tinyMCEPopup.getWindowArg('head_html');\r
+\r
+       // Preprocess the HTML disable scripts and urls\r
+       h = h.replace(/<script>/gi, '<script type="text/javascript">');\r
+       h = h.replace(/type=([\"\'])?/gi, 'type=$1-mce-');\r
+       h = h.replace(/(src=|href=)/g, '_mce_$1');\r
+\r
+       // Write in the content in the iframe\r
+       doc.write(h + '</body></html>');\r
+       doc.close();\r
+\r
+       // Parse xml and doctype\r
+       xmlVer = getReItem(/<\?\s*?xml.*?version\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);\r
+       xmlEnc = getReItem(/<\?\s*?xml.*?encoding\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);\r
+       docType = getReItem(/<\!DOCTYPE.*?>/gi, h.replace(/\n/g, ''), 0).replace(/ +/g, ' ');\r
+       f.langcode.value = getReItem(/lang="(.*?)"/gi, h, 1);\r
+\r
+       // Parse title\r
+       if (e = doc.getElementsByTagName('title')[0])\r
+               el.metatitle.value = e.textContent || e.text;\r
+\r
+       // Parse meta\r
+       tinymce.each(doc.getElementsByTagName('meta'), function(n) {\r
+               var na = (n.getAttribute('name', 2) || '').toLowerCase(), va = n.getAttribute('content', 2), eq = n.getAttribute('httpEquiv', 2) || '';\r
+\r
+               e = el['meta' + na];\r
+\r
+               if (na == 'robots') {\r
+                       selectByValue(f, 'metarobots', tinymce.trim(va), true, true);\r
+                       return;\r
+               }\r
+\r
+               switch (eq.toLowerCase()) {\r
+                       case "content-type":\r
+                               tmp = getReItem(/charset\s*=\s*(.*)\s*/gi, va, 1);\r
+\r
+                               // Override XML encoding\r
+                               if (tmp != "")\r
+                                       xmlEnc = tmp;\r
+\r
+                               return;\r
+               }\r
+\r
+               if (e)\r
+                       e.value = va;\r
+       });\r
+\r
+       selectByValue(f, 'doctypes', docType, true, true);\r
+       selectByValue(f, 'docencoding', xmlEnc, true, true);\r
+       selectByValue(f, 'langdir', doc.body.getAttribute('dir', 2) || '', true, true);\r
+\r
+       if (xmlVer != '')\r
+               el.xml_pi.checked = true;\r
+\r
+       // Parse appearance\r
+\r
+       // Parse primary stylesheet\r
+       tinymce.each(doc.getElementsByTagName("link"), function(l) {\r
+               var m = l.getAttribute('media', 2) || '', t = l.getAttribute('type', 2) || '';\r
+\r
+               if (t == "-mce-text/css" && (m == "" || m == "screen" || m == "all") && (l.getAttribute('rel', 2) || '') == "stylesheet") {\r
+                       f.stylesheet.value = l.getAttribute('_mce_href', 2) || '';\r
+                       return false;\r
+               }\r
+       });\r
+\r
+       // Get from style elements\r
+       tinymce.each(doc.getElementsByTagName("style"), function(st) {\r
+               var tmp = parseStyleElement(st);\r
+\r
+               for (x=0; x<tmp.length; x++) {\r
+                       if (tmp[x].rule.indexOf('a:visited') != -1 && tmp[x].data['color'])\r
+                               f.visited_color.value = tmp[x].data['color'];\r
+\r
+                       if (tmp[x].rule.indexOf('a:link') != -1 && tmp[x].data['color'])\r
+                               f.link_color.value = tmp[x].data['color'];\r
+\r
+                       if (tmp[x].rule.indexOf('a:active') != -1 && tmp[x].data['color'])\r
+                               f.active_color.value = tmp[x].data['color'];\r
+               }\r
+       });\r
+\r
+       f.textcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "text");\r
+       f.active_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "alink");\r
+       f.link_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "link");\r
+       f.visited_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "vlink");\r
+       f.bgcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "bgcolor");\r
+       f.bgimage.value = tinyMCEPopup.dom.getAttrib(doc.body, "background");\r
+\r
+       // Get from style info\r
+       style = tinyMCEPopup.dom.parseStyle(tinyMCEPopup.dom.getAttrib(doc.body, 'style'));\r
+\r
+       if (style['font-family'])\r
+               selectByValue(f, 'fontface', style['font-family'], true, true);\r
+       else\r
+               selectByValue(f, 'fontface', ed.getParam("fullpage_default_fontface", ""), true, true);\r
+\r
+       if (style['font-size'])\r
+               selectByValue(f, 'fontsize', style['font-size'], true, true);\r
+       else\r
+               selectByValue(f, 'fontsize', ed.getParam("fullpage_default_fontsize", ""), true, true);\r
+\r
+       if (style['color'])\r
+               f.textcolor.value = convertRGBToHex(style['color']);\r
+\r
+       if (style['background-image'])\r
+               f.bgimage.value = style['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");\r
+\r
+       if (style['background-color'])\r
+               f.bgcolor.value = style['background-color'];\r
+\r
+       if (style['margin']) {\r
+               tmp = style['margin'].replace(/[^0-9 ]/g, '');\r
+               tmp = tmp.split(/ +/);\r
+               f.topmargin.value = tmp.length > 0 ? tmp[0] : '';\r
+               f.rightmargin.value = tmp.length > 1 ? tmp[1] : tmp[0];\r
+               f.bottommargin.value = tmp.length > 2 ? tmp[2] : tmp[0];\r
+               f.leftmargin.value = tmp.length > 3 ? tmp[3] : tmp[0];\r
+       }\r
+\r
+       if (style['margin-left'])\r
+               f.leftmargin.value = style['margin-left'].replace(/[^0-9]/g, '');\r
+\r
+       if (style['margin-right'])\r
+               f.rightmargin.value = style['margin-right'].replace(/[^0-9]/g, '');\r
+\r
+       if (style['margin-top'])\r
+               f.topmargin.value = style['margin-top'].replace(/[^0-9]/g, '');\r
+\r
+       if (style['margin-bottom'])\r
+               f.bottommargin.value = style['margin-bottom'].replace(/[^0-9]/g, '');\r
+\r
+       f.style.value = tinyMCEPopup.dom.serializeStyle(style);\r
+\r
+       // Update colors\r
+       updateColor('textcolor_pick', 'textcolor');\r
+       updateColor('bgcolor_pick', 'bgcolor');\r
+       updateColor('visited_color_pick', 'visited_color');\r
+       updateColor('active_color_pick', 'active_color');\r
+       updateColor('link_color_pick', 'link_color');\r
+}\r
+\r
+function getReItem(r, s, i) {\r
+       var c = r.exec(s);\r
+\r
+       if (c && c.length > i)\r
+               return c[i];\r
+\r
+       return '';\r
+}\r
+\r
+function updateAction() {\r
+       var f = document.forms[0], nl, i, h, v, s, head, html, l, tmp, addlink = true, ser;\r
+\r
+       head = doc.getElementsByTagName('head')[0];\r
+\r
+       // Fix scripts without a type\r
+       nl = doc.getElementsByTagName('script');\r
+       for (i=0; i<nl.length; i++) {\r
+               if (tinyMCEPopup.dom.getAttrib(nl[i], '_mce_type') == '')\r
+                       nl[i].setAttribute('_mce_type', 'text/javascript');\r
+       }\r
+\r
+       // Get primary stylesheet\r
+       nl = doc.getElementsByTagName("link");\r
+       for (i=0; i<nl.length; i++) {\r
+               l = nl[i];\r
+\r
+               tmp = tinyMCEPopup.dom.getAttrib(l, 'media');\r
+\r
+               if (tinyMCEPopup.dom.getAttrib(l, '_mce_type') == "text/css" && (tmp == "" || tmp == "screen" || tmp == "all") && tinyMCEPopup.dom.getAttrib(l, 'rel') == "stylesheet") {\r
+                       addlink = false;\r
+\r
+                       if (f.stylesheet.value == '')\r
+                               l.parentNode.removeChild(l);\r
+                       else\r
+                               l.setAttribute('_mce_href', f.stylesheet.value);\r
+\r
+                       break;\r
+               }\r
+       }\r
+\r
+       // Add new link\r
+       if (f.stylesheet.value != '') {\r
+               l = doc.createElement('link');\r
+\r
+               l.setAttribute('type', 'text/css');\r
+               l.setAttribute('_mce_href', f.stylesheet.value);\r
+               l.setAttribute('rel', 'stylesheet');\r
+\r
+               head.appendChild(l);\r
+       }\r
+\r
+       setMeta(head, 'keywords', f.metakeywords.value);\r
+       setMeta(head, 'description', f.metadescription.value);\r
+       setMeta(head, 'author', f.metaauthor.value);\r
+       setMeta(head, 'copyright', f.metacopyright.value);\r
+       setMeta(head, 'robots', getSelectValue(f, 'metarobots'));\r
+       setMeta(head, 'Content-Type', getSelectValue(f, 'docencoding'));\r
+\r
+       doc.body.dir = getSelectValue(f, 'langdir');\r
+       doc.body.style.cssText = f.style.value;\r
+\r
+       doc.body.setAttribute('vLink', f.visited_color.value);\r
+       doc.body.setAttribute('link', f.link_color.value);\r
+       doc.body.setAttribute('text', f.textcolor.value);\r
+       doc.body.setAttribute('aLink', f.active_color.value);\r
+\r
+       doc.body.style.fontFamily = getSelectValue(f, 'fontface');\r
+       doc.body.style.fontSize = getSelectValue(f, 'fontsize');\r
+       doc.body.style.backgroundColor = f.bgcolor.value;\r
+\r
+       if (f.leftmargin.value != '')\r
+               doc.body.style.marginLeft = f.leftmargin.value + 'px';\r
+\r
+       if (f.rightmargin.value != '')\r
+               doc.body.style.marginRight = f.rightmargin.value + 'px';\r
+\r
+       if (f.bottommargin.value != '')\r
+               doc.body.style.marginBottom = f.bottommargin.value + 'px';\r
+\r
+       if (f.topmargin.value != '')\r
+               doc.body.style.marginTop = f.topmargin.value + 'px';\r
+\r
+       html = doc.getElementsByTagName('html')[0];\r
+       html.setAttribute('lang', f.langcode.value);\r
+       html.setAttribute('xml:lang', f.langcode.value);\r
+\r
+       if (f.bgimage.value != '')\r
+               doc.body.style.backgroundImage = "url('" + f.bgimage.value + "')";\r
+       else\r
+               doc.body.style.backgroundImage = '';\r
+\r
+       ser = tinyMCEPopup.editor.plugins.fullpage._createSerializer();\r
+       ser.setRules('-title,meta[http-equiv|name|content],base[href|target],link[href|rel|type|title|media],style[type],script[type|language|src],html[lang|xml::lang|xmlns],body[style|dir|vlink|link|text|alink],head');\r
+\r
+       h = ser.serialize(doc.documentElement);\r
+       h = h.substring(0, h.lastIndexOf('</body>'));\r
+\r
+       if (h.indexOf('<title>') == -1)\r
+               h = h.replace(/<head.*?>/, '$&\n' + '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>');\r
+       else\r
+               h = h.replace(/<title>(.*?)<\/title>/, '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>');\r
+\r
+       if ((v = getSelectValue(f, 'doctypes')) != '')\r
+               h = v + '\n' + h;\r
+\r
+       if (f.xml_pi.checked) {\r
+               s = '<?xml version="1.0"';\r
+\r
+               if ((v = getSelectValue(f, 'docencoding')) != '')\r
+                       s += ' encoding="' + v + '"';\r
+\r
+               s += '?>\n';\r
+               h = s + h;\r
+       }\r
+\r
+       h = h.replace(/type=\"\-mce\-/gi, 'type="');\r
+\r
+       tinyMCEPopup.editor.plugins.fullpage.head = h;\r
+       tinyMCEPopup.editor.plugins.fullpage._setBodyAttribs(tinyMCEPopup.editor, {});\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function changedStyleField(field) {\r
+}\r
+\r
+function setMeta(he, k, v) {\r
+       var nl, i, m;\r
+\r
+       nl = he.getElementsByTagName('meta');\r
+       for (i=0; i<nl.length; i++) {\r
+               if (k == 'Content-Type' && tinyMCEPopup.dom.getAttrib(nl[i], 'http-equiv') == k) {\r
+                       if (v == '')\r
+                               nl[i].parentNode.removeChild(nl[i]);\r
+                       else\r
+                               nl[i].setAttribute('content', "text/html; charset=" + v);\r
+\r
+                       return;\r
+               }\r
+\r
+               if (tinyMCEPopup.dom.getAttrib(nl[i], 'name') == k) {\r
+                       if (v == '')\r
+                               nl[i].parentNode.removeChild(nl[i]);\r
+                       else\r
+                               nl[i].setAttribute('content', v);\r
+                       return;\r
+               }\r
+       }\r
+\r
+       if (v == '')\r
+               return;\r
+\r
+       m = doc.createElement('meta');\r
+\r
+       if (k == 'Content-Type')\r
+               m.httpEquiv = k;\r
+       else\r
+               m.setAttribute('name', k);\r
+\r
+       m.setAttribute('content', v);\r
+       he.appendChild(m);\r
+}\r
+\r
+function parseStyleElement(e) {\r
+       var v = e.innerHTML;\r
+       var p, i, r;\r
+\r
+       v = v.replace(/<!--/gi, '');\r
+       v = v.replace(/-->/gi, '');\r
+       v = v.replace(/[\n\r]/gi, '');\r
+       v = v.replace(/\s+/gi, ' ');\r
+\r
+       r = [];\r
+       p = v.split(/{|}/);\r
+\r
+       for (i=0; i<p.length; i+=2) {\r
+               if (p[i] != "")\r
+                       r[r.length] = {rule : tinymce.trim(p[i]), data : tinyMCEPopup.dom.parseStyle(p[i+1])};\r
+       }\r
+\r
+       return r;\r
+}\r
+\r
+function serializeStyleElement(d) {\r
+       var i, s, st;\r
+\r
+       s = '<!--\n';\r
+\r
+       for (i=0; i<d.length; i++) {\r
+               s += d[i].rule + ' {\n';\r
+\r
+               st = tinyMCE.serializeStyle(d[i].data);\r
+\r
+               if (st != '')\r
+                       st += ';';\r
+\r
+               s += st.replace(/;/g, ';\n');\r
+               s += '}\n';\r
+\r
+               if (i != d.length - 1)\r
+                       s += '\n';\r
+       }\r
+\r
+       s += '\n-->';\r
+\r
+       return s;\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js b/docs/include/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js
new file mode 100644 (file)
index 0000000..f5801b8
--- /dev/null
@@ -0,0 +1,85 @@
+tinyMCE.addI18n('en.fullpage_dlg',{\r
+title:"Document properties",\r
+meta_tab:"General",\r
+appearance_tab:"Appearance",\r
+advanced_tab:"Advanced",\r
+meta_props:"Meta information",\r
+langprops:"Language and encoding",\r
+meta_title:"Title",\r
+meta_keywords:"Keywords",\r
+meta_description:"Description",\r
+meta_robots:"Robots",\r
+doctypes:"Doctype",\r
+langcode:"Language code",\r
+langdir:"Language direction",\r
+ltr:"Left to right",\r
+rtl:"Right to left",\r
+xml_pi:"XML declaration",\r
+encoding:"Character encoding",\r
+appearance_bgprops:"Background properties",\r
+appearance_marginprops:"Body margins",\r
+appearance_linkprops:"Link colors",\r
+appearance_textprops:"Text properties",\r
+bgcolor:"Background color",\r
+bgimage:"Background image",\r
+left_margin:"Left margin",\r
+right_margin:"Right margin",\r
+top_margin:"Top margin",\r
+bottom_margin:"Bottom margin",\r
+text_color:"Text color",\r
+font_size:"Font size",\r
+font_face:"Font face",\r
+link_color:"Link color",\r
+hover_color:"Hover color",\r
+visited_color:"Visited color",\r
+active_color:"Active color",\r
+textcolor:"Color",\r
+fontsize:"Font size",\r
+fontface:"Font family",\r
+meta_index_follow:"Index and follow the links",\r
+meta_index_nofollow:"Index and don't follow the links",\r
+meta_noindex_follow:"Do not index but follow the links",\r
+meta_noindex_nofollow:"Do not index and don\'t follow the links",\r
+appearance_style:"Stylesheet and style properties",\r
+stylesheet:"Stylesheet",\r
+style:"Style",\r
+author:"Author",\r
+copyright:"Copyright",\r
+add:"Add new element",\r
+remove:"Remove selected element",\r
+moveup:"Move selected element up",\r
+movedown:"Move selected element down",\r
+head_elements:"Head elements",\r
+info:"Information",\r
+add_title:"Title element",\r
+add_meta:"Meta element",\r
+add_script:"Script element",\r
+add_style:"Style element",\r
+add_link:"Link element",\r
+add_base:"Base element",\r
+add_comment:"Comment node",\r
+title_element:"Title element",\r
+script_element:"Script element",\r
+style_element:"Style element",\r
+base_element:"Base element",\r
+link_element:"Link element",\r
+meta_element:"Meta element",\r
+comment_element:"Comment",\r
+src:"Src",\r
+language:"Language",\r
+href:"Href",\r
+target:"Target",\r
+type:"Type",\r
+charset:"Charset",\r
+defer:"Defer",\r
+media:"Media",\r
+properties:"Properties",\r
+name:"Name",\r
+value:"Value",\r
+content:"Content",\r
+rel:"Rel",\r
+rev:"Rev",\r
+hreflang:"Href lang",\r
+general_props:"General",\r
+advanced_props:"Advanced"\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js
new file mode 100644 (file)
index 0000000..dfb3f16
--- /dev/null
@@ -0,0 +1 @@
+(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(c,d){var e=this,f={},b;e.editor=c;c.addCommand("mceFullScreen",function(){var h,i=a.doc.documentElement;if(c.getParam("fullscreen_is_enabled")){if(c.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",e.resizeFunc);tinyMCE.get(c.getParam("fullscreen_editor_id")).setContent(c.getContent({format:"raw"}),{format:"raw"});tinyMCE.remove(c);a.remove("mce_fullscreen_container");i.style.overflow=c.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",c.getParam("fullscreen_overflow"));a.win.scrollTo(c.getParam("fullscreen_scrollx"),c.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(c.getParam("fullscreen_new_window")){h=a.win.open(d+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{h.resizeTo(screen.availWidth,screen.availHeight)}catch(g){}}else{tinyMCE.oldSettings=tinyMCE.settings;f.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";f.fullscreen_html_overflow=a.getStyle(i,"overflow",1);b=a.getViewPort();f.fullscreen_scrollx=b.x;f.fullscreen_scrolly=b.y;if(tinymce.isOpera&&f.fullscreen_overflow=="visible"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&f.fullscreen_overflow=="scroll"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&(f.fullscreen_html_overflow=="visible"||f.fullscreen_html_overflow=="scroll")){f.fullscreen_html_overflow="auto"}if(f.fullscreen_overflow=="0px"){f.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");i.style.overflow="hidden";b=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){b.h-=1}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+(tinymce.isIE6||(tinymce.isIE&&!a.boxModel)?"absolute":"fixed")+";top:0;left:0;width:"+b.w+"px;height:"+b.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(c.settings,function(j,k){f[k]=j});f.id="mce_fullscreen";f.width=n.clientWidth;f.height=n.clientHeight-15;f.fullscreen_is_enabled=true;f.fullscreen_editor_id=c.id;f.theme_advanced_resizing=false;f.save_onsavecallback=function(){c.setContent(tinyMCE.get(f.id).getContent({format:"raw"}),{format:"raw"});c.execCommand("mceSave")};tinymce.each(c.getParam("fullscreen_settings"),function(l,j){f[j]=l});if(f.theme_advanced_toolbar_location==="external"){f.theme_advanced_toolbar_location="top"}e.fullscreenEditor=new tinymce.Editor("mce_fullscreen",f);e.fullscreenEditor.onInit.add(function(){e.fullscreenEditor.setContent(c.getContent());e.fullscreenEditor.focus()});e.fullscreenEditor.render();tinyMCE.add(e.fullscreenEditor);e.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");e.fullscreenElement.update();e.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var j=tinymce.DOM.getViewPort();e.fullscreenEditor.theme.resizeTo(j.w,j.h)})}});c.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});c.onNodeChange.add(function(h,g){g.setActive("fullscreen",h.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..7429fff
--- /dev/null
@@ -0,0 +1,148 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       var DOM = tinymce.DOM;\r
+\r
+       tinymce.create('tinymce.plugins.FullScreenPlugin', {\r
+               init : function(ed, url) {\r
+                       var t = this, s = {}, vp;\r
+\r
+                       t.editor = ed;\r
+\r
+                       // Register commands\r
+                       ed.addCommand('mceFullScreen', function() {\r
+                               var win, de = DOM.doc.documentElement;\r
+\r
+                               if (ed.getParam('fullscreen_is_enabled')) {\r
+                                       if (ed.getParam('fullscreen_new_window'))\r
+                                               closeFullscreen(); // Call to close in new window\r
+                                       else {\r
+                                               DOM.win.setTimeout(function() {\r
+                                                       tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);\r
+                                                       tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'});\r
+                                                       tinyMCE.remove(ed);\r
+                                                       DOM.remove('mce_fullscreen_container');\r
+                                                       de.style.overflow = ed.getParam('fullscreen_html_overflow');\r
+                                                       DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow'));\r
+                                                       DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly'));\r
+                                                       tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings\r
+                                               }, 10);\r
+                                       }\r
+\r
+                                       return;\r
+                               }\r
+\r
+                               if (ed.getParam('fullscreen_new_window')) {\r
+                                       win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);\r
+                                       try {\r
+                                               win.resizeTo(screen.availWidth, screen.availHeight);\r
+                                       } catch (e) {\r
+                                               // Ignore\r
+                                       }\r
+                               } else {\r
+                                       tinyMCE.oldSettings = tinyMCE.settings; // Store old settings\r
+                                       s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';\r
+                                       s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);\r
+                                       vp = DOM.getViewPort();\r
+                                       s.fullscreen_scrollx = vp.x;\r
+                                       s.fullscreen_scrolly = vp.y;\r
+\r
+                                       // Fixes an Opera bug where the scrollbars doesn't reappear\r
+                                       if (tinymce.isOpera && s.fullscreen_overflow == 'visible')\r
+                                               s.fullscreen_overflow = 'auto';\r
+\r
+                                       // Fixes an IE bug where horizontal scrollbars would appear\r
+                                       if (tinymce.isIE && s.fullscreen_overflow == 'scroll')\r
+                                               s.fullscreen_overflow = 'auto';\r
+\r
+                                       // Fixes an IE bug where the scrollbars doesn't reappear\r
+                                       if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))\r
+                                               s.fullscreen_html_overflow = 'auto'; \r
+\r
+                                       if (s.fullscreen_overflow == '0px')\r
+                                               s.fullscreen_overflow = '';\r
+\r
+                                       DOM.setStyle(DOM.doc.body, 'overflow', 'hidden');\r
+                                       de.style.overflow = 'hidden'; //Fix for IE6/7\r
+                                       vp = DOM.getViewPort();\r
+                                       DOM.win.scrollTo(0, 0);\r
+\r
+                                       if (tinymce.isIE)\r
+                                               vp.h -= 1;\r
+\r
+                                       n = DOM.add(DOM.doc.body, 'div', {id : 'mce_fullscreen_container', style : 'position:' + (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel) ? 'absolute' : 'fixed') + ';top:0;left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'});\r
+                                       DOM.add(n, 'div', {id : 'mce_fullscreen'});\r
+\r
+                                       tinymce.each(ed.settings, function(v, n) {\r
+                                               s[n] = v;\r
+                                       });\r
+\r
+                                       s.id = 'mce_fullscreen';\r
+                                       s.width = n.clientWidth;\r
+                                       s.height = n.clientHeight - 15;\r
+                                       s.fullscreen_is_enabled = true;\r
+                                       s.fullscreen_editor_id = ed.id;\r
+                                       s.theme_advanced_resizing = false;\r
+                                       s.save_onsavecallback = function() {\r
+                                               ed.setContent(tinyMCE.get(s.id).getContent({format : 'raw'}), {format : 'raw'});\r
+                                               ed.execCommand('mceSave');\r
+                                       };\r
+\r
+                                       tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) {\r
+                                               s[k] = v;\r
+                                       });\r
+\r
+                                       if (s.theme_advanced_toolbar_location === 'external')\r
+                                               s.theme_advanced_toolbar_location = 'top';\r
+\r
+                                       t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s);\r
+                                       t.fullscreenEditor.onInit.add(function() {\r
+                                               t.fullscreenEditor.setContent(ed.getContent());\r
+                                               t.fullscreenEditor.focus();\r
+                                       });\r
+\r
+                                       t.fullscreenEditor.render();\r
+                                       tinyMCE.add(t.fullscreenEditor);\r
+\r
+                                       t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container');\r
+                                       t.fullscreenElement.update();\r
+                                       //document.body.overflow = 'hidden';\r
+\r
+                                       t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() {\r
+                                               var vp = tinymce.DOM.getViewPort();\r
+\r
+                                               t.fullscreenEditor.theme.resizeTo(vp.w, vp.h);\r
+                                       });\r
+                               }\r
+                       });\r
+\r
+                       // Register buttons\r
+                       ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'});\r
+\r
+                       ed.onNodeChange.add(function(ed, cm) {\r
+                               cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled'));\r
+                       });\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Fullscreen',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm b/docs/include/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm
new file mode 100644 (file)
index 0000000..4c4f27e
--- /dev/null
@@ -0,0 +1,109 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title></title>\r
+       <script type="text/javascript" src="../../tiny_mce.js"></script>\r
+       <script type="text/javascript">\r
+               function patchCallback(settings, key) {\r
+                       if (settings[key])\r
+                               settings[key] = "window.opener." + settings[key];\r
+               }\r
+\r
+               var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id;\r
+\r
+               // Clone array\r
+               for (var n in paSe)\r
+                       settings[n] = paSe[n];\r
+\r
+               // Override options for fullscreen\r
+               for (var n in paSe.fullscreen_settings)\r
+                       settings[n] = paSe.fullscreen_settings[n];\r
+\r
+               // Patch callbacks, make them point to window.opener\r
+               patchCallback(settings, 'urlconverter_callback');\r
+               patchCallback(settings, 'insertlink_callback');\r
+               patchCallback(settings, 'insertimage_callback');\r
+               patchCallback(settings, 'setupcontent_callback');\r
+               patchCallback(settings, 'save_callback');\r
+               patchCallback(settings, 'onchange_callback');\r
+               patchCallback(settings, 'init_instance_callback');\r
+               patchCallback(settings, 'file_browser_callback');\r
+               patchCallback(settings, 'cleanup_callback');\r
+               patchCallback(settings, 'execcommand_callback');\r
+               patchCallback(settings, 'oninit');\r
+\r
+               // Set options\r
+               delete settings.id;\r
+               settings['mode'] = 'exact';\r
+               settings['elements'] = 'fullscreenarea';\r
+               settings['add_unload_trigger'] = false;\r
+               settings['ask'] = false;\r
+               settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI();\r
+               settings['fullscreen_is_enabled'] = true;\r
+               settings['fullscreen_editor_id'] = oeID;\r
+               settings['theme_advanced_resizing'] = false;\r
+               settings['strict_loading_mode'] = true;\r
+\r
+               settings.save_onsavecallback = function() {\r
+                       window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});\r
+                       window.opener.tinyMCE.get(oeID).execCommand('mceSave');\r
+                       window.close();\r
+               };\r
+\r
+               function unloadHandler(e) {\r
+                       moveContent();\r
+               }\r
+\r
+               function moveContent() {\r
+                       window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent());\r
+               }\r
+\r
+               function closeFullscreen() {\r
+                       moveContent();\r
+                       window.close();\r
+               }\r
+\r
+               function doParentSubmit() {\r
+                       moveContent();\r
+\r
+                       if (window.opener.tinyMCE.selectedInstance.formElement.form)\r
+                               window.opener.tinyMCE.selectedInstance.formElement.form.submit();\r
+\r
+                       window.close();\r
+\r
+                       return false;\r
+               }\r
+\r
+               function render() {\r
+                       var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;\r
+\r
+                       e.value = window.opener.tinyMCE.get(oeID).getContent();\r
+\r
+                       vp = dom.getViewPort();\r
+                       settings.width = vp.w;\r
+                       settings.height = vp.h - 15;\r
+\r
+                       tinymce.dom.Event.add(window, 'resize', function() {\r
+                               var vp = dom.getViewPort();\r
+\r
+                               tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);\r
+                       });\r
+\r
+                       tinyMCE.init(settings);\r
+               }\r
+\r
+               // Add onunload\r
+               tinymce.dom.Event.add(window, "beforeunload", unloadHandler);\r
+       </script>\r
+</head>\r
+<body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no">\r
+<form onsubmit="doParentSubmit();">\r
+<textarea id="fullscreenarea" style="width:100%; height:100%"></textarea>\r
+</form>\r
+\r
+<script type="text/javascript">\r
+       render();\r
+</script>\r
+\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/iespell/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/iespell/editor_plugin.js
new file mode 100644 (file)
index 0000000..e9cba10
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.IESpell",{init:function(a,b){var c=this,d;if(!tinymce.isIE){return}c.editor=a;a.addCommand("mceIESpell",function(){try{d=new ActiveXObject("ieSpell.ieSpellExtension");d.CheckDocumentNode(a.getDoc().documentElement)}catch(f){if(f.number==-2146827859){a.windowManager.confirm(a.getLang("iespell.download"),function(e){if(e){window.open("http://www.iespell.com/download.php","ieSpellDownload","")}})}else{a.windowManager.alert("Error Loading ieSpell: Exception "+f.number)}}});a.addButton("iespell",{title:"iespell.iespell_desc",cmd:"mceIESpell"})},getInfo:function(){return{longname:"IESpell (IE Only)",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("iespell",tinymce.plugins.IESpell)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..1b2bb98
--- /dev/null
@@ -0,0 +1,54 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.IESpell', {\r
+               init : function(ed, url) {\r
+                       var t = this, sp;\r
+\r
+                       if (!tinymce.isIE)\r
+                               return;\r
+\r
+                       t.editor = ed;\r
+\r
+                       // Register commands\r
+                       ed.addCommand('mceIESpell', function() {\r
+                               try {\r
+                                       sp = new ActiveXObject("ieSpell.ieSpellExtension");\r
+                                       sp.CheckDocumentNode(ed.getDoc().documentElement);\r
+                               } catch (e) {\r
+                                       if (e.number == -2146827859) {\r
+                                               ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) {\r
+                                                       if (s)\r
+                                                               window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');\r
+                                               });\r
+                                       } else\r
+                                               ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number);\r
+                               }\r
+                       });\r
+\r
+                       // Register buttons\r
+                       ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'});\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'IESpell (IE Only)',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js
new file mode 100644 (file)
index 0000000..07ea477
--- /dev/null
@@ -0,0 +1 @@
+(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(r,j){var y=this,i,k="",q=y.editor,g=0,s=0,h,m,n,o,l,v,x;r=r||{};j=j||{};if(!r.inline){return y.parent(r,j)}if(!r.type){y.bookmark=q.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();r.width=parseInt(r.width||320);r.height=parseInt(r.height||240)+(tinymce.isIE?8:0);r.min_width=parseInt(r.min_width||150);r.min_height=parseInt(r.min_height||100);r.max_width=parseInt(r.max_width||2000);r.max_height=parseInt(r.max_height||2000);r.left=r.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(r.width/2)));r.top=r.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(r.height/2)));r.movable=r.resizable=true;j.mce_width=r.width;j.mce_height=r.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=r.auto_focus;y.features=r;y.params=j;y.onOpen.dispatch(y,r,j);if(r.type){k+=" mceModal";if(r.type){k+=" mce"+r.type.substring(0,1).toUpperCase()+r.type.substring(1)}r.resizable=false}if(r.statusbar){k+=" mceStatusbar"}if(r.resizable){k+=" mceResizable"}if(r.minimizable){k+=" mceMinimizable"}if(r.maximizable){k+=" mceMaximizable"}if(r.movable){k+=" mceMovable"}y._addAll(d.doc.body,["div",{id:i,"class":q.settings.inlinepopups_skin||"clearlooks2",style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},r.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!r.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;s+=d.get(i+"_top").clientHeight;s+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:r.top,left:r.left,width:r.width+g,height:r.height+s});x=r.url||r.file;if(x){if(tinymce.relaxedDomain){x+=(x.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}x=tinymce._addVer(x)}if(!r.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:r.width,height:r.height});d.setAttrib(i+"_ifr","src",x)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(r.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",r.content.replace("\n","<br />"))}n=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=y.windows[i];y.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return y._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return y._startDrag(i,t,u.className.substring(13))}}}}}});o=a.add(i,"click",function(f){var p=f.target;y.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":y.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":r.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});v=y.windows[i]={id:i,mousedown_func:n,click_func:o,element:new b(i,{blocker:1,container:q.getContainer()}),iframeElement:new b(i+"_ifr"),features:r,deltaWidth:g,deltaHeight:s};v.iframeElement.on("focus",function(){y.focus(i)});if(y.count==0&&y.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(y.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:y.zIndex-1}});d.show("mceModalBlocker")}else{d.setStyle("mceModalBlocker","z-index",y.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}y.focus(i);y._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}y.count++;return v},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;g<h.length;g++){f._addAll(k,h[g])}}}},_startDrag:function(v,G,E){var o=this,u,z,C=d.doc,f,l=o.windows[v],h=l.element,y=h.getXY(),x,q,F,g,A,s,r,j,i,m,k,n,B;g={x:0,y:0};A=d.getViewPort();A.w-=2;A.h-=2;j=G.screenX;i=G.screenY;m=k=n=B=0;u=a.add(C,"mouseup",function(p){a.remove(C,"mouseup",u);a.remove(C,"mousemove",z);if(f){f.remove()}h.moveBy(m,k);h.resizeBy(n,B);q=h.getSize();d.setStyles(v+"_ifr",{width:q.w-l.deltaWidth,height:q.h-l.deltaHeight});o._fixIELayout(v,1);return a.cancel(p)});if(E!="Move"){D()}function D(){if(f){return}o._fixIELayout(v,0);d.add(C.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(o.editor.settings.inlinepopups_skin||"clearlooks2"),style:{zIndex:o.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceEventBlocker",{position:"absolute",left:A.x,top:A.y,width:A.w-2,height:A.h-2})}f=new b("mceEventBlocker");f.update();x=h.getXY();q=h.getSize();s=g.x+x.x-A.x;r=g.y+x.y-A.y;d.add(f.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:s,top:r,width:q.w,height:q.h}});F=new b("mcePlaceHolder")}z=a.add(C,"mousemove",function(w){var p,H,t;D();p=w.screenX-j;H=w.screenY-i;switch(E){case"ResizeW":m=p;n=0-p;break;case"ResizeE":n=p;break;case"ResizeN":case"ResizeNW":case"ResizeNE":if(E=="ResizeNW"){m=p;n=0-p}else{if(E=="ResizeNE"){n=p}}k=H;B=0-H;break;case"ResizeS":case"ResizeSW":case"ResizeSE":if(E=="ResizeSW"){m=p;n=0-p}else{if(E=="ResizeSE"){n=p}}B=H;break;case"mceMove":m=p;k=H;break}if(n<(t=l.features.min_width-q.w)){if(m!==0){m+=n-t}n=t}if(B<(t=l.features.min_height-q.h)){if(k!==0){k+=B-t}B=t}n=Math.min(n,l.features.max_width-q.w);B=Math.min(B,l.features.max_height-q.h);m=Math.max(m,A.x-(s+A.x));k=Math.max(k,A.y-(r+A.y));m=Math.min(m,(A.w+A.x)-(s+q.w+A.x));k=Math.min(k,(A.h+A.y)-(r+q.h+A.y));if(m+k!==0){if(s+m<0){m=0}if(r+k<0){k=0}F.moveTo(s+m,r+k)}if(n+B!==0){F.resizeTo(q.w+n,q.h+B)}return a.cancel(w)});return a.cancel(G)},resizeBy:function(g,h,i){var f=this.windows[i];if(f){f.element.resizeBy(g,h);f.iframeElement.resizeBy(g,h)}},close:function(j,l){var h=this,g,k=d.doc,f=0,i,l;l=h._findId(l||j);if(!h.windows[l]){h.parent(j);return}h.count--;if(h.count==0){d.remove("mceModalBlocker")}if(g=h.windows[l]){h.onClose.dispatch(h);a.remove(k,"mousedown",g.mousedownFunc);a.remove(k,"click",g.clickFunc);a.clear(l);a.clear(l+"_ifr");d.setAttrib(l+"_ifr","src",'javascript:""');g.element.remove();delete h.windows[l];e(h.windows,function(m){if(m.zIndex>f){i=m;f=m.zIndex}});if(i){h.focus(i.id)}}},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..e991683
--- /dev/null
@@ -0,0 +1,635 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is;\r
+\r
+       tinymce.create('tinymce.plugins.InlinePopups', {\r
+               init : function(ed, url) {\r
+                       // Replace window manager\r
+                       ed.onBeforeRenderUI.add(function() {\r
+                               ed.windowManager = new tinymce.InlineWindowManager(ed);\r
+                               DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css");\r
+                       });\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'InlinePopups',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               }\r
+       });\r
+\r
+       tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', {\r
+               InlineWindowManager : function(ed) {\r
+                       var t = this;\r
+\r
+                       t.parent(ed);\r
+                       t.zIndex = 300000;\r
+                       t.count = 0;\r
+                       t.windows = {};\r
+               },\r
+\r
+               open : function(f, p) {\r
+                       var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u;\r
+\r
+                       f = f || {};\r
+                       p = p || {};\r
+\r
+                       // Run native windows\r
+                       if (!f.inline)\r
+                               return t.parent(f, p);\r
+\r
+                       // Only store selection if the type is a normal window\r
+                       if (!f.type)\r
+                               t.bookmark = ed.selection.getBookmark(1);\r
+\r
+                       id = DOM.uniqueId();\r
+                       vp = DOM.getViewPort();\r
+                       f.width = parseInt(f.width || 320);\r
+                       f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0);\r
+                       f.min_width = parseInt(f.min_width || 150);\r
+                       f.min_height = parseInt(f.min_height || 100);\r
+                       f.max_width = parseInt(f.max_width || 2000);\r
+                       f.max_height = parseInt(f.max_height || 2000);\r
+                       f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0)));\r
+                       f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0)));\r
+                       f.movable = f.resizable = true;\r
+                       p.mce_width = f.width;\r
+                       p.mce_height = f.height;\r
+                       p.mce_inline = true;\r
+                       p.mce_window_id = id;\r
+                       p.mce_auto_focus = f.auto_focus;\r
+\r
+                       // Transpose\r
+//                     po = DOM.getPos(ed.getContainer());\r
+//                     f.left -= po.x;\r
+//                     f.top -= po.y;\r
+\r
+                       t.features = f;\r
+                       t.params = p;\r
+                       t.onOpen.dispatch(t, f, p);\r
+\r
+                       if (f.type) {\r
+                               opt += ' mceModal';\r
+\r
+                               if (f.type)\r
+                                       opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1);\r
+\r
+                               f.resizable = false;\r
+                       }\r
+\r
+                       if (f.statusbar)\r
+                               opt += ' mceStatusbar';\r
+\r
+                       if (f.resizable)\r
+                               opt += ' mceResizable';\r
+\r
+                       if (f.minimizable)\r
+                               opt += ' mceMinimizable';\r
+\r
+                       if (f.maximizable)\r
+                               opt += ' mceMaximizable';\r
+\r
+                       if (f.movable)\r
+                               opt += ' mceMovable';\r
+\r
+                       // Create DOM objects\r
+                       t._addAll(DOM.doc.body, \r
+                               ['div', {id : id, 'class' : ed.settings.inlinepopups_skin || 'clearlooks2', style : 'width:100px;height:100px'}, \r
+                                       ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt},\r
+                                               ['div', {id : id + '_top', 'class' : 'mceTop'}, \r
+                                                       ['div', {'class' : 'mceLeft'}],\r
+                                                       ['div', {'class' : 'mceCenter'}],\r
+                                                       ['div', {'class' : 'mceRight'}],\r
+                                                       ['span', {id : id + '_title'}, f.title || '']\r
+                                               ],\r
+\r
+                                               ['div', {id : id + '_middle', 'class' : 'mceMiddle'}, \r
+                                                       ['div', {id : id + '_left', 'class' : 'mceLeft'}],\r
+                                                       ['span', {id : id + '_content'}],\r
+                                                       ['div', {id : id + '_right', 'class' : 'mceRight'}]\r
+                                               ],\r
+\r
+                                               ['div', {id : id + '_bottom', 'class' : 'mceBottom'},\r
+                                                       ['div', {'class' : 'mceLeft'}],\r
+                                                       ['div', {'class' : 'mceCenter'}],\r
+                                                       ['div', {'class' : 'mceRight'}],\r
+                                                       ['span', {id : id + '_status'}, 'Content']\r
+                                               ],\r
+\r
+                                               ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}],\r
+                                               ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],\r
+                                               ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],\r
+                                               ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],\r
+                                               ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],\r
+                                               ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}],\r
+                                               ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}],\r
+                                               ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}],\r
+                                               ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}],\r
+                                               ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}],\r
+                                               ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}],\r
+                                               ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}],\r
+                                               ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}]\r
+                                       ]\r
+                               ]\r
+                       );\r
+\r
+                       DOM.setStyles(id, {top : -10000, left : -10000});\r
+\r
+                       // Fix gecko rendering bug, where the editors iframe messed with window contents\r
+                       if (tinymce.isGecko)\r
+                               DOM.setStyle(id, 'overflow', 'auto');\r
+\r
+                       // Measure borders\r
+                       if (!f.type) {\r
+                               dw += DOM.get(id + '_left').clientWidth;\r
+                               dw += DOM.get(id + '_right').clientWidth;\r
+                               dh += DOM.get(id + '_top').clientHeight;\r
+                               dh += DOM.get(id + '_bottom').clientHeight;\r
+                       }\r
+\r
+                       // Resize window\r
+                       DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh});\r
+\r
+                       u = f.url || f.file;\r
+                       if (u) {\r
+                               if (tinymce.relaxedDomain)\r
+                                       u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain;\r
+\r
+                               u = tinymce._addVer(u);\r
+                       }\r
+\r
+                       if (!f.type) {\r
+                               DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'});\r
+                               DOM.setStyles(id + '_ifr', {width : f.width, height : f.height});\r
+                               DOM.setAttrib(id + '_ifr', 'src', u);\r
+                       } else {\r
+                               DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok');\r
+\r
+                               if (f.type == 'confirm')\r
+                                       DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel');\r
+\r
+                               DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'});\r
+                               DOM.setHTML(id + '_content', f.content.replace('\n', '<br />'));\r
+                       }\r
+\r
+                       // Register events\r
+                       mdf = Event.add(id, 'mousedown', function(e) {\r
+                               var n = e.target, w, vp;\r
+\r
+                               w = t.windows[id];\r
+                               t.focus(id);\r
+\r
+                               if (n.nodeName == 'A' || n.nodeName == 'a') {\r
+                                       if (n.className == 'mceMax') {\r
+                                               w.oldPos = w.element.getXY();\r
+                                               w.oldSize = w.element.getSize();\r
+\r
+                                               vp = DOM.getViewPort();\r
+\r
+                                               // Reduce viewport size to avoid scrollbars\r
+                                               vp.w -= 2;\r
+                                               vp.h -= 2;\r
+\r
+                                               w.element.moveTo(vp.x, vp.y);\r
+                                               w.element.resizeTo(vp.w, vp.h);\r
+                                               DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight});\r
+                                               DOM.addClass(id + '_wrapper', 'mceMaximized');\r
+                                       } else if (n.className == 'mceMed') {\r
+                                               // Reset to old size\r
+                                               w.element.moveTo(w.oldPos.x, w.oldPos.y);\r
+                                               w.element.resizeTo(w.oldSize.w, w.oldSize.h);\r
+                                               w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight);\r
+\r
+                                               DOM.removeClass(id + '_wrapper', 'mceMaximized');\r
+                                       } else if (n.className == 'mceMove')\r
+                                               return t._startDrag(id, e, n.className);\r
+                                       else if (DOM.hasClass(n, 'mceResize'))\r
+                                               return t._startDrag(id, e, n.className.substring(13));\r
+                               }\r
+                       });\r
+\r
+                       clf = Event.add(id, 'click', function(e) {\r
+                               var n = e.target;\r
+\r
+                               t.focus(id);\r
+\r
+                               if (n.nodeName == 'A' || n.nodeName == 'a') {\r
+                                       switch (n.className) {\r
+                                               case 'mceClose':\r
+                                                       t.close(null, id);\r
+                                                       return Event.cancel(e);\r
+\r
+                                               case 'mceButton mceOk':\r
+                                               case 'mceButton mceCancel':\r
+                                                       f.button_func(n.className == 'mceButton mceOk');\r
+                                                       return Event.cancel(e);\r
+                                       }\r
+                               }\r
+                       });\r
+\r
+                       // Add window\r
+                       w = t.windows[id] = {\r
+                               id : id,\r
+                               mousedown_func : mdf,\r
+                               click_func : clf,\r
+                               element : new Element(id, {blocker : 1, container : ed.getContainer()}),\r
+                               iframeElement : new Element(id + '_ifr'),\r
+                               features : f,\r
+                               deltaWidth : dw,\r
+                               deltaHeight : dh\r
+                       };\r
+\r
+                       w.iframeElement.on('focus', function() {\r
+                               t.focus(id);\r
+                       });\r
+\r
+                       // Setup blocker\r
+                       if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') {\r
+                               DOM.add(DOM.doc.body, 'div', {\r
+                                       id : 'mceModalBlocker',\r
+                                       'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker',\r
+                                       style : {zIndex : t.zIndex - 1}\r
+                               });\r
+\r
+                               DOM.show('mceModalBlocker'); // Reduces flicker in IE\r
+                       } else\r
+                               DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1);\r
+\r
+                       if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel))\r
+                               DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});\r
+\r
+                       t.focus(id);\r
+                       t._fixIELayout(id, 1);\r
+\r
+                       // Focus ok button\r
+                       if (DOM.get(id + '_ok'))\r
+                               DOM.get(id + '_ok').focus();\r
+\r
+                       t.count++;\r
+\r
+                       return w;\r
+               },\r
+\r
+               focus : function(id) {\r
+                       var t = this, w;\r
+\r
+                       if (w = t.windows[id]) {\r
+                               w.zIndex = this.zIndex++;\r
+                               w.element.setStyle('zIndex', w.zIndex);\r
+                               w.element.update();\r
+\r
+                               id = id + '_wrapper';\r
+                               DOM.removeClass(t.lastId, 'mceFocus');\r
+                               DOM.addClass(id, 'mceFocus');\r
+                               t.lastId = id;\r
+                       }\r
+               },\r
+\r
+               _addAll : function(te, ne) {\r
+                       var i, n, t = this, dom = tinymce.DOM;\r
+\r
+                       if (is(ne, 'string'))\r
+                               te.appendChild(dom.doc.createTextNode(ne));\r
+                       else if (ne.length) {\r
+                               te = te.appendChild(dom.create(ne[0], ne[1]));\r
+\r
+                               for (i=2; i<ne.length; i++)\r
+                                       t._addAll(te, ne[i]);\r
+                       }\r
+               },\r
+\r
+               _startDrag : function(id, se, ac) {\r
+                       var t = this, mu, mm, d = DOM.doc, eb, w = t.windows[id], we = w.element, sp = we.getXY(), p, sz, ph, cp, vp, sx, sy, sex, sey, dx, dy, dw, dh;\r
+\r
+                       // Get positons and sizes\r
+//                     cp = DOM.getPos(t.editor.getContainer());\r
+                       cp = {x : 0, y : 0};\r
+                       vp = DOM.getViewPort();\r
+\r
+                       // Reduce viewport size to avoid scrollbars while dragging\r
+                       vp.w -= 2;\r
+                       vp.h -= 2;\r
+\r
+                       sex = se.screenX;\r
+                       sey = se.screenY;\r
+                       dx = dy = dw = dh = 0;\r
+\r
+                       // Handle mouse up\r
+                       mu = Event.add(d, 'mouseup', function(e) {\r
+                               Event.remove(d, 'mouseup', mu);\r
+                               Event.remove(d, 'mousemove', mm);\r
+\r
+                               if (eb)\r
+                                       eb.remove();\r
+\r
+                               we.moveBy(dx, dy);\r
+                               we.resizeBy(dw, dh);\r
+                               sz = we.getSize();\r
+                               DOM.setStyles(id + '_ifr', {width : sz.w - w.deltaWidth, height : sz.h - w.deltaHeight});\r
+                               t._fixIELayout(id, 1);\r
+\r
+                               return Event.cancel(e);\r
+                       });\r
+\r
+                       if (ac != 'Move')\r
+                               startMove();\r
+\r
+                       function startMove() {\r
+                               if (eb)\r
+                                       return;\r
+\r
+                               t._fixIELayout(id, 0);\r
+\r
+                               // Setup event blocker\r
+                               DOM.add(d.body, 'div', {\r
+                                       id : 'mceEventBlocker',\r
+                                       'class' : 'mceEventBlocker ' + (t.editor.settings.inlinepopups_skin || 'clearlooks2'),\r
+                                       style : {zIndex : t.zIndex + 1}\r
+                               });\r
+\r
+                               if (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel))\r
+                                       DOM.setStyles('mceEventBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});\r
+\r
+                               eb = new Element('mceEventBlocker');\r
+                               eb.update();\r
+\r
+                               // Setup placeholder\r
+                               p = we.getXY();\r
+                               sz = we.getSize();\r
+                               sx = cp.x + p.x - vp.x;\r
+                               sy = cp.y + p.y - vp.y;\r
+                               DOM.add(eb.get(), 'div', {id : 'mcePlaceHolder', 'class' : 'mcePlaceHolder', style : {left : sx, top : sy, width : sz.w, height : sz.h}});\r
+                               ph = new Element('mcePlaceHolder');\r
+                       };\r
+\r
+                       // Handle mouse move/drag\r
+                       mm = Event.add(d, 'mousemove', function(e) {\r
+                               var x, y, v;\r
+\r
+                               startMove();\r
+\r
+                               x = e.screenX - sex;\r
+                               y = e.screenY - sey;\r
+\r
+                               switch (ac) {\r
+                                       case 'ResizeW':\r
+                                               dx = x;\r
+                                               dw = 0 - x;\r
+                                               break;\r
+\r
+                                       case 'ResizeE':\r
+                                               dw = x;\r
+                                               break;\r
+\r
+                                       case 'ResizeN':\r
+                                       case 'ResizeNW':\r
+                                       case 'ResizeNE':\r
+                                               if (ac == "ResizeNW") {\r
+                                                       dx = x;\r
+                                                       dw = 0 - x;\r
+                                               } else if (ac == "ResizeNE")\r
+                                                       dw = x;\r
+\r
+                                               dy = y;\r
+                                               dh = 0 - y;\r
+                                               break;\r
+\r
+                                       case 'ResizeS':\r
+                                       case 'ResizeSW':\r
+                                       case 'ResizeSE':\r
+                                               if (ac == "ResizeSW") {\r
+                                                       dx = x;\r
+                                                       dw = 0 - x;\r
+                                               } else if (ac == "ResizeSE")\r
+                                                       dw = x;\r
+\r
+                                               dh = y;\r
+                                               break;\r
+\r
+                                       case 'mceMove':\r
+                                               dx = x;\r
+                                               dy = y;\r
+                                               break;\r
+                               }\r
+\r
+                               // Boundary check\r
+                               if (dw < (v = w.features.min_width - sz.w)) {\r
+                                       if (dx !== 0)\r
+                                               dx += dw - v;\r
+\r
+                                       dw = v;\r
+                               }\r
+       \r
+                               if (dh < (v = w.features.min_height - sz.h)) {\r
+                                       if (dy !== 0)\r
+                                               dy += dh - v;\r
+\r
+                                       dh = v;\r
+                               }\r
+\r
+                               dw = Math.min(dw, w.features.max_width - sz.w);\r
+                               dh = Math.min(dh, w.features.max_height - sz.h);\r
+                               dx = Math.max(dx, vp.x - (sx + vp.x));\r
+                               dy = Math.max(dy, vp.y - (sy + vp.y));\r
+                               dx = Math.min(dx, (vp.w + vp.x) - (sx + sz.w + vp.x));\r
+                               dy = Math.min(dy, (vp.h + vp.y) - (sy + sz.h + vp.y));\r
+\r
+                               // Move if needed\r
+                               if (dx + dy !== 0) {\r
+                                       if (sx + dx < 0)\r
+                                               dx = 0;\r
+       \r
+                                       if (sy + dy < 0)\r
+                                               dy = 0;\r
+\r
+                                       ph.moveTo(sx + dx, sy + dy);\r
+                               }\r
+\r
+                               // Resize if needed\r
+                               if (dw + dh !== 0)\r
+                                       ph.resizeTo(sz.w + dw, sz.h + dh);\r
+\r
+                               return Event.cancel(e);\r
+                       });\r
+\r
+                       return Event.cancel(se);\r
+               },\r
+\r
+               resizeBy : function(dw, dh, id) {\r
+                       var w = this.windows[id];\r
+\r
+                       if (w) {\r
+                               w.element.resizeBy(dw, dh);\r
+                               w.iframeElement.resizeBy(dw, dh);\r
+                       }\r
+               },\r
+\r
+               close : function(win, id) {\r
+                       var t = this, w, d = DOM.doc, ix = 0, fw, id;\r
+\r
+                       id = t._findId(id || win);\r
+\r
+                       // Probably not inline\r
+                       if (!t.windows[id]) {\r
+                               t.parent(win);\r
+                               return;\r
+                       }\r
+\r
+                       t.count--;\r
+\r
+                       if (t.count == 0)\r
+                               DOM.remove('mceModalBlocker');\r
+\r
+                       if (w = t.windows[id]) {\r
+                               t.onClose.dispatch(t);\r
+                               Event.remove(d, 'mousedown', w.mousedownFunc);\r
+                               Event.remove(d, 'click', w.clickFunc);\r
+                               Event.clear(id);\r
+                               Event.clear(id + '_ifr');\r
+\r
+                               DOM.setAttrib(id + '_ifr', 'src', 'javascript:""'); // Prevent leak\r
+                               w.element.remove();\r
+                               delete t.windows[id];\r
+\r
+                               // Find front most window and focus that\r
+                               each (t.windows, function(w) {\r
+                                       if (w.zIndex > ix) {\r
+                                               fw = w;\r
+                                               ix = w.zIndex;\r
+                                       }\r
+                               });\r
+\r
+                               if (fw)\r
+                                       t.focus(fw.id);\r
+                       }\r
+               },\r
+\r
+               setTitle : function(w, ti) {\r
+                       var e;\r
+\r
+                       w = this._findId(w);\r
+\r
+                       if (e = DOM.get(w + '_title'))\r
+                               e.innerHTML = DOM.encode(ti);\r
+               },\r
+\r
+               alert : function(txt, cb, s) {\r
+                       var t = this, w;\r
+\r
+                       w = t.open({\r
+                               title : t,\r
+                               type : 'alert',\r
+                               button_func : function(s) {\r
+                                       if (cb)\r
+                                               cb.call(s || t, s);\r
+\r
+                                       t.close(null, w.id);\r
+                               },\r
+                               content : DOM.encode(t.editor.getLang(txt, txt)),\r
+                               inline : 1,\r
+                               width : 400,\r
+                               height : 130\r
+                       });\r
+               },\r
+\r
+               confirm : function(txt, cb, s) {\r
+                       var t = this, w;\r
+\r
+                       w = t.open({\r
+                               title : t,\r
+                               type : 'confirm',\r
+                               button_func : function(s) {\r
+                                       if (cb)\r
+                                               cb.call(s || t, s);\r
+\r
+                                       t.close(null, w.id);\r
+                               },\r
+                               content : DOM.encode(t.editor.getLang(txt, txt)),\r
+                               inline : 1,\r
+                               width : 400,\r
+                               height : 130\r
+                       });\r
+               },\r
+\r
+               // Internal functions\r
+\r
+               _findId : function(w) {\r
+                       var t = this;\r
+\r
+                       if (typeof(w) == 'string')\r
+                               return w;\r
+\r
+                       each(t.windows, function(wo) {\r
+                               var ifr = DOM.get(wo.id + '_ifr');\r
+\r
+                               if (ifr && w == ifr.contentWindow) {\r
+                                       w = wo.id;\r
+                                       return false;\r
+                               }\r
+                       });\r
+\r
+                       return w;\r
+               },\r
+\r
+               _fixIELayout : function(id, s) {\r
+                       var w, img;\r
+\r
+                       if (!tinymce.isIE6)\r
+                               return;\r
+\r
+                       // Fixes the bug where hover flickers and does odd things in IE6\r
+                       each(['n','s','w','e','nw','ne','sw','se'], function(v) {\r
+                               var e = DOM.get(id + '_resize_' + v);\r
+\r
+                               DOM.setStyles(e, {\r
+                                       width : s ? e.clientWidth : '',\r
+                                       height : s ? e.clientHeight : '',\r
+                                       cursor : DOM.getStyle(e, 'cursor', 1)\r
+                               });\r
+\r
+                               DOM.setStyle(id + "_bottom", 'bottom', '-1px');\r
+\r
+                               e = 0;\r
+                       });\r
+\r
+                       // Fixes graphics glitch\r
+                       if (w = this.windows[id]) {\r
+                               // Fixes rendering bug after resize\r
+                               w.element.hide();\r
+                               w.element.show();\r
+\r
+                               // Forced a repaint of the window\r
+                               //DOM.get(id).style.filter = '';\r
+\r
+                               // IE has a bug where images used in CSS won't get loaded\r
+                               // sometimes when the cache in the browser is disabled\r
+                               // This fix tries to solve it by loading the images using the image object\r
+                               each(DOM.select('div,a', id), function(e, i) {\r
+                                       if (e.currentStyle.backgroundImage != 'none') {\r
+                                               img = new Image();\r
+                                               img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1');\r
+                                       }\r
+                               });\r
+\r
+                               DOM.get(id).style.filter = '';\r
+                       }\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups);\r
+})();\r
+\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif
new file mode 100644 (file)
index 0000000..94abd08
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif
new file mode 100644 (file)
index 0000000..e671094
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif
new file mode 100644 (file)
index 0000000..6baf64a
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif
new file mode 100644 (file)
index 0000000..497307a
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif
new file mode 100644 (file)
index 0000000..c894b2e
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif
new file mode 100644 (file)
index 0000000..c2a2ad4
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif
new file mode 100644 (file)
index 0000000..43a735f
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css
new file mode 100644 (file)
index 0000000..5e6fd7d
--- /dev/null
@@ -0,0 +1,90 @@
+/* Clearlooks 2 */
+
+/* Reset */
+.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block}
+
+/* General */
+.clearlooks2 {position:absolute; direction:ltr}
+.clearlooks2 .mceWrapper {position:static}
+.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%}
+.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)}
+.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none}
+
+/* Top */
+.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px}
+.clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)}
+.clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)}
+.clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0}
+.clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold}
+.clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0}
+.clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px}
+.clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0}
+.clearlooks2 .mceFocus .mceTop span {color:#FFF}
+
+/* Middle */
+.clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0}
+.clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)}
+.clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0}
+.clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF}
+.clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)}
+
+/* Bottom */
+.clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px}
+.clearlooks2 .mceBottom {left:0; bottom:0; width:100%}
+.clearlooks2 .mceBottom div {top:0}
+.clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px}
+.clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px}
+.clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0}
+.clearlooks2 .mceBottom span {display:none}
+.clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px}
+.clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0}
+.clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px}
+.clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0}
+.clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px}
+
+/* Actions */
+.clearlooks2 a {width:29px; height:16px; top:3px;}
+.clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0}
+.clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0}
+.clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0}
+.clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0}
+.clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px}
+.clearlooks2 .mceMovable .mceMove {display:block}
+.clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px}
+.clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px}
+.clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px}
+.clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px}
+.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
+.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
+.clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px}
+.clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px}
+.clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px}
+
+/* Resize */
+.clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px}
+.clearlooks2 .mceResizable .mceResize {display:block}
+.clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none}
+.clearlooks2 .mceMinimizable .mceMin {display:block}
+.clearlooks2 .mceMaximizable .mceMax {display:block}
+.clearlooks2 .mceMaximized .mceMed {display:block}
+.clearlooks2 .mceMaximized .mceMax {display:none}
+.clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize}
+.clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize}
+.clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize}
+.clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;}
+.clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize}
+.clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize}
+.clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize}
+.clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize}
+
+/* Alert/Confirm */
+.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0}
+.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px}
+.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal}
+.clearlooks2 a:hover {font-weight:bold;}
+.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5}
+.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px}
+.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)}
+.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px}
+.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto}
+.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)} 
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/inlinepopups/template.htm b/docs/include/jscripts/tiny_mce/plugins/inlinepopups/template.htm
new file mode 100644 (file)
index 0000000..f9ec642
--- /dev/null
@@ -0,0 +1,387 @@
+<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -->\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+<title>Template for dialogs</title>\r
+<link rel="stylesheet" type="text/css" href="skins/clearlooks2/window.css" />\r
+</head>\r
+<body>\r
+\r
+<div class="mceEditor">\r
+       <div class="clearlooks2" style="width:400px; height:100px; left:10px;">\r
+               <div class="mceWrapper">\r
+                       <div class="mceTop">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Blured</span>\r
+                       </div>\r
+\r
+                       <div class="mceMiddle">\r
+                               <div class="mceLeft"></div>\r
+                               <span>Content</span>\r
+                               <div class="mceRight"></div>\r
+                       </div>\r
+\r
+                       <div class="mceBottom">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Statusbar text.</span>\r
+                       </div>\r
+\r
+                       <a class="mceMove" href="#"></a>\r
+                       <a class="mceMin" href="#"></a>\r
+                       <a class="mceMax" href="#"></a>\r
+                       <a class="mceMed" href="#"></a>\r
+                       <a class="mceClose" href="#"></a>\r
+                       <a class="mceResize mceResizeN" href="#"></a>\r
+                       <a class="mceResize mceResizeS" href="#"></a>\r
+                       <a class="mceResize mceResizeW" href="#"></a>\r
+                       <a class="mceResize mceResizeE" href="#"></a>\r
+                       <a class="mceResize mceResizeNW" href="#"></a>\r
+                       <a class="mceResize mceResizeNE" href="#"></a>\r
+                       <a class="mceResize mceResizeSW" href="#"></a>\r
+                       <a class="mceResize mceResizeSE" href="#"></a>\r
+               </div>\r
+       </div>\r
+\r
+       <div class="clearlooks2" style="width:400px; height:100px; left:420px;">\r
+               <div class="mceWrapper mceMovable mceFocus">\r
+                       <div class="mceTop">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Focused</span>\r
+                       </div>\r
+\r
+                       <div class="mceMiddle">\r
+                               <div class="mceLeft"></div>\r
+                               <span>Content</span>\r
+                               <div class="mceRight"></div>\r
+                       </div>\r
+\r
+                       <div class="mceBottom">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Statusbar text.</span>\r
+                       </div>\r
+\r
+                       <a class="mceMove" href="#"></a>\r
+                       <a class="mceMin" href="#"></a>\r
+                       <a class="mceMax" href="#"></a>\r
+                       <a class="mceMed" href="#"></a>\r
+                       <a class="mceClose" href="#"></a>\r
+                       <a class="mceResize mceResizeN" href="#"></a>\r
+                       <a class="mceResize mceResizeS" href="#"></a>\r
+                       <a class="mceResize mceResizeW" href="#"></a>\r
+                       <a class="mceResize mceResizeE" href="#"></a>\r
+                       <a class="mceResize mceResizeNW" href="#"></a>\r
+                       <a class="mceResize mceResizeNE" href="#"></a>\r
+                       <a class="mceResize mceResizeSW" href="#"></a>\r
+                       <a class="mceResize mceResizeSE" href="#"></a>\r
+               </div>\r
+       </div>\r
+\r
+       <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:120px;">\r
+               <div class="mceWrapper mceMovable mceFocus mceStatusbar">\r
+                       <div class="mceTop">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Statusbar</span>\r
+                       </div>\r
+\r
+                       <div class="mceMiddle">\r
+                               <div class="mceLeft"></div>\r
+                               <span>Content</span>\r
+                               <div class="mceRight"></div>\r
+                       </div>\r
+\r
+                       <div class="mceBottom">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Statusbar text.</span>\r
+                       </div>\r
+\r
+                       <a class="mceMove" href="#"></a>\r
+                       <a class="mceMin" href="#"></a>\r
+                       <a class="mceMax" href="#"></a>\r
+                       <a class="mceMed" href="#"></a>\r
+                       <a class="mceClose" href="#"></a>\r
+                       <a class="mceResize mceResizeN" href="#"></a>\r
+                       <a class="mceResize mceResizeS" href="#"></a>\r
+                       <a class="mceResize mceResizeW" href="#"></a>\r
+                       <a class="mceResize mceResizeE" href="#"></a>\r
+                       <a class="mceResize mceResizeNW" href="#"></a>\r
+                       <a class="mceResize mceResizeNE" href="#"></a>\r
+                       <a class="mceResize mceResizeSW" href="#"></a>\r
+                       <a class="mceResize mceResizeSE" href="#"></a>\r
+               </div>\r
+       </div>\r
+\r
+       <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:120px;">\r
+               <div class="mceWrapper mceMovable mceFocus mceStatusbar mceResizable">\r
+                       <div class="mceTop">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Statusbar, Resizable</span>\r
+                       </div>\r
+\r
+                       <div class="mceMiddle">\r
+                               <div class="mceLeft"></div>\r
+                               <span>Content</span>\r
+                               <div class="mceRight"></div>\r
+                       </div>\r
+\r
+                       <div class="mceBottom">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Statusbar text.</span>\r
+                       </div>\r
+\r
+                       <a class="mceMove" href="#"></a>\r
+                       <a class="mceMin" href="#"></a>\r
+                       <a class="mceMax" href="#"></a>\r
+                       <a class="mceMed" href="#"></a>\r
+                       <a class="mceClose" href="#"></a>\r
+                       <a class="mceResize mceResizeN" href="#"></a>\r
+                       <a class="mceResize mceResizeS" href="#"></a>\r
+                       <a class="mceResize mceResizeW" href="#"></a>\r
+                       <a class="mceResize mceResizeE" href="#"></a>\r
+                       <a class="mceResize mceResizeNW" href="#"></a>\r
+                       <a class="mceResize mceResizeNE" href="#"></a>\r
+                       <a class="mceResize mceResizeSW" href="#"></a>\r
+                       <a class="mceResize mceResizeSE" href="#"></a>\r
+               </div>\r
+       </div>\r
+\r
+       <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:230px;">\r
+               <div class="mceWrapper mceMovable mceFocus mceResizable mceMaximizable">\r
+                       <div class="mceTop">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Resizable, Maximizable</span>\r
+                       </div>\r
+\r
+                       <div class="mceMiddle">\r
+                               <div class="mceLeft"></div>\r
+                               <span>Content</span>\r
+                               <div class="mceRight"></div>\r
+                       </div>\r
+\r
+                       <div class="mceBottom">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Statusbar text.</span>\r
+                       </div>\r
+\r
+                       <a class="mceMove" href="#"></a>\r
+                       <a class="mceMin" href="#"></a>\r
+                       <a class="mceMax" href="#"></a>\r
+                       <a class="mceMed" href="#"></a>\r
+                       <a class="mceClose" href="#"></a>\r
+                       <a class="mceResize mceResizeN" href="#"></a>\r
+                       <a class="mceResize mceResizeS" href="#"></a>\r
+                       <a class="mceResize mceResizeW" href="#"></a>\r
+                       <a class="mceResize mceResizeE" href="#"></a>\r
+                       <a class="mceResize mceResizeNW" href="#"></a>\r
+                       <a class="mceResize mceResizeNE" href="#"></a>\r
+                       <a class="mceResize mceResizeSW" href="#"></a>\r
+                       <a class="mceResize mceResizeSE" href="#"></a>\r
+               </div>\r
+       </div>\r
+\r
+       <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:230px;">\r
+               <div class="mceWrapper mceMovable mceStatusbar mceResizable mceMaximizable">\r
+                       <div class="mceTop">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Blurred, Maximizable, Statusbar, Resizable</span>\r
+                       </div>\r
+\r
+                       <div class="mceMiddle">\r
+                               <div class="mceLeft"></div>\r
+                               <span>Content</span>\r
+                               <div class="mceRight"></div>\r
+                       </div>\r
+\r
+                       <div class="mceBottom">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Statusbar text.</span>\r
+                       </div>\r
+\r
+                       <a class="mceMove" href="#"></a>\r
+                       <a class="mceMin" href="#"></a>\r
+                       <a class="mceMax" href="#"></a>\r
+                       <a class="mceMed" href="#"></a>\r
+                       <a class="mceClose" href="#"></a>\r
+                       <a class="mceResize mceResizeN" href="#"></a>\r
+                       <a class="mceResize mceResizeS" href="#"></a>\r
+                       <a class="mceResize mceResizeW" href="#"></a>\r
+                       <a class="mceResize mceResizeE" href="#"></a>\r
+                       <a class="mceResize mceResizeNW" href="#"></a>\r
+                       <a class="mceResize mceResizeNE" href="#"></a>\r
+                       <a class="mceResize mceResizeSW" href="#"></a>\r
+                       <a class="mceResize mceResizeSE" href="#"></a>\r
+               </div>\r
+       </div>\r
+\r
+       <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:340px;">\r
+               <div class="mceWrapper mceMovable mceFocus mceResizable mceMaximized mceMinimizable mceMaximizable">\r
+                       <div class="mceTop">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Maximized, Maximizable, Minimizable</span>\r
+                       </div>\r
+\r
+                       <div class="mceMiddle">\r
+                               <div class="mceLeft"></div>\r
+                               <span>Content</span>\r
+                               <div class="mceRight"></div>\r
+                       </div>\r
+\r
+                       <div class="mceBottom">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Statusbar text.</span>\r
+                       </div>\r
+\r
+                       <a class="mceMove" href="#"></a>\r
+                       <a class="mceMin" href="#"></a>\r
+                       <a class="mceMax" href="#"></a>\r
+                       <a class="mceMed" href="#"></a>\r
+                       <a class="mceClose" href="#"></a>\r
+                       <a class="mceResize mceResizeN" href="#"></a>\r
+                       <a class="mceResize mceResizeS" href="#"></a>\r
+                       <a class="mceResize mceResizeW" href="#"></a>\r
+                       <a class="mceResize mceResizeE" href="#"></a>\r
+                       <a class="mceResize mceResizeNW" href="#"></a>\r
+                       <a class="mceResize mceResizeNE" href="#"></a>\r
+                       <a class="mceResize mceResizeSW" href="#"></a>\r
+                       <a class="mceResize mceResizeSE" href="#"></a>\r
+               </div>\r
+       </div>\r
+\r
+       <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:340px;">\r
+               <div class="mceWrapper mceMovable mceStatusbar mceResizable mceMaximized mceMinimizable mceMaximizable">\r
+                       <div class="mceTop">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Blured</span>\r
+                       </div>\r
+\r
+                       <div class="mceMiddle">\r
+                               <div class="mceLeft"></div>\r
+                               <span>Content</span>\r
+                               <div class="mceRight"></div>\r
+                       </div>\r
+\r
+                       <div class="mceBottom">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Statusbar text.</span>\r
+                       </div>\r
+\r
+                       <a class="mceMove" href="#"></a>\r
+                       <a class="mceMin" href="#"></a>\r
+                       <a class="mceMax" href="#"></a>\r
+                       <a class="mceMed" href="#"></a>\r
+                       <a class="mceClose" href="#"></a>\r
+                       <a class="mceResize mceResizeN" href="#"></a>\r
+                       <a class="mceResize mceResizeS" href="#"></a>\r
+                       <a class="mceResize mceResizeW" href="#"></a>\r
+                       <a class="mceResize mceResizeE" href="#"></a>\r
+                       <a class="mceResize mceResizeNW" href="#"></a>\r
+                       <a class="mceResize mceResizeNE" href="#"></a>\r
+                       <a class="mceResize mceResizeSW" href="#"></a>\r
+                       <a class="mceResize mceResizeSE" href="#"></a>\r
+               </div>\r
+       </div>\r
+\r
+       <div class="clearlooks2" style="width:400px; height:130px; left:10px; top:450px;">\r
+               <div class="mceWrapper mceMovable mceFocus mceModal mceAlert">\r
+                       <div class="mceTop">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Alert</span>\r
+                       </div>\r
+\r
+                       <div class="mceMiddle">\r
+                               <div class="mceLeft"></div>\r
+                               <span>\r
+                                       This is a very long error message. This is a very long error message.\r
+                                       This is a very long error message. This is a very long error message.\r
+                                       This is a very long error message. This is a very long error message.\r
+                                       This is a very long error message. This is a very long error message.\r
+                                       This is a very long error message. This is a very long error message.\r
+                                       This is a very long error message. This is a very long error message.\r
+                               </span>\r
+                               <div class="mceRight"></div>\r
+                               <div class="mceIcon"></div>\r
+                       </div>\r
+\r
+                       <div class="mceBottom">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                       </div>\r
+\r
+                       <a class="mceMove" href="#"></a>\r
+                       <a class="mceButton mceOk" href="#">Ok</a>\r
+                       <a class="mceClose" href="#"></a>\r
+               </div>\r
+       </div>\r
+\r
+       <div class="clearlooks2" style="width:400px; height:130px; left:420px; top:450px;">\r
+               <div class="mceWrapper mceMovable mceFocus mceModal mceConfirm">\r
+                       <div class="mceTop">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                               <span>Confirm</span>\r
+                       </div>\r
+\r
+                       <div class="mceMiddle">\r
+                               <div class="mceLeft"></div>\r
+                               <span>\r
+                                       This is a very long error message. This is a very long error message.\r
+                                       This is a very long error message. This is a very long error message.\r
+                                       This is a very long error message. This is a very long error message.\r
+                                       This is a very long error message. This is a very long error message.\r
+                                       This is a very long error message. This is a very long error message.\r
+                                       This is a very long error message. This is a very long error message.\r
+                                       </span>\r
+                               <div class="mceRight"></div>\r
+                               <div class="mceIcon"></div>\r
+                       </div>\r
+\r
+                       <div class="mceBottom">\r
+                               <div class="mceLeft"></div>\r
+                               <div class="mceCenter"></div>\r
+                               <div class="mceRight"></div>\r
+                       </div>\r
+\r
+                       <a class="mceMove" href="#"></a>\r
+                       <a class="mceButton mceOk" href="#">Ok</a>\r
+                       <a class="mceButton mceCancel" href="#">Cancel</a>\r
+                       <a class="mceClose" href="#"></a>\r
+               </div>\r
+       </div>\r
+</div>\r
+\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/insert_tag/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/insert_tag/editor_plugin.js
new file mode 100644 (file)
index 0000000..959c6ad
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.PluginManager.requireLangPack('insert_tag');tinymce.create('tinymce.plugins.Insert_tagPlugin',{createControl:function(n,cm){var editor=tinyMCE.activeEditor;switch(n){case'insert_tag':var pluginImgURL=tinymce.baseURL+'/plugins/insert_tag/img/';var c=cm.createMenuButton('insert_tag',{title:'insert_tag.desc',image:pluginImgURL+'insert_tag.png',cmd:'mceInsert_tag'});c.onRenderMenu.add(function(c,m){m.add({title:'insert_tag.term',onclick:function(){editor.execCommand('mceInsertContent',false,'[?][/?]')}});m.add({title:'insert_tag.code',onclick:function(){editor.execCommand('mceInsertContent',false,'[code][/code]')}});m.add({title:'insert_tag.media',onclick:function(){editor.execCommand('mceInsertContent',false,'[media|640|480]http://[/media]')}})});return c}return null},getInfo:function(){return{longname:'Insert tag plugin',author:'ATutor',authorurl:'http://www.atutor.ca',infourl:'http://www.atutor.ca',version:"0.1alpha"}}});tinymce.PluginManager.add('insert_tag',tinymce.plugins.Insert_tagPlugin)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/insert_tag/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/insert_tag/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..547c3f8
--- /dev/null
@@ -0,0 +1,91 @@
+/**\r
+ * $Id: $\r
+ *\r
+ * @author Laurel A. Williams\r
+ * @copyright Copyright Â© 2008, ATutor, All rights reserved.\r
+ */\r
+\r
+\r
+(function() {\r
+       // Load plugin specific language pack\r
+       tinymce.PluginManager.requireLangPack('insert_tag');\r
+\r
+       tinymce.create('tinymce.plugins.Insert_tagPlugin', {\r
+               /**\r
+                * Creates control instances based in the incoming name. This method is\r
+                * normally not needed since the addButton method of the tinymce.Editor\r
+                * class is a more easy way of adding buttons but you sometimes need to\r
+                * create more complex controls like listboxes, split buttons etc then\r
+                * this method can be used to create those.\r
+                * \r
+                * @param {String}\r
+                *            n Name of the control to create.\r
+                * @param {tinymce.ControlManager}\r
+                *            cm Control manager to use to create new control.\r
+                * @return {tinymce.ui.Control} New control instance or null if no\r
+                *         control was created.\r
+                */\r
+               createControl: function(n, cm) {\r
+                       var editor = tinyMCE.activeEditor;\r
+                       switch (n) {\r
+                               case 'insert_tag':\r
+                                       var pluginImgURL = tinymce.baseURL + '/plugins/insert_tag/img/';\r
+                                       var c = cm.createMenuButton('insert_tag', {\r
+                                               title : 'insert_tag.desc',\r
+                                               image : pluginImgURL + 'insert_tag.png',\r
+                                               cmd : 'mceInsert_tag'\r
+                                       });\r
+                                       \r
+                                       c.onRenderMenu.add(function(c, m) {\r
+                                               m.add({\r
+                                                       //image: pluginImgURL + 'insert_tag.png',\r
+                                                       title : 'insert_tag.term',\r
+                                                       onclick : function() {\r
+                                                               editor.execCommand('mceInsertContent', false, '[?][/?]');\r
+                                                       }\r
+                                               });\r
+       \r
+                                               m.add({\r
+                                                       title : 'insert_tag.code', \r
+                                                       onclick : function() {\r
+                                                               editor.execCommand('mceInsertContent', false, '[code][/code]');\r
+                                                       }\r
+                                               });\r
+                                               \r
+                                               m.add({\r
+                                                       title : 'insert_tag.media', \r
+                                                       onclick : function() {\r
+                                                               editor.execCommand('mceInsertContent', false, '[media|640|480]http://[/media]');\r
+                                                       }\r
+                                               });\r
+                                       });\r
+                \r
+                                       // Return the new menu button instance\r
+                                       return c;\r
+                               }\r
+                               return null;\r
+               },      \r
+               \r
+               \r
+               \r
+               /**\r
+                * Returns information about the plugin as a name/value array. The\r
+                * current keys are longname, author, authorurl, infourl and version.\r
+                * \r
+                * @return {Object} Name/value array containing information about the\r
+                *         plugin.\r
+                */\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Insert tag plugin',\r
+                               author : 'ATutor',\r
+                               authorurl : 'http://www.atutor.ca',\r
+                               infourl : 'http://www.atutor.ca',\r
+                               version : "0.1alpha"\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('insert_tag', tinymce.plugins.Insert_tagPlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/insert_tag/img/insert_tag.png b/docs/include/jscripts/tiny_mce/plugins/insert_tag/img/insert_tag.png
new file mode 100644 (file)
index 0000000..7c54004
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/insert_tag/img/insert_tag.png differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/insert_tag/img/term.png b/docs/include/jscripts/tiny_mce/plugins/insert_tag/img/term.png
new file mode 100644 (file)
index 0000000..51a1301
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/insert_tag/img/term.png differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/insert_tag/langs/en.js b/docs/include/jscripts/tiny_mce/plugins/insert_tag/langs/en.js
new file mode 100644 (file)
index 0000000..c635700
--- /dev/null
@@ -0,0 +1,6 @@
+tinyMCE.addI18n('en.insert_tag',{\r
+       desc : 'Insert tag',\r
+       term : 'term [?]',\r
+       code : '[code]',\r
+       media : '[media]'\r
+});\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js
new file mode 100644 (file)
index 0000000..938ce6b
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.InsertDateTime",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertDate",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_dateFormat",a.getLang("insertdatetime.date_fmt")));a.execCommand("mceInsertContent",false,d)});a.addCommand("mceInsertTime",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_timeFormat",a.getLang("insertdatetime.time_fmt")));a.execCommand("mceInsertContent",false,d)});a.addButton("insertdate",{title:"insertdatetime.insertdate_desc",cmd:"mceInsertDate"});a.addButton("inserttime",{title:"insertdatetime.inserttime_desc",cmd:"mceInsertTime"})},getInfo:function(){return{longname:"Insert date/time",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getDateTime:function(e,a){var c=this.editor;function b(g,d){g=""+g;if(g.length<d){for(var f=0;f<(d-g.length);f++){g="0"+g}}return g}a=a.replace("%D","%m/%d/%y");a=a.replace("%r","%I:%M:%S %p");a=a.replace("%Y",""+e.getFullYear());a=a.replace("%y",""+e.getYear());a=a.replace("%m",b(e.getMonth()+1,2));a=a.replace("%d",b(e.getDate(),2));a=a.replace("%H",""+b(e.getHours(),2));a=a.replace("%M",""+b(e.getMinutes(),2));a=a.replace("%S",""+b(e.getSeconds(),2));a=a.replace("%I",""+((e.getHours()+11)%12+1));a=a.replace("%p",""+(e.getHours()<12?"AM":"PM"));a=a.replace("%B",""+c.getLang("insertdatetime.months_long").split(",")[e.getMonth()]);a=a.replace("%b",""+c.getLang("insertdatetime.months_short").split(",")[e.getMonth()]);a=a.replace("%A",""+c.getLang("insertdatetime.day_long").split(",")[e.getDay()]);a=a.replace("%a",""+c.getLang("insertdatetime.day_short").split(",")[e.getDay()]);a=a.replace("%%","%");return a}});tinymce.PluginManager.add("insertdatetime",tinymce.plugins.InsertDateTime)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..181c791
--- /dev/null
@@ -0,0 +1,83 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.InsertDateTime', {\r
+               init : function(ed, url) {\r
+                       var t = this;\r
+\r
+                       t.editor = ed;\r
+\r
+                       ed.addCommand('mceInsertDate', function() {\r
+                               var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt')));\r
+\r
+                               ed.execCommand('mceInsertContent', false, str);\r
+                       });\r
+\r
+                       ed.addCommand('mceInsertTime', function() {\r
+                               var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt')));\r
+\r
+                               ed.execCommand('mceInsertContent', false, str);\r
+                       });\r
+\r
+                       ed.addButton('insertdate', {title : 'insertdatetime.insertdate_desc', cmd : 'mceInsertDate'});\r
+                       ed.addButton('inserttime', {title : 'insertdatetime.inserttime_desc', cmd : 'mceInsertTime'});\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Insert date/time',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               },\r
+\r
+               // Private methods\r
+\r
+               _getDateTime : function(d, fmt) {\r
+                       var ed = this.editor;\r
+\r
+                       function addZeros(value, len) {\r
+                               value = "" + value;\r
+\r
+                               if (value.length < len) {\r
+                                       for (var i=0; i<(len-value.length); i++)\r
+                                               value = "0" + value;\r
+                               }\r
+\r
+                               return value;\r
+                       };\r
+\r
+                       fmt = fmt.replace("%D", "%m/%d/%y");\r
+                       fmt = fmt.replace("%r", "%I:%M:%S %p");\r
+                       fmt = fmt.replace("%Y", "" + d.getFullYear());\r
+                       fmt = fmt.replace("%y", "" + d.getYear());\r
+                       fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));\r
+                       fmt = fmt.replace("%d", addZeros(d.getDate(), 2));\r
+                       fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));\r
+                       fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));\r
+                       fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));\r
+                       fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));\r
+                       fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));\r
+                       fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]);\r
+                       fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]);\r
+                       fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]);\r
+                       fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]);\r
+                       fmt = fmt.replace("%%", "%");\r
+\r
+                       return fmt;\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/layer/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/layer/editor_plugin.js
new file mode 100644 (file)
index 0000000..f88a6dd
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.Layer",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertLayer",c._insertLayer,c);a.addCommand("mceMoveForward",function(){c._move(1)});a.addCommand("mceMoveBackward",function(){c._move(-1)});a.addCommand("mceMakeAbsolute",function(){c._toggleAbsolute()});a.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"});a.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"});a.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"});a.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"});a.onInit.add(function(){if(tinymce.isIE){a.getDoc().execCommand("2D-Position",false,true)}});a.onNodeChange.add(c._nodeChange,c);a.onVisualAid.add(c._visualAid,c)},getInfo:function(){return{longname:"Layer",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var c,d;c=this._getParentLayer(e);d=b.dom.getParent(e,"DIV,P,IMG");if(!d){a.setDisabled("absolute",1);a.setDisabled("moveforward",1);a.setDisabled("movebackward",1)}else{a.setDisabled("absolute",0);a.setDisabled("moveforward",!c);a.setDisabled("movebackward",!c);a.setActive("absolute",c&&c.style.position.toLowerCase()=="absolute")}},_visualAid:function(a,c,b){var d=a.dom;tinymce.each(d.select("div,p",c),function(f){if(/^(absolute|relative|static)$/i.test(f.style.position)){if(b){d.addClass(f,"mceItemVisualAid")}else{d.removeClass(f,"mceItemVisualAid")}}})},_move:function(h){var b=this.editor,f,g=[],e=this._getParentLayer(b.selection.getNode()),c=-1,j=-1,a;a=[];tinymce.walk(b.getBody(),function(d){if(d.nodeType==1&&/^(absolute|relative|static)$/i.test(d.style.position)){a.push(d)}},"childNodes");for(f=0;f<a.length;f++){g[f]=a[f].style.zIndex?parseInt(a[f].style.zIndex):0;if(c<0&&a[f]==e){c=f}}if(h<0){for(f=0;f<g.length;f++){if(g[f]<g[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{if(g[c]>0){a[c].style.zIndex=g[c]-1}}}else{for(f=0;f<g.length;f++){if(g[f]>g[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{a[c].style.zIndex=g[c]+1}}b.execCommand("mceRepaint")},_getParentLayer:function(a){return this.editor.dom.getParent(a,function(b){return b.nodeType==1&&/^(absolute|relative|static)$/i.test(b.style.position)})},_insertLayer:function(){var a=this.editor,b=a.dom.getPos(a.dom.getParent(a.selection.getNode(),"*"));a.dom.add(a.getBody(),"div",{style:{position:"absolute",left:b.x,top:(b.y>20?b.y:20),width:100,height:100},"class":"mceItemVisualAid"},a.selection.getContent()||a.getLang("layer.content"))},_toggleAbsolute:function(){var a=this.editor,b=this._getParentLayer(a.selection.getNode());if(!b){b=a.dom.getParent(a.selection.getNode(),"DIV,P,IMG")}if(b){if(b.style.position.toLowerCase()=="absolute"){a.dom.setStyles(b,{position:"",left:"",top:"",width:"",height:""});a.dom.removeClass(b,"mceItemVisualAid")}else{if(b.style.left==""){b.style.left=20+"px"}if(b.style.top==""){b.style.top=20+"px"}if(b.style.width==""){b.style.width=b.width?(b.width+"px"):"100px"}if(b.style.height==""){b.style.height=b.height?(b.height+"px"):"100px"}b.style.position="absolute";a.addVisual(a.getBody())}a.execCommand("mceRepaint");a.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..d5aa865
--- /dev/null
@@ -0,0 +1,212 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.Layer', {\r
+               init : function(ed, url) {\r
+                       var t = this;\r
+\r
+                       t.editor = ed;\r
+\r
+                       // Register commands\r
+                       ed.addCommand('mceInsertLayer', t._insertLayer, t);\r
+\r
+                       ed.addCommand('mceMoveForward', function() {\r
+                               t._move(1);\r
+                       });\r
+\r
+                       ed.addCommand('mceMoveBackward', function() {\r
+                               t._move(-1);\r
+                       });\r
+\r
+                       ed.addCommand('mceMakeAbsolute', function() {\r
+                               t._toggleAbsolute();\r
+                       });\r
+\r
+                       // Register buttons\r
+                       ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'});\r
+                       ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'});\r
+                       ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'});\r
+                       ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'});\r
+\r
+                       ed.onInit.add(function() {\r
+                               if (tinymce.isIE)\r
+                                       ed.getDoc().execCommand('2D-Position', false, true);\r
+                       });\r
+\r
+                       ed.onNodeChange.add(t._nodeChange, t);\r
+                       ed.onVisualAid.add(t._visualAid, t);\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Layer',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               },\r
+\r
+               // Private methods\r
+\r
+               _nodeChange : function(ed, cm, n) {\r
+                       var le, p;\r
+\r
+                       le = this._getParentLayer(n);\r
+                       p = ed.dom.getParent(n, 'DIV,P,IMG');\r
+\r
+                       if (!p) {\r
+                               cm.setDisabled('absolute', 1);\r
+                               cm.setDisabled('moveforward', 1);\r
+                               cm.setDisabled('movebackward', 1);\r
+                       } else {\r
+                               cm.setDisabled('absolute', 0);\r
+                               cm.setDisabled('moveforward', !le);\r
+                               cm.setDisabled('movebackward', !le);\r
+                               cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute");\r
+                       }\r
+               },\r
+\r
+               // Private methods\r
+\r
+               _visualAid : function(ed, e, s) {\r
+                       var dom = ed.dom;\r
+\r
+                       tinymce.each(dom.select('div,p', e), function(e) {\r
+                               if (/^(absolute|relative|static)$/i.test(e.style.position)) {\r
+                                       if (s)\r
+                                               dom.addClass(e, 'mceItemVisualAid');\r
+                                       else\r
+                                               dom.removeClass(e, 'mceItemVisualAid'); \r
+                               }\r
+                       });\r
+               },\r
+\r
+               _move : function(d) {\r
+                       var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl;\r
+\r
+                       nl = [];\r
+                       tinymce.walk(ed.getBody(), function(n) {\r
+                               if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position))\r
+                                       nl.push(n); \r
+                       }, 'childNodes');\r
+\r
+                       // Find z-indexes\r
+                       for (i=0; i<nl.length; i++) {\r
+                               z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex) : 0;\r
+\r
+                               if (ci < 0 && nl[i] == le)\r
+                                       ci = i;\r
+                       }\r
+\r
+                       if (d < 0) {\r
+                               // Move back\r
+\r
+                               // Try find a lower one\r
+                               for (i=0; i<z.length; i++) {\r
+                                       if (z[i] < z[ci]) {\r
+                                               fi = i;\r
+                                               break;\r
+                                       }\r
+                               }\r
+\r
+                               if (fi > -1) {\r
+                                       nl[ci].style.zIndex = z[fi];\r
+                                       nl[fi].style.zIndex = z[ci];\r
+                               } else {\r
+                                       if (z[ci] > 0)\r
+                                               nl[ci].style.zIndex = z[ci] - 1;\r
+                               }\r
+                       } else {\r
+                               // Move forward\r
+\r
+                               // Try find a higher one\r
+                               for (i=0; i<z.length; i++) {\r
+                                       if (z[i] > z[ci]) {\r
+                                               fi = i;\r
+                                               break;\r
+                                       }\r
+                               }\r
+\r
+                               if (fi > -1) {\r
+                                       nl[ci].style.zIndex = z[fi];\r
+                                       nl[fi].style.zIndex = z[ci];\r
+                               } else\r
+                                       nl[ci].style.zIndex = z[ci] + 1;\r
+                       }\r
+\r
+                       ed.execCommand('mceRepaint');\r
+               },\r
+\r
+               _getParentLayer : function(n) {\r
+                       return this.editor.dom.getParent(n, function(n) {\r
+                               return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position);\r
+                       });\r
+               },\r
+\r
+               _insertLayer : function() {\r
+                       var ed = this.editor, p = ed.dom.getPos(ed.dom.getParent(ed.selection.getNode(), '*'));\r
+\r
+                       ed.dom.add(ed.getBody(), 'div', {\r
+                               style : {\r
+                                       position : 'absolute',\r
+                                       left : p.x,\r
+                                       top : (p.y > 20 ? p.y : 20),\r
+                                       width : 100,\r
+                                       height : 100\r
+                               },\r
+                               'class' : 'mceItemVisualAid'\r
+                       }, ed.selection.getContent() || ed.getLang('layer.content'));\r
+               },\r
+\r
+               _toggleAbsolute : function() {\r
+                       var ed = this.editor, le = this._getParentLayer(ed.selection.getNode());\r
+\r
+                       if (!le)\r
+                               le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG');\r
+\r
+                       if (le) {\r
+                               if (le.style.position.toLowerCase() == "absolute") {\r
+                                       ed.dom.setStyles(le, {\r
+                                               position : '',\r
+                                               left : '',\r
+                                               top : '',\r
+                                               width : '',\r
+                                               height : ''\r
+                                       });\r
+\r
+                                       ed.dom.removeClass(le, 'mceItemVisualAid');\r
+                               } else {\r
+                                       if (le.style.left == "")\r
+                                               le.style.left = 20 + 'px';\r
+\r
+                                       if (le.style.top == "")\r
+                                               le.style.top = 20 + 'px';\r
+\r
+                                       if (le.style.width == "")\r
+                                               le.style.width = le.width ? (le.width + 'px') : '100px';\r
+\r
+                                       if (le.style.height == "")\r
+                                               le.style.height = le.height ? (le.height + 'px') : '100px';\r
+\r
+                                       le.style.position = "absolute";\r
+                                       ed.addVisual(ed.getBody());\r
+                               }\r
+\r
+                               ed.execCommand('mceRepaint');\r
+                               ed.nodeChanged();\r
+                       }\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('layer', tinymce.plugins.Layer);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin.js
new file mode 100644 (file)
index 0000000..33618e8
--- /dev/null
@@ -0,0 +1 @@
+(function(a){a.onAddEditor.addToTop(function(c,b){b.settings.inline_styles=false});a.create("tinymce.plugins.LegacyOutput",{init:function(b){b.onInit.add(function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",e=a.explode(b.settings.font_size_style_values),d=b.serializer;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignfull:{selector:c,attributes:{align:"full"}},bold:{inline:"b"},italic:{inline:"i"},underline:{inline:"u"},strikethrough:{inline:"strike"},fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(f){return a.inArray(e,f.value)+1}}},forecolor:{inline:"font",styles:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}},});d._setup();a.each("b,i,u,strike".split(","),function(f){var g=d.rules[f];if(!g){d.addRules(f)}});if(!d.rules.font){d.addRules("font[face|size|color|style]")}a.each(c.split(","),function(f){var h=d.rules[f],g;if(h){a.each(h.attribs,function(j,i){if(i.name=="align"){g=true;return false}});if(!g){h.attribs.push({name:"align"})}}});b.onNodeChange.add(function(g,k){var j,f,h,i;f=g.dom.getParent(g.selection.getNode(),"font");if(f){h=f.face;i=f.size}if(j=k.get("fontselect")){j.select(function(l){return l==h})}if(j=k.get("fontsizeselect")){j.select(function(m){var l=a.inArray(e,m.fontSize);return l+1==i})}})})},getInfo:function(){return{longname:"LegacyOutput",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("legacyoutput",a.plugins.LegacyOutput)})(tinymce);
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..3673a4d
--- /dev/null
@@ -0,0 +1,136 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ *\r
+ * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align\r
+ * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash\r
+ *\r
+ * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are\r
+ * not apart of the newer specifications for HTML and XHTML.\r
+ */\r
+\r
+(function(tinymce) {\r
+       // Override inline_styles setting to force TinyMCE to produce deprecated contents\r
+       tinymce.onAddEditor.addToTop(function(tinymce, editor) {\r
+               editor.settings.inline_styles = false;\r
+       });\r
+\r
+       // Create the legacy ouput plugin\r
+       tinymce.create('tinymce.plugins.LegacyOutput', {\r
+               init : function(editor) {\r
+                       editor.onInit.add(function() {\r
+                               var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img',\r
+                                       fontSizes = tinymce.explode(editor.settings.font_size_style_values),\r
+                                       serializer = editor.serializer;\r
+\r
+                               // Override some internal formats to produce legacy elements and attributes\r
+                               editor.formatter.register({\r
+                                       // Change alignment formats to use the deprecated align attribute\r
+                                       alignleft : {selector : alignElements, attributes : {align : 'left'}},\r
+                                       aligncenter : {selector : alignElements, attributes : {align : 'center'}},\r
+                                       alignright : {selector : alignElements, attributes : {align : 'right'}},\r
+                                       alignfull : {selector : alignElements, attributes : {align : 'full'}},\r
+\r
+                                       // Change the basic formatting elements to use deprecated element types\r
+                                       bold : {inline : 'b'},\r
+                                       italic : {inline : 'i'},\r
+                                       underline : {inline : 'u'},\r
+                                       strikethrough : {inline : 'strike'},\r
+\r
+                                       // Change font size and font family to use the deprecated font element\r
+                                       fontname : {inline : 'font', attributes : {face : '%value'}},\r
+                                       fontsize : {\r
+                                               inline : 'font',\r
+                                               attributes : {\r
+                                                       size : function(vars) {\r
+                                                               return tinymce.inArray(fontSizes, vars.value) + 1;\r
+                                                       }\r
+                                               }\r
+                                       },\r
+\r
+                                       // Setup font elements for colors as well\r
+                                       forecolor : {inline : 'font', styles : {color : '%value'}},\r
+                                       hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}},\r
+                               });\r
+\r
+                               // Force parsing of the serializer rules\r
+                               serializer._setup();\r
+\r
+                               // Check that deprecated elements are allowed if not add them\r
+                               tinymce.each('b,i,u,strike'.split(','), function(name) {\r
+                                       var rule = serializer.rules[name];\r
+\r
+                                       if (!rule)\r
+                                               serializer.addRules(name);\r
+                               });\r
+\r
+                               // Add font element if it's missing\r
+                               if (!serializer.rules["font"])\r
+                                       serializer.addRules("font[face|size|color|style]");\r
+\r
+                               // Add the missing and depreacted align attribute for the serialization engine\r
+                               tinymce.each(alignElements.split(','), function(name) {\r
+                                       var rule = serializer.rules[name], found;\r
+\r
+                                       if (rule) {\r
+                                               tinymce.each(rule.attribs, function(name, attr) {\r
+                                                       if (attr.name == 'align') {\r
+                                                               found = true;\r
+                                                               return false;\r
+                                                       }\r
+                                               });\r
+\r
+                                               if (!found)\r
+                                                       rule.attribs.push({name : 'align'});\r
+                                       }\r
+                               });\r
+\r
+                               // Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes\r
+                               editor.onNodeChange.add(function(editor, control_manager) {\r
+                                       var control, fontElm, fontName, fontSize;\r
+\r
+                                       // Find font element get it's name and size\r
+                                       fontElm = editor.dom.getParent(editor.selection.getNode(), 'font');\r
+                                       if (fontElm) {\r
+                                               fontName = fontElm.face;\r
+                                               fontSize = fontElm.size;\r
+                                       }\r
+\r
+                                       // Select/unselect the font name in droplist\r
+                                       if (control = control_manager.get('fontselect')) {\r
+                                               control.select(function(value) {\r
+                                                       return value == fontName;\r
+                                               });\r
+                                       }\r
+\r
+                                       // Select/unselect the font size in droplist\r
+                                       if (control = control_manager.get('fontsizeselect')) {\r
+                                               control.select(function(value) {\r
+                                                       var index = tinymce.inArray(fontSizes, value.fontSize);\r
+\r
+                                                       return index + 1 == fontSize;\r
+                                               });\r
+                                       }\r
+                               });\r
+                       });\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'LegacyOutput',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('legacyoutput', tinymce.plugins.LegacyOutput);\r
+})(tinymce);
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/media/css/content.css b/docs/include/jscripts/tiny_mce/plugins/media/css/content.css
new file mode 100644 (file)
index 0000000..1bf6a75
--- /dev/null
@@ -0,0 +1,6 @@
+.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;}\r
+.mceItemShockWave {background-image: url(../img/shockwave.gif);}\r
+.mceItemFlash {background-image:url(../img/flash.gif);}\r
+.mceItemQuickTime {background-image:url(../img/quicktime.gif);}\r
+.mceItemWindowsMedia {background-image:url(../img/windowsmedia.gif);}\r
+.mceItemRealMedia {background-image:url(../img/realmedia.gif);}\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/media/css/media.css b/docs/include/jscripts/tiny_mce/plugins/media/css/media.css
new file mode 100644 (file)
index 0000000..2d08794
--- /dev/null
@@ -0,0 +1,16 @@
+#id, #name, #hspace, #vspace, #class_name, #align {    width: 100px }\r
+#hspace, #vspace { width: 50px }\r
+#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px }\r
+#flash_base, #flash_flashvars { width: 240px }\r
+#width, #height { width: 40px }\r
+#src, #media_type { width: 250px }\r
+#class { width: 120px }\r
+#prev { margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: auto }\r
+.panel_wrapper div.current { height: 390px; overflow: auto }\r
+#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none }\r
+.mceAddSelectValue { background-color: #DDDDDD }\r
+#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px }\r
+#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px }\r
+#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px }\r
+#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px }\r
+#qt_qtsrc { width: 200px }\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/media/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/media/editor_plugin.js
new file mode 100644 (file)
index 0000000..4bbe367
--- /dev/null
@@ -0,0 +1 @@
+(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.MediaPlugin",{init:function(b,c){var e=this;e.editor=b;e.url=c;function f(g){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(g.className)}b.onPreInit.add(function(){b.serializer.addRules("param[name|value|_mce_value]")});b.addCommand("mceMedia",function(){b.windowManager.open({file:c+"/media.htm",width:430+parseInt(b.getLang("media.delta_width",0)),height:470+parseInt(b.getLang("media.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("media",{title:"media.desc",cmd:"mceMedia"});b.onNodeChange.add(function(h,g,i){g.setActive("media",i.nodeName=="IMG"&&f(i))});b.onInit.add(function(){var g={mceItemFlash:"flash",mceItemShockWave:"shockwave",mceItemWindowsMedia:"windowsmedia",mceItemQuickTime:"quicktime",mceItemRealMedia:"realmedia"};b.selection.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.selection.onBeforeSetContent.add(e._objectsToSpans,e);if(b.settings.content_css!==false){b.dom.loadCSS(c+"/css/content.css")}if(b.theme&&b.theme.onResolveName){b.theme.onResolveName.add(function(h,i){if(i.name=="img"){a(g,function(l,j){if(b.dom.hasClass(i.node,j)){i.name=l;i.title=b.dom.getAttrib(i.node,"title");return false}})}})}if(b&&b.plugins.contextmenu){b.plugins.contextmenu.onContextMenu.add(function(i,h,j){if(j.nodeName=="IMG"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(j.className)){h.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});b.onBeforeSetContent.add(e._objectsToSpans,e);b.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.onPreProcess.add(function(g,i){var h=g.dom;if(i.set){e._spansToImgs(i.node);a(h.select("IMG",i.node),function(k){var j;if(f(k)){j=e._parse(k.title);h.setAttrib(k,"width",h.getAttrib(k,"width",j.width||100));h.setAttrib(k,"height",h.getAttrib(k,"height",j.height||100))}})}if(i.get){a(h.select("IMG",i.node),function(m){var l,j,k;if(g.getParam("media_use_script")){if(f(m)){m.className=m.className.replace(/mceItem/g,"mceTemp")}return}switch(m.className){case"mceItemFlash":l="d27cdb6e-ae6d-11cf-96b8-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="application/x-shockwave-flash";break;case"mceItemShockWave":l="166b1bca-3f9c-11cf-8075-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0";k="application/x-director";break;case"mceItemWindowsMedia":l=g.getParam("media_wmp6_compatible")?"05589fa1-c356-11ce-bf01-00aa0055595a":"6bf52a52-394a-11d3-b153-00c04f79faa6";j="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701";k="application/x-mplayer2";break;case"mceItemQuickTime":l="02bf25d5-8c17-4b23-bc80-d3488abddc6b";j="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0";k="video/quicktime";break;case"mceItemRealMedia":l="cfcdaa03-8be4-11cf-b84b-0020afbbccfa";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="audio/x-pn-realaudio-plugin";break}if(l){h.replace(e._buildObj({classid:l,codebase:j,type:k},m),m)}})}});b.onPostProcess.add(function(g,h){h.content=h.content.replace(/_mce_value=/g,"value=")});function d(g,h){h=new RegExp(h+'="([^"]+)"',"g").exec(g);return h?b.dom.decode(h[1]):""}b.onPostProcess.add(function(g,h){if(g.getParam("media_use_script")){h.content=h.content.replace(/<img[^>]+>/g,function(j){var i=d(j,"class");if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(i)){at=e._parse(d(j,"title"));at.width=d(j,"width");at.height=d(j,"height");j='<script type="text/javascript">write'+i.substring(7)+"({"+e._serialize(at)+"});<\/script>"}return j})}})},getInfo:function(){return{longname:"Media",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_objectsToSpans:function(b,e){var c=this,d=e.content;d=d.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(g,f,i){var h=c._parse(i);return'<img class="mceItem'+f+'" title="'+b.dom.encode(i)+'" src="'+c.url+'/img/trans.gif" width="'+h.width+'" height="'+h.height+'" />'});d=d.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');d=d.replace(/<embed([^>]*)\/?>/gi,'<span class="mceItemEmbed" $1></span>');d=d.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');d=d.replace(/<\/(object)([^>]*)>/gi,"</span>");d=d.replace(/<\/embed>/gi,"");d=d.replace(/<param([^>]*)>/gi,function(g,f){return"<span "+f.replace(/value=/gi,"_mce_value=")+' class="mceItemParam"></span>'});d=d.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');e.content=d},_buildObj:function(g,h){var d,c=this.editor,f=c.dom,e=this._parse(h.title),b;b=c.getParam("media_strict",true)&&g.type=="application/x-shockwave-flash";e.width=g.width=f.getAttrib(h,"width")||100;e.height=g.height=f.getAttrib(h,"height")||100;if(e.src){e.src=c.convertURL(e.src,"src",h)}if(b){d=f.create("span",{id:e.id,_mce_name:"object",type:"application/x-shockwave-flash",data:e.src,style:f.getAttrib(h,"style"),width:g.width,height:g.height})}else{d=f.create("span",{id:e.id,_mce_name:"object",classid:"clsid:"+g.classid,style:f.getAttrib(h,"style"),codebase:g.codebase,width:g.width,height:g.height})}a(e,function(j,i){if(!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(i)){if(g.type=="application/x-mplayer2"&&i=="src"&&!e.url){i="url"}if(j){f.add(d,"span",{_mce_name:"param",name:i,_mce_value:j})}}});if(!b){f.add(d,"span",tinymce.extend({_mce_name:"embed",type:g.type,style:f.getAttrib(h,"style")},e))}return d},_spansToImgs:function(e){var d=this,f=d.editor.dom,b,c;a(f.select("span",e),function(g){if(f.getAttrib(g,"class")=="mceItemObject"){c=f.getAttrib(g,"classid").toLowerCase().replace(/\s+/g,"");switch(c){case"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000":f.replace(d._createImg("mceItemFlash",g),g);break;case"clsid:166b1bca-3f9c-11cf-8075-444553540000":f.replace(d._createImg("mceItemShockWave",g),g);break;case"clsid:6bf52a52-394a-11d3-b153-00c04f79faa6":case"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95":case"clsid:05589fa1-c356-11ce-bf01-00aa0055595a":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}return}if(f.getAttrib(g,"class")=="mceItemEmbed"){switch(f.getAttrib(g,"type")){case"application/x-shockwave-flash":f.replace(d._createImg("mceItemFlash",g),g);break;case"application/x-director":f.replace(d._createImg("mceItemShockWave",g),g);break;case"application/x-mplayer2":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"video/quicktime":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"audio/x-pn-realaudio-plugin":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}}})},_createImg:function(c,h){var b,g=this.editor.dom,f={},e="",d;d=["id","name","width","height","bgcolor","align","flashvars","src","wmode","allowfullscreen","quality","data"];b=g.create("img",{src:this.url+"/img/trans.gif",width:g.getAttrib(h,"width")||100,height:g.getAttrib(h,"height")||100,style:g.getAttrib(h,"style"),"class":c});a(d,function(i){var j=g.getAttrib(h,i);if(j){f[i]=j}});a(g.select("span",h),function(i){if(g.hasClass(i,"mceItemParam")){f[g.getAttrib(i,"name")]=g.getAttrib(i,"_mce_value")}});if(f.movie){f.src=f.movie;delete f.movie}if(!f.src){f.src=f.data;delete f.data}h=g.select(".mceItemEmbed",h)[0];if(h){a(d,function(i){var j=g.getAttrib(h,i);if(j&&!f[i]){f[i]=j}})}delete f.width;delete f.height;b.title=this._serialize(f);return b},_parse:function(b){return tinymce.util.JSON.parse("{"+b+"}")},_serialize:function(b){return tinymce.util.JSON.serialize(b).replace(/[{}]/g,"")}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/media/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/media/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..fc84e5b
--- /dev/null
@@ -0,0 +1,414 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       var each = tinymce.each;\r
+\r
+       tinymce.create('tinymce.plugins.MediaPlugin', {\r
+               init : function(ed, url) {\r
+                       var t = this;\r
+                       \r
+                       t.editor = ed;\r
+                       t.url = url;\r
+\r
+                       function isMediaElm(n) {\r
+                               return /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);\r
+                       };\r
+\r
+                       ed.onPreInit.add(function() {\r
+                               // Force in _value parameter this extra parameter is required for older Opera versions\r
+                               ed.serializer.addRules('param[name|value|_mce_value]');\r
+                       });\r
+\r
+                       // Register commands\r
+                       ed.addCommand('mceMedia', function() {\r
+                               ed.windowManager.open({\r
+                                       file : url + '/media.htm',\r
+                                       width : 430 + parseInt(ed.getLang('media.delta_width', 0)),\r
+                                       height : 470 + parseInt(ed.getLang('media.delta_height', 0)),\r
+                                       inline : 1\r
+                               }, {\r
+                                       plugin_url : url\r
+                               });\r
+                       });\r
+\r
+                       // Register buttons\r
+                       ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'});\r
+\r
+                       ed.onNodeChange.add(function(ed, cm, n) {\r
+                               cm.setActive('media', n.nodeName == 'IMG' && isMediaElm(n));\r
+                       });\r
+\r
+                       ed.onInit.add(function() {\r
+                               var lo = {\r
+                                       mceItemFlash : 'flash',\r
+                                       mceItemShockWave : 'shockwave',\r
+                                       mceItemWindowsMedia : 'windowsmedia',\r
+                                       mceItemQuickTime : 'quicktime',\r
+                                       mceItemRealMedia : 'realmedia'\r
+                               };\r
+\r
+                               ed.selection.onSetContent.add(function() {\r
+                                       t._spansToImgs(ed.getBody());\r
+                               });\r
+\r
+                               ed.selection.onBeforeSetContent.add(t._objectsToSpans, t);\r
+\r
+                               if (ed.settings.content_css !== false)\r
+                                       ed.dom.loadCSS(url + "/css/content.css");\r
+\r
+                               if (ed.theme && ed.theme.onResolveName) {\r
+                                       ed.theme.onResolveName.add(function(th, o) {\r
+                                               if (o.name == 'img') {\r
+                                                       each(lo, function(v, k) {\r
+                                                               if (ed.dom.hasClass(o.node, k)) {\r
+                                                                       o.name = v;\r
+                                                                       o.title = ed.dom.getAttrib(o.node, 'title');\r
+                                                                       return false;\r
+                                                               }\r
+                                                       });\r
+                                               }\r
+                                       });\r
+                               }\r
+\r
+                               if (ed && ed.plugins.contextmenu) {\r
+                                       ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {\r
+                                               if (e.nodeName == 'IMG' && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)) {\r
+                                                       m.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'});\r
+                                               }\r
+                                       });\r
+                               }\r
+                       });\r
+\r
+                       ed.onBeforeSetContent.add(t._objectsToSpans, t);\r
+\r
+                       ed.onSetContent.add(function() {\r
+                               t._spansToImgs(ed.getBody());\r
+                       });\r
+\r
+                       ed.onPreProcess.add(function(ed, o) {\r
+                               var dom = ed.dom;\r
+\r
+                               if (o.set) {\r
+                                       t._spansToImgs(o.node);\r
+\r
+                                       each(dom.select('IMG', o.node), function(n) {\r
+                                               var p;\r
+\r
+                                               if (isMediaElm(n)) {\r
+                                                       p = t._parse(n.title);\r
+                                                       dom.setAttrib(n, 'width', dom.getAttrib(n, 'width', p.width || 100));\r
+                                                       dom.setAttrib(n, 'height', dom.getAttrib(n, 'height', p.height || 100));\r
+                                               }\r
+                                       });\r
+                               }\r
+\r
+                               if (o.get) {\r
+                                       each(dom.select('IMG', o.node), function(n) {\r
+                                               var ci, cb, mt;\r
+\r
+                                               if (ed.getParam('media_use_script')) {\r
+                                                       if (isMediaElm(n))\r
+                                                               n.className = n.className.replace(/mceItem/g, 'mceTemp');\r
+\r
+                                                       return;\r
+                                               }\r
+\r
+                                               switch (n.className) {\r
+                                                       case 'mceItemFlash':\r
+                                                               ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000';\r
+                                                               cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';\r
+                                                               mt = 'application/x-shockwave-flash';\r
+                                                               break;\r
+\r
+                                                       case 'mceItemShockWave':\r
+                                                               ci = '166b1bca-3f9c-11cf-8075-444553540000';\r
+                                                               cb = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';\r
+                                                               mt = 'application/x-director';\r
+                                                               break;\r
+\r
+                                                       case 'mceItemWindowsMedia':\r
+                                                               ci = ed.getParam('media_wmp6_compatible') ? '05589fa1-c356-11ce-bf01-00aa0055595a' : '6bf52a52-394a-11d3-b153-00c04f79faa6';\r
+                                                               cb = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';\r
+                                                               mt = 'application/x-mplayer2';\r
+                                                               break;\r
+\r
+                                                       case 'mceItemQuickTime':\r
+                                                               ci = '02bf25d5-8c17-4b23-bc80-d3488abddc6b';\r
+                                                               cb = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';\r
+                                                               mt = 'video/quicktime';\r
+                                                               break;\r
+\r
+                                                       case 'mceItemRealMedia':\r
+                                                               ci = 'cfcdaa03-8be4-11cf-b84b-0020afbbccfa';\r
+                                                               cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';\r
+                                                               mt = 'audio/x-pn-realaudio-plugin';\r
+                                                               break;\r
+                                               }\r
+\r
+                                               if (ci) {\r
+                                                       dom.replace(t._buildObj({\r
+                                                               classid : ci,\r
+                                                               codebase : cb,\r
+                                                               type : mt\r
+                                                       }, n), n);\r
+                                               }\r
+                                       });\r
+                               }\r
+                       });\r
+\r
+                       ed.onPostProcess.add(function(ed, o) {\r
+                               o.content = o.content.replace(/_mce_value=/g, 'value=');\r
+                       });\r
+\r
+                       function getAttr(s, n) {\r
+                               n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s);\r
+\r
+                               return n ? ed.dom.decode(n[1]) : '';\r
+                       };\r
+\r
+                       ed.onPostProcess.add(function(ed, o) {\r
+                               if (ed.getParam('media_use_script')) {\r
+                                       o.content = o.content.replace(/<img[^>]+>/g, function(im) {\r
+                                               var cl = getAttr(im, 'class');\r
+\r
+                                               if (/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)) {\r
+                                                       at = t._parse(getAttr(im, 'title'));\r
+                                                       at.width = getAttr(im, 'width');\r
+                                                       at.height = getAttr(im, 'height');\r
+                                                       im = '<script type="text/javascript">write' + cl.substring(7) + '({' + t._serialize(at) + '});</script>';\r
+                                               }\r
+\r
+                                               return im;\r
+                                       });\r
+                               }\r
+                       });\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Media',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               },\r
+\r
+               // Private methods\r
+               _objectsToSpans : function(ed, o) {\r
+                       var t = this, h = o.content;\r
+\r
+                       h = h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) {\r
+                               var o = t._parse(c);\r
+\r
+                               return '<img class="mceItem' + b + '" title="' + ed.dom.encode(c) + '" src="' + t.url + '/img/trans.gif" width="' + o.width + '" height="' + o.height + '" />'\r
+                       });\r
+\r
+                       h = h.replace(/<object([^>]*)>/gi, '<span class="mceItemObject" $1>');\r
+                       h = h.replace(/<embed([^>]*)\/?>/gi, '<span class="mceItemEmbed" $1></span>');\r
+                       h = h.replace(/<embed([^>]*)>/gi, '<span class="mceItemEmbed" $1>');\r
+                       h = h.replace(/<\/(object)([^>]*)>/gi, '</span>');\r
+                       h = h.replace(/<\/embed>/gi, '');\r
+                       h = h.replace(/<param([^>]*)>/gi, function(a, b) {return '<span ' + b.replace(/value=/gi, '_mce_value=') + ' class="mceItemParam"></span>'});\r
+                       h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam"></span>');\r
+\r
+                       o.content = h;\r
+               },\r
+\r
+               _buildObj : function(o, n) {\r
+                       var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title), stc;\r
+                       \r
+                       stc = ed.getParam('media_strict', true) && o.type == 'application/x-shockwave-flash';\r
+\r
+                       p.width = o.width = dom.getAttrib(n, 'width') || 100;\r
+                       p.height = o.height = dom.getAttrib(n, 'height') || 100;\r
+\r
+                       if (p.src)\r
+                               p.src = ed.convertURL(p.src, 'src', n);\r
+\r
+                       if (stc) {\r
+                               ob = dom.create('span', {\r
+                                       id : p.id,\r
+                                       _mce_name : 'object',\r
+                                       type : 'application/x-shockwave-flash',\r
+                                       data : p.src,\r
+                                       style : dom.getAttrib(n, 'style'),\r
+                                       width : o.width,\r
+                                       height : o.height\r
+                               });\r
+                       } else {\r
+                               ob = dom.create('span', {\r
+                                       id : p.id,\r
+                                       _mce_name : 'object',\r
+                                       classid : "clsid:" + o.classid,\r
+                                       style : dom.getAttrib(n, 'style'),\r
+                                       codebase : o.codebase,\r
+                                       width : o.width,\r
+                                       height : o.height\r
+                               });\r
+                       }\r
+\r
+                       each (p, function(v, k) {\r
+                               if (!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(k)) {\r
+                                       // Use url instead of src in IE for Windows media\r
+                                       if (o.type == 'application/x-mplayer2' && k == 'src' && !p.url)\r
+                                               k = 'url';\r
+\r
+                                       if (v)\r
+                                               dom.add(ob, 'span', {_mce_name : 'param', name : k, '_mce_value' : v});\r
+                               }\r
+                       });\r
+\r
+                       if (!stc)\r
+                               dom.add(ob, 'span', tinymce.extend({_mce_name : 'embed', type : o.type, style : dom.getAttrib(n, 'style')}, p));\r
+\r
+                       return ob;\r
+               },\r
+\r
+               _spansToImgs : function(p) {\r
+                       var t = this, dom = t.editor.dom, im, ci;\r
+\r
+                       each(dom.select('span', p), function(n) {\r
+                               // Convert object into image\r
+                               if (dom.getAttrib(n, 'class') == 'mceItemObject') {\r
+                                       ci = dom.getAttrib(n, "classid").toLowerCase().replace(/\s+/g, '');\r
+\r
+                                       switch (ci) {\r
+                                               case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':\r
+                                                       dom.replace(t._createImg('mceItemFlash', n), n);\r
+                                                       break;\r
+\r
+                                               case 'clsid:166b1bca-3f9c-11cf-8075-444553540000':\r
+                                                       dom.replace(t._createImg('mceItemShockWave', n), n);\r
+                                                       break;\r
+\r
+                                               case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':\r
+                                               case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':\r
+                                               case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':\r
+                                                       dom.replace(t._createImg('mceItemWindowsMedia', n), n);\r
+                                                       break;\r
+\r
+                                               case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':\r
+                                                       dom.replace(t._createImg('mceItemQuickTime', n), n);\r
+                                                       break;\r
+\r
+                                               case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':\r
+                                                       dom.replace(t._createImg('mceItemRealMedia', n), n);\r
+                                                       break;\r
+\r
+                                               default:\r
+                                                       dom.replace(t._createImg('mceItemFlash', n), n);\r
+                                       }\r
+                                       \r
+                                       return;\r
+                               }\r
+\r
+                               // Convert embed into image\r
+                               if (dom.getAttrib(n, 'class') == 'mceItemEmbed') {\r
+                                       switch (dom.getAttrib(n, 'type')) {\r
+                                               case 'application/x-shockwave-flash':\r
+                                                       dom.replace(t._createImg('mceItemFlash', n), n);\r
+                                                       break;\r
+\r
+                                               case 'application/x-director':\r
+                                                       dom.replace(t._createImg('mceItemShockWave', n), n);\r
+                                                       break;\r
+\r
+                                               case 'application/x-mplayer2':\r
+                                                       dom.replace(t._createImg('mceItemWindowsMedia', n), n);\r
+                                                       break;\r
+\r
+                                               case 'video/quicktime':\r
+                                                       dom.replace(t._createImg('mceItemQuickTime', n), n);\r
+                                                       break;\r
+\r
+                                               case 'audio/x-pn-realaudio-plugin':\r
+                                                       dom.replace(t._createImg('mceItemRealMedia', n), n);\r
+                                                       break;\r
+\r
+                                               default:\r
+                                                       dom.replace(t._createImg('mceItemFlash', n), n);\r
+                                       }\r
+                               }                       \r
+                       });\r
+               },\r
+\r
+               _createImg : function(cl, n) {\r
+                       var im, dom = this.editor.dom, pa = {}, ti = '', args;\r
+\r
+                       args = ['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode', 'allowfullscreen', 'quality', 'data'];        \r
+\r
+                       // Create image\r
+                       im = dom.create('img', {\r
+                               src : this.url + '/img/trans.gif',\r
+                               width : dom.getAttrib(n, 'width') || 100,\r
+                               height : dom.getAttrib(n, 'height') || 100,\r
+                               style : dom.getAttrib(n, 'style'),\r
+                               'class' : cl\r
+                       });\r
+\r
+                       // Setup base parameters\r
+                       each(args, function(na) {\r
+                               var v = dom.getAttrib(n, na);\r
+\r
+                               if (v)\r
+                                       pa[na] = v;\r
+                       });\r
+\r
+                       // Add optional parameters\r
+                       each(dom.select('span', n), function(n) {\r
+                               if (dom.hasClass(n, 'mceItemParam'))\r
+                                       pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_mce_value');\r
+                       });\r
+\r
+                       // Use src not movie\r
+                       if (pa.movie) {\r
+                               pa.src = pa.movie;\r
+                               delete pa.movie;\r
+                       }\r
+\r
+                       // No src try data\r
+                       if (!pa.src) {\r
+                               pa.src = pa.data;\r
+                               delete pa.data;\r
+                       }\r
+\r
+                       // Merge with embed args\r
+                       n = dom.select('.mceItemEmbed', n)[0];\r
+                       if (n) {\r
+                               each(args, function(na) {\r
+                                       var v = dom.getAttrib(n, na);\r
+\r
+                                       if (v && !pa[na])\r
+                                               pa[na] = v;\r
+                               });\r
+                       }\r
+\r
+                       delete pa.width;\r
+                       delete pa.height;\r
+\r
+                       im.title = this._serialize(pa);\r
+\r
+                       return im;\r
+               },\r
+\r
+               _parse : function(s) {\r
+                       return tinymce.util.JSON.parse('{' + s + '}');\r
+               },\r
+\r
+               _serialize : function(o) {\r
+                       return tinymce.util.JSON.serialize(o).replace(/[{}]/g, '');\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/media/img/flash.gif b/docs/include/jscripts/tiny_mce/plugins/media/img/flash.gif
new file mode 100644 (file)
index 0000000..cb192e6
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/media/img/flash.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/media/img/flv_player.swf b/docs/include/jscripts/tiny_mce/plugins/media/img/flv_player.swf
new file mode 100644 (file)
index 0000000..042c2ab
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/media/img/flv_player.swf differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/media/img/quicktime.gif b/docs/include/jscripts/tiny_mce/plugins/media/img/quicktime.gif
new file mode 100644 (file)
index 0000000..3b04991
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/media/img/quicktime.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/media/img/realmedia.gif b/docs/include/jscripts/tiny_mce/plugins/media/img/realmedia.gif
new file mode 100644 (file)
index 0000000..fdfe0b9
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/media/img/realmedia.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/media/img/shockwave.gif b/docs/include/jscripts/tiny_mce/plugins/media/img/shockwave.gif
new file mode 100644 (file)
index 0000000..5f235df
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/media/img/shockwave.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/media/img/trans.gif b/docs/include/jscripts/tiny_mce/plugins/media/img/trans.gif
new file mode 100644 (file)
index 0000000..3884865
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/media/img/trans.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/media/img/windowsmedia.gif b/docs/include/jscripts/tiny_mce/plugins/media/img/windowsmedia.gif
new file mode 100644 (file)
index 0000000..ab50f2d
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/media/img/windowsmedia.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/media/js/embed.js b/docs/include/jscripts/tiny_mce/plugins/media/js/embed.js
new file mode 100644 (file)
index 0000000..f8dc810
--- /dev/null
@@ -0,0 +1,73 @@
+/**\r
+ * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.\r
+ */\r
+\r
+function writeFlash(p) {\r
+       writeEmbed(\r
+               'D27CDB6E-AE6D-11cf-96B8-444553540000',\r
+               'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',\r
+               'application/x-shockwave-flash',\r
+               p\r
+       );\r
+}\r
+\r
+function writeShockWave(p) {\r
+       writeEmbed(\r
+       '166B1BCA-3F9C-11CF-8075-444553540000',\r
+       'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',\r
+       'application/x-director',\r
+               p\r
+       );\r
+}\r
+\r
+function writeQuickTime(p) {\r
+       writeEmbed(\r
+               '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',\r
+               'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',\r
+               'video/quicktime',\r
+               p\r
+       );\r
+}\r
+\r
+function writeRealMedia(p) {\r
+       writeEmbed(\r
+               'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',\r
+               'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',\r
+               'audio/x-pn-realaudio-plugin',\r
+               p\r
+       );\r
+}\r
+\r
+function writeWindowsMedia(p) {\r
+       p.url = p.src;\r
+       writeEmbed(\r
+               '6BF52A52-394A-11D3-B153-00C04F79FAA6',\r
+               'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',\r
+               'application/x-mplayer2',\r
+               p\r
+       );\r
+}\r
+\r
+function writeEmbed(cls, cb, mt, p) {\r
+       var h = '', n;\r
+\r
+       h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';\r
+       h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';\r
+       h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';\r
+       h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';\r
+       h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';\r
+       h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';\r
+       h += '>';\r
+\r
+       for (n in p)\r
+               h += '<param name="' + n + '" value="' + p[n] + '">';\r
+\r
+       h += '<embed type="' + mt + '"';\r
+\r
+       for (n in p)\r
+               h += n + '="' + p[n] + '" ';\r
+\r
+       h += '></embed></object>';\r
+\r
+       document.write(h);\r
+}\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/media/js/media.js b/docs/include/jscripts/tiny_mce/plugins/media/js/media.js
new file mode 100644 (file)
index 0000000..86cfa98
--- /dev/null
@@ -0,0 +1,630 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+var oldWidth, oldHeight, ed, url;\r
+\r
+if (url = tinyMCEPopup.getParam("media_external_list_url"))\r
+       document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
+\r
+function init() {\r
+       var pl = "", f, val;\r
+       var type = "flash", fe, i;\r
+\r
+       ed = tinyMCEPopup.editor;\r
+\r
+       tinyMCEPopup.resizeToInnerSize();\r
+       f = document.forms[0]\r
+\r
+       fe = ed.selection.getNode();\r
+       if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) {\r
+               pl = fe.title;\r
+\r
+               switch (ed.dom.getAttrib(fe, 'class')) {\r
+                       case 'mceItemFlash':\r
+                               type = 'flash';\r
+                               break;\r
+\r
+                       case 'mceItemFlashVideo':\r
+                               type = 'flv';\r
+                               break;\r
+\r
+                       case 'mceItemShockWave':\r
+                               type = 'shockwave';\r
+                               break;\r
+\r
+                       case 'mceItemWindowsMedia':\r
+                               type = 'wmp';\r
+                               break;\r
+\r
+                       case 'mceItemQuickTime':\r
+                               type = 'qt';\r
+                               break;\r
+\r
+                       case 'mceItemRealMedia':\r
+                               type = 'rmp';\r
+                               break;\r
+               }\r
+\r
+               document.forms[0].insert.value = ed.getLang('update', 'Insert', true); \r
+       }\r
+\r
+       document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');\r
+       document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media');\r
+       document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');\r
+\r
+       var html = getMediaListHTML('medialist','src','media','media');\r
+       if (html == "")\r
+               document.getElementById("linklistrow").style.display = 'none';\r
+       else\r
+               document.getElementById("linklistcontainer").innerHTML = html;\r
+\r
+       // Resize some elements\r
+       if (isVisible('filebrowser'))\r
+               document.getElementById('src').style.width = '230px';\r
+\r
+       // Setup form\r
+       if (pl != "") {\r
+               pl = tinyMCEPopup.editor.plugins.media._parse(pl);\r
+\r
+               switch (type) {\r
+                       case "flash":\r
+                               setBool(pl, 'flash', 'play');\r
+                               setBool(pl, 'flash', 'loop');\r
+                               setBool(pl, 'flash', 'menu');\r
+                               setBool(pl, 'flash', 'swliveconnect');\r
+                               setStr(pl, 'flash', 'quality');\r
+                               setStr(pl, 'flash', 'scale');\r
+                               setStr(pl, 'flash', 'salign');\r
+                               setStr(pl, 'flash', 'wmode');\r
+                               setStr(pl, 'flash', 'base');\r
+                               setStr(pl, 'flash', 'flashvars');\r
+                       break;\r
+\r
+                       case "qt":\r
+                               setBool(pl, 'qt', 'loop');\r
+                               setBool(pl, 'qt', 'autoplay');\r
+                               setBool(pl, 'qt', 'cache');\r
+                               setBool(pl, 'qt', 'controller');\r
+                               setBool(pl, 'qt', 'correction');\r
+                               setBool(pl, 'qt', 'enablejavascript');\r
+                               setBool(pl, 'qt', 'kioskmode');\r
+                               setBool(pl, 'qt', 'autohref');\r
+                               setBool(pl, 'qt', 'playeveryframe');\r
+                               setBool(pl, 'qt', 'tarsetcache');\r
+                               setStr(pl, 'qt', 'scale');\r
+                               setStr(pl, 'qt', 'starttime');\r
+                               setStr(pl, 'qt', 'endtime');\r
+                               setStr(pl, 'qt', 'tarset');\r
+                               setStr(pl, 'qt', 'qtsrcchokespeed');\r
+                               setStr(pl, 'qt', 'volume');\r
+                               setStr(pl, 'qt', 'qtsrc');\r
+                       break;\r
+\r
+                       case "shockwave":\r
+                               setBool(pl, 'shockwave', 'sound');\r
+                               setBool(pl, 'shockwave', 'progress');\r
+                               setBool(pl, 'shockwave', 'autostart');\r
+                               setBool(pl, 'shockwave', 'swliveconnect');\r
+                               setStr(pl, 'shockwave', 'swvolume');\r
+                               setStr(pl, 'shockwave', 'swstretchstyle');\r
+                               setStr(pl, 'shockwave', 'swstretchhalign');\r
+                               setStr(pl, 'shockwave', 'swstretchvalign');\r
+                       break;\r
+\r
+                       case "wmp":\r
+                               setBool(pl, 'wmp', 'autostart');\r
+                               setBool(pl, 'wmp', 'enabled');\r
+                               setBool(pl, 'wmp', 'enablecontextmenu');\r
+                               setBool(pl, 'wmp', 'fullscreen');\r
+                               setBool(pl, 'wmp', 'invokeurls');\r
+                               setBool(pl, 'wmp', 'mute');\r
+                               setBool(pl, 'wmp', 'stretchtofit');\r
+                               setBool(pl, 'wmp', 'windowlessvideo');\r
+                               setStr(pl, 'wmp', 'balance');\r
+                               setStr(pl, 'wmp', 'baseurl');\r
+                               setStr(pl, 'wmp', 'captioningid');\r
+                               setStr(pl, 'wmp', 'currentmarker');\r
+                               setStr(pl, 'wmp', 'currentposition');\r
+                               setStr(pl, 'wmp', 'defaultframe');\r
+                               setStr(pl, 'wmp', 'playcount');\r
+                               setStr(pl, 'wmp', 'rate');\r
+                               setStr(pl, 'wmp', 'uimode');\r
+                               setStr(pl, 'wmp', 'volume');\r
+                       break;\r
+\r
+                       case "rmp":\r
+                               setBool(pl, 'rmp', 'autostart');\r
+                               setBool(pl, 'rmp', 'loop');\r
+                               setBool(pl, 'rmp', 'autogotourl');\r
+                               setBool(pl, 'rmp', 'center');\r
+                               setBool(pl, 'rmp', 'imagestatus');\r
+                               setBool(pl, 'rmp', 'maintainaspect');\r
+                               setBool(pl, 'rmp', 'nojava');\r
+                               setBool(pl, 'rmp', 'prefetch');\r
+                               setBool(pl, 'rmp', 'shuffle');\r
+                               setStr(pl, 'rmp', 'console');\r
+                               setStr(pl, 'rmp', 'controls');\r
+                               setStr(pl, 'rmp', 'numloop');\r
+                               setStr(pl, 'rmp', 'scriptcallbacks');\r
+                       break;\r
+               }\r
+\r
+               setStr(pl, null, 'src');\r
+               setStr(pl, null, 'id');\r
+               setStr(pl, null, 'name');\r
+               setStr(pl, null, 'vspace');\r
+               setStr(pl, null, 'hspace');\r
+               setStr(pl, null, 'bgcolor');\r
+               setStr(pl, null, 'align');\r
+               setStr(pl, null, 'width');\r
+               setStr(pl, null, 'height');\r
+\r
+               if ((val = ed.dom.getAttrib(fe, "width")) != "")\r
+                       pl.width = f.width.value = val;\r
+\r
+               if ((val = ed.dom.getAttrib(fe, "height")) != "")\r
+                       pl.height = f.height.value = val;\r
+\r
+               oldWidth = pl.width ? parseInt(pl.width) : 0;\r
+               oldHeight = pl.height ? parseInt(pl.height) : 0;\r
+       } else\r
+               oldWidth = oldHeight = 0;\r
+\r
+       selectByValue(f, 'media_type', type);\r
+       changedType(type);\r
+       updateColor('bgcolor_pick', 'bgcolor');\r
+\r
+       TinyMCE_EditableSelects.init();\r
+       generatePreview();\r
+}\r
+\r
+function insertMedia() {\r
+       var fe, f = document.forms[0], h;\r
+\r
+       tinyMCEPopup.restoreSelection();\r
+\r
+       if (!AutoValidator.validate(f)) {\r
+               tinyMCEPopup.alert(ed.getLang('invalid_data'));\r
+               return false;\r
+       }\r
+\r
+       f.width.value = f.width.value == "" ? 100 : f.width.value;\r
+       f.height.value = f.height.value == "" ? 100 : f.height.value;\r
+\r
+       fe = ed.selection.getNode();\r
+       if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) {\r
+               switch (f.media_type.options[f.media_type.selectedIndex].value) {\r
+                       case "flash":\r
+                               fe.className = "mceItemFlash";\r
+                               break;\r
+\r
+                       case "flv":\r
+                               fe.className = "mceItemFlashVideo";\r
+                               break;\r
+\r
+                       case "shockwave":\r
+                               fe.className = "mceItemShockWave";\r
+                               break;\r
+\r
+                       case "qt":\r
+                               fe.className = "mceItemQuickTime";\r
+                               break;\r
+\r
+                       case "wmp":\r
+                               fe.className = "mceItemWindowsMedia";\r
+                               break;\r
+\r
+                       case "rmp":\r
+                               fe.className = "mceItemRealMedia";\r
+                               break;\r
+               }\r
+\r
+               if (fe.width != f.width.value || fe.height != f.height.value)\r
+                       ed.execCommand('mceRepaint');\r
+\r
+               fe.title = serializeParameters();\r
+               fe.width = f.width.value;\r
+               fe.height = f.height.value;\r
+               fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : '');\r
+               fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : '');\r
+               fe.align = f.align.options[f.align.selectedIndex].value;\r
+       } else {\r
+               h = '<img src="' + tinyMCEPopup.getWindowArg("plugin_url") + '/img/trans.gif"' ;\r
+\r
+               switch (f.media_type.options[f.media_type.selectedIndex].value) {\r
+                       case "flash":\r
+                               h += ' class="mceItemFlash"';\r
+                               break;\r
+\r
+                       case "flv":\r
+                               h += ' class="mceItemFlashVideo"';\r
+                               break;\r
+\r
+                       case "shockwave":\r
+                               h += ' class="mceItemShockWave"';\r
+                               break;\r
+\r
+                       case "qt":\r
+                               h += ' class="mceItemQuickTime"';\r
+                               break;\r
+\r
+                       case "wmp":\r
+                               h += ' class="mceItemWindowsMedia"';\r
+                               break;\r
+\r
+                       case "rmp":\r
+                               h += ' class="mceItemRealMedia"';\r
+                               break;\r
+               }\r
+\r
+               h += ' title="' + serializeParameters() + '"';\r
+               h += ' width="' + f.width.value + '"';\r
+               h += ' height="' + f.height.value + '"';\r
+               h += ' align="' + f.align.options[f.align.selectedIndex].value + '"';\r
+\r
+               h += ' />';\r
+\r
+               ed.execCommand('mceInsertContent', false, h);\r
+       }\r
+\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function updatePreview() {\r
+       var f = document.forms[0], type;\r
+\r
+       f.width.value = f.width.value || '320';\r
+       f.height.value = f.height.value || '240';\r
+\r
+       type = getType(f.src.value);\r
+       selectByValue(f, 'media_type', type);\r
+       changedType(type);\r
+       generatePreview();\r
+}\r
+\r
+function getMediaListHTML() {\r
+       if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) {\r
+               var html = "";\r
+\r
+               html += '<select id="linklist" name="linklist" style="width: 250px" onchange="this.form.src.value=this.options[this.selectedIndex].value;updatePreview();">';\r
+               html += '<option value="">---</option>';\r
+\r
+               for (var i=0; i<tinyMCEMediaList.length; i++)\r
+                       html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>';\r
+\r
+               html += '</select>';\r
+\r
+               return html;\r
+       }\r
+\r
+       return "";\r
+}\r
+\r
+function getType(v) {\r
+       var fo, i, c, el, x, f = document.forms[0];\r
+\r
+       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(';');\r
+\r
+       // YouTube\r
+       if (v.match(/watch\?v=(.+)(.*)/)) {\r
+               f.width.value = '425';\r
+               f.height.value = '350';\r
+               f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1];\r
+               return 'flash';\r
+       }\r
+\r
+       // Google video\r
+       if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) {\r
+               f.width.value = '425';\r
+               f.height.value = '326';\r
+               f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en';\r
+               return 'flash';\r
+       }\r
+\r
+       for (i=0; i<fo.length; i++) {\r
+               c = fo[i].split('=');\r
+\r
+               el = c[1].split(',');\r
+               for (x=0; x<el.length; x++)\r
+               if (v.indexOf('.' + el[x]) != -1)\r
+                       return c[0];\r
+       }\r
+\r
+       return null;\r
+}\r
+\r
+function switchType(v) {\r
+       var t = getType(v), d = document, f = d.forms[0];\r
+\r
+       if (!t)\r
+               return;\r
+\r
+       selectByValue(d.forms[0], 'media_type', t);\r
+       changedType(t);\r
+\r
+       // Update qtsrc also\r
+       if (t == 'qt' && f.src.value.toLowerCase().indexOf('rtsp://') != -1) {\r
+               alert(ed.getLang("media_qt_stream_warn"));\r
+\r
+               if (f.qt_qtsrc.value == '')\r
+                       f.qt_qtsrc.value = f.src.value;\r
+       }\r
+}\r
+\r
+function changedType(t) {\r
+       var d = document;\r
+\r
+       d.getElementById('flash_options').style.display = 'none';\r
+       d.getElementById('flv_options').style.display = 'none';\r
+       d.getElementById('qt_options').style.display = 'none';\r
+       d.getElementById('shockwave_options').style.display = 'none';\r
+       d.getElementById('wmp_options').style.display = 'none';\r
+       d.getElementById('rmp_options').style.display = 'none';\r
+\r
+       if (t)\r
+               d.getElementById(t + '_options').style.display = 'block';\r
+}\r
+\r
+function serializeParameters() {\r
+       var d = document, f = d.forms[0], s = '';\r
+\r
+       switch (f.media_type.options[f.media_type.selectedIndex].value) {\r
+               case "flash":\r
+                       s += getBool('flash', 'play', true);\r
+                       s += getBool('flash', 'loop', true);\r
+                       s += getBool('flash', 'menu', true);\r
+                       s += getBool('flash', 'swliveconnect', false);\r
+                       s += getStr('flash', 'quality');\r
+                       s += getStr('flash', 'scale');\r
+                       s += getStr('flash', 'salign');\r
+                       s += getStr('flash', 'wmode');\r
+                       s += getStr('flash', 'base');\r
+                       s += getStr('flash', 'flashvars');\r
+               break;\r
+\r
+               case "qt":\r
+                       s += getBool('qt', 'loop', false);\r
+                       s += getBool('qt', 'autoplay', true);\r
+                       s += getBool('qt', 'cache', false);\r
+                       s += getBool('qt', 'controller', true);\r
+                       s += getBool('qt', 'correction', false, 'none', 'full');\r
+                       s += getBool('qt', 'enablejavascript', false);\r
+                       s += getBool('qt', 'kioskmode', false);\r
+                       s += getBool('qt', 'autohref', false);\r
+                       s += getBool('qt', 'playeveryframe', false);\r
+                       s += getBool('qt', 'targetcache', false);\r
+                       s += getStr('qt', 'scale');\r
+                       s += getStr('qt', 'starttime');\r
+                       s += getStr('qt', 'endtime');\r
+                       s += getStr('qt', 'target');\r
+                       s += getStr('qt', 'qtsrcchokespeed');\r
+                       s += getStr('qt', 'volume');\r
+                       s += getStr('qt', 'qtsrc');\r
+               break;\r
+\r
+               case "shockwave":\r
+                       s += getBool('shockwave', 'sound');\r
+                       s += getBool('shockwave', 'progress');\r
+                       s += getBool('shockwave', 'autostart');\r
+                       s += getBool('shockwave', 'swliveconnect');\r
+                       s += getStr('shockwave', 'swvolume');\r
+                       s += getStr('shockwave', 'swstretchstyle');\r
+                       s += getStr('shockwave', 'swstretchhalign');\r
+                       s += getStr('shockwave', 'swstretchvalign');\r
+               break;\r
+\r
+               case "wmp":\r
+                       s += getBool('wmp', 'autostart', true);\r
+                       s += getBool('wmp', 'enabled', false);\r
+                       s += getBool('wmp', 'enablecontextmenu', true);\r
+                       s += getBool('wmp', 'fullscreen', false);\r
+                       s += getBool('wmp', 'invokeurls', true);\r
+                       s += getBool('wmp', 'mute', false);\r
+                       s += getBool('wmp', 'stretchtofit', false);\r
+                       s += getBool('wmp', 'windowlessvideo', false);\r
+                       s += getStr('wmp', 'balance');\r
+                       s += getStr('wmp', 'baseurl');\r
+                       s += getStr('wmp', 'captioningid');\r
+                       s += getStr('wmp', 'currentmarker');\r
+                       s += getStr('wmp', 'currentposition');\r
+                       s += getStr('wmp', 'defaultframe');\r
+                       s += getStr('wmp', 'playcount');\r
+                       s += getStr('wmp', 'rate');\r
+                       s += getStr('wmp', 'uimode');\r
+                       s += getStr('wmp', 'volume');\r
+               break;\r
+\r
+               case "rmp":\r
+                       s += getBool('rmp', 'autostart', false);\r
+                       s += getBool('rmp', 'loop', false);\r
+                       s += getBool('rmp', 'autogotourl', true);\r
+                       s += getBool('rmp', 'center', false);\r
+                       s += getBool('rmp', 'imagestatus', true);\r
+                       s += getBool('rmp', 'maintainaspect', false);\r
+                       s += getBool('rmp', 'nojava', false);\r
+                       s += getBool('rmp', 'prefetch', false);\r
+                       s += getBool('rmp', 'shuffle', false);\r
+                       s += getStr('rmp', 'console');\r
+                       s += getStr('rmp', 'controls');\r
+                       s += getStr('rmp', 'numloop');\r
+                       s += getStr('rmp', 'scriptcallbacks');\r
+               break;\r
+       }\r
+\r
+       s += getStr(null, 'id');\r
+       s += getStr(null, 'name');\r
+       s += getStr(null, 'src');\r
+       s += getStr(null, 'align');\r
+       s += getStr(null, 'bgcolor');\r
+       s += getInt(null, 'vspace');\r
+       s += getInt(null, 'hspace');\r
+       s += getStr(null, 'width');\r
+       s += getStr(null, 'height');\r
+\r
+       s = s.length > 0 ? s.substring(0, s.length - 1) : s;\r
+\r
+       return s;\r
+}\r
+\r
+function setBool(pl, p, n) {\r
+       if (typeof(pl[n]) == "undefined")\r
+               return;\r
+\r
+       document.forms[0].elements[p + "_" + n].checked = pl[n] != 'false';\r
+}\r
+\r
+function setStr(pl, p, n) {\r
+       var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n];\r
+\r
+       if (typeof(pl[n]) == "undefined")\r
+               return;\r
+\r
+       if (e.type == "text")\r
+               e.value = pl[n];\r
+       else\r
+               selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]);\r
+}\r
+\r
+function getBool(p, n, d, tv, fv) {\r
+       var v = document.forms[0].elements[p + "_" + n].checked;\r
+\r
+       tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'";\r
+       fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'";\r
+\r
+       return (v == d) ? '' : n + (v ? ':' + tv + ',' : ":\'" + fv + "\',");\r
+}\r
+\r
+function getStr(p, n, d) {\r
+       var e = document.forms[0].elements[(p != null ? p + "_" : "") + n];\r
+       var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value;\r
+\r
+       if (n == 'src')\r
+               v = tinyMCEPopup.editor.convertURL(v, 'src', null);\r
+\r
+       return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',");\r
+}\r
+\r
+function getInt(p, n, d) {\r
+       var e = document.forms[0].elements[(p != null ? p + "_" : "") + n];\r
+       var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value;\r
+\r
+       return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ",");\r
+}\r
+\r
+function jsEncode(s) {\r
+       s = s.replace(new RegExp('\\\\', 'g'), '\\\\');\r
+       s = s.replace(new RegExp('"', 'g'), '\\"');\r
+       s = s.replace(new RegExp("'", 'g'), "\\'");\r
+\r
+       return s;\r
+}\r
+\r
+function generatePreview(c) {\r
+       var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh;\r
+\r
+       p.innerHTML = '<!-- x --->';\r
+\r
+       nw = parseInt(f.width.value);\r
+       nh = parseInt(f.height.value);\r
+\r
+       if (f.width.value != "" && f.height.value != "") {\r
+               if (f.constrain.checked) {\r
+                       if (c == 'width' && oldWidth != 0) {\r
+                               wp = nw / oldWidth;\r
+                               nh = Math.round(wp * nh);\r
+                               f.height.value = nh;\r
+                       } else if (c == 'height' && oldHeight != 0) {\r
+                               hp = nh / oldHeight;\r
+                               nw = Math.round(hp * nw);\r
+                               f.width.value = nw;\r
+                       }\r
+               }\r
+       }\r
+\r
+       if (f.width.value != "")\r
+               oldWidth = nw;\r
+\r
+       if (f.height.value != "")\r
+               oldHeight = nh;\r
+\r
+       // After constrain\r
+       pl = serializeParameters();\r
+\r
+       switch (f.media_type.options[f.media_type.selectedIndex].value) {\r
+               case "flash":\r
+                       cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';\r
+                       codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';\r
+                       type = 'application/x-shockwave-flash';\r
+                       break;\r
+\r
+               case "shockwave":\r
+                       cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000';\r
+                       codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';\r
+                       type = 'application/x-director';\r
+                       break;\r
+\r
+               case "qt":\r
+                       cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';\r
+                       codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';\r
+                       type = 'video/quicktime';\r
+                       break;\r
+\r
+               case "wmp":\r
+                       cls = ed.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6';\r
+                       codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';\r
+                       type = 'application/x-mplayer2';\r
+                       break;\r
+\r
+               case "rmp":\r
+                       cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA';\r
+                       codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';\r
+                       type = 'audio/x-pn-realaudio-plugin';\r
+                       break;\r
+       }\r
+\r
+       if (pl == '') {\r
+               p.innerHTML = '';\r
+               return;\r
+       }\r
+\r
+       pl = tinyMCEPopup.editor.plugins.media._parse(pl);\r
+\r
+       if (!pl.src) {\r
+               p.innerHTML = '';\r
+               return;\r
+       }\r
+\r
+       pl.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(pl.src);\r
+       pl.width = !pl.width ? 100 : pl.width;\r
+       pl.height = !pl.height ? 100 : pl.height;\r
+       pl.id = !pl.id ? 'obj' : pl.id;\r
+       pl.name = !pl.name ? 'eobj' : pl.name;\r
+       pl.align = !pl.align ? '' : pl.align;\r
+\r
+       // Avoid annoying warning about insecure items\r
+       if (!tinymce.isIE || document.location.protocol != 'https:') {\r
+               h += '<object classid="' + cls + '" codebase="' + codebase + '" width="' + pl.width + '" height="' + pl.height + '" id="' + pl.id + '" name="' + pl.name + '" align="' + pl.align + '">';\r
+\r
+               for (n in pl) {\r
+                       h += '<param name="' + n + '" value="' + pl[n] + '">';\r
+\r
+                       // Add extra url parameter if it's an absolute URL\r
+                       if (n == 'src' && pl[n].indexOf('://') != -1)\r
+                               h += '<param name="url" value="' + pl[n] + '" />';\r
+               }\r
+       }\r
+\r
+       h += '<embed type="' + type + '" ';\r
+\r
+       for (n in pl)\r
+               h += n + '="' + pl[n] + '" ';\r
+\r
+       h += '></embed>';\r
+\r
+       // Avoid annoying warning about insecure items\r
+       if (!tinymce.isIE || document.location.protocol != 'https:')\r
+               h += '</object>';\r
+\r
+       p.innerHTML = "<!-- x --->" + h;\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/media/langs/en_dlg.js b/docs/include/jscripts/tiny_mce/plugins/media/langs/en_dlg.js
new file mode 100644 (file)
index 0000000..6d0a996
--- /dev/null
@@ -0,0 +1,103 @@
+tinyMCE.addI18n('en.media_dlg',{\r
+title:"Insert / edit embedded media",\r
+general:"General",\r
+advanced:"Advanced",\r
+file:"File/URL",\r
+list:"List",\r
+size:"Dimensions",\r
+preview:"Preview",\r
+constrain_proportions:"Constrain proportions",\r
+type:"Type",\r
+id:"Id",\r
+name:"Name",\r
+class_name:"Class",\r
+vspace:"V-Space",\r
+hspace:"H-Space",\r
+play:"Auto play",\r
+loop:"Loop",\r
+menu:"Show menu",\r
+quality:"Quality",\r
+scale:"Scale",\r
+align:"Align",\r
+salign:"SAlign",\r
+wmode:"WMode",\r
+bgcolor:"Background",\r
+base:"Base",\r
+flashvars:"Flashvars",\r
+liveconnect:"SWLiveConnect",\r
+autohref:"AutoHREF",\r
+cache:"Cache",\r
+hidden:"Hidden",\r
+controller:"Controller",\r
+kioskmode:"Kiosk mode",\r
+playeveryframe:"Play every frame",\r
+targetcache:"Target cache",\r
+correction:"No correction",\r
+enablejavascript:"Enable JavaScript",\r
+starttime:"Start time",\r
+endtime:"End time",\r
+href:"Href",\r
+qtsrcchokespeed:"Choke speed",\r
+target:"Target",\r
+volume:"Volume",\r
+autostart:"Auto start",\r
+enabled:"Enabled",\r
+fullscreen:"Fullscreen",\r
+invokeurls:"Invoke URLs",\r
+mute:"Mute",\r
+stretchtofit:"Stretch to fit",\r
+windowlessvideo:"Windowless video",\r
+balance:"Balance",\r
+baseurl:"Base URL",\r
+captioningid:"Captioning id",\r
+currentmarker:"Current marker",\r
+currentposition:"Current position",\r
+defaultframe:"Default frame",\r
+playcount:"Play count",\r
+rate:"Rate",\r
+uimode:"UI Mode",\r
+flash_options:"Flash options",\r
+qt_options:"Quicktime options",\r
+wmp_options:"Windows media player options",\r
+rmp_options:"Real media player options",\r
+shockwave_options:"Shockwave options",\r
+autogotourl:"Auto goto URL",\r
+center:"Center",\r
+imagestatus:"Image status",\r
+maintainaspect:"Maintain aspect",\r
+nojava:"No java",\r
+prefetch:"Prefetch",\r
+shuffle:"Shuffle",\r
+console:"Console",\r
+numloop:"Num loops",\r
+controls:"Controls",\r
+scriptcallbacks:"Script callbacks",\r
+swstretchstyle:"Stretch style",\r
+swstretchhalign:"Stretch H-Align",\r
+swstretchvalign:"Stretch V-Align",\r
+sound:"Sound",\r
+progress:"Progress",\r
+qtsrc:"QT Src",\r
+qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\nYou should also add a non streamed version to the Src field..",\r
+align_top:"Top",\r
+align_right:"Right",\r
+align_bottom:"Bottom",\r
+align_left:"Left",\r
+align_center:"Center",\r
+align_top_left:"Top left",\r
+align_top_right:"Top right",\r
+align_bottom_left:"Bottom left",\r
+align_bottom_right:"Bottom right",\r
+flv_options:"Flash video options",\r
+flv_scalemode:"Scale mode",\r
+flv_buffer:"Buffer",\r
+flv_startimage:"Start image",\r
+flv_starttime:"Start time",\r
+flv_defaultvolume:"Default volumne",\r
+flv_hiddengui:"Hidden GUI",\r
+flv_autostart:"Auto start",\r
+flv_loop:"Loop",\r
+flv_showscalemodes:"Show scale modes",\r
+flv_smoothvideo:"Smooth video",\r
+flv_jscallback:"JS Callback"\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/media/media.htm b/docs/include/jscripts/tiny_mce/plugins/media/media.htm
new file mode 100644 (file)
index 0000000..73a903f
--- /dev/null
@@ -0,0 +1,817 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#media_dlg.title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="js/media.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/validate.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+       <link href="css/media.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body style="display: none">\r
+    <form onsubmit="insertMedia();return false;" action="#">\r
+               <div class="tabs">\r
+                       <ul>\r
+                               <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');generatePreview();" onmousedown="return false;">{#media_dlg.general}</a></span></li>\r
+                               <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#media_dlg.advanced}</a></span></li>\r
+                       </ul>\r
+               </div>\r
+\r
+               <div class="panel_wrapper">\r
+                       <div id="general_panel" class="panel current">\r
+                               <fieldset>\r
+                                       <legend>{#media_dlg.general}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                                       <tr>\r
+                                                               <td><label for="media_type">{#media_dlg.type}</label></td>\r
+                                                               <td>\r
+                                                                       <select id="media_type" name="media_type" onchange="changedType(this.value);generatePreview();">\r
+                                                                               <option value="flash">Flash</option>\r
+                                                                               <!-- <option value="flv">Flash video (FLV)</option> -->\r
+                                                                               <option value="qt">Quicktime</option>\r
+                                                                               <option value="shockwave">Shockwave</option>\r
+                                                                               <option value="wmp">Windows Media</option>\r
+                                                                               <option value="rmp">Real Media</option>\r
+                                                                       </select>\r
+                                                               </td>\r
+                                                       </tr>\r
+                                                       <tr>\r
+                                                       <td><label for="src">{#media_dlg.file}</label></td>\r
+                                                         <td>\r
+                                                                       <table border="0" cellspacing="0" cellpadding="0">\r
+                                                                         <tr>\r
+                                                                               <td><input id="src" name="src" type="text" value="" class="mceFocus" onchange="switchType(this.value);generatePreview();" /></td>\r
+                                                                               <td id="filebrowsercontainer">&nbsp;</td>\r
+                                                                         </tr>\r
+                                                                       </table>\r
+                                                               </td>\r
+                                                       </tr>\r
+                                                       <tr id="linklistrow">\r
+                                                               <td><label for="linklist">{#media_dlg.list}</label></td>\r
+                                                               <td id="linklistcontainer"><select id="linklist"><option value=""></option></select></td>\r
+                                                       </tr>\r
+                                                       <tr>\r
+                                                               <td><label for="width">{#media_dlg.size}</label></td>\r
+                                                               <td>\r
+                                                                       <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                               <tr>\r
+                                                                                       <td><input type="text" id="width" name="width" value="" class="size" onchange="generatePreview('width');" /> x <input type="text" id="height" name="height" value="" class="size"  onchange="generatePreview('height');" /></td>\r
+                                                                                       <td>&nbsp;&nbsp;<input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>\r
+                                                                                       <td><label id="constrainlabel" for="constrain">{#media_dlg.constrain_proportions}</label></td>\r
+                                                                               </tr>\r
+                                                                       </table>\r
+                                                               </td>\r
+                                                       </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+\r
+                               <fieldset>\r
+                                       <legend>{#media_dlg.preview}</legend>\r
+                                       <div id="prev"></div>\r
+                               </fieldset>\r
+                       </div>\r
+\r
+                       <div id="advanced_panel" class="panel">\r
+                               <fieldset>\r
+                                       <legend>{#media_dlg.advanced}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0" width="100%">\r
+                                               <tr>\r
+                                                       <td><label for="id">{#media_dlg.id}</label></td>\r
+                                                       <td><input type="text" id="id" name="id" onchange="generatePreview();" /></td>\r
+                                                       <td><label for="name">{#media_dlg.name}</label></td>\r
+                                                       <td><input type="text" id="name" name="name" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="align">{#media_dlg.align}</label></td>\r
+                                                       <td>\r
+                                                               <select id="align" name="align" onchange="generatePreview();">\r
+                                                                       <option value="">{#not_set}</option> \r
+                                                                       <option value="top">{#media_dlg.align_top}</option>\r
+                                                                       <option value="right">{#media_dlg.align_right}</option>\r
+                                                                       <option value="bottom">{#media_dlg.align_bottom}</option>\r
+                                                                       <option value="left">{#media_dlg.align_left}</option>\r
+                                                               </select>\r
+                                                       </td>\r
+\r
+                                                       <td><label for="bgcolor">{#media_dlg.bgcolor}</label></td>\r
+                                                       <td>\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');generatePreview();" /></td>\r
+                                                                               <td id="bgcolor_pickcontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="vspace">{#media_dlg.vspace}</label></td>\r
+                                                       <td><input type="text" id="vspace" name="vspace" class="number" onchange="generatePreview();" /></td>\r
+                                                       <td><label for="hspace">{#media_dlg.hspace}</label></td>\r
+                                                       <td><input type="text" id="hspace" name="hspace" class="number" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+\r
+                               <fieldset id="flash_options">\r
+                                       <legend>{#media_dlg.flash_options}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td><label for="flash_quality">{#media_dlg.quality}</label></td>\r
+                                                       <td>\r
+                                                               <select id="flash_quality" name="flash_quality" onchange="generatePreview();">\r
+                                                                       <option value="">{#not_set}</option> \r
+                                                                       <option value="high">high</option>\r
+                                                                       <option value="low">low</option>\r
+                                                                       <option value="autolow">autolow</option>\r
+                                                                       <option value="autohigh">autohigh</option>\r
+                                                                       <option value="best">best</option>\r
+                                                               </select>\r
+                                                       </td>\r
+\r
+                                                       <td><label for="flash_scale">{#media_dlg.scale}</label></td>\r
+                                                       <td>\r
+                                                               <select id="flash_scale" name="flash_scale" onchange="generatePreview();">\r
+                                                                       <option value="">{#not_set}</option> \r
+                                                                       <option value="showall">showall</option>\r
+                                                                       <option value="noborder">noborder</option>\r
+                                                                       <option value="exactfit">exactfit</option>\r
+                                                                       <option value="noscale">noscale</option>\r
+                                                               </select>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="flash_wmode">{#media_dlg.wmode}</label></td>\r
+                                                       <td>\r
+                                                               <select id="flash_wmode" name="flash_wmode" onchange="generatePreview();">\r
+                                                                       <option value="">{#not_set}</option> \r
+                                                                       <option value="window">window</option>\r
+                                                                       <option value="opaque">opaque</option>\r
+                                                                       <option value="transparent">transparent</option>\r
+                                                               </select>\r
+                                                       </td>\r
+\r
+                                                       <td><label for="flash_salign">{#media_dlg.salign}</label></td>\r
+                                                       <td>\r
+                                                               <select id="flash_salign" name="flash_salign" onchange="generatePreview();">\r
+                                                                       <option value="">{#not_set}</option> \r
+                                                                       <option value="l">{#media_dlg.align_left}</option>\r
+                                                                       <option value="t">{#media_dlg.align_top}</option>\r
+                                                                       <option value="r">{#media_dlg.align_right}</option>\r
+                                                                       <option value="b">{#media_dlg.align_bottom}</option>\r
+                                                                       <option value="tl">{#media_dlg.align_top_left}</option>\r
+                                                                       <option value="tr">{#media_dlg.align_top_right}</option>\r
+                                                                       <option value="bl">{#media_dlg.align_bottom_left}</option>\r
+                                                                       <option value="br">{#media_dlg.align_bottom_right}</option>\r
+                                                               </select>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="flash_play">{#media_dlg.play}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="flash_loop">{#media_dlg.loop}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="flash_menu">{#media_dlg.menu}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="flash_swliveconnect">{#media_dlg.liveconnect}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+                                       </table>\r
+\r
+                                       <table>\r
+                                               <tr>\r
+                                                       <td><label for="flash_base">{#media_dlg.base}</label></td>\r
+                                                       <td><input type="text" id="flash_base" name="flash_base" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="flash_flashvars">{#media_dlg.flashvars}</label></td>\r
+                                                       <td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+\r
+                               <fieldset id="flv_options">\r
+                                       <legend>{#media_dlg.flv_options}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td><label for="flv_scalemode">{#media_dlg.flv_scalemode}</label></td>\r
+                                                       <td>\r
+                                                               <select id="flv_scalemode" name="flv_scalemode" onchange="generatePreview();">\r
+                                                                       <option value="">{#not_set}</option> \r
+                                                                       <option value="none">none</option>\r
+                                                                       <option value="double">double</option>\r
+                                                                       <option value="full">full</option>\r
+                                                               </select>\r
+                                                       </td>\r
+\r
+                                                       <td><label for="flv_buffer">{#media_dlg.flv_buffer}</label></td>\r
+                                                       <td><input type="text" id="flv_buffer" name="flv_buffer" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="flv_startimage">{#media_dlg.flv_startimage}</label></td>\r
+                                                       <td><input type="text" id="flv_startimage" name="flv_startimage" onchange="generatePreview();" /></td>\r
+\r
+                                                       <td><label for="flv_starttime">{#media_dlg.flv_starttime}</label></td>\r
+                                                       <td><input type="text" id="flv_starttime" name="flv_starttime" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="flv_defaultvolume">{#media_dlg.flv_defaultvolume}</label></td>\r
+                                                       <td><input type="text" id="flv_defaultvolume" name="flv_defaultvolume" onchange="generatePreview();" /></td>\r
+\r
+\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="flv_hiddengui" name="flv_hiddengui" checked="checked" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="flv_hiddengui">{#media_dlg.flv_hiddengui}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="flv_autostart" name="flv_autostart" checked="checked" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="flv_autostart">{#media_dlg.flv_autostart}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="flv_loop" name="flv_loop" checked="checked" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="flv_loop">{#media_dlg.flv_loop}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="flv_showscalemodes" name="flv_showscalemodes" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="flv_showscalemodes">{#media_dlg.flv_showscalemodes}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="flv_smoothvideo" name="flash_flv_flv_smoothvideosmoothvideo" checked="checked" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="flv_smoothvideo">{#media_dlg.flv_smoothvideo}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="flv_jscallback" name="flv_jscallback" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="flv_jscallback">{#media_dlg.flv_jscallback}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+\r
+                               <fieldset id="qt_options">\r
+                                       <legend>{#media_dlg.qt_options}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="qt_loop" name="qt_loop" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="qt_loop">{#media_dlg.loop}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="qt_autoplay" name="qt_autoplay" checked="checked" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="qt_autoplay">{#media_dlg.play}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="qt_cache" name="qt_cache" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="qt_cache">{#media_dlg.cache}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="qt_controller" name="qt_controller" checked="checked" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="qt_controller">{#media_dlg.controller}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="qt_correction" name="qt_correction" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="qt_correction">{#media_dlg.correction}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="qt_enablejavascript" name="qt_enablejavascript" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="qt_enablejavascript">{#media_dlg.enablejavascript}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="qt_kioskmode" name="qt_kioskmode" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="qt_kioskmode">{#media_dlg.kioskmode}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="qt_autohref" name="qt_autohref" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="qt_autohref">{#media_dlg.autohref}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="qt_playeveryframe" name="qt_playeveryframe" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="qt_playeveryframe">{#media_dlg.playeveryframe}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="qt_targetcache" name="qt_targetcache" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="qt_targetcache">{#media_dlg.targetcache}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="qt_scale">{#media_dlg.scale}</label></td>\r
+                                                       <td><select id="qt_scale" name="qt_scale" class="mceEditableSelect" onchange="generatePreview();">\r
+                                                                       <option value="">{#not_set}</option> \r
+                                                                       <option value="tofit">tofit</option>\r
+                                                                       <option value="aspect">aspect</option>\r
+                                                               </select>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">&nbsp;</td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="qt_starttime">{#media_dlg.starttime}</label></td>\r
+                                                       <td><input type="text" id="qt_starttime" name="qt_starttime" onchange="generatePreview();" /></td>\r
+\r
+                                                       <td><label for="qt_endtime">{#media_dlg.endtime}</label></td>\r
+                                                       <td><input type="text" id="qt_endtime" name="qt_endtime" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="qt_target">{#media_dlg.target}</label></td>\r
+                                                       <td><input type="text" id="qt_target" name="qt_target" onchange="generatePreview();" /></td>\r
+\r
+                                                       <td><label for="qt_href">{#media_dlg.href}</label></td>\r
+                                                       <td><input type="text" id="qt_href" name="qt_href" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="qt_qtsrcchokespeed">{#media_dlg.qtsrcchokespeed}</label></td>\r
+                                                       <td><input type="text" id="qt_qtsrcchokespeed" name="qt_qtsrcchokespeed" onchange="generatePreview();" /></td>\r
+\r
+                                                       <td><label for="qt_volume">{#media_dlg.volume}</label></td>\r
+                                                       <td><input type="text" id="qt_volume" name="qt_volume" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="qt_qtsrc">{#media_dlg.qtsrc}</label></td>\r
+                                                       <td colspan="4">\r
+                                                       <table border="0" cellspacing="0" cellpadding="0">\r
+                                                                 <tr>\r
+                                                                       <td><input type="text" id="qt_qtsrc" name="qt_qtsrc" onchange="generatePreview();" /></td>\r
+                                                                       <td id="qtsrcfilebrowsercontainer">&nbsp;</td>\r
+                                                                 </tr>\r
+                                                       </table>\r
+                                                       </td>\r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+\r
+                               <fieldset id="wmp_options">\r
+                                       <legend>{#media_dlg.wmp_options}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="wmp_autostart" name="wmp_autostart" checked="checked" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="wmp_autostart">{#media_dlg.autostart}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="wmp_enabled" name="wmp_enabled" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="wmp_enabled">{#media_dlg.enabled}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="wmp_enablecontextmenu" name="wmp_enablecontextmenu" checked="checked" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="wmp_enablecontextmenu">{#media_dlg.menu}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="wmp_fullscreen" name="wmp_fullscreen" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="wmp_fullscreen">{#media_dlg.fullscreen}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="wmp_invokeurls" name="wmp_invokeurls" checked="checked" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="wmp_invokeurls">{#media_dlg.invokeurls}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="wmp_mute" name="wmp_mute" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="wmp_mute">{#media_dlg.mute}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="wmp_stretchtofit" name="wmp_stretchtofit" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="wmp_stretchtofit">{#media_dlg.stretchtofit}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="wmp_windowlessvideo" name="wmp_windowlessvideo" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="wmp_windowlessvideo">{#media_dlg.windowlessvideo}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="wmp_balance">{#media_dlg.balance}</label></td>\r
+                                                       <td><input type="text" id="wmp_balance" name="wmp_balance" onchange="generatePreview();" /></td>\r
+\r
+                                                       <td><label for="wmp_baseurl">{#media_dlg.baseurl}</label></td>\r
+                                                       <td><input type="text" id="wmp_baseurl" name="wmp_baseurl" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="wmp_captioningid">{#media_dlg.captioningid}</label></td>\r
+                                                       <td><input type="text" id="wmp_captioningid" name="wmp_captioningid" onchange="generatePreview();" /></td>\r
+\r
+                                                       <td><label for="wmp_currentmarker">{#media_dlg.currentmarker}</label></td>\r
+                                                       <td><input type="text" id="wmp_currentmarker" name="wmp_currentmarker" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="wmp_currentposition">{#media_dlg.currentposition}</label></td>\r
+                                                       <td><input type="text" id="wmp_currentposition" name="wmp_currentposition" onchange="generatePreview();" /></td>\r
+\r
+                                                       <td><label for="wmp_defaultframe">{#media_dlg.defaultframe}</label></td>\r
+                                                       <td><input type="text" id="wmp_defaultframe" name="wmp_defaultframe" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="wmp_playcount">{#media_dlg.playcount}</label></td>\r
+                                                       <td><input type="text" id="wmp_playcount" name="wmp_playcount" onchange="generatePreview();" /></td>\r
+\r
+                                                       <td><label for="wmp_rate">{#media_dlg.rate}</label></td>\r
+                                                       <td><input type="text" id="wmp_rate" name="wmp_rate" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="wmp_uimode">{#media_dlg.uimode}</label></td>\r
+                                                       <td><input type="text" id="wmp_uimode" name="wmp_uimode" onchange="generatePreview();" /></td>\r
+\r
+                                                       <td><label for="wmp_volume">{#media_dlg.volume}</label></td>\r
+                                                       <td><input type="text" id="wmp_volume" name="wmp_volume" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+\r
+                                       </table>\r
+                               </fieldset>\r
+\r
+                               <fieldset id="rmp_options">\r
+                                       <legend>{#media_dlg.rmp_options}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="rmp_autostart" name="rmp_autostart" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="rmp_autostart">{#media_dlg.autostart}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="rmp_loop" name="rmp_loop" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="rmp_loop">{#media_dlg.loop}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="rmp_autogotourl" name="rmp_autogotourl" checked="checked" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="rmp_autogotourl">{#media_dlg.autogotourl}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="rmp_center" name="rmp_center" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="rmp_center">{#media_dlg.center}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="rmp_imagestatus" name="rmp_imagestatus" checked="checked" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="rmp_imagestatus">{#media_dlg.imagestatus}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="rmp_maintainaspect" name="rmp_maintainaspect" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="rmp_maintainaspect">{#media_dlg.maintainaspect}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="rmp_nojava" name="rmp_nojava" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="rmp_nojava">{#media_dlg.nojava}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="rmp_prefetch" name="rmp_prefetch" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="rmp_prefetch">{#media_dlg.prefetch}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="rmp_shuffle" name="rmp_shuffle" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="rmp_shuffle">{#media_dlg.shuffle}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               &nbsp;\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="rmp_console">{#media_dlg.console}</label></td>\r
+                                                       <td><input type="text" id="rmp_console" name="rmp_console" onchange="generatePreview();" /></td>\r
+\r
+                                                       <td><label for="rmp_controls">{#media_dlg.controls}</label></td>\r
+                                                       <td><input type="text" id="rmp_controls" name="rmp_controls" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="rmp_numloop">{#media_dlg.numloop}</label></td>\r
+                                                       <td><input type="text" id="rmp_numloop" name="rmp_numloop" onchange="generatePreview();" /></td>\r
+\r
+                                                       <td><label for="rmp_scriptcallbacks">{#media_dlg.scriptcallbacks}</label></td>\r
+                                                       <td><input type="text" id="rmp_scriptcallbacks" name="rmp_scriptcallbacks" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+\r
+                               <fieldset id="shockwave_options">\r
+                                       <legend>{#media_dlg.shockwave_options}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td><label for="shockwave_swstretchstyle">{#media_dlg.swstretchstyle}</label></td>\r
+                                                       <td>\r
+                                                               <select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="generatePreview();">\r
+                                                                       <option value="none">{#not_set}</option>\r
+                                                                       <option value="meet">Meet</option>\r
+                                                                       <option value="fill">Fill</option>\r
+                                                                       <option value="stage">Stage</option>\r
+                                                               </select>\r
+                                                       </td>\r
+\r
+                                                       <td><label for="shockwave_swvolume">{#media_dlg.volume}</label></td>\r
+                                                       <td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="generatePreview();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="shockwave_swstretchhalign">{#media_dlg.swstretchhalign}</label></td>\r
+                                                       <td>\r
+                                                               <select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="generatePreview();">\r
+                                                                       <option value="none">{#not_set}</option>\r
+                                                                       <option value="left">{#media_dlg.align_left}</option>\r
+                                                                       <option value="center">{#media_dlg.align_center}</option>\r
+                                                                       <option value="right">{#media_dlg.align_right}</option>\r
+                                                               </select>\r
+                                                       </td>\r
+\r
+                                                       <td><label for="shockwave_swstretchvalign">{#media_dlg.swstretchvalign}</label></td>\r
+                                                       <td>\r
+                                                               <select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="generatePreview();">\r
+                                                                       <option value="none">{#not_set}</option>\r
+                                                                       <option value="meet">Meet</option>\r
+                                                                       <option value="fill">Fill</option>\r
+                                                                       <option value="stage">Stage</option>\r
+                                                               </select>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="generatePreview();" checked="checked" /></td>\r
+                                                                               <td><label for="shockwave_autostart">{#media_dlg.autostart}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="generatePreview();" checked="checked" /></td>\r
+                                                                               <td><label for="shockwave_sound">{#media_dlg.sound}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+\r
+                                               <tr>\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="generatePreview();" /></td>\r
+                                                                               <td><label for="shockwave_swliveconnect">{#media_dlg.liveconnect}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+\r
+                                                       <td colspan="2">\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="generatePreview();" checked="checked" /></td>\r
+                                                                               <td><label for="shockwave_progress">{#media_dlg.progress}</label></td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td>\r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+                       </div>\r
+               </div>\r
+\r
+               <div class="mceActionPanel">\r
+                       <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+                       <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+               </div>\r
+       </form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js
new file mode 100644 (file)
index 0000000..f2dbbff
--- /dev/null
@@ -0,0 +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)?'<span class="mceItemHidden mceVisualNbsp">&middot;</span>':"&nbsp;")});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
diff --git a/docs/include/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..e3b078b
--- /dev/null
@@ -0,0 +1,53 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.Nonbreaking', {\r
+               init : function(ed, url) {\r
+                       var t = this;\r
+\r
+                       t.editor = ed;\r
+\r
+                       // Register commands\r
+                       ed.addCommand('mceNonBreaking', function() {\r
+                               ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span class="mceItemHidden mceVisualNbsp">&middot;</span>' : '&nbsp;');\r
+                       });\r
+\r
+                       // Register buttons\r
+                       ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'});\r
+\r
+                       if (ed.getParam('nonbreaking_force_tab')) {\r
+                               ed.onKeyDown.add(function(ed, e) {\r
+                                       if (tinymce.isIE && e.keyCode == 9) {\r
+                                               ed.execCommand('mceNonBreaking');\r
+                                               ed.execCommand('mceNonBreaking');\r
+                                               ed.execCommand('mceNonBreaking');\r
+                                               tinymce.dom.Event.cancel(e);\r
+                                       }\r
+                               });\r
+                       }\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Nonbreaking space',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               }\r
+\r
+               // Private methods\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js
new file mode 100644 (file)
index 0000000..9945cd8
--- /dev/null
@@ -0,0 +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
diff --git a/docs/include/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..656c971
--- /dev/null
@@ -0,0 +1,90 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       var Event = tinymce.dom.Event;\r
+\r
+       tinymce.create('tinymce.plugins.NonEditablePlugin', {\r
+               init : function(ed, url) {\r
+                       var t = this, editClass, nonEditClass;\r
+\r
+                       t.editor = ed;\r
+                       editClass = ed.getParam("noneditable_editable_class", "mceEditable");\r
+                       nonEditClass = ed.getParam("noneditable_noneditable_class", "mceNonEditable");\r
+\r
+                       ed.onNodeChange.addToTop(function(ed, cm, n) {\r
+                               var sc, ec;\r
+\r
+                               // Block if start or end is inside a non editable element\r
+                               sc = ed.dom.getParent(ed.selection.getStart(), function(n) {\r
+                                       return ed.dom.hasClass(n, nonEditClass);\r
+                               });\r
+\r
+                               ec = ed.dom.getParent(ed.selection.getEnd(), function(n) {\r
+                                       return ed.dom.hasClass(n, nonEditClass);\r
+                               });\r
+\r
+                               // Block or unblock\r
+                               if (sc || ec) {\r
+                                       t._setDisabled(1);\r
+                                       return false;\r
+                               } else\r
+                                       t._setDisabled(0);\r
+                       });\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Non editable elements',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               },\r
+\r
+               _block : function(ed, e) {\r
+                       var k = e.keyCode;\r
+\r
+                       // Don't block arrow keys, pg up/down, and F1-F12\r
+                       if ((k > 32 && k < 41) || (k > 111 && k < 124))\r
+                               return;\r
+\r
+                       return Event.cancel(e);\r
+               },\r
+\r
+               _setDisabled : function(s) {\r
+                       var t = this, ed = t.editor;\r
+\r
+                       tinymce.each(ed.controlManager.controls, function(c) {\r
+                               c.setDisabled(s);\r
+                       });\r
+\r
+                       if (s !== t.disabled) {\r
+                               if (s) {\r
+                                       ed.onKeyDown.addToTop(t._block);\r
+                                       ed.onKeyPress.addToTop(t._block);\r
+                                       ed.onKeyUp.addToTop(t._block);\r
+                                       ed.onPaste.addToTop(t._block);\r
+                               } else {\r
+                                       ed.onKeyDown.remove(t._block);\r
+                                       ed.onKeyPress.remove(t._block);\r
+                                       ed.onKeyUp.remove(t._block);\r
+                                       ed.onPaste.remove(t._block);\r
+                               }\r
+\r
+                               t.disabled = s;\r
+                       }\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/pagebreak/css/content.css b/docs/include/jscripts/tiny_mce/plugins/pagebreak/css/content.css
new file mode 100644 (file)
index 0000000..c949d58
--- /dev/null
@@ -0,0 +1 @@
+.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/docs/include/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js
new file mode 100644 (file)
index 0000000..a212f69
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='<img src="'+d+'/img/trans.gif" class="mcePageBreak mceItemNoResize" />',a="mcePageBreak",c=b.getParam("pagebreak_separator","<!-- pagebreak -->"),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(/<img[^>]+>/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/docs/include/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..4e1eb0a
--- /dev/null
@@ -0,0 +1,77 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.PageBreakPlugin', {\r
+               init : function(ed, url) {\r
+                       var pb = '<img src="' + url + '/img/trans.gif" class="mcePageBreak mceItemNoResize" />', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', '<!-- pagebreak -->'), pbRE;\r
+\r
+                       pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g');\r
+\r
+                       // Register commands\r
+                       ed.addCommand('mcePageBreak', function() {\r
+                               ed.execCommand('mceInsertContent', 0, pb);\r
+                       });\r
+\r
+                       // Register buttons\r
+                       ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls});\r
+\r
+                       ed.onInit.add(function() {\r
+                               if (ed.settings.content_css !== false)\r
+                                       ed.dom.loadCSS(url + "/css/content.css");\r
+\r
+                               if (ed.theme.onResolveName) {\r
+                                       ed.theme.onResolveName.add(function(th, o) {\r
+                                               if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls))\r
+                                                       o.name = 'pagebreak';\r
+                                       });\r
+                               }\r
+                       });\r
+\r
+                       ed.onClick.add(function(ed, e) {\r
+                               e = e.target;\r
+\r
+                               if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls))\r
+                                       ed.selection.select(e);\r
+                       });\r
+\r
+                       ed.onNodeChange.add(function(ed, cm, n) {\r
+                               cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls));\r
+                       });\r
+\r
+                       ed.onBeforeSetContent.add(function(ed, o) {\r
+                               o.content = o.content.replace(pbRE, pb);\r
+                       });\r
+\r
+                       ed.onPostProcess.add(function(ed, o) {\r
+                               if (o.get)\r
+                                       o.content = o.content.replace(/<img[^>]+>/g, function(im) {\r
+                                               if (im.indexOf('class="mcePageBreak') !== -1)\r
+                                                       im = sep;\r
+\r
+                                               return im;\r
+                                       });\r
+                       });\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'PageBreak',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif b/docs/include/jscripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif
new file mode 100644 (file)
index 0000000..acdf408
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/pagebreak/img/trans.gif b/docs/include/jscripts/tiny_mce/plugins/pagebreak/img/trans.gif
new file mode 100644 (file)
index 0000000..3884865
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/pagebreak/img/trans.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/paste/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/paste/editor_plugin.js
new file mode 100644 (file)
index 0000000..78fd6d7
--- /dev/null
@@ -0,0 +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("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.")}else{e.windowManager.alert("Paste is now in plain text mode. Click again to toggle back to regular paste mode.")}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(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)});t+=(p.select("> span.Apple-style-span div",u)[0]||p.select("> span.Apple-style-span",u)[0]||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*(&nbsp;)+/gi,/(&nbsp;|<br[^>]*>)+\s*$/gi]);if(b(l,"paste_convert_headers_to_strong")){k=k.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>")}if(b(l,"paste_convert_middot_lists")){e([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"]])}e([/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/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([[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\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(/&quot;/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([[/<h[1-6][^>]*>/gi,"<p><strong>"],[/<\/h[1-6][^>]*>/gi,"</strong></p>"]])}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;m<e.length;m++){p=e[m];k=i.getStyle(n,p);if(k){o[p]=k;l++}}}i.setAttrib(n,"style","");if(e&&l>0){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(/&nbsp;/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<e){o=tinymce.inArray(n,g);q=j.getParents(i.parentNode,t);i=q[q.length-1-o]||i}}}c(j.select("span",u),function(w){var p=w.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(t=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){j.remove(w)}else{if(/^[\s\S]*\w+\.(&nbsp;|\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*(&nbsp;|\u00a0)+\s*/,"")}else{s=u.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.(&nbsp;|\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('<span id="'+k+'">&nbsp;</span>',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(o<e.y||o+i>e.y+e.h){l.getDoc().body.scrollTop=o<e.y?o:o-e.h+25}},_insert:function(g,e){var f=this.editor;if(!f.selection.isCollapsed()){f.getDoc().execCommand("Delete",false,null)}f.execCommand(tinymce.isGecko?"insertHTML":"mceInsertContent",false,g,{skip_undo:e})},_insertPlainText:function(j,x,v){var t,u,l,k,r,e,p,f,n=j.getWin(),z=j.getDoc(),s=j.selection,m=tinymce.is,y=tinymce.inArray,g=b(j,"paste_text_linebreaktype"),o=b(j,"paste_text_replacements");function q(h){c(h,function(i){if(i.constructor==RegExp){v=v.replace(i,"")}else{v=v.replace(i[0],i[1])}})}if((typeof(v)==="string")&&(v.length>0)){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"],[/<br[^>]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*<t[dh][^>]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/&nbsp;/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,"<br />"]])}else{q([/^\s+|\s+$/g,[/\n\n/g,"</p><p>"],[/\n/g,"<br />"]])}}if((l=v.indexOf("</p><p>"))!=-1){k=v.lastIndexOf("</p><p>");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<u;t++){p+="</"+e[t].nodeName.toLowerCase()+">";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+'<span id="_plain_text_marker">&nbsp;</span>');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((A<i.y)||(A+w>i.y+i.h)){z.body.scrollTop=A<i.y?A:A-i.h+25}},0)}},_legacySupport:function(){var f=this,e=f.editor;e.addCommand("mcePasteWord",function(){e.windowManager.open({file:f.url+"/pasteword.htm",width:parseInt(b(e,"paste_dialog_width")),height:parseInt(b(e,"paste_dialog_height")),inline:1})});if(b(e,"paste_text_use_dialog")){e.addCommand("mcePasteText",function(){e.windowManager.open({file:f.url+"/pastetext.htm",width:parseInt(b(e,"paste_dialog_width")),height:parseInt(b(e,"paste_dialog_height")),inline:1})})}e.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/docs/include/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..d85b39b
--- /dev/null
@@ -0,0 +1,929 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       var each = tinymce.each,\r
+               entities = null,\r
+               defs = {\r
+                       paste_auto_cleanup_on_paste : true,\r
+                       paste_block_drop : false,\r
+                       paste_retain_style_properties : "none",\r
+                       paste_strip_class_attributes : "mso",\r
+                       paste_remove_spans : false,\r
+                       paste_remove_styles : false,\r
+                       paste_remove_styles_if_webkit : true,\r
+                       paste_convert_middot_lists : true,\r
+                       paste_convert_headers_to_strong : false,\r
+                       paste_dialog_width : "450",\r
+                       paste_dialog_height : "400",\r
+                       paste_text_use_dialog : false,\r
+                       paste_text_sticky : false,\r
+                       paste_text_notifyalways : false,\r
+                       paste_text_linebreaktype : "p",\r
+                       paste_text_replacements : [\r
+                               [/\u2026/g, "..."],\r
+                               [/[\x93\x94\u201c\u201d]/g, '"'],\r
+                               [/[\x60\x91\x92\u2018\u2019]/g, "'"]\r
+                       ]\r
+               };\r
+\r
+       function getParam(ed, name) {\r
+               return ed.getParam(name, defs[name]);\r
+       }\r
+\r
+       tinymce.create('tinymce.plugins.PastePlugin', {\r
+               init : function(ed, url) {\r
+                       var t = this;\r
+\r
+                       t.editor = ed;\r
+                       t.url = url;\r
+\r
+                       // Setup plugin events\r
+                       t.onPreProcess = new tinymce.util.Dispatcher(t);\r
+                       t.onPostProcess = new tinymce.util.Dispatcher(t);\r
+\r
+                       // Register default handlers\r
+                       t.onPreProcess.add(t._preProcess);\r
+                       t.onPostProcess.add(t._postProcess);\r
+\r
+                       // Register optional preprocess handler\r
+                       t.onPreProcess.add(function(pl, o) {\r
+                               ed.execCallback('paste_preprocess', pl, o);\r
+                       });\r
+\r
+                       // Register optional postprocess\r
+                       t.onPostProcess.add(function(pl, o) {\r
+                               ed.execCallback('paste_postprocess', pl, o);\r
+                       });\r
+\r
+                       // Initialize plain text flag\r
+                       ed.pasteAsPlainText = false;\r
+\r
+                       // This function executes the process handlers and inserts the contents\r
+                       // force_rich overrides plain text mode set by user, important for pasting with execCommand\r
+                       function process(o, force_rich) {\r
+                               var dom = ed.dom;\r
+\r
+                               // Execute pre process handlers\r
+                               t.onPreProcess.dispatch(t, o);\r
+\r
+                               // Create DOM structure\r
+                               o.node = dom.create('div', 0, o.content);\r
+\r
+                               // Execute post process handlers\r
+                               t.onPostProcess.dispatch(t, o);\r
+\r
+                               // Serialize content\r
+                               o.content = ed.serializer.serialize(o.node, {getInner : 1});\r
+\r
+                               // Plain text option active?\r
+                               if ((!force_rich) && (ed.pasteAsPlainText)) {\r
+                                       t._insertPlainText(ed, dom, o.content);\r
+\r
+                                       if (!getParam(ed, "paste_text_sticky")) {\r
+                                               ed.pasteAsPlainText = false;\r
+                                               ed.controlManager.setActive("pastetext", false);\r
+                                       }\r
+                               } else if (/<(p|h[1-6]|ul|ol)/.test(o.content)) {\r
+                                       // Handle insertion of contents containing block elements separately\r
+                                       t._insertBlockContent(ed, dom, o.content);\r
+                               } else {\r
+                                       t._insert(o.content);\r
+                               }\r
+                       }\r
+\r
+                       // Add command for external usage\r
+                       ed.addCommand('mceInsertClipboardContent', function(u, o) {\r
+                               process(o, true);\r
+                       });\r
+\r
+                       if (!getParam(ed, "paste_text_use_dialog")) {\r
+                               ed.addCommand('mcePasteText', function(u, v) {\r
+                                       var cookie = tinymce.util.Cookie;\r
+\r
+                                       ed.pasteAsPlainText = !ed.pasteAsPlainText;\r
+                                       ed.controlManager.setActive('pastetext', ed.pasteAsPlainText);\r
+\r
+                                       if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) {\r
+                                               if (getParam(ed, "paste_text_sticky")) {\r
+                                                       ed.windowManager.alert("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.");\r
+                                               } else {\r
+                                                       ed.windowManager.alert("Paste is now in plain text mode. Click again to toggle back to regular paste mode.");\r
+                                               }\r
+\r
+                                               if (!getParam(ed, "paste_text_notifyalways")) {\r
+                                                       cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31))\r
+                                               }\r
+                                       }\r
+                               });\r
+                       }\r
+\r
+                       ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'});\r
+                       ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'});\r
+\r
+                       // This function grabs the contents from the clipboard by adding a\r
+                       // hidden div and placing the caret inside it and after the browser paste\r
+                       // is done it grabs that contents and processes that\r
+                       function grabContent(e) {\r
+                               var n, or, rng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY;\r
+\r
+                               if (dom.get('_mcePaste'))\r
+                                       return;\r
+\r
+                               // Create container to paste into\r
+                               n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste'}, '\uFEFF');\r
+\r
+                               // If contentEditable mode we need to find out the position of the closest element\r
+                               if (body != ed.getDoc().body)\r
+                                       posY = dom.getPos(ed.selection.getStart(), body).y;\r
+                               else\r
+                                       posY = body.scrollTop;\r
+\r
+                               // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles\r
+                               dom.setStyles(n, {\r
+                                       position : 'absolute',\r
+                                       left : -10000,\r
+                                       top : posY,\r
+                                       width : 1,\r
+                                       height : 1,\r
+                                       overflow : 'hidden'\r
+                               });\r
+\r
+                               if (tinymce.isIE) {\r
+                                       // Select the container\r
+                                       rng = dom.doc.body.createTextRange();\r
+                                       rng.moveToElementText(n);\r
+                                       rng.execCommand('Paste');\r
+\r
+                                       // Remove container\r
+                                       dom.remove(n);\r
+\r
+                                       // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due\r
+                                       // to IE security settings so we pass the junk though better than nothing right\r
+                                       if (n.innerHTML === '\uFEFF') {\r
+                                               ed.execCommand('mcePasteWord');\r
+                                               e.preventDefault();\r
+                                               return;\r
+                                       }\r
+\r
+                                       // Process contents\r
+                                       process({content : n.innerHTML});\r
+\r
+                                       // Block the real paste event\r
+                                       return tinymce.dom.Event.cancel(e);\r
+                               } else {\r
+                                       function block(e) {\r
+                                               e.preventDefault();\r
+                                       };\r
+\r
+                                       // Block mousedown and click to prevent selection change\r
+                                       dom.bind(ed.getDoc(), 'mousedown', block);\r
+                                       dom.bind(ed.getDoc(), 'keydown', block);\r
+\r
+                                       or = ed.selection.getRng();\r
+\r
+                                       // Move caret into hidden div\r
+                                       n = n.firstChild;\r
+                                       rng = ed.getDoc().createRange();\r
+                                       rng.setStart(n, 0);\r
+                                       rng.setEnd(n, 1);\r
+                                       sel.setRng(rng);\r
+\r
+                                       // Wait a while and grab the pasted contents\r
+                                       window.setTimeout(function() {\r
+                                               var h = '', nl = dom.select('div.mcePaste');\r
+\r
+                                               // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string\r
+                                               each(nl, function(n) {\r
+                                                       // WebKit duplicates the divs so we need to remove them\r
+                                                       each(dom.select('div.mcePaste', n), function(n) {\r
+                                                               dom.remove(n, 1);\r
+                                                       });\r
+\r
+                                                       // Contents in WebKit is sometimes wrapped in a apple style span so we need to grab it from that one\r
+                                                       h += (dom.select('> span.Apple-style-span div', n)[0] || dom.select('> span.Apple-style-span', n)[0] || n).innerHTML;\r
+                                               });\r
+\r
+                                               // Remove the nodes\r
+                                               each(nl, function(n) {\r
+                                                       dom.remove(n);\r
+                                               });\r
+\r
+                                               // Restore the old selection\r
+                                               if (or)\r
+                                                       sel.setRng(or);\r
+\r
+                                               process({content : h});\r
+\r
+                                               // Unblock events ones we got the contents\r
+                                               dom.unbind(ed.getDoc(), 'mousedown', block);\r
+                                               dom.unbind(ed.getDoc(), 'keydown', block);\r
+                                       }, 0);\r
+                               }\r
+                       }\r
+\r
+                       // Check if we should use the new auto process method                   \r
+                       if (getParam(ed, "paste_auto_cleanup_on_paste")) {\r
+                               // Is it's Opera or older FF use key handler\r
+                               if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {\r
+                                       ed.onKeyDown.add(function(ed, e) {\r
+                                               if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))\r
+                                                       grabContent(e);\r
+                                       });\r
+                               } else {\r
+                                       // Grab contents on paste event on Gecko and WebKit\r
+                                       ed.onPaste.addToTop(function(ed, e) {\r
+                                               return grabContent(e);\r
+                                       });\r
+                               }\r
+                       }\r
+\r
+                       // Block all drag/drop events\r
+                       if (getParam(ed, "paste_block_drop")) {\r
+                               ed.onInit.add(function() {\r
+                                       ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) {\r
+                                               e.preventDefault();\r
+                                               e.stopPropagation();\r
+\r
+                                               return false;\r
+                                       });\r
+                               });\r
+                       }\r
+\r
+                       // Add legacy support\r
+                       t._legacySupport();\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Paste text/word',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               },\r
+\r
+               _preProcess : function(pl, o) {\r
+                       //console.log('Before preprocess:' + o.content);\r
+\r
+                       var ed = this.editor,\r
+                               h = o.content,\r
+                               grep = tinymce.grep,\r
+                               explode = tinymce.explode,\r
+                               trim = tinymce.trim,\r
+                               len, stripClass;\r
+\r
+                       function process(items) {\r
+                               each(items, function(v) {\r
+                                       // Remove or replace\r
+                                       if (v.constructor == RegExp)\r
+                                               h = h.replace(v, '');\r
+                                       else\r
+                                               h = h.replace(v[0], v[1]);\r
+                               });\r
+                       }\r
+\r
+                       // Detect Word content and process it more aggressive\r
+                       if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) {\r
+                               o.wordContent = true;                   // Mark the pasted contents as word specific content\r
+                               //console.log('Word contents detected.');\r
+\r
+                               // Process away some basic content\r
+                               process([\r
+                                       /^\s*(&nbsp;)+/gi,                              // &nbsp; entities at the start of contents\r
+                                       /(&nbsp;|<br[^>]*>)+\s*$/gi             // &nbsp; entities at the end of contents\r
+                               ]);\r
+\r
+                               if (getParam(ed, "paste_convert_headers_to_strong")) {\r
+                                       h = h.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "<p><strong>$1</strong></p>");\r
+                               }\r
+\r
+                               if (getParam(ed, "paste_convert_middot_lists")) {\r
+                                       process([\r
+                                               [/<!--\[if !supportLists\]-->/gi, '$&__MCE_ITEM__'],                                    // Convert supportLists to a list item marker\r
+                                               [/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__']              // Convert mso-list and symbol spans to item markers\r
+                                       ]);\r
+                               }\r
+\r
+                               process([\r
+                                       // Word comments like conditional comments etc\r
+                                       /<!--[\s\S]+?-->/gi,\r
+\r
+                                       // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags\r
+                                       /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,\r
+\r
+                                       // Convert <s> into <strike> for line-though\r
+                                       [/<(\/?)s>/gi, "<$1strike>"],\r
+\r
+                                       // Replace nsbp entites to char since it's easier to handle\r
+                                       [/&nbsp;/gi, "\u00a0"]\r
+                               ]);\r
+\r
+                               // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag.\r
+                               // If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot.\r
+                               do {\r
+                                       len = h.length;\r
+                                       h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");\r
+                               } while (len != h.length);\r
+\r
+                               // Remove all spans if no styles is to be retained\r
+                               if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) {\r
+                                       h = h.replace(/<\/?span[^>]*>/gi, "");\r
+                               } else {\r
+                                       // We're keeping styles, so at least clean them up.\r
+                                       // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx\r
+\r
+                                       process([\r
+                                               // Convert <span style="mso-spacerun:yes">___</span> to string of alternating breaking/non-breaking spaces of same length\r
+                                               [/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,\r
+                                                       function(str, spaces) {\r
+                                                               return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : "";\r
+                                                       }\r
+                                               ],\r
+\r
+                                               // Examine all styles: delete junk, transform some, and keep the rest\r
+                                               [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,\r
+                                                       function(str, tag, style) {\r
+                                                               var n = [],\r
+                                                                       i = 0,\r
+                                                                       s = explode(trim(style).replace(/&quot;/gi, "'"), ";");\r
+\r
+                                                               // Examine each style definition within the tag's style attribute\r
+                                                               each(s, function(v) {\r
+                                                                       var name, value,\r
+                                                                               parts = explode(v, ":");\r
+\r
+                                                                       function ensureUnits(v) {\r
+                                                                               return v + ((v !== "0") && (/\d$/.test(v)))? "px" : "";\r
+                                                                       }\r
+\r
+                                                                       if (parts.length == 2) {\r
+                                                                               name = parts[0].toLowerCase();\r
+                                                                               value = parts[1].toLowerCase();\r
+\r
+                                                                               // Translate certain MS Office styles into their CSS equivalents\r
+                                                                               switch (name) {\r
+                                                                                       case "mso-padding-alt":\r
+                                                                                       case "mso-padding-top-alt":\r
+                                                                                       case "mso-padding-right-alt":\r
+                                                                                       case "mso-padding-bottom-alt":\r
+                                                                                       case "mso-padding-left-alt":\r
+                                                                                       case "mso-margin-alt":\r
+                                                                                       case "mso-margin-top-alt":\r
+                                                                                       case "mso-margin-right-alt":\r
+                                                                                       case "mso-margin-bottom-alt":\r
+                                                                                       case "mso-margin-left-alt":\r
+                                                                                       case "mso-table-layout-alt":\r
+                                                                                       case "mso-height":\r
+                                                                                       case "mso-width":\r
+                                                                                       case "mso-vertical-align-alt":\r
+                                                                                               n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value);\r
+                                                                                               return;\r
+\r
+                                                                                       case "horiz-align":\r
+                                                                                               n[i++] = "text-align:" + value;\r
+                                                                                               return;\r
+\r
+                                                                                       case "vert-align":\r
+                                                                                               n[i++] = "vertical-align:" + value;\r
+                                                                                               return;\r
+\r
+                                                                                       case "font-color":\r
+                                                                                       case "mso-foreground":\r
+                                                                                               n[i++] = "color:" + value;\r
+                                                                                               return;\r
+\r
+                                                                                       case "mso-background":\r
+                                                                                       case "mso-highlight":\r
+                                                                                               n[i++] = "background:" + value;\r
+                                                                                               return;\r
+\r
+                                                                                       case "mso-default-height":\r
+                                                                                               n[i++] = "min-height:" + ensureUnits(value);\r
+                                                                                               return;\r
+\r
+                                                                                       case "mso-default-width":\r
+                                                                                               n[i++] = "min-width:" + ensureUnits(value);\r
+                                                                                               return;\r
+\r
+                                                                                       case "mso-padding-between-alt":\r
+                                                                                               n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value);\r
+                                                                                               return;\r
+\r
+                                                                                       case "text-line-through":\r
+                                                                                               if ((value == "single") || (value == "double")) {\r
+                                                                                                       n[i++] = "text-decoration:line-through";\r
+                                                                                               }\r
+                                                                                               return;\r
+\r
+                                                                                       case "mso-zero-height":\r
+                                                                                               if (value == "yes") {\r
+                                                                                                       n[i++] = "display:none";\r
+                                                                                               }\r
+                                                                                               return;\r
+                                                                               }\r
+\r
+                                                                               // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name\r
+                                                                               if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) {\r
+                                                                                       return;\r
+                                                                               }\r
+\r
+                                                                               // If it reached this point, it must be a valid CSS style\r
+                                                                               n[i++] = name + ":" + parts[1];         // Lower-case name, but keep value case\r
+                                                                       }\r
+                                                               });\r
+\r
+                                                               // If style attribute contained any valid styles the re-write it; otherwise delete style attribute.\r
+                                                               if (i > 0) {\r
+                                                                       return tag + ' style="' + n.join(';') + '"';\r
+                                                               } else {\r
+                                                                       return tag;\r
+                                                               }\r
+                                                       }\r
+                                               ]\r
+                                       ]);\r
+                               }\r
+                       }\r
+\r
+                       // Replace headers with <strong>\r
+                       if (getParam(ed, "paste_convert_headers_to_strong")) {\r
+                               process([\r
+                                       [/<h[1-6][^>]*>/gi, "<p><strong>"],\r
+                                       [/<\/h[1-6][^>]*>/gi, "</strong></p>"]\r
+                               ]);\r
+                       }\r
+\r
+                       // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso").\r
+                       // Note:-  paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation.\r
+                       stripClass = getParam(ed, "paste_strip_class_attributes");\r
+\r
+                       if (stripClass !== "none") {\r
+                               function removeClasses(match, g1) {\r
+                                               if (stripClass === "all")\r
+                                                       return '';\r
+\r
+                                               var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "),\r
+                                                       function(v) {\r
+                                                               return (/^(?!mso)/i.test(v));\r
+                                                       }\r
+                                               );\r
+\r
+                                               return cls.length ? ' class="' + cls.join(" ") + '"' : '';\r
+                               };\r
+\r
+                               h = h.replace(/ class="([^"]+)"/gi, removeClasses);\r
+                               h = h.replace(/ class=(\w+)/gi, removeClasses);\r
+                       }\r
+\r
+                       // Remove spans option\r
+                       if (getParam(ed, "paste_remove_spans")) {\r
+                               h = h.replace(/<\/?span[^>]*>/gi, "");\r
+                       }\r
+\r
+                       //console.log('After preprocess:' + h);\r
+\r
+                       o.content = h;\r
+               },\r
+\r
+               /**\r
+                * Various post process items.\r
+                */\r
+               _postProcess : function(pl, o) {\r
+                       var t = this, ed = t.editor, dom = ed.dom, styleProps;\r
+\r
+                       if (o.wordContent) {\r
+                               // Remove named anchors or TOC links\r
+                               each(dom.select('a', o.node), function(a) {\r
+                                       if (!a.href || a.href.indexOf('#_Toc') != -1)\r
+                                               dom.remove(a, 1);\r
+                               });\r
+\r
+                               if (getParam(ed, "paste_convert_middot_lists")) {\r
+                                       t._convertLists(pl, o);\r
+                               }\r
+\r
+                               // Process styles\r
+                               styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties\r
+\r
+                               // Process only if a string was specified and not equal to "all" or "*"\r
+                               if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) {\r
+                                       styleProps = tinymce.explode(styleProps.replace(/^none$/i, ""));\r
+\r
+                                       // Retains some style properties\r
+                                       each(dom.select('*', o.node), function(el) {\r
+                                               var newStyle = {}, npc = 0, i, sp, sv;\r
+\r
+                                               // Store a subset of the existing styles\r
+                                               if (styleProps) {\r
+                                                       for (i = 0; i < styleProps.length; i++) {\r
+                                                               sp = styleProps[i];\r
+                                                               sv = dom.getStyle(el, sp);\r
+\r
+                                                               if (sv) {\r
+                                                                       newStyle[sp] = sv;\r
+                                                                       npc++;\r
+                                                               }\r
+                                                       }\r
+                                               }\r
+\r
+                                               // Remove all of the existing styles\r
+                                               dom.setAttrib(el, 'style', '');\r
+\r
+                                               if (styleProps && npc > 0)\r
+                                                       dom.setStyles(el, newStyle); // Add back the stored subset of styles\r
+                                               else // Remove empty span tags that do not have class attributes\r
+                                                       if (el.nodeName == 'SPAN' && !el.className)\r
+                                                               dom.remove(el, true);\r
+                                       });\r
+                               }\r
+                       }\r
+\r
+                       // Remove all style information or only specifically on WebKit to avoid the style bug on that browser\r
+                       if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) {\r
+                               each(dom.select('*[style]', o.node), function(el) {\r
+                                       el.removeAttribute('style');\r
+                                       el.removeAttribute('_mce_style');\r
+                               });\r
+                       } else {\r
+                               if (tinymce.isWebKit) {\r
+                                       // We need to compress the styles on WebKit since if you paste <img border="0" /> it will become <img border="0" style="... lots of junk ..." />\r
+                                       // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles\r
+                                       each(dom.select('*', o.node), function(el) {\r
+                                               el.removeAttribute('_mce_style');\r
+                                       });\r
+                               }\r
+                       }\r
+               },\r
+\r
+               /**\r
+                * Converts the most common bullet and number formats in Office into a real semantic UL/LI list.\r
+                */\r
+               _convertLists : function(pl, o) {\r
+                       var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html;\r
+\r
+                       // Convert middot lists into real semantic lists\r
+                       each(dom.select('p', o.node), function(p) {\r
+                               var sib, val = '', type, html, idx, parents;\r
+\r
+                               // Get text node value at beginning of paragraph\r
+                               for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling)\r
+                                       val += sib.nodeValue;\r
+\r
+                               val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/&nbsp;/g, '\u00a0');\r
+\r
+                               // Detect unordered lists look for bullets\r
+                               if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(val))\r
+                                       type = 'ul';\r
+\r
+                               // Detect ordered lists 1., a. or ixv.\r
+                               if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(val))\r
+                                       type = 'ol';\r
+\r
+                               // Check if node value matches the list pattern: o&nbsp;&nbsp;\r
+                               if (type) {\r
+                                       margin = parseFloat(p.style.marginLeft || 0);\r
+\r
+                                       if (margin > lastMargin)\r
+                                               levels.push(margin);\r
+\r
+                                       if (!listElm || type != lastType) {\r
+                                               listElm = dom.create(type);\r
+                                               dom.insertAfter(listElm, p);\r
+                                       } else {\r
+                                               // Nested list element\r
+                                               if (margin > lastMargin) {\r
+                                                       listElm = li.appendChild(dom.create(type));\r
+                                               } else if (margin < lastMargin) {\r
+                                                       // Find parent level based on margin value\r
+                                                       idx = tinymce.inArray(levels, margin);\r
+                                                       parents = dom.getParents(listElm.parentNode, type);\r
+                                                       listElm = parents[parents.length - 1 - idx] || listElm;\r
+                                               }\r
+                                       }\r
+\r
+                                       // Remove middot or number spans if they exists\r
+                                       each(dom.select('span', p), function(span) {\r
+                                               var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, '');\r
+\r
+                                               // Remove span with the middot or the number\r
+                                               if (type == 'ul' && /^[\u2022\u00b7\u00a7\u00d8o]/.test(html))\r
+                                                       dom.remove(span);\r
+                                               else if (/^[\s\S]*\w+\.(&nbsp;|\u00a0)*\s*/.test(html))\r
+                                                       dom.remove(span);\r
+                                       });\r
+\r
+                                       html = p.innerHTML;\r
+\r
+                                       // Remove middot/list items\r
+                                       if (type == 'ul')\r
+                                               html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*(&nbsp;|\u00a0)+\s*/, '');\r
+                                       else\r
+                                               html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.(&nbsp;|\u00a0)+\s*/, '');\r
+\r
+                                       // Create li and add paragraph data into the new li\r
+                                       li = listElm.appendChild(dom.create('li', 0, html));\r
+                                       dom.remove(p);\r
+\r
+                                       lastMargin = margin;\r
+                                       lastType = type;\r
+                               } else\r
+                                       listElm = lastMargin = 0; // End list element\r
+                       });\r
+\r
+                       // Remove any left over makers\r
+                       html = o.node.innerHTML;\r
+                       if (html.indexOf('__MCE_ITEM__') != -1)\r
+                               o.node.innerHTML = html.replace(/__MCE_ITEM__/g, '');\r
+               },\r
+\r
+               /**\r
+                * This method will split the current block parent and insert the contents inside the split position.\r
+                * This logic can be improved so text nodes at the start/end remain in the start/end block elements\r
+                */\r
+               _insertBlockContent : function(ed, dom, content) {\r
+                       var parentBlock, marker, sel = ed.selection, last, elm, vp, y, elmHeight, markerId = 'mce_marker';\r
+\r
+                       function select(n) {\r
+                               var r;\r
+\r
+                               if (tinymce.isIE) {\r
+                                       r = ed.getDoc().body.createTextRange();\r
+                                       r.moveToElementText(n);\r
+                                       r.collapse(false);\r
+                                       r.select();\r
+                               } else {\r
+                                       sel.select(n, 1);\r
+                                       sel.collapse(false);\r
+                               }\r
+                       }\r
+\r
+                       // Insert a marker for the caret position\r
+                       this._insert('<span id="' + markerId + '">&nbsp;</span>', 1);\r
+                       marker = dom.get(markerId);\r
+                       parentBlock = dom.getParent(marker, 'p,h1,h2,h3,h4,h5,h6,ul,ol,th,td');\r
+\r
+                       // If it's a parent block but not a table cell\r
+                       if (parentBlock && !/TD|TH/.test(parentBlock.nodeName)) {\r
+                               // Split parent block\r
+                               marker = dom.split(parentBlock, marker);\r
+\r
+                               // Insert nodes before the marker\r
+                               each(dom.create('div', 0, content).childNodes, function(n) {\r
+                                       last = marker.parentNode.insertBefore(n.cloneNode(true), marker);\r
+                               });\r
+\r
+                               // Move caret after marker\r
+                               select(last);\r
+                       } else {\r
+                               dom.setOuterHTML(marker, content);\r
+                               sel.select(ed.getBody(), 1);\r
+                               sel.collapse(0);\r
+                       }\r
+\r
+                       // Remove marker if it's left\r
+                       while (elm = dom.get(markerId))\r
+                               dom.remove(elm);\r
+\r
+                       // Get element, position and height\r
+                       elm = sel.getStart();\r
+                       vp = dom.getViewPort(ed.getWin());\r
+                       y = ed.dom.getPos(elm).y;\r
+                       elmHeight = elm.clientHeight;\r
+\r
+                       // Is element within viewport if not then scroll it into view\r
+                       if (y < vp.y || y + elmHeight > vp.y + vp.h)\r
+                               ed.getDoc().body.scrollTop = y < vp.y ? y : y - vp.h + 25;\r
+               },\r
+\r
+               /**\r
+                * Inserts the specified contents at the caret position.\r
+                */\r
+               _insert : function(h, skip_undo) {\r
+                       var ed = this.editor;\r
+\r
+                       // First delete the contents seems to work better on WebKit\r
+                       if (!ed.selection.isCollapsed())\r
+                               ed.getDoc().execCommand('Delete', false, null);\r
+\r
+                       // It's better to use the insertHTML method on Gecko since it will combine paragraphs correctly before inserting the contents\r
+                       ed.execCommand(tinymce.isGecko ? 'insertHTML' : 'mceInsertContent', false, h, {skip_undo : skip_undo});\r
+               },\r
+\r
+               /**\r
+                * Instead of the old plain text method which tried to re-create a paste operation, the\r
+                * new approach adds a plain text mode toggle switch that changes the behavior of paste.\r
+                * This function is passed the same input that the regular paste plugin produces.\r
+                * It performs additional scrubbing and produces (and inserts) the plain text.\r
+                * This approach leverages all of the great existing functionality in the paste\r
+                * plugin, and requires minimal changes to add the new functionality.\r
+                * Speednet - June 2009\r
+                */\r
+               _insertPlainText : function(ed, dom, h) {\r
+                       var i, len, pos, rpos, node, breakElms, before, after,\r
+                               w = ed.getWin(),\r
+                               d = ed.getDoc(),\r
+                               sel = ed.selection,\r
+                               is = tinymce.is,\r
+                               inArray = tinymce.inArray,\r
+                               linebr = getParam(ed, "paste_text_linebreaktype"),\r
+                               rl = getParam(ed, "paste_text_replacements");\r
+\r
+                       function process(items) {\r
+                               each(items, function(v) {\r
+                                       if (v.constructor == RegExp)\r
+                                               h = h.replace(v, "");\r
+                                       else\r
+                                               h = h.replace(v[0], v[1]);\r
+                               });\r
+                       };\r
+\r
+                       if ((typeof(h) === "string") && (h.length > 0)) {\r
+                               if (!entities)\r
+                                       entities = ("34,quot,38,amp,39,apos,60,lt,62,gt," + ed.serializer.settings.entities).split(",");\r
+\r
+                               // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line\r
+                               if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(h)) {\r
+                                       process([\r
+                                               /[\n\r]+/g\r
+                                       ]);\r
+                               } else {\r
+                                       // Otherwise just get rid of carriage returns (only need linefeeds)\r
+                                       process([\r
+                                               /\r+/g\r
+                                       ]);\r
+                               }\r
+\r
+                               process([\r
+                                       [/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"],               // Block tags get a blank line after them\r
+                                       [/<br[^>]*>|<\/tr>/gi, "\n"],                           // Single linebreak for <br /> tags and table rows\r
+                                       [/<\/t[dh]>\s*<t[dh][^>]*>/gi, "\t"],           // Table cells get tabs betweem them\r
+                                       /<[a-z!\/?][^>]*>/gi,                                           // Delete all remaining tags\r
+                                       [/&nbsp;/gi, " "],                                                      // Convert non-break spaces to regular spaces (remember, *plain text*)\r
+                                       [\r
+                                               // HTML entity\r
+                                               /&(#\d+|[a-z0-9]{1,10});/gi,\r
+\r
+                                               // Replace with actual character\r
+                                               function(e, s) {\r
+                                                       if (s.charAt(0) === "#") {\r
+                                                               return String.fromCharCode(s.slice(1));\r
+                                                       }\r
+                                                       else {\r
+                                                               return ((e = inArray(entities, s)) > 0)? String.fromCharCode(entities[e-1]) : " ";\r
+                                                       }\r
+                                               }\r
+                                       ],\r
+                                       [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"],    // Cool little RegExp deletes whitespace around linebreak chars.\r
+                                       [/\n{3,}/g, "\n\n"],                                                    // Max. 2 consecutive linebreaks\r
+                                       /^\s+|\s+$/g                                                                    // Trim the front & back\r
+                               ]);\r
+\r
+                               h = dom.encode(h);\r
+\r
+                               // Delete any highlighted text before pasting\r
+                               if (!sel.isCollapsed()) {\r
+                                       d.execCommand("Delete", false, null);\r
+                               }\r
+\r
+                               // Perform default or custom replacements\r
+                               if (is(rl, "array") || (is(rl, "array"))) {\r
+                                       process(rl);\r
+                               }\r
+                               else if (is(rl, "string")) {\r
+                                       process(new RegExp(rl, "gi"));\r
+                               }\r
+\r
+                               // Treat paragraphs as specified in the config\r
+                               if (linebr == "none") {\r
+                                       process([\r
+                                               [/\n+/g, " "]\r
+                                       ]);\r
+                               }\r
+                               else if (linebr == "br") {\r
+                                       process([\r
+                                               [/\n/g, "<br />"]\r
+                                       ]);\r
+                               }\r
+                               else {\r
+                                       process([\r
+                                               /^\s+|\s+$/g,\r
+                                               [/\n\n/g, "</p><p>"],\r
+                                               [/\n/g, "<br />"]\r
+                                       ]);\r
+                               }\r
+\r
+                               // This next piece of code handles the situation where we're pasting more than one paragraph of plain\r
+                               // text, and we are pasting the content into the middle of a block node in the editor.  The block\r
+                               // node gets split at the selection point into "Para A" and "Para B" (for the purposes of explaining).\r
+                               // The first paragraph of the pasted text is appended to "Para A", and the last paragraph of the\r
+                               // pasted text is prepended to "Para B".  Any other paragraphs of pasted text are placed between\r
+                               // "Para A" and "Para B".  This code solves a host of problems with the original plain text plugin and\r
+                               // now handles styles correctly.  (Pasting plain text into a styled paragraph is supposed to make the\r
+                               // plain text take the same style as the existing paragraph.)\r
+                               if ((pos = h.indexOf("</p><p>")) != -1) {\r
+                                       rpos = h.lastIndexOf("</p><p>");\r
+                                       node = sel.getNode(); \r
+                                       breakElms = [];         // Get list of elements to break \r
+\r
+                                       do {\r
+                                               if (node.nodeType == 1) {\r
+                                                       // Don't break tables and break at body\r
+                                                       if (node.nodeName == "TD" || node.nodeName == "BODY") {\r
+                                                               break;\r
+                                                       }\r
+\r
+                                                       breakElms[breakElms.length] = node;\r
+                                               }\r
+                                       } while (node = node.parentNode);\r
+\r
+                                       // Are we in the middle of a block node?\r
+                                       if (breakElms.length > 0) {\r
+                                               before = h.substring(0, pos);\r
+                                               after = "";\r
+\r
+                                               for (i=0, len=breakElms.length; i<len; i++) {\r
+                                                       before += "</" + breakElms[i].nodeName.toLowerCase() + ">";\r
+                                                       after += "<" + breakElms[breakElms.length-i-1].nodeName.toLowerCase() + ">";\r
+                                               }\r
+\r
+                                               if (pos == rpos) {\r
+                                                       h = before + after + h.substring(pos+7);\r
+                                               }\r
+                                               else {\r
+                                                       h = before + h.substring(pos+4, rpos+4) + after + h.substring(rpos+7);\r
+                                               }\r
+                                       }\r
+                               }\r
+\r
+                               // Insert content at the caret, plus add a marker for repositioning the caret\r
+                               ed.execCommand("mceInsertRawHTML", false, h + '<span id="_plain_text_marker">&nbsp;</span>');\r
+\r
+                               // Reposition the caret to the marker, which was placed immediately after the inserted content.\r
+                               // Needs to be done asynchronously (in window.setTimeout) or else it doesn't work in all browsers.\r
+                               // The second part of the code scrolls the content up if the caret is positioned off-screen.\r
+                               // This is only necessary for WebKit browsers, but it doesn't hurt to use for all.\r
+                               window.setTimeout(function() {\r
+                                       var marker = dom.get('_plain_text_marker'),\r
+                                               elm, vp, y, elmHeight;\r
+\r
+                                       sel.select(marker, false);\r
+                                       d.execCommand("Delete", false, null);\r
+                                       marker = null;\r
+\r
+                                       // Get element, position and height\r
+                                       elm = sel.getStart();\r
+                                       vp = dom.getViewPort(w);\r
+                                       y = dom.getPos(elm).y;\r
+                                       elmHeight = elm.clientHeight;\r
+\r
+                                       // Is element within viewport if not then scroll it into view\r
+                                       if ((y < vp.y) || (y + elmHeight > vp.y + vp.h)) {\r
+                                               d.body.scrollTop = y < vp.y ? y : y - vp.h + 25;\r
+                                       }\r
+                               }, 0);\r
+                       }\r
+               },\r
+\r
+               /**\r
+                * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine.\r
+                */\r
+               _legacySupport : function() {\r
+                       var t = this, ed = t.editor;\r
+\r
+                       // Register command(s) for backwards compatibility\r
+                       ed.addCommand("mcePasteWord", function() {\r
+                               ed.windowManager.open({\r
+                                       file: t.url + "/pasteword.htm",\r
+                                       width: parseInt(getParam(ed, "paste_dialog_width")),\r
+                                       height: parseInt(getParam(ed, "paste_dialog_height")),\r
+                                       inline: 1\r
+                               });\r
+                       });\r
+\r
+                       if (getParam(ed, "paste_text_use_dialog")) {\r
+                               ed.addCommand("mcePasteText", function() {\r
+                                       ed.windowManager.open({\r
+                                               file : t.url + "/pastetext.htm",\r
+                                               width: parseInt(getParam(ed, "paste_dialog_width")),\r
+                                               height: parseInt(getParam(ed, "paste_dialog_height")),\r
+                                               inline : 1\r
+                                       });\r
+                               });\r
+                       }\r
+\r
+                       // Register button for backwards compatibility\r
+                       ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"});\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin);\r
+})();\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/paste/js/pastetext.js b/docs/include/jscripts/tiny_mce/plugins/paste/js/pastetext.js
new file mode 100644 (file)
index 0000000..c524f9e
--- /dev/null
@@ -0,0 +1,36 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+var PasteTextDialog = {\r
+       init : function() {\r
+               this.resize();\r
+       },\r
+\r
+       insert : function() {\r
+               var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines;\r
+\r
+               // Convert linebreaks into paragraphs\r
+               if (document.getElementById('linebreaks').checked) {\r
+                       lines = h.split(/\r?\n/);\r
+                       if (lines.length > 1) {\r
+                               h = '';\r
+                               tinymce.each(lines, function(row) {\r
+                                       h += '<p>' + row + '</p>';\r
+                               });\r
+                       }\r
+               }\r
+\r
+               tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h});\r
+               tinyMCEPopup.close();\r
+       },\r
+\r
+       resize : function() {\r
+               var vp = tinyMCEPopup.dom.getViewPort(window), el;\r
+\r
+               el = document.getElementById('content');\r
+\r
+               el.style.width  = (vp.w - 20) + 'px';\r
+               el.style.height = (vp.h - 90) + 'px';\r
+       }\r
+};\r
+\r
+tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/paste/js/pasteword.js b/docs/include/jscripts/tiny_mce/plugins/paste/js/pasteword.js
new file mode 100644 (file)
index 0000000..a52731c
--- /dev/null
@@ -0,0 +1,51 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+var PasteWordDialog = {\r
+       init : function() {\r
+               var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = '';\r
+\r
+               // Create iframe\r
+               el.innerHTML = '<iframe id="iframe" src="javascript:\'\';" frameBorder="0" style="border: 1px solid gray"></iframe>';\r
+               ifr = document.getElementById('iframe');\r
+               doc = ifr.contentWindow.document;\r
+\r
+               // Force absolute CSS urls\r
+               css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")];\r
+               css = css.concat(tinymce.explode(ed.settings.content_css) || []);\r
+               tinymce.each(css, function(u) {\r
+                       cssHTML += '<link href="' + ed.documentBaseURI.toAbsolute('' + u) + '" rel="stylesheet" type="text/css" />';\r
+               });\r
+\r
+               // Write content into iframe\r
+               doc.open();\r
+               doc.write('<html><head>' + cssHTML + '</head><body class="mceContentBody" spellcheck="false"></body></html>');\r
+               doc.close();\r
+\r
+               doc.designMode = 'on';\r
+               this.resize();\r
+\r
+               window.setTimeout(function() {\r
+                       ifr.contentWindow.focus();\r
+               }, 10);\r
+       },\r
+\r
+       insert : function() {\r
+               var h = document.getElementById('iframe').contentWindow.document.body.innerHTML;\r
+\r
+               tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true});\r
+               tinyMCEPopup.close();\r
+       },\r
+\r
+       resize : function() {\r
+               var vp = tinyMCEPopup.dom.getViewPort(window), el;\r
+\r
+               el = document.getElementById('iframe');\r
+\r
+               if (el) {\r
+                       el.style.width  = (vp.w - 20) + 'px';\r
+                       el.style.height = (vp.h - 90) + 'px';\r
+               }\r
+       }\r
+};\r
+\r
+tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js b/docs/include/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js
new file mode 100644 (file)
index 0000000..eeac778
--- /dev/null
@@ -0,0 +1,5 @@
+tinyMCE.addI18n('en.paste_dlg',{\r
+text_title:"Use CTRL+V on your keyboard to paste the text into the window.",\r
+text_linebreaks:"Keep linebreaks",\r
+word_title:"Use CTRL+V on your keyboard to paste the text into the window."\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/paste/pastetext.htm b/docs/include/jscripts/tiny_mce/plugins/paste/pastetext.htm
new file mode 100644 (file)
index 0000000..b655945
--- /dev/null
@@ -0,0 +1,27 @@
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#paste.paste_text_desc}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="js/pastetext.js"></script>\r
+</head>\r
+<body onresize="PasteTextDialog.resize();" style="display:none; overflow:hidden;">\r
+       <form name="source" onsubmit="return PasteTextDialog.insert();" action="#">\r
+               <div style="float: left" class="title">{#paste.paste_text_desc}</div>\r
+\r
+               <div style="float: right">\r
+                       <input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label>\r
+               </div>\r
+\r
+               <br style="clear: both" />\r
+\r
+               <div>{#paste_dlg.text_title}</div>\r
+\r
+               <textarea id="content" name="content" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft" class="mceFocus"></textarea>\r
+\r
+               <div class="mceActionPanel">\r
+                       <input type="submit" name="insert" value="{#insert}" id="insert" />\r
+                       <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />\r
+               </div>\r
+       </form>\r
+</body> \r
+</html>
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/paste/pasteword.htm b/docs/include/jscripts/tiny_mce/plugins/paste/pasteword.htm
new file mode 100644 (file)
index 0000000..0f6bb41
--- /dev/null
@@ -0,0 +1,21 @@
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#paste.paste_word_desc}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="js/pasteword.js"></script>\r
+</head>\r
+<body onresize="PasteWordDialog.resize();" style="display:none; overflow:hidden;">\r
+       <form name="source" onsubmit="return PasteWordDialog.insert();" action="#">\r
+               <div class="title">{#paste.paste_word_desc}</div>\r
+\r
+               <div>{#paste_dlg.word_title}</div>\r
+\r
+               <div id="iframecontainer"></div>\r
+\r
+               <div class="mceActionPanel">\r
+                       <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+                       <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+               </div>\r
+       </form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/preview/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/preview/editor_plugin.js
new file mode 100644 (file)
index 0000000..507909c
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.Preview",{init:function(a,b){var d=this,c=tinymce.explode(a.settings.content_css);d.editor=a;tinymce.each(c,function(f,e){c[e]=a.documentBaseURI.toAbsolute(f)});a.addCommand("mcePreview",function(){a.windowManager.open({file:a.getParam("plugin_preview_pageurl",b+"/preview.html"),width:parseInt(a.getParam("plugin_preview_width","550")),height:parseInt(a.getParam("plugin_preview_height","600")),resizable:"yes",scrollbars:"yes",popup_css:c?c.join(","):a.baseURI.toAbsolute("themes/"+a.settings.theme+"/skins/"+a.settings.skin+"/content.css"),inline:a.getParam("plugin_preview_inline",1)},{base:a.documentBaseURI.getURI()})});a.addButton("preview",{title:"preview.preview_desc",cmd:"mcePreview"})},getInfo:function(){return{longname:"Preview",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("preview",tinymce.plugins.Preview)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..80f00f0
--- /dev/null
@@ -0,0 +1,53 @@
+/**
+ * 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.create('tinymce.plugins.Preview', {
+               init : function(ed, url) {
+                       var t = this, css = tinymce.explode(ed.settings.content_css);
+
+                       t.editor = ed;
+
+                       // Force absolute CSS urls      
+                       tinymce.each(css, function(u, k) {
+                               css[k] = ed.documentBaseURI.toAbsolute(u);
+                       });
+
+                       ed.addCommand('mcePreview', function() {
+                               ed.windowManager.open({
+                                       file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
+                                       width : parseInt(ed.getParam("plugin_preview_width", "550")),
+                                       height : parseInt(ed.getParam("plugin_preview_height", "600")),
+                                       resizable : "yes",
+                                       scrollbars : "yes",
+                                       popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"),
+                                       inline : ed.getParam("plugin_preview_inline", 1)
+                               }, {
+                                       base : ed.documentBaseURI.getURI()
+                               });
+                       });
+
+                       ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
+               },
+
+               getInfo : function() {
+                       return {
+                               longname : 'Preview',
+                               author : 'Moxiecode Systems AB',
+                               authorurl : 'http://tinymce.moxiecode.com',
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion
+                       };
+               }
+       });
+
+       // Register plugin
+       tinymce.PluginManager.add('preview', tinymce.plugins.Preview);
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/preview/example.html b/docs/include/jscripts/tiny_mce/plugins/preview/example.html
new file mode 100644 (file)
index 0000000..b2c3d90
--- /dev/null
@@ -0,0 +1,28 @@
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+<script language="javascript" src="../../tiny_mce_popup.js"></script>\r
+<script type="text/javascript" src="jscripts/embed.js"></script>\r
+<script type="text/javascript">\r
+tinyMCEPopup.onInit.add(function(ed) {\r
+       var dom = tinyMCEPopup.dom;\r
+\r
+       // Load editor content_css\r
+       tinymce.each(ed.settings.content_css.split(','), function(u) {\r
+               dom.loadCSS(ed.documentBaseURI.toAbsolute(u));\r
+       });\r
+\r
+       // Place contents inside div container\r
+       dom.setHTML('content', ed.getContent());\r
+});\r
+</script>\r
+<title>Example of a custom preview page</title>\r
+</head>\r
+<body>\r
+\r
+Editor contents: <br />\r
+<div id="content">\r
+<!-- Gets filled with editor contents -->\r
+</div>\r
+\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/preview/jscripts/embed.js b/docs/include/jscripts/tiny_mce/plugins/preview/jscripts/embed.js
new file mode 100644 (file)
index 0000000..f8dc810
--- /dev/null
@@ -0,0 +1,73 @@
+/**\r
+ * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.\r
+ */\r
+\r
+function writeFlash(p) {\r
+       writeEmbed(\r
+               'D27CDB6E-AE6D-11cf-96B8-444553540000',\r
+               'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',\r
+               'application/x-shockwave-flash',\r
+               p\r
+       );\r
+}\r
+\r
+function writeShockWave(p) {\r
+       writeEmbed(\r
+       '166B1BCA-3F9C-11CF-8075-444553540000',\r
+       'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',\r
+       'application/x-director',\r
+               p\r
+       );\r
+}\r
+\r
+function writeQuickTime(p) {\r
+       writeEmbed(\r
+               '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',\r
+               'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',\r
+               'video/quicktime',\r
+               p\r
+       );\r
+}\r
+\r
+function writeRealMedia(p) {\r
+       writeEmbed(\r
+               'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',\r
+               'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',\r
+               'audio/x-pn-realaudio-plugin',\r
+               p\r
+       );\r
+}\r
+\r
+function writeWindowsMedia(p) {\r
+       p.url = p.src;\r
+       writeEmbed(\r
+               '6BF52A52-394A-11D3-B153-00C04F79FAA6',\r
+               'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',\r
+               'application/x-mplayer2',\r
+               p\r
+       );\r
+}\r
+\r
+function writeEmbed(cls, cb, mt, p) {\r
+       var h = '', n;\r
+\r
+       h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';\r
+       h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';\r
+       h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';\r
+       h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';\r
+       h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';\r
+       h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';\r
+       h += '>';\r
+\r
+       for (n in p)\r
+               h += '<param name="' + n + '" value="' + p[n] + '">';\r
+\r
+       h += '<embed type="' + mt + '"';\r
+\r
+       for (n in p)\r
+               h += n + '="' + p[n] + '" ';\r
+\r
+       h += '></embed></object>';\r
+\r
+       document.write(h);\r
+}\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/preview/preview.html b/docs/include/jscripts/tiny_mce/plugins/preview/preview.html
new file mode 100644 (file)
index 0000000..67e7b14
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+<script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+<script type="text/javascript" src="jscripts/embed.js"></script>\r
+<script type="text/javascript"><!--\r
+document.write('<base href="' + tinyMCEPopup.getWindowArg("base") + '">');\r
+// -->\r
+</script>\r
+<title>{#preview.preview_desc}</title>\r
+</head>\r
+<body id="content">\r
+<script type="text/javascript">\r
+       document.write(tinyMCEPopup.editor.getContent());\r
+</script>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/print/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/print/editor_plugin.js
new file mode 100644 (file)
index 0000000..b5b3a55
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.Print",{init:function(a,b){a.addCommand("mcePrint",function(){a.getWin().print()});a.addButton("print",{title:"print.print_desc",cmd:"mcePrint"})},getInfo:function(){return{longname:"Print",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("print",tinymce.plugins.Print)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/print/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/print/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..3933fe6
--- /dev/null
@@ -0,0 +1,34 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.Print', {\r
+               init : function(ed, url) {\r
+                       ed.addCommand('mcePrint', function() {\r
+                               ed.getWin().print();\r
+                       });\r
+\r
+                       ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'});\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Print',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('print', tinymce.plugins.Print);\r
+})();\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/safari/blank.htm b/docs/include/jscripts/tiny_mce/plugins/safari/blank.htm
new file mode 100644 (file)
index 0000000..266808c
--- /dev/null
@@ -0,0 +1 @@
+<!-- WebKit -->
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/safari/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/safari/editor_plugin.js
new file mode 100644 (file)
index 0000000..794477c
--- /dev/null
@@ -0,0 +1 @@
+(function(){var a=tinymce.dom.Event,c=tinymce.grep,d=tinymce.each,b=tinymce.inArray;function e(j,i,h){var g,k;g=j.createTreeWalker(i,NodeFilter.SHOW_ALL,null,false);while(k=g.nextNode()){if(h){if(!h(k)){return false}}if(k.nodeType==3&&k.nodeValue&&/[^\s\u00a0]+/.test(k.nodeValue)){return false}if(k.nodeType==1&&/^(HR|IMG|TABLE)$/.test(k.nodeName)){return false}}return true}tinymce.create("tinymce.plugins.Safari",{init:function(f){var g=this,h;if(!tinymce.isWebKit){return}g.editor=f;g.webKitFontSizes=["x-small","small","medium","large","x-large","xx-large","-webkit-xxx-large"];g.namedFontSizes=["xx-small","x-small","small","medium","large","x-large","xx-large"];f.addCommand("CreateLink",function(k,j){var m=f.selection.getNode(),l=f.dom,i;if(m&&(/^(left|right)$/i.test(l.getStyle(m,"float",1))||/^(left|right)$/i.test(l.getAttrib(m,"align")))){i=l.create("a",{href:j},m.cloneNode());m.parentNode.replaceChild(i,m);f.selection.select(i)}else{f.getDoc().execCommand("CreateLink",false,j)}});f.onKeyUp.add(function(j,o){var l,i,m,p,k;if(o.keyCode==46||o.keyCode==8){i=j.getBody();l=i.innerHTML;k=j.selection;if(i.childNodes.length==1&&!/<(img|hr)/.test(l)&&tinymce.trim(l.replace(/<[^>]+>/g,"")).length==0){j.setContent('<p><br mce_bogus="1" /></p>',{format:"raw"});p=i.firstChild;m=k.getRng();m.setStart(p,0);m.setEnd(p,0);k.setRng(m)}}});f.addCommand("FormatBlock",function(j,i){var l=f.dom,k=l.getParent(f.selection.getNode(),l.isBlock);if(k){l.replace(l.create(i),k,1)}else{f.getDoc().execCommand("FormatBlock",false,i)}});f.addCommand("mceInsertContent",function(j,i){f.getDoc().execCommand("InsertText",false,"mce_marker");f.getBody().innerHTML=f.getBody().innerHTML.replace(/mce_marker/g,f.dom.processHTML(i)+'<span id="_mce_tmp">XX</span>');f.selection.select(f.dom.get("_mce_tmp"));f.getDoc().execCommand("Delete",false," ")});f.onKeyPress.add(function(o,p){var q,v,r,l,j,k,i,u,m,t,s;if(p.keyCode==13){i=o.selection;q=i.getNode();if(p.shiftKey||o.settings.force_br_newlines&&q.nodeName!="LI"){g._insertBR(o);a.cancel(p)}if(v=h.getParent(q,"LI")){r=h.getParent(v,"OL,UL");u=o.getDoc();s=h.create("p");h.add(s,"br",{mce_bogus:"1"});if(e(u,v)){if(k=h.getParent(r.parentNode,"LI,OL,UL")){return}k=h.getParent(r,"p,h1,h2,h3,h4,h5,h6,div")||r;l=u.createRange();l.setStartBefore(k);l.setEndBefore(v);j=u.createRange();j.setStartAfter(v);j.setEndAfter(k);m=l.cloneContents();t=j.cloneContents();if(!e(u,t)){h.insertAfter(t,k)}h.insertAfter(s,k);if(!e(u,m)){h.insertAfter(m,k)}h.remove(k);k=s.firstChild;l=u.createRange();l.setStartBefore(k);l.setEndBefore(k);i.setRng(l);return a.cancel(p)}}}});f.onExecCommand.add(function(i,k){var j,m,n,l;if(k=="InsertUnorderedList"||k=="InsertOrderedList"){j=i.selection;m=i.dom;if(n=m.getParent(j.getNode(),function(o){return/^(H[1-6]|P|ADDRESS|PRE)$/.test(o.nodeName)})){l=j.getBookmark();m.remove(n,1);j.moveToBookmark(l)}}});f.onClick.add(function(i,j){j=j.target;if(j.nodeName=="IMG"){g.selElm=j;i.selection.select(j)}else{g.selElm=null}});f.onInit.add(function(){g._fixWebKitSpans()});f.onSetContent.add(function(){h=f.dom;d(["strong","b","em","u","strike","sub","sup","a"],function(i){d(c(h.select(i)).reverse(),function(l){var k=l.nodeName.toLowerCase(),j;if(k=="a"){if(l.name){h.replace(h.create("img",{mce_name:"a",name:l.name,"class":"mceItemAnchor"}),l)}return}switch(k){case"b":case"strong":if(k=="b"){k="strong"}j="font-weight: bold;";break;case"em":j="font-style: italic;";break;case"u":j="text-decoration: underline;";break;case"sub":j="vertical-align: sub;";break;case"sup":j="vertical-align: super;";break;case"strike":j="text-decoration: line-through;";break}h.replace(h.create("span",{mce_name:k,style:j,"class":"Apple-style-span"}),l,1)})})});f.onPreProcess.add(function(i,j){h=i.dom;d(c(j.node.getElementsByTagName("span")).reverse(),function(m){var k,l;if(j.get){if(h.hasClass(m,"Apple-style-span")){l=m.style.backgroundColor;switch(h.getAttrib(m,"mce_name")){case"font":if(!i.settings.convert_fonts_to_spans){h.setAttrib(m,"style","")}break;case"strong":case"em":case"sub":case"sup":h.setAttrib(m,"style","");break;case"strike":case"u":if(!i.settings.inline_styles){h.setAttrib(m,"style","")}else{h.setAttrib(m,"mce_name","")}break;default:if(!i.settings.inline_styles){h.setAttrib(m,"style","")}}if(l){m.style.backgroundColor=l}}}if(h.hasClass(m,"mceItemRemoved")){h.remove(m,1)}})});f.onPostProcess.add(function(i,j){j.content=j.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g,"</$1>");j.content=j.content.replace(/ id=\"undefined\"/g,"")})},getInfo:function(){return{longname:"Safari compatibility",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_fixWebKitSpans:function(){var g=this,f=g.editor;a.add(f.getDoc(),"DOMNodeInserted",function(h){h=h.target;if(h&&h.nodeType==1){g._fixAppleSpan(h)}})},_fixAppleSpan:function(l){var g=this.editor,m=g.dom,i=this.webKitFontSizes,f=this.namedFontSizes,j=g.settings,h,k;if(m.getAttrib(l,"mce_fixed")){return}if(l.nodeName=="SPAN"&&l.className=="Apple-style-span"){h=l.style;if(!j.convert_fonts_to_spans){if(h.fontSize){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"size",b(i,h.fontSize)+1)}if(h.fontFamily){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"face",h.fontFamily)}if(h.color){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"color",m.toHex(h.color))}if(h.backgroundColor){m.setAttrib(l,"mce_name","font");m.setStyle(l,"background-color",h.backgroundColor)}}else{if(h.fontSize){m.setStyle(l,"fontSize",f[b(i,h.fontSize)])}}if(h.fontWeight=="bold"){m.setAttrib(l,"mce_name","strong")}if(h.fontStyle=="italic"){m.setAttrib(l,"mce_name","em")}if(h.textDecoration=="underline"){m.setAttrib(l,"mce_name","u")}if(h.textDecoration=="line-through"){m.setAttrib(l,"mce_name","strike")}if(h.verticalAlign=="super"){m.setAttrib(l,"mce_name","sup")}if(h.verticalAlign=="sub"){m.setAttrib(l,"mce_name","sub")}m.setAttrib(l,"mce_fixed","1")}},_insertBR:function(f){var j=f.dom,h=f.selection,i=h.getRng(),g;i.insertNode(g=j.create("br"));i.setStartAfter(g);i.setEndAfter(g);h.setRng(i);if(h.getSel().focusNode==g.previousSibling){h.select(j.insertAfter(j.doc.createTextNode("\u00a0"),g));h.collapse(1)}f.getWin().scrollTo(0,j.getPos(h.getRng().startContainer).y)}});tinymce.PluginManager.add("safari",tinymce.plugins.Safari)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/safari/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/safari/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..6667b7c
--- /dev/null
@@ -0,0 +1,438 @@
+/**\r
+ * $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $\r
+ *\r
+ * @author Moxiecode\r
+ * @copyright Copyright Â© 2004-2008, Moxiecode Systems AB, All rights reserved.\r
+ */\r
+\r
+(function() {\r
+       var Event = tinymce.dom.Event, grep = tinymce.grep, each = tinymce.each, inArray = tinymce.inArray;\r
+\r
+       function isEmpty(d, e, f) {\r
+               var w, n;\r
+\r
+               w = d.createTreeWalker(e, NodeFilter.SHOW_ALL, null, false);\r
+               while (n = w.nextNode()) {\r
+                       // Filter func\r
+                       if (f) {\r
+                               if (!f(n))\r
+                                       return false;\r
+                       }\r
+\r
+                       // Non whitespace text node\r
+                       if (n.nodeType == 3 && n.nodeValue && /[^\s\u00a0]+/.test(n.nodeValue))\r
+                               return false;\r
+\r
+                       // Is non text element byt still content\r
+                       if (n.nodeType == 1 && /^(HR|IMG|TABLE)$/.test(n.nodeName))\r
+                               return false;\r
+               }\r
+\r
+               return true;\r
+       };\r
+\r
+       tinymce.create('tinymce.plugins.Safari', {\r
+               init : function(ed) {\r
+                       var t = this, dom;\r
+\r
+                       // Ignore on non webkit\r
+                       if (!tinymce.isWebKit)\r
+                               return;\r
+\r
+                       t.editor = ed;\r
+                       t.webKitFontSizes = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large'];\r
+                       t.namedFontSizes = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large'];\r
+\r
+                       // Safari CreateLink command will not work correctly on images that is aligned\r
+                       ed.addCommand('CreateLink', function(u, v) {\r
+                               var n = ed.selection.getNode(), dom = ed.dom, a;\r
+\r
+                               if (n && (/^(left|right)$/i.test(dom.getStyle(n, 'float', 1)) || /^(left|right)$/i.test(dom.getAttrib(n, 'align')))) {\r
+                                       a = dom.create('a', {href : v}, n.cloneNode());\r
+                                       n.parentNode.replaceChild(a, n);\r
+                                       ed.selection.select(a);\r
+                               } else\r
+                                       ed.getDoc().execCommand("CreateLink", false, v);\r
+                       });\r
+\r
+/*\r
+                       // WebKit generates spans out of thin air this patch used to remove them but it will also remove styles we want so it's disabled for now\r
+                       ed.onPaste.add(function(ed, e) {\r
+                               function removeStyles(e) {\r
+                                       e = e.target;\r
+\r
+                                       if (e.nodeType == 1) {\r
+                                               e.style.cssText = '';\r
+\r
+                                               each(ed.dom.select('*', e), function(e) {\r
+                                                       e.style.cssText = '';\r
+                                               });\r
+                                       }\r
+                               };\r
+\r
+                               Event.add(ed.getDoc(), 'DOMNodeInserted', removeStyles);\r
+\r
+                               window.setTimeout(function() {\r
+                                       Event.remove(ed.getDoc(), 'DOMNodeInserted', removeStyles);\r
+                               }, 0);\r
+                       });\r
+*/\r
+                       ed.onKeyUp.add(function(ed, e) {\r
+                               var h, b, r, n, s;\r
+\r
+                               // If backspace or delete key\r
+                               if (e.keyCode == 46 || e.keyCode == 8) {\r
+                                       b = ed.getBody();\r
+                                       h = b.innerHTML;\r
+                                       s = ed.selection;\r
+\r
+                                       // If there is no text content or images or hr elements then remove everything\r
+                                       if (b.childNodes.length == 1 && !/<(img|hr)/.test(h) && tinymce.trim(h.replace(/<[^>]+>/g, '')).length == 0) {\r
+                                               // Inject paragrah and bogus br\r
+                                               ed.setContent('<p><br mce_bogus="1" /></p>', {format : 'raw'});\r
+\r
+                                               // Move caret before bogus br\r
+                                               n = b.firstChild;\r
+                                               r = s.getRng();\r
+                                               r.setStart(n, 0);\r
+                                               r.setEnd(n, 0);\r
+                                               s.setRng(r);\r
+                                       }\r
+                               }\r
+                       });\r
+\r
+                       // Workaround for FormatBlock bug, http://bugs.webkit.org/show_bug.cgi?id=16004\r
+                       ed.addCommand('FormatBlock', function(u, v) {\r
+                               var dom = ed.dom, e = dom.getParent(ed.selection.getNode(), dom.isBlock);\r
+\r
+                               if (e)\r
+                                       dom.replace(dom.create(v), e, 1);\r
+                               else\r
+                                       ed.getDoc().execCommand("FormatBlock", false, v);\r
+                       });\r
+\r
+                       // Workaround for InsertHTML bug, http://bugs.webkit.org/show_bug.cgi?id=16382\r
+                       ed.addCommand('mceInsertContent', function(u, v) {\r
+                               ed.getDoc().execCommand("InsertText", false, 'mce_marker');\r
+                               ed.getBody().innerHTML = ed.getBody().innerHTML.replace(/mce_marker/g, ed.dom.processHTML(v) + '<span id="_mce_tmp">XX</span>');\r
+                               ed.selection.select(ed.dom.get('_mce_tmp'));\r
+                               ed.getDoc().execCommand("Delete", false, ' ');\r
+                       });\r
+       \r
+       /*              ed.onKeyDown.add(function(ed, e) {\r
+                               // Ctrl+A select all will fail on WebKit since if you paste the contents you selected it will produce a odd div wrapper\r
+                               if ((e.ctrlKey || e.metaKey) && e.keyCode == 65) {\r
+                                       ed.selection.select(ed.getBody(), 1);\r
+                                       return Event.cancel(e);\r
+                               }\r
+                       });*/\r
+\r
+                       ed.onKeyPress.add(function(ed, e) {\r
+                               var se, li, lic, r1, r2, n, sel, doc, be, af, pa;\r
+\r
+                               if (e.keyCode == 13) {\r
+                                       sel = ed.selection;\r
+                                       se = sel.getNode();\r
+\r
+                                       // Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973\r
+                                       if (e.shiftKey || ed.settings.force_br_newlines && se.nodeName != 'LI') {\r
+                                               t._insertBR(ed);\r
+                                               Event.cancel(e);\r
+                                       }\r
+\r
+                                       // Workaround for DIV elements produced by Safari\r
+                                       if (li = dom.getParent(se, 'LI')) {\r
+                                               lic = dom.getParent(li, 'OL,UL');\r
+                                               doc = ed.getDoc();\r
+\r
+                                               pa = dom.create('p');\r
+                                               dom.add(pa, 'br', {mce_bogus : "1"});\r
+\r
+                                               if (isEmpty(doc, li)) {\r
+                                                       // If list in list then use browser default behavior\r
+                                                       if (n = dom.getParent(lic.parentNode, 'LI,OL,UL'))\r
+                                                               return;\r
+\r
+                                                       n = dom.getParent(lic, 'p,h1,h2,h3,h4,h5,h6,div') || lic;\r
+\r
+                                                       // Create range from the start of block element to the list item\r
+                                                       r1 = doc.createRange();\r
+                                                       r1.setStartBefore(n);\r
+                                                       r1.setEndBefore(li);\r
+\r
+                                                       // Create range after the list to the end of block element\r
+                                                       r2 = doc.createRange();\r
+                                                       r2.setStartAfter(li);\r
+                                                       r2.setEndAfter(n);\r
+\r
+                                                       be = r1.cloneContents();\r
+                                                       af = r2.cloneContents();\r
+\r
+                                                       if (!isEmpty(doc, af))\r
+                                                               dom.insertAfter(af, n);\r
+\r
+                                                       dom.insertAfter(pa, n);\r
+\r
+                                                       if (!isEmpty(doc, be))\r
+                                                               dom.insertAfter(be, n);\r
+\r
+                                                       dom.remove(n);\r
+\r
+                                                       n = pa.firstChild;\r
+                                                       r1 = doc.createRange();\r
+                                                       r1.setStartBefore(n);\r
+                                                       r1.setEndBefore(n);\r
+                                                       sel.setRng(r1);\r
+\r
+                                                       return Event.cancel(e);\r
+                                               }\r
+                                       }\r
+                               }\r
+                       });\r
+\r
+                       // Safari doesn't place lists outside block elements\r
+                       ed.onExecCommand.add(function(ed, cmd) {\r
+                               var sel, dom, bl, bm;\r
+\r
+                               if (cmd == 'InsertUnorderedList' || cmd == 'InsertOrderedList') {\r
+                                       sel = ed.selection;\r
+                                       dom = ed.dom;\r
+\r
+                                       if (bl = dom.getParent(sel.getNode(), function(n) {return /^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName);})) {\r
+                                               bm = sel.getBookmark();\r
+                                               dom.remove(bl, 1);\r
+                                               sel.moveToBookmark(bm);\r
+                                       }\r
+                               }\r
+                       });\r
+\r
+                       // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250\r
+                       ed.onClick.add(function(ed, e) {\r
+                               e = e.target;\r
+\r
+                               if (e.nodeName == 'IMG') {\r
+                                       t.selElm = e;\r
+                                       ed.selection.select(e);\r
+                               } else\r
+                                       t.selElm = null;\r
+                       });\r
+\r
+                       ed.onInit.add(function() {\r
+                               t._fixWebKitSpans();\r
+                       });\r
+\r
+                       ed.onSetContent.add(function() {\r
+                               dom = ed.dom;\r
+\r
+                               // Convert strong,b,em,u,strike to spans\r
+                               each(['strong','b','em','u','strike','sub','sup','a'], function(v) {\r
+                                       each(grep(dom.select(v)).reverse(), function(n) {\r
+                                               var nn = n.nodeName.toLowerCase(), st;\r
+\r
+                                               // Convert anchors into images\r
+                                               if (nn == 'a') {\r
+                                                       if (n.name)\r
+                                                               dom.replace(dom.create('img', {mce_name : 'a', name : n.name, 'class' : 'mceItemAnchor'}), n);\r
+\r
+                                                       return;\r
+                                               }\r
+\r
+                                               switch (nn) {\r
+                                                       case 'b':\r
+                                                       case 'strong':\r
+                                                               if (nn == 'b')\r
+                                                                       nn = 'strong';\r
+\r
+                                                               st = 'font-weight: bold;';\r
+                                                               break;\r
+\r
+                                                       case 'em':\r
+                                                               st = 'font-style: italic;';\r
+                                                               break;\r
+\r
+                                                       case 'u':\r
+                                                               st = 'text-decoration: underline;';\r
+                                                               break;\r
+\r
+                                                       case 'sub':\r
+                                                               st = 'vertical-align: sub;';\r
+                                                               break;\r
+\r
+                                                       case 'sup':\r
+                                                               st = 'vertical-align: super;';\r
+                                                               break;\r
+\r
+                                                       case 'strike':\r
+                                                               st = 'text-decoration: line-through;';\r
+                                                               break;\r
+                                               }\r
+\r
+                                               dom.replace(dom.create('span', {mce_name : nn, style : st, 'class' : 'Apple-style-span'}), n, 1);\r
+                                       });\r
+                               });\r
+                       });\r
+\r
+                       ed.onPreProcess.add(function(ed, o) {\r
+                               dom = ed.dom;\r
+\r
+                               each(grep(o.node.getElementsByTagName('span')).reverse(), function(n) {\r
+                                       var v, bg;\r
+\r
+                                       if (o.get) {\r
+                                               if (dom.hasClass(n, 'Apple-style-span')) {\r
+                                                       bg = n.style.backgroundColor;\r
+\r
+                                                       switch (dom.getAttrib(n, 'mce_name')) {\r
+                                                               case 'font':\r
+                                                                       if (!ed.settings.convert_fonts_to_spans)\r
+                                                                               dom.setAttrib(n, 'style', '');\r
+                                                                       break;\r
+\r
+                                                               case 'strong':\r
+                                                               case 'em':\r
+                                                               case 'sub':\r
+                                                               case 'sup':\r
+                                                                       dom.setAttrib(n, 'style', '');\r
+                                                                       break;\r
+\r
+                                                               case 'strike':\r
+                                                               case 'u':\r
+                                                                       if (!ed.settings.inline_styles)\r
+                                                                               dom.setAttrib(n, 'style', '');\r
+                                                                       else\r
+                                                                               dom.setAttrib(n, 'mce_name', '');\r
+\r
+                                                                       break;\r
+\r
+                                                               default:\r
+                                                                       if (!ed.settings.inline_styles)\r
+                                                                               dom.setAttrib(n, 'style', '');\r
+                                                       }\r
+\r
+\r
+                                                       if (bg)\r
+                                                               n.style.backgroundColor = bg;\r
+                                               }\r
+                                       }\r
+\r
+                                       if (dom.hasClass(n, 'mceItemRemoved'))\r
+                                               dom.remove(n, 1);\r
+                               });\r
+                       });\r
+\r
+                       ed.onPostProcess.add(function(ed, o) {\r
+                               // Safari adds BR at end of all block elements\r
+                               o.content = o.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g, '</$1>');\r
+\r
+                               // Safari adds id="undefined" to HR elements\r
+                               o.content = o.content.replace(/ id=\"undefined\"/g, '');\r
+                       });\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Safari compatibility',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               },\r
+\r
+               // Internal methods\r
+\r
+               _fixWebKitSpans : function() {\r
+                       var t = this, ed = t.editor;\r
+\r
+                       // Use mutator events on new WebKit\r
+                       Event.add(ed.getDoc(), 'DOMNodeInserted', function(e) {\r
+                               e = e.target;\r
+\r
+                               if (e && e.nodeType == 1)\r
+                                       t._fixAppleSpan(e);\r
+                       });\r
+               },\r
+\r
+               _fixAppleSpan : function(e) {\r
+                       var ed = this.editor, dom = ed.dom, fz = this.webKitFontSizes, fzn = this.namedFontSizes, s = ed.settings, st, p;\r
+\r
+                       if (dom.getAttrib(e, 'mce_fixed'))\r
+                               return;\r
+\r
+                       // Handle Apple style spans\r
+                       if (e.nodeName == 'SPAN' && e.className == 'Apple-style-span') {\r
+                               st = e.style;\r
+\r
+                               if (!s.convert_fonts_to_spans) {\r
+                                       if (st.fontSize) {\r
+                                               dom.setAttrib(e, 'mce_name', 'font');\r
+                                               dom.setAttrib(e, 'size', inArray(fz, st.fontSize) + 1);\r
+                                       }\r
+\r
+                                       if (st.fontFamily) {\r
+                                               dom.setAttrib(e, 'mce_name', 'font');\r
+                                               dom.setAttrib(e, 'face', st.fontFamily);\r
+                                       }\r
+\r
+                                       if (st.color) {\r
+                                               dom.setAttrib(e, 'mce_name', 'font');\r
+                                               dom.setAttrib(e, 'color', dom.toHex(st.color));\r
+                                       }\r
+\r
+                                       if (st.backgroundColor) {\r
+                                               dom.setAttrib(e, 'mce_name', 'font');\r
+                                               dom.setStyle(e, 'background-color', st.backgroundColor);\r
+                                       }\r
+                               } else {\r
+                                       if (st.fontSize)\r
+                                               dom.setStyle(e, 'fontSize', fzn[inArray(fz, st.fontSize)]);\r
+                               }\r
+\r
+                               if (st.fontWeight == 'bold')\r
+                                       dom.setAttrib(e, 'mce_name', 'strong');\r
+\r
+                               if (st.fontStyle == 'italic')\r
+                                       dom.setAttrib(e, 'mce_name', 'em');\r
+\r
+                               if (st.textDecoration == 'underline')\r
+                                       dom.setAttrib(e, 'mce_name', 'u');\r
+\r
+                               if (st.textDecoration == 'line-through')\r
+                                       dom.setAttrib(e, 'mce_name', 'strike');\r
+\r
+                               if (st.verticalAlign == 'super')\r
+                                       dom.setAttrib(e, 'mce_name', 'sup');\r
+\r
+                               if (st.verticalAlign == 'sub')\r
+                                       dom.setAttrib(e, 'mce_name', 'sub');\r
+\r
+                               dom.setAttrib(e, 'mce_fixed', '1');\r
+                       }\r
+               },\r
+\r
+               _insertBR : function(ed) {\r
+                       var dom = ed.dom, s = ed.selection, r = s.getRng(), br;\r
+\r
+                       // Insert BR element\r
+                       r.insertNode(br = dom.create('br'));\r
+\r
+                       // Place caret after BR\r
+                       r.setStartAfter(br);\r
+                       r.setEndAfter(br);\r
+                       s.setRng(r);\r
+\r
+                       // Could not place caret after BR then insert an nbsp entity and move the caret\r
+                       if (s.getSel().focusNode == br.previousSibling) {\r
+                               s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'), br));\r
+                               s.collapse(1);\r
+                       }\r
+\r
+                       // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117\r
+                       ed.getWin().scrollTo(0, dom.getPos(s.getRng().startContainer).y);\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('safari', tinymce.plugins.Safari);\r
+})();\r
+\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/save/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/save/editor_plugin.js
new file mode 100644 (file)
index 0000000..8e93996
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.Save",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceSave",c._save,c);a.addCommand("mceCancel",c._cancel,c);a.addButton("save",{title:"save.save_desc",cmd:"mceSave"});a.addButton("cancel",{title:"save.cancel_desc",cmd:"mceCancel"});a.onNodeChange.add(c._nodeChange,c);a.addShortcut("ctrl+s",a.getLang("save.save_desc"),"mceSave")},getInfo:function(){return{longname:"Save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,c){var b=this.editor;if(b.getParam("save_enablewhendirty")){a.setDisabled("save",!b.isDirty());a.setDisabled("cancel",!b.isDirty())}},_save:function(){var c=this.editor,a,e,d,b;a=tinymce.DOM.get(c.id).form||tinymce.DOM.getParent(c.id,"form");if(c.getParam("save_enablewhendirty")&&!c.isDirty()){return}tinyMCE.triggerSave();if(e=c.getParam("save_onsavecallback")){if(c.execCallback("save_onsavecallback",c)){c.startContent=tinymce.trim(c.getContent({format:"raw"}));c.nodeChanged()}return}if(a){c.isNotDirty=true;if(a.onsubmit==null||a.onsubmit()!=false){a.submit()}c.nodeChanged()}else{c.windowManager.alert("Error: No form element found.")}},_cancel:function(){var a=this.editor,c,b=tinymce.trim(a.startContent);if(c=a.getParam("save_oncancelcallback")){a.execCallback("save_oncancelcallback",a);return}a.setContent(b);a.undoManager.clear();a.nodeChanged()}});tinymce.PluginManager.add("save",tinymce.plugins.Save)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/save/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/save/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..f5a3de8
--- /dev/null
@@ -0,0 +1,101 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.Save', {\r
+               init : function(ed, url) {\r
+                       var t = this;\r
+\r
+                       t.editor = ed;\r
+\r
+                       // Register commands\r
+                       ed.addCommand('mceSave', t._save, t);\r
+                       ed.addCommand('mceCancel', t._cancel, t);\r
+\r
+                       // Register buttons\r
+                       ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'});\r
+                       ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'});\r
+\r
+                       ed.onNodeChange.add(t._nodeChange, t);\r
+                       ed.addShortcut('ctrl+s', ed.getLang('save.save_desc'), 'mceSave');\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Save',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               },\r
+\r
+               // Private methods\r
+\r
+               _nodeChange : function(ed, cm, n) {\r
+                       var ed = this.editor;\r
+\r
+                       if (ed.getParam('save_enablewhendirty')) {\r
+                               cm.setDisabled('save', !ed.isDirty());\r
+                               cm.setDisabled('cancel', !ed.isDirty());\r
+                       }\r
+               },\r
+\r
+               // Private methods\r
+\r
+               _save : function() {\r
+                       var ed = this.editor, formObj, os, i, elementId;\r
+\r
+                       formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form');\r
+\r
+                       if (ed.getParam("save_enablewhendirty") && !ed.isDirty())\r
+                               return;\r
+\r
+                       tinyMCE.triggerSave();\r
+\r
+                       // Use callback instead\r
+                       if (os = ed.getParam("save_onsavecallback")) {\r
+                               if (ed.execCallback('save_onsavecallback', ed)) {\r
+                                       ed.startContent = tinymce.trim(ed.getContent({format : 'raw'}));\r
+                                       ed.nodeChanged();\r
+                               }\r
+\r
+                               return;\r
+                       }\r
+\r
+                       if (formObj) {\r
+                               ed.isNotDirty = true;\r
+\r
+                               if (formObj.onsubmit == null || formObj.onsubmit() != false)\r
+                                       formObj.submit();\r
+\r
+                               ed.nodeChanged();\r
+                       } else\r
+                               ed.windowManager.alert("Error: No form element found.");\r
+               },\r
+\r
+               _cancel : function() {\r
+                       var ed = this.editor, os, h = tinymce.trim(ed.startContent);\r
+\r
+                       // Use callback instead\r
+                       if (os = ed.getParam("save_oncancelcallback")) {\r
+                               ed.execCallback('save_oncancelcallback', ed);\r
+                               return;\r
+                       }\r
+\r
+                       ed.setContent(h);\r
+                       ed.undoManager.clear();\r
+                       ed.nodeChanged();\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('save', tinymce.plugins.Save);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css b/docs/include/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css
new file mode 100644 (file)
index 0000000..ecdf58c
--- /dev/null
@@ -0,0 +1,6 @@
+.panel_wrapper {height:85px;}\r
+.panel_wrapper div.current {height:85px;}\r
+\r
+/* IE */\r
+* html .panel_wrapper {height:100px;}\r
+* html .panel_wrapper div.current {height:100px;}\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js
new file mode 100644 (file)
index 0000000..cd9c985
--- /dev/null
@@ -0,0 +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
diff --git a/docs/include/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..1433a06
--- /dev/null
@@ -0,0 +1,57 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.SearchReplacePlugin', {\r
+               init : function(ed, url) {\r
+                       function open(m) {\r
+                               ed.windowManager.open({\r
+                                       file : url + '/searchreplace.htm',\r
+                                       width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)),\r
+                                       height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)),\r
+                                       inline : 1,\r
+                                       auto_focus : 0\r
+                               }, {\r
+                                       mode : m,\r
+                                       search_string : ed.selection.getContent({format : 'text'}),\r
+                                       plugin_url : url\r
+                               });\r
+                       };\r
+\r
+                       // Register commands\r
+                       ed.addCommand('mceSearch', function() {\r
+                               open('search');\r
+                       });\r
+\r
+                       ed.addCommand('mceReplace', function() {\r
+                               open('replace');\r
+                       });\r
+\r
+                       // Register buttons\r
+                       ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'});\r
+                       ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'});\r
+\r
+                       ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch');\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Search/Replace',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js b/docs/include/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js
new file mode 100644 (file)
index 0000000..c0a6243
--- /dev/null
@@ -0,0 +1,130 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+var SearchReplaceDialog = {\r
+       init : function(ed) {\r
+               var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");\r
+\r
+               this.switchMode(m);\r
+\r
+               f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");\r
+\r
+               // Focus input field\r
+               f[m + '_panel_searchstring'].focus();\r
+       },\r
+\r
+       switchMode : function(m) {\r
+               var f, lm = this.lastMode;\r
+\r
+               if (lm != m) {\r
+                       f = document.forms[0];\r
+\r
+                       if (lm) {\r
+                               f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value;\r
+                               f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked;\r
+                               f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked;\r
+                               f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked;\r
+                       }\r
+\r
+                       mcTabs.displayTab(m + '_tab',  m + '_panel');\r
+                       document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none";\r
+                       document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none";\r
+                       this.lastMode = m;\r
+               }\r
+       },\r
+\r
+       searchNext : function(a) {\r
+               var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;\r
+\r
+               // Get input\r
+               f = document.forms[0];\r
+               s = f[m + '_panel_searchstring'].value;\r
+               b = f[m + '_panel_backwardsu'].checked;\r
+               ca = f[m + '_panel_casesensitivebox'].checked;\r
+               rs = f['replace_panel_replacestring'].value;\r
+\r
+               if (s == '')\r
+                       return;\r
+\r
+               function fix() {\r
+                       // Correct Firefox graphics glitches\r
+                       r = se.getRng().cloneRange();\r
+                       ed.getDoc().execCommand('SelectAll', false, null);\r
+                       se.setRng(r);\r
+               };\r
+\r
+               function replace() {\r
+                       if (tinymce.isIE)\r
+                               ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE\r
+                       else\r
+                               ed.getDoc().execCommand('InsertHTML', false, rs);\r
+               };\r
+\r
+               // IE flags\r
+               if (ca)\r
+                       fl = fl | 4;\r
+\r
+               switch (a) {\r
+                       case 'all':\r
+                               // Move caret to beginning of text\r
+                               ed.execCommand('SelectAll');\r
+                               ed.selection.collapse(true);\r
+\r
+                               if (tinymce.isIE) {\r
+                                       while (r.findText(s, b ? -1 : 1, fl)) {\r
+                                               r.scrollIntoView();\r
+                                               r.select();\r
+                                               replace();\r
+                                               fo = 1;\r
+\r
+                                               if (b) {\r
+                                                       r.moveEnd("character", -(rs.length)); // Otherwise will loop forever\r
+                                               }\r
+                                       }\r
+\r
+                                       tinyMCEPopup.storeSelection();\r
+                               } else {\r
+                                       while (w.find(s, ca, b, false, false, false, false)) {\r
+                                               replace();\r
+                                               fo = 1;\r
+                                       }\r
+                               }\r
+\r
+                               if (fo)\r
+                                       tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced'));\r
+                               else\r
+                                       tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));\r
+\r
+                               return;\r
+\r
+                       case 'current':\r
+                               if (!ed.selection.isCollapsed())\r
+                                       replace();\r
+\r
+                               break;\r
+               }\r
+\r
+               se.collapse(b);\r
+               r = se.getRng();\r
+\r
+               // Whats the point\r
+               if (!s)\r
+                       return;\r
+\r
+               if (tinymce.isIE) {\r
+                       if (r.findText(s, b ? -1 : 1, fl)) {\r
+                               r.scrollIntoView();\r
+                               r.select();\r
+                       } else\r
+                               tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));\r
+\r
+                       tinyMCEPopup.storeSelection();\r
+               } else {\r
+                       if (!w.find(s, ca, b, false, false, false, false))\r
+                               tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));\r
+                       else\r
+                               fix();\r
+               }\r
+       }\r
+};\r
+\r
+tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js b/docs/include/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js
new file mode 100644 (file)
index 0000000..370959a
--- /dev/null
@@ -0,0 +1,16 @@
+tinyMCE.addI18n('en.searchreplace_dlg',{\r
+searchnext_desc:"Find again",\r
+notfound:"The search has been completed. The search string could not be found.",\r
+search_title:"Find",\r
+replace_title:"Find/Replace",\r
+allreplaced:"All occurrences of the search string were replaced.",\r
+findwhat:"Find what",\r
+replacewith:"Replace with",\r
+direction:"Direction",\r
+up:"Up",\r
+down:"Down",\r
+mcase:"Match case",\r
+findnext:"Find next",\r
+replace:"Replace",\r
+replaceall:"Replace all"\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm b/docs/include/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm
new file mode 100644 (file)
index 0000000..d0424cf
--- /dev/null
@@ -0,0 +1,99 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#searchreplace_dlg.replace_title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <script type="text/javascript" src="js/searchreplace.js"></script>\r
+       <link rel="stylesheet" type="text/css" href="css/searchreplace.css" />\r
+</head>\r
+<body style="display:none;">\r
+<form onsubmit="SearchReplaceDialog.searchNext('none');return false;" action="#">\r
+       <div class="tabs">\r
+               <ul>\r
+                       <li id="search_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('search');" onmousedown="return false;">{#searchreplace.search_desc}</a></span></li>\r
+                       <li id="replace_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('replace');" onmousedown="return false;">{#searchreplace_dlg.replace}</a></span></li>\r
+               </ul>\r
+       </div>\r
+\r
+       <div class="panel_wrapper">\r
+               <div id="search_panel" class="panel">\r
+                       <table border="0" cellspacing="0" cellpadding="2">\r
+                               <tr>\r
+                                       <td><label for="search_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>\r
+                                       <td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" /></td>\r
+                               </tr>\r
+                               <tr>\r
+                                       <td colspan="2">\r
+                                               <table border="0" cellspacing="0" cellpadding="0" class="direction">\r
+                                                       <tr>\r
+                                                               <td><label>{#searchreplace_dlg.direction}</label></td>\r
+                                                               <td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td>\r
+                                                               <td><label for="search_panel_backwardsu">{#searchreplace_dlg.up}</label></td>\r
+                                                               <td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" checked="checked" /></td>\r
+                                                               <td><label for="search_panel_backwardsd">{#searchreplace_dlg.down}</label></td>\r
+                                                       </tr>\r
+                                               </table>\r
+                                       </td>\r
+                               </tr>\r
+                               <tr>\r
+                                       <td colspan="2">\r
+                                               <table border="0" cellspacing="0" cellpadding="0">\r
+                                                       <tr>\r
+                                                               <td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>\r
+                                                               <td><label for="search_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>\r
+                                                       </tr>\r
+                                               </table>\r
+                                       </td>\r
+                               </tr>\r
+                       </table>\r
+               </div>\r
+\r
+               <div id="replace_panel" class="panel">\r
+                       <table border="0" cellspacing="0" cellpadding="2">\r
+                               <tr>\r
+                                       <td><label for="replace_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>\r
+                                       <td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" /></td>\r
+                               </tr>\r
+                               <tr>\r
+                                       <td><label for="replace_panel_replacestring">{#searchreplace_dlg.replacewith}</label></td>\r
+                                       <td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" /></td>\r
+                               </tr>\r
+                               <tr>\r
+                                       <td colspan="2">\r
+                                               <table border="0" cellspacing="0" cellpadding="0" class="direction">\r
+                                                       <tr>\r
+                                                               <td><label>{#searchreplace_dlg.direction}</label></td>\r
+                                                               <td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td>\r
+                                                               <td><label for="replace_panel_backwardsu">{#searchreplace_dlg.up}</label></td>\r
+                                                               <td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" checked="checked" /></td>\r
+                                                               <td><label for="replace_panel_backwardsd">{#searchreplace_dlg.down}</label></td>\r
+                                                       </tr>\r
+                                               </table>\r
+                                       </td>\r
+                               </tr>\r
+                               <tr>\r
+                                       <td colspan="2">\r
+                                               <table border="0" cellspacing="0" cellpadding="0">\r
+                                                       <tr>\r
+                                                               <td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>\r
+                                                               <td><label for="replace_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>\r
+                                                       </tr>\r
+                                               </table>\r
+                                       </td>\r
+                               </tr>\r
+                       </table>\r
+               </div>\r
+\r
+       </div>\r
+\r
+       <div class="mceActionPanel">\r
+               <input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" />\r
+               <input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" />\r
+               <input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" />\r
+               <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+       </div>\r
+</form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/spellchecker/css/content.css b/docs/include/jscripts/tiny_mce/plugins/spellchecker/css/content.css
new file mode 100644 (file)
index 0000000..24efa02
--- /dev/null
@@ -0,0 +1 @@
+.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;}\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/spellchecker/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/spellchecker/editor_plugin.js
new file mode 100644 (file)
index 0000000..377e4e8
--- /dev/null
@@ -0,0 +1 @@
+(function(){var a=tinymce.util.JSONRequest,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.SpellcheckerPlugin",{getInfo:function(){return{longname:"Spellchecker",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker",version:tinymce.majorVersion+"."+tinymce.minorVersion}},init:function(e,f){var g=this,d;g.url=f;g.editor=e;e.addCommand("mceSpellCheck",function(){if(!g.active){e.setProgressState(1);g._sendRPC("checkWords",[g.selectedLang,g._getWords()],function(h){if(h.length>0){g.active=1;g._markWords(h);e.setProgressState(0);e.nodeChanged()}else{e.setProgressState(0);e.windowManager.alert("spellchecker.no_mpell")}})}else{g._done()}});e.onInit.add(function(){if(e.settings.content_css!==false){e.dom.loadCSS(f+"/css/content.css")}});e.onClick.add(g._showMenu,g);e.onContextMenu.add(g._showMenu,g);e.onBeforeGetContent.add(function(){if(g.active){g._removeWords()}});e.onNodeChange.add(function(i,h){h.setActive("spellchecker",g.active)});e.onSetContent.add(function(){g._done()});e.onBeforeGetContent.add(function(){g._done()});e.onBeforeExecCommand.add(function(h,i){if(i=="mceFullScreen"){g._done()}});g.languages={};c(e.getParam("spellchecker_languages","+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv","hash"),function(i,h){if(h.indexOf("+")===0){h=h.substring(1);g.selectedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h=="spellchecker"){g=d.createSplitButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f});g.onRenderMenu.add(function(j,i){i.add({title:"spellchecker.langs","class":"mceMenuItemTitle"}).setDisabled(1);c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){l.setSelected(1);f.selectedItem.setSelected(0);f.selectedItem=l;f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);if(n==f.selectedLang){f.selectedItem=l}})});return g}},_walk:function(i,g){var h=this.editor.getDoc(),e;if(h.createTreeWalker){e=h.createTreeWalker(i,NodeFilter.SHOW_TEXT,null,false);while((i=e.nextNode())!=null){g.call(this,i)}}else{tinymce.walk(i,g,"childNodes")}},_getSeparators:function(){var e="",d,f=this.editor.getParam("spellchecker_word_separator_chars",'\\s!"#$%&()*+,-./:;<=>?@[]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');for(d=0;d<f.length;d++){e+="\\"+f.charAt(d)}return e},_getWords:function(){var e=this.editor,g=[],d="",f={};this._walk(e.getBody(),function(h){if(h.nodeType==3){d+=h.nodeValue+" "}});d=d.replace(new RegExp("([0-9]|["+this._getSeparators()+"])","g")," ");d=tinymce.trim(d.replace(/(\s+)/g," "));c(d.split(" "),function(h){if(!f[h]){g.push(h);f[h]=1}});return g},_removeWords:function(e){var f=this.editor,h=f.dom,g=f.selection,d=g.getBookmark();c(h.select("span").reverse(),function(i){if(i&&(h.hasClass(i,"mceItemHiddenSpellWord")||h.hasClass(i,"mceItemHidden"))){if(!e||h.decode(i.innerHTML)==e){h.remove(i,1)}}});g.moveToBookmark(d)},_markWords:function(o){var i,h,g,f,e,n="",k=this.editor,p=this._getSeparators(),j=k.dom,d=[];var l=k.selection,m=l.getBookmark();c(o,function(q){n+=(n?"|":"")+q});i=new RegExp("(["+p+"])("+n+")(["+p+"])","g");h=new RegExp("^("+n+")","g");g=new RegExp("("+n+")(["+p+"]?)$","g");f=new RegExp("^("+n+")(["+p+"]?)$","g");e=new RegExp("("+n+")(["+p+"])","g");this._walk(this.editor.getBody(),function(q){if(q.nodeType==3){d.push(q)}});c(d,function(r){var q;if(r.nodeType==3){q=r.nodeValue;if(i.test(q)||h.test(q)||g.test(q)||f.test(q)){q=j.encode(q);q=q.replace(e,'<span class="mceItemHiddenSpellWord">$1</span>$2');q=q.replace(g,'<span class="mceItemHiddenSpellWord">$1</span>$2');j.replace(j.create("span",{"class":"mceItemHidden"},q),r)}}});l.moveToBookmark(m)},_showMenu:function(g,i){var h=this,g=h.editor,d=h._menu,k,j=g.dom,f=j.getViewPort(g.getWin());if(!d){k=b.getPos(g.getContentAreaContainer());d=g.controlManager.createDropMenu("spellcheckermenu",{offset_x:k.x,offset_y:k.y,"class":"mceNoIcons"});h._menu=d}if(j.hasClass(i.target,"mceItemHiddenSpellWord")){d.removeAll();d.add({title:"spellchecker.wait","class":"mceMenuItemTitle"}).setDisabled(1);h._sendRPC("getSuggestions",[h.selectedLang,j.decode(i.target.innerHTML)],function(e){d.removeAll();if(e.length>0){d.add({title:"spellchecker.sug","class":"mceMenuItemTitle"}).setDisabled(1);c(e,function(l){d.add({title:l,onclick:function(){j.replace(g.getDoc().createTextNode(l),i.target);h._checkDone()}})});d.addSeparator()}else{d.add({title:"spellchecker.no_sug","class":"mceMenuItemTitle"}).setDisabled(1)}d.add({title:"spellchecker.ignore_word",onclick:function(){j.remove(i.target,1);h._checkDone()}});d.add({title:"spellchecker.ignore_words",onclick:function(){h._removeWords(j.decode(i.target.innerHTML));h._checkDone()}});d.update()});g.selection.select(i.target);k=j.getPos(i.target);d.showMenu(k.x,k.y+i.target.offsetHeight-f.y);return tinymce.dom.Event.cancel(i)}else{d.hideMenu()}},_checkDone:function(){var e=this,d=e.editor,g=d.dom,f;c(g.select("span"),function(h){if(h&&g.hasClass(h,"mceItemHiddenSpellWord")){f=true;return false}});if(!f){e._done()}},_done:function(){var d=this,e=d.active;if(d.active){d.active=0;d._removeWords();if(d._menu){d._menu.hideMenu()}if(e){d.editor.nodeChanged()}}},_sendRPC:function(e,h,d){var g=this,f=g.editor.getParam("spellchecker_rpc_url","{backend}");if(f=="{backend}"){g.editor.setProgressState(0);alert("Please specify: spellchecker_rpc_url");return}a.sendRPC({url:f,method:e,params:h,success:d,error:function(j,i){g.editor.setProgressState(0);g.editor.windowManager.alert(j.errstr||("Error response: "+i.responseText))}})}});tinymce.PluginManager.add("spellchecker",tinymce.plugins.SpellcheckerPlugin)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..0b3d3b6
--- /dev/null
@@ -0,0 +1,341 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM;\r
+\r
+       tinymce.create('tinymce.plugins.SpellcheckerPlugin', {\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Spellchecker',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               },\r
+\r
+               init : function(ed, url) {\r
+                       var t = this, cm;\r
+\r
+                       t.url = url;\r
+                       t.editor = ed;\r
+\r
+                       // Register commands\r
+                       ed.addCommand('mceSpellCheck', function() {\r
+                               if (!t.active) {\r
+                                       ed.setProgressState(1);\r
+                                       t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) {\r
+                                               if (r.length > 0) {\r
+                                                       t.active = 1;\r
+                                                       t._markWords(r);\r
+                                                       ed.setProgressState(0);\r
+                                                       ed.nodeChanged();\r
+                                               } else {\r
+                                                       ed.setProgressState(0);\r
+                                                       ed.windowManager.alert('spellchecker.no_mpell');\r
+                                               }\r
+                                       });\r
+                               } else\r
+                                       t._done();\r
+                       });\r
+\r
+                       ed.onInit.add(function() {\r
+                               if (ed.settings.content_css !== false)\r
+                                       ed.dom.loadCSS(url + '/css/content.css');\r
+                       });\r
+\r
+                       ed.onClick.add(t._showMenu, t);\r
+                       ed.onContextMenu.add(t._showMenu, t);\r
+                       ed.onBeforeGetContent.add(function() {\r
+                               if (t.active)\r
+                                       t._removeWords();\r
+                       });\r
+\r
+                       ed.onNodeChange.add(function(ed, cm) {\r
+                               cm.setActive('spellchecker', t.active);\r
+                       });\r
+\r
+                       ed.onSetContent.add(function() {\r
+                               t._done();\r
+                       });\r
+\r
+                       ed.onBeforeGetContent.add(function() {\r
+                               t._done();\r
+                       });\r
+\r
+                       ed.onBeforeExecCommand.add(function(ed, cmd) {\r
+                               if (cmd == 'mceFullScreen')\r
+                                       t._done();\r
+                       });\r
+\r
+                       // Find selected language\r
+                       t.languages = {};\r
+                       each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) {\r
+                               if (k.indexOf('+') === 0) {\r
+                                       k = k.substring(1);\r
+                                       t.selectedLang = v;\r
+                               }\r
+\r
+                               t.languages[k] = v;\r
+                       });\r
+               },\r
+\r
+               createControl : function(n, cm) {\r
+                       var t = this, c, ed = t.editor;\r
+\r
+                       if (n == 'spellchecker') {\r
+                               c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t});\r
+\r
+                               c.onRenderMenu.add(function(c, m) {\r
+                                       m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1);\r
+                                       each(t.languages, function(v, k) {\r
+                                               var o = {icon : 1}, mi;\r
+\r
+                                               o.onclick = function() {\r
+                                                       mi.setSelected(1);\r
+                                                       t.selectedItem.setSelected(0);\r
+                                                       t.selectedItem = mi;\r
+                                                       t.selectedLang = v;\r
+                                               };\r
+\r
+                                               o.title = k;\r
+                                               mi = m.add(o);\r
+                                               mi.setSelected(v == t.selectedLang);\r
+\r
+                                               if (v == t.selectedLang)\r
+                                                       t.selectedItem = mi;\r
+                                       })\r
+                               });\r
+\r
+                               return c;\r
+                       }\r
+               },\r
+\r
+               // Internal functions\r
+\r
+               _walk : function(n, f) {\r
+                       var d = this.editor.getDoc(), w;\r
+\r
+                       if (d.createTreeWalker) {\r
+                               w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);\r
+\r
+                               while ((n = w.nextNode()) != null)\r
+                                       f.call(this, n);\r
+                       } else\r
+                               tinymce.walk(n, f, 'childNodes');\r
+               },\r
+\r
+               _getSeparators : function() {\r
+                       var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');\r
+\r
+                       // Build word separator regexp\r
+                       for (i=0; i<str.length; i++)\r
+                               re += '\\' + str.charAt(i);\r
+\r
+                       return re;\r
+               },\r
+\r
+               _getWords : function() {\r
+                       var ed = this.editor, wl = [], tx = '', lo = {};\r
+\r
+                       // Get area text\r
+                       this._walk(ed.getBody(), function(n) {\r
+                               if (n.nodeType == 3)\r
+                                       tx += n.nodeValue + ' ';\r
+                       });\r
+\r
+                       // Split words by separator\r
+                       tx = tx.replace(new RegExp('([0-9]|[' + this._getSeparators() + '])', 'g'), ' ');\r
+                       tx = tinymce.trim(tx.replace(/(\s+)/g, ' '));\r
+\r
+                       // Build word array and remove duplicates\r
+                       each(tx.split(' '), function(v) {\r
+                               if (!lo[v]) {\r
+                                       wl.push(v);\r
+                                       lo[v] = 1;\r
+                               }\r
+                       });\r
+\r
+                       return wl;\r
+               },\r
+\r
+               _removeWords : function(w) {\r
+                       var ed = this.editor, dom = ed.dom, se = ed.selection, b = se.getBookmark();\r
+\r
+                       each(dom.select('span').reverse(), function(n) {\r
+                               if (n && (dom.hasClass(n, 'mceItemHiddenSpellWord') || dom.hasClass(n, 'mceItemHidden'))) {\r
+                                       if (!w || dom.decode(n.innerHTML) == w)\r
+                                               dom.remove(n, 1);\r
+                               }\r
+                       });\r
+\r
+                       se.moveToBookmark(b);\r
+               },\r
+\r
+               _markWords : function(wl) {\r
+                       var r1, r2, r3, r4, r5, w = '', ed = this.editor, re = this._getSeparators(), dom = ed.dom, nl = [];\r
+                       var se = ed.selection, b = se.getBookmark();\r
+\r
+                       each(wl, function(v) {\r
+                               w += (w ? '|' : '') + v;\r
+                       });\r
+\r
+                       r1 = new RegExp('([' + re + '])(' + w + ')([' + re + '])', 'g');\r
+                       r2 = new RegExp('^(' + w + ')', 'g');\r
+                       r3 = new RegExp('(' + w + ')([' + re + ']?)$', 'g');\r
+                       r4 = new RegExp('^(' + w + ')([' + re + ']?)$', 'g');\r
+                       r5 = new RegExp('(' + w + ')([' + re + '])', 'g');\r
+\r
+                       // Collect all text nodes\r
+                       this._walk(this.editor.getBody(), function(n) {\r
+                               if (n.nodeType == 3) {\r
+                                       nl.push(n);\r
+                               }\r
+                       });\r
+\r
+                       // Wrap incorrect words in spans\r
+                       each(nl, function(n) {\r
+                               var v;\r
+\r
+                               if (n.nodeType == 3) {\r
+                                       v = n.nodeValue;\r
+\r
+                                       if (r1.test(v) || r2.test(v) || r3.test(v) || r4.test(v)) {\r
+                                               v = dom.encode(v);\r
+                                               v = v.replace(r5, '<span class="mceItemHiddenSpellWord">$1</span>$2');\r
+                                               v = v.replace(r3, '<span class="mceItemHiddenSpellWord">$1</span>$2');\r
+\r
+                                               dom.replace(dom.create('span', {'class' : 'mceItemHidden'}, v), n);\r
+                                       }\r
+                               }\r
+                       });\r
+\r
+                       se.moveToBookmark(b);\r
+               },\r
+\r
+               _showMenu : function(ed, e) {\r
+                       var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin());\r
+\r
+                       if (!m) {\r
+                               p1 = DOM.getPos(ed.getContentAreaContainer());\r
+                               //p2 = DOM.getPos(ed.getContainer());\r
+\r
+                               m = ed.controlManager.createDropMenu('spellcheckermenu', {\r
+                                       offset_x : p1.x,\r
+                                       offset_y : p1.y,\r
+                                       'class' : 'mceNoIcons'\r
+                               });\r
+\r
+                               t._menu = m;\r
+                       }\r
+\r
+                       if (dom.hasClass(e.target, 'mceItemHiddenSpellWord')) {\r
+                               m.removeAll();\r
+                               m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1);\r
+\r
+                               t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(e.target.innerHTML)], function(r) {\r
+                                       m.removeAll();\r
+\r
+                                       if (r.length > 0) {\r
+                                               m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1);\r
+                                               each(r, function(v) {\r
+                                                       m.add({title : v, onclick : function() {\r
+                                                               dom.replace(ed.getDoc().createTextNode(v), e.target);\r
+                                                               t._checkDone();\r
+                                                       }});\r
+                                               });\r
+\r
+                                               m.addSeparator();\r
+                                       } else\r
+                                               m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1);\r
+\r
+                                       m.add({\r
+                                               title : 'spellchecker.ignore_word',\r
+                                               onclick : function() {\r
+                                                       dom.remove(e.target, 1);\r
+                                                       t._checkDone();\r
+                                               }\r
+                                       });\r
+\r
+                                       m.add({\r
+                                               title : 'spellchecker.ignore_words',\r
+                                               onclick : function() {\r
+                                                       t._removeWords(dom.decode(e.target.innerHTML));\r
+                                                       t._checkDone();\r
+                                               }\r
+                                       });\r
+\r
+                                       m.update();\r
+                               });\r
+\r
+                               ed.selection.select(e.target);\r
+                               p1 = dom.getPos(e.target);\r
+                               m.showMenu(p1.x, p1.y + e.target.offsetHeight - vp.y);\r
+\r
+                               return tinymce.dom.Event.cancel(e);\r
+                       } else\r
+                               m.hideMenu();\r
+               },\r
+\r
+               _checkDone : function() {\r
+                       var t = this, ed = t.editor, dom = ed.dom, o;\r
+\r
+                       each(dom.select('span'), function(n) {\r
+                               if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) {\r
+                                       o = true;\r
+                                       return false;\r
+                               }\r
+                       });\r
+\r
+                       if (!o)\r
+                               t._done();\r
+               },\r
+\r
+               _done : function() {\r
+                       var t = this, la = t.active;\r
+\r
+                       if (t.active) {\r
+                               t.active = 0;\r
+                               t._removeWords();\r
+\r
+                               if (t._menu)\r
+                                       t._menu.hideMenu();\r
+\r
+                               if (la)\r
+                                       t.editor.nodeChanged();\r
+                       }\r
+               },\r
+\r
+               _sendRPC : function(m, p, cb) {\r
+                       var t = this, url = t.editor.getParam("spellchecker_rpc_url", "{backend}");\r
+\r
+                       if (url == '{backend}') {\r
+                               t.editor.setProgressState(0);\r
+                               alert('Please specify: spellchecker_rpc_url');\r
+                               return;\r
+                       }\r
+\r
+                       JSONRequest.sendRPC({\r
+                               url : url,\r
+                               method : m,\r
+                               params : p,\r
+                               success : cb,\r
+                               error : function(e, x) {\r
+                                       t.editor.setProgressState(0);\r
+                                       t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText));\r
+                               }\r
+                       });\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/spellchecker/img/wline.gif b/docs/include/jscripts/tiny_mce/plugins/spellchecker/img/wline.gif
new file mode 100644 (file)
index 0000000..7d0a4db
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/plugins/spellchecker/img/wline.gif differ
diff --git a/docs/include/jscripts/tiny_mce/plugins/style/css/props.css b/docs/include/jscripts/tiny_mce/plugins/style/css/props.css
new file mode 100644 (file)
index 0000000..eb1f264
--- /dev/null
@@ -0,0 +1,13 @@
+#text_font {width:250px;}\r
+#text_size {width:70px;}\r
+.mceAddSelectValue {background:#DDD;}\r
+select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;}\r
+#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;}\r
+#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;}\r
+#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;}\r
+.panel_wrapper div.current {padding-top:10px;height:230px;}\r
+.delim {border-left:1px solid gray;}\r
+.tdelim {border-bottom:1px solid gray;}\r
+#block_display {width:145px;}\r
+#list_type {width:115px;}\r
+.disabled {background:#EEE;}\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/style/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/style/editor_plugin.js
new file mode 100644 (file)
index 0000000..cab2153
--- /dev/null
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.StylePlugin",{init:function(a,b){a.addCommand("mceStyleProps",function(){a.windowManager.open({file:b+"/props.htm",width:480+parseInt(a.getLang("style.delta_width",0)),height:320+parseInt(a.getLang("style.delta_height",0)),inline:1},{plugin_url:b,style_text:a.selection.getNode().style.cssText})});a.addCommand("mceSetElementStyle",function(d,c){if(e=a.selection.getNode()){a.dom.setAttrib(e,"style",c);a.execCommand("mceRepaint")}});a.onNodeChange.add(function(d,c,f){c.setDisabled("styleprops",f.nodeName==="BODY")});a.addButton("styleprops",{title:"style.desc",cmd:"mceStyleProps"})},getInfo:function(){return{longname:"Style",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("style",tinymce.plugins.StylePlugin)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/style/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/style/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..5f7755f
--- /dev/null
@@ -0,0 +1,55 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.StylePlugin', {\r
+               init : function(ed, url) {\r
+                       // Register commands\r
+                       ed.addCommand('mceStyleProps', function() {\r
+                               ed.windowManager.open({\r
+                                       file : url + '/props.htm',\r
+                                       width : 480 + parseInt(ed.getLang('style.delta_width', 0)),\r
+                                       height : 320 + parseInt(ed.getLang('style.delta_height', 0)),\r
+                                       inline : 1\r
+                               }, {\r
+                                       plugin_url : url,\r
+                                       style_text : ed.selection.getNode().style.cssText\r
+                               });\r
+                       });\r
+\r
+                       ed.addCommand('mceSetElementStyle', function(ui, v) {\r
+                               if (e = ed.selection.getNode()) {\r
+                                       ed.dom.setAttrib(e, 'style', v);\r
+                                       ed.execCommand('mceRepaint');\r
+                               }\r
+                       });\r
+\r
+                       ed.onNodeChange.add(function(ed, cm, n) {\r
+                               cm.setDisabled('styleprops', n.nodeName === 'BODY');\r
+                       });\r
+\r
+                       // Register buttons\r
+                       ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'});\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Style',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/style/js/props.js b/docs/include/jscripts/tiny_mce/plugins/style/js/props.js
new file mode 100644 (file)
index 0000000..a8dd93d
--- /dev/null
@@ -0,0 +1,641 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+var defaultFonts = "" + \r
+       "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + \r
+       "Times New Roman, Times, serif=Times New Roman, Times, serif;" + \r
+       "Courier New, Courier, mono=Courier New, Courier, mono;" + \r
+       "Times New Roman, Times, serif=Times New Roman, Times, serif;" + \r
+       "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + \r
+       "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + \r
+       "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif";\r
+\r
+var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger";\r
+var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%";\r
+var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%";\r
+var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%";\r
+var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900";\r
+var defaultTextStyle = "normal;italic;oblique";\r
+var defaultVariant = "normal;small-caps";\r
+var defaultLineHeight = "normal";\r
+var defaultAttachment = "fixed;scroll";\r
+var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y";\r
+var defaultPosH = "left;center;right";\r
+var defaultPosV = "top;center;bottom";\r
+var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom";\r
+var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none";\r
+var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset";\r
+var defaultBorderWidth = "thin;medium;thick";\r
+var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none";\r
+\r
+function init() {\r
+       var ce = document.getElementById('container'), h;\r
+\r
+       ce.style.cssText = tinyMCEPopup.getWindowArg('style_text');\r
+\r
+       h = getBrowserHTML('background_image_browser','background_image','image','advimage');\r
+       document.getElementById("background_image_browser").innerHTML = h;\r
+\r
+       document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color');\r
+       document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color');\r
+       document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top');\r
+       document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right');\r
+       document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom');\r
+       document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left');\r
+\r
+       fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true);\r
+       fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true);\r
+       fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true);\r
+       fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true);\r
+       fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true);\r
+       fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true);\r
+       fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true);\r
+       fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true);\r
+\r
+       fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true);\r
+       fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true);\r
+\r
+       fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true);\r
+\r
+       fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true);\r
+       fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true);\r
+\r
+       fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true);\r
+       fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true);\r
+       fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true);\r
+       fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true);\r
+       fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true);\r
+       fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true);\r
+       fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true);\r
+       fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true);\r
+       fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true);\r
+\r
+       fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true);\r
+       fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true);\r
+       fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true);\r
+\r
+       fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true);\r
+       fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true);\r
+       fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true);\r
+       fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true);\r
+\r
+       fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true);\r
+       fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true);\r
+       fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true);\r
+       fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true);\r
+\r
+       fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true);\r
+\r
+       fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true);\r
+       fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true);\r
+\r
+       fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true);\r
+       fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true);\r
+\r
+       fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true);\r
+\r
+       fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true);\r
+\r
+       fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true);\r
+       fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true);\r
+\r
+       TinyMCE_EditableSelects.init();\r
+       setupFormData();\r
+       showDisabledControls();\r
+}\r
+\r
+function setupFormData() {\r
+       var ce = document.getElementById('container'), f = document.forms[0], s, b, i;\r
+\r
+       // Setup text fields\r
+\r
+       selectByValue(f, 'text_font', ce.style.fontFamily, true, true);\r
+       selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true);\r
+       selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize));\r
+       selectByValue(f, 'text_weight', ce.style.fontWeight, true, true);\r
+       selectByValue(f, 'text_style', ce.style.fontStyle, true, true);\r
+       selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true);\r
+       selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight));\r
+       selectByValue(f, 'text_case', ce.style.textTransform, true, true);\r
+       selectByValue(f, 'text_variant', ce.style.fontVariant, true, true);\r
+       f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color);\r
+       updateColor('text_color_pick', 'text_color');\r
+       f.text_underline.checked = inStr(ce.style.textDecoration, 'underline');\r
+       f.text_overline.checked = inStr(ce.style.textDecoration, 'overline');\r
+       f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through');\r
+       f.text_blink.checked = inStr(ce.style.textDecoration, 'blink');\r
+\r
+       // Setup background fields\r
+\r
+       f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor);\r
+       updateColor('background_color_pick', 'background_color');\r
+       f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");\r
+       selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true);\r
+       selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true);\r
+       selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true);\r
+       selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0)));\r
+       selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true);\r
+       selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1)));\r
+\r
+       // Setup block fields\r
+\r
+       selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true);\r
+       selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing));\r
+       selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true);\r
+       selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing));\r
+       selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true);\r
+       selectByValue(f, 'block_text_align', ce.style.textAlign, true, true);\r
+       f.block_text_indent.value = getNum(ce.style.textIndent);\r
+       selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent));\r
+       selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true);\r
+       selectByValue(f, 'block_display', ce.style.display, true, true);\r
+\r
+       // Setup box fields\r
+\r
+       f.box_width.value = getNum(ce.style.width);\r
+       selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width));\r
+\r
+       f.box_height.value = getNum(ce.style.height);\r
+       selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height));\r
+\r
+       if (tinymce.isGecko)\r
+               selectByValue(f, 'box_float', ce.style.cssFloat, true, true);\r
+       else\r
+               selectByValue(f, 'box_float', ce.style.styleFloat, true, true);\r
+\r
+       selectByValue(f, 'box_clear', ce.style.clear, true, true);\r
+\r
+       setupBox(f, ce, 'box_padding', 'padding', '');\r
+       setupBox(f, ce, 'box_margin', 'margin', '');\r
+\r
+       // Setup border fields\r
+\r
+       setupBox(f, ce, 'border_style', 'border', 'Style');\r
+       setupBox(f, ce, 'border_width', 'border', 'Width');\r
+       setupBox(f, ce, 'border_color', 'border', 'Color');\r
+\r
+       updateColor('border_color_top_pick', 'border_color_top');\r
+       updateColor('border_color_right_pick', 'border_color_right');\r
+       updateColor('border_color_bottom_pick', 'border_color_bottom');\r
+       updateColor('border_color_left_pick', 'border_color_left');\r
+\r
+       f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value);\r
+       f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value);\r
+       f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value);\r
+       f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value);\r
+\r
+       // Setup list fields\r
+\r
+       selectByValue(f, 'list_type', ce.style.listStyleType, true, true);\r
+       selectByValue(f, 'list_position', ce.style.listStylePosition, true, true);\r
+       f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");\r
+\r
+       // Setup box fields\r
+\r
+       selectByValue(f, 'positioning_type', ce.style.position, true, true);\r
+       selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true);\r
+       selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true);\r
+       f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : "";\r
+\r
+       f.positioning_width.value = getNum(ce.style.width);\r
+       selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width));\r
+\r
+       f.positioning_height.value = getNum(ce.style.height);\r
+       selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height));\r
+\r
+       setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']);\r
+\r
+       s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1");\r
+       s = s.replace(/,/g, ' ');\r
+\r
+       if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) {\r
+               f.positioning_clip_top.value = getNum(getVal(s, 0));\r
+               selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));\r
+               f.positioning_clip_right.value = getNum(getVal(s, 1));\r
+               selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1)));\r
+               f.positioning_clip_bottom.value = getNum(getVal(s, 2));\r
+               selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2)));\r
+               f.positioning_clip_left.value = getNum(getVal(s, 3));\r
+               selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3)));\r
+       } else {\r
+               f.positioning_clip_top.value = getNum(getVal(s, 0));\r
+               selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));\r
+               f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value;\r
+       }\r
+\r
+//     setupBox(f, ce, '', 'border', 'Color');\r
+}\r
+\r
+function getMeasurement(s) {\r
+       return s.replace(/^([0-9.]+)(.*)$/, "$2");\r
+}\r
+\r
+function getNum(s) {\r
+       if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s))\r
+               return s.replace(/[^0-9.]/g, '');\r
+\r
+       return s;\r
+}\r
+\r
+function inStr(s, n) {\r
+       return new RegExp(n, 'gi').test(s);\r
+}\r
+\r
+function getVal(s, i) {\r
+       var a = s.split(' ');\r
+\r
+       if (a.length > 1)\r
+               return a[i];\r
+\r
+       return "";\r
+}\r
+\r
+function setValue(f, n, v) {\r
+       if (f.elements[n].type == "text")\r
+               f.elements[n].value = v;\r
+       else\r
+               selectByValue(f, n, v, true, true);\r
+}\r
+\r
+function setupBox(f, ce, fp, pr, sf, b) {\r
+       if (typeof(b) == "undefined")\r
+               b = ['Top', 'Right', 'Bottom', 'Left'];\r
+\r
+       if (isSame(ce, pr, sf, b)) {\r
+               f.elements[fp + "_same"].checked = true;\r
+\r
+               setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));\r
+               f.elements[fp + "_top"].disabled = false;\r
+\r
+               f.elements[fp + "_right"].value = "";\r
+               f.elements[fp + "_right"].disabled = true;\r
+               f.elements[fp + "_bottom"].value = "";\r
+               f.elements[fp + "_bottom"].disabled = true;\r
+               f.elements[fp + "_left"].value = "";\r
+               f.elements[fp + "_left"].disabled = true;\r
+\r
+               if (f.elements[fp + "_top_measurement"]) {\r
+                       selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));\r
+                       f.elements[fp + "_left_measurement"].disabled = true;\r
+                       f.elements[fp + "_bottom_measurement"].disabled = true;\r
+                       f.elements[fp + "_right_measurement"].disabled = true;\r
+               }\r
+       } else {\r
+               f.elements[fp + "_same"].checked = false;\r
+\r
+               setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));\r
+               f.elements[fp + "_top"].disabled = false;\r
+\r
+               setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf]));\r
+               f.elements[fp + "_right"].disabled = false;\r
+\r
+               setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf]));\r
+               f.elements[fp + "_bottom"].disabled = false;\r
+\r
+               setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf]));\r
+               f.elements[fp + "_left"].disabled = false;\r
+\r
+               if (f.elements[fp + "_top_measurement"]) {\r
+                       selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));\r
+                       selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf]));\r
+                       selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf]));\r
+                       selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf]));\r
+                       f.elements[fp + "_left_measurement"].disabled = false;\r
+                       f.elements[fp + "_bottom_measurement"].disabled = false;\r
+                       f.elements[fp + "_right_measurement"].disabled = false;\r
+               }\r
+       }\r
+}\r
+\r
+function isSame(e, pr, sf, b) {\r
+       var a = [], i, x;\r
+\r
+       if (typeof(b) == "undefined")\r
+               b = ['Top', 'Right', 'Bottom', 'Left'];\r
+\r
+       if (typeof(sf) == "undefined" || sf == null)\r
+               sf = "";\r
+\r
+       a[0] = e.style[pr + b[0] + sf];\r
+       a[1] = e.style[pr + b[1] + sf];\r
+       a[2] = e.style[pr + b[2] + sf];\r
+       a[3] = e.style[pr + b[3] + sf];\r
+\r
+       for (i=0; i<a.length; i++) {\r
+               if (a[i] == null)\r
+                       return false;\r
+\r
+               for (x=0; x<a.length; x++) {\r
+                       if (a[x] != a[i])\r
+                               return false;\r
+               }\r
+       }\r
+\r
+       return true;\r
+};\r
+\r
+function hasEqualValues(a) {\r
+       var i, x;\r
+\r
+       for (i=0; i<a.length; i++) {\r
+               if (a[i] == null)\r
+                       return false;\r
+\r
+               for (x=0; x<a.length; x++) {\r
+                       if (a[x] != a[i])\r
+                               return false;\r
+               }\r
+       }\r
+\r
+       return true;\r
+}\r
+\r
+function applyAction() {\r
+       var ce = document.getElementById('container'), ed = tinyMCEPopup.editor;\r
+\r
+       generateCSS();\r
+\r
+       tinyMCEPopup.restoreSelection();\r
+       ed.dom.setAttrib(ed.selection.getNode(), 'style', tinyMCEPopup.editor.dom.serializeStyle(tinyMCEPopup.editor.dom.parseStyle(ce.style.cssText)));\r
+}\r
+\r
+function updateAction() {\r
+       applyAction();\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function generateCSS() {\r
+       var ce = document.getElementById('container'), f = document.forms[0], num = new RegExp('[0-9]+', 'g'), s, t;\r
+\r
+       ce.style.cssText = "";\r
+\r
+       // Build text styles\r
+       ce.style.fontFamily = f.text_font.value;\r
+       ce.style.fontSize = f.text_size.value + (isNum(f.text_size.value) ? (f.text_size_measurement.value || 'px') : "");\r
+       ce.style.fontStyle = f.text_style.value;\r
+       ce.style.lineHeight = f.text_lineheight.value + (isNum(f.text_lineheight.value) ? f.text_lineheight_measurement.value : "");\r
+       ce.style.textTransform = f.text_case.value;\r
+       ce.style.fontWeight = f.text_weight.value;\r
+       ce.style.fontVariant = f.text_variant.value;\r
+       ce.style.color = f.text_color.value;\r
+\r
+       s = "";\r
+       s += f.text_underline.checked ? " underline" : "";\r
+       s += f.text_overline.checked ? " overline" : "";\r
+       s += f.text_linethrough.checked ? " line-through" : "";\r
+       s += f.text_blink.checked ? " blink" : "";\r
+       s = s.length > 0 ? s.substring(1) : s;\r
+\r
+       if (f.text_none.checked)\r
+               s = "none";\r
+\r
+       ce.style.textDecoration = s;\r
+\r
+       // Build background styles\r
+\r
+       ce.style.backgroundColor = f.background_color.value;\r
+       ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : "";\r
+       ce.style.backgroundRepeat = f.background_repeat.value;\r
+       ce.style.backgroundAttachment = f.background_attachment.value;\r
+\r
+       if (f.background_hpos.value != "") {\r
+               s = "";\r
+               s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " ";\r
+               s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : "");\r
+               ce.style.backgroundPosition = s;\r
+       }\r
+\r
+       // Build block styles\r
+\r
+       ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : "");\r
+       ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : "");\r
+       ce.style.verticalAlign = f.block_vertical_alignment.value;\r
+       ce.style.textAlign = f.block_text_align.value;\r
+       ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : "");\r
+       ce.style.whiteSpace = f.block_whitespace.value;\r
+       ce.style.display = f.block_display.value;\r
+\r
+       // Build box styles\r
+\r
+       ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : "");\r
+       ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : "");\r
+       ce.style.styleFloat = f.box_float.value;\r
+\r
+       if (tinymce.isGecko)\r
+               ce.style.cssFloat = f.box_float.value;\r
+\r
+       ce.style.clear = f.box_clear.value;\r
+\r
+       if (!f.box_padding_same.checked) {\r
+               ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");\r
+               ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : "");\r
+               ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : "");\r
+               ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : "");\r
+       } else\r
+               ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");               \r
+\r
+       if (!f.box_margin_same.checked) {\r
+               ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");\r
+               ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : "");\r
+               ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : "");\r
+               ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : "");\r
+       } else\r
+               ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");           \r
+\r
+       // Build border styles\r
+\r
+       if (!f.border_style_same.checked) {\r
+               ce.style.borderTopStyle = f.border_style_top.value;\r
+               ce.style.borderRightStyle = f.border_style_right.value;\r
+               ce.style.borderBottomStyle = f.border_style_bottom.value;\r
+               ce.style.borderLeftStyle = f.border_style_left.value;\r
+       } else\r
+               ce.style.borderStyle = f.border_style_top.value;\r
+\r
+       if (!f.border_width_same.checked) {\r
+               ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");\r
+               ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : "");\r
+               ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : "");\r
+               ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : "");\r
+       } else\r
+               ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");\r
+\r
+       if (!f.border_color_same.checked) {\r
+               ce.style.borderTopColor = f.border_color_top.value;\r
+               ce.style.borderRightColor = f.border_color_right.value;\r
+               ce.style.borderBottomColor = f.border_color_bottom.value;\r
+               ce.style.borderLeftColor = f.border_color_left.value;\r
+       } else\r
+               ce.style.borderColor = f.border_color_top.value;\r
+\r
+       // Build list styles\r
+\r
+       ce.style.listStyleType = f.list_type.value;\r
+       ce.style.listStylePosition = f.list_position.value;\r
+       ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : "";\r
+\r
+       // Build positioning styles\r
+\r
+       ce.style.position = f.positioning_type.value;\r
+       ce.style.visibility = f.positioning_visibility.value;\r
+\r
+       if (ce.style.width == "")\r
+               ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : "");\r
+\r
+       if (ce.style.height == "")\r
+               ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : "");\r
+\r
+       ce.style.zIndex = f.positioning_zindex.value;\r
+       ce.style.overflow = f.positioning_overflow.value;\r
+\r
+       if (!f.positioning_placement_same.checked) {\r
+               ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");\r
+               ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : "");\r
+               ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : "");\r
+               ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : "");\r
+       } else {\r
+               s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");\r
+               ce.style.top = s;\r
+               ce.style.right = s;\r
+               ce.style.bottom = s;\r
+               ce.style.left = s;\r
+       }\r
+\r
+       if (!f.positioning_clip_same.checked) {\r
+               s = "rect(";\r
+               s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " ";\r
+               s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " ";\r
+               s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " ";\r
+               s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto");\r
+               s += ")";\r
+\r
+               if (s != "rect(auto auto auto auto)")\r
+                       ce.style.clip = s;\r
+       } else {\r
+               s = "rect(";\r
+               t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto";\r
+               s += t + " ";\r
+               s += t + " ";\r
+               s += t + " ";\r
+               s += t + ")";\r
+\r
+               if (s != "rect(auto auto auto auto)")\r
+                       ce.style.clip = s;\r
+       }\r
+\r
+       ce.style.cssText = ce.style.cssText;\r
+}\r
+\r
+function isNum(s) {\r
+       return new RegExp('[0-9]+', 'g').test(s);\r
+}\r
+\r
+function showDisabledControls() {\r
+       var f = document.forms, i, a;\r
+\r
+       for (i=0; i<f.length; i++) {\r
+               for (a=0; a<f[i].elements.length; a++) {\r
+                       if (f[i].elements[a].disabled)\r
+                               tinyMCEPopup.editor.dom.addClass(f[i].elements[a], "disabled");\r
+                       else\r
+                               tinyMCEPopup.editor.dom.removeClass(f[i].elements[a], "disabled");\r
+               }\r
+       }\r
+}\r
+\r
+function fillSelect(f, s, param, dval, sep, em) {\r
+       var i, ar, p, se;\r
+\r
+       f = document.forms[f];\r
+       sep = typeof(sep) == "undefined" ? ";" : sep;\r
+\r
+       if (em)\r
+               addSelectValue(f, s, "", "");\r
+\r
+       ar = tinyMCEPopup.getParam(param, dval).split(sep);\r
+       for (i=0; i<ar.length; i++) {\r
+               se = false;\r
+\r
+               if (ar[i].charAt(0) == '+') {\r
+                       ar[i] = ar[i].substring(1);\r
+                       se = true;\r
+               }\r
+\r
+               p = ar[i].split('=');\r
+\r
+               if (p.length > 1) {\r
+                       addSelectValue(f, s, p[0], p[1]);\r
+\r
+                       if (se)\r
+                               selectByValue(f, s, p[1]);\r
+               } else {\r
+                       addSelectValue(f, s, p[0], p[0]);\r
+\r
+                       if (se)\r
+                               selectByValue(f, s, p[0]);\r
+               }\r
+       }\r
+}\r
+\r
+function toggleSame(ce, pre) {\r
+       var el = document.forms[0].elements, i;\r
+\r
+       if (ce.checked) {\r
+               el[pre + "_top"].disabled = false;\r
+               el[pre + "_right"].disabled = true;\r
+               el[pre + "_bottom"].disabled = true;\r
+               el[pre + "_left"].disabled = true;\r
+\r
+               if (el[pre + "_top_measurement"]) {\r
+                       el[pre + "_top_measurement"].disabled = false;\r
+                       el[pre + "_right_measurement"].disabled = true;\r
+                       el[pre + "_bottom_measurement"].disabled = true;\r
+                       el[pre + "_left_measurement"].disabled = true;\r
+               }\r
+       } else {\r
+               el[pre + "_top"].disabled = false;\r
+               el[pre + "_right"].disabled = false;\r
+               el[pre + "_bottom"].disabled = false;\r
+               el[pre + "_left"].disabled = false;\r
+\r
+               if (el[pre + "_top_measurement"]) {\r
+                       el[pre + "_top_measurement"].disabled = false;\r
+                       el[pre + "_right_measurement"].disabled = false;\r
+                       el[pre + "_bottom_measurement"].disabled = false;\r
+                       el[pre + "_left_measurement"].disabled = false;\r
+               }\r
+       }\r
+\r
+       showDisabledControls();\r
+}\r
+\r
+function synch(fr, to) {\r
+       var f = document.forms[0];\r
+\r
+       f.elements[to].value = f.elements[fr].value;\r
+\r
+       if (f.elements[fr + "_measurement"])\r
+               selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value);\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/style/langs/en_dlg.js b/docs/include/jscripts/tiny_mce/plugins/style/langs/en_dlg.js
new file mode 100644 (file)
index 0000000..5026313
--- /dev/null
@@ -0,0 +1,63 @@
+tinyMCE.addI18n('en.style_dlg',{\r
+title:"Edit CSS Style",\r
+apply:"Apply",\r
+text_tab:"Text",\r
+background_tab:"Background",\r
+block_tab:"Block",\r
+box_tab:"Box",\r
+border_tab:"Border",\r
+list_tab:"List",\r
+positioning_tab:"Positioning",\r
+text_props:"Text",\r
+text_font:"Font",\r
+text_size:"Size",\r
+text_weight:"Weight",\r
+text_style:"Style",\r
+text_variant:"Variant",\r
+text_lineheight:"Line height",\r
+text_case:"Case",\r
+text_color:"Color",\r
+text_decoration:"Decoration",\r
+text_overline:"overline",\r
+text_underline:"underline",\r
+text_striketrough:"strikethrough",\r
+text_blink:"blink",\r
+text_none:"none",\r
+background_color:"Background color",\r
+background_image:"Background image",\r
+background_repeat:"Repeat",\r
+background_attachment:"Attachment",\r
+background_hpos:"Horizontal position",\r
+background_vpos:"Vertical position",\r
+block_wordspacing:"Word spacing",\r
+block_letterspacing:"Letter spacing",\r
+block_vertical_alignment:"Vertical alignment",\r
+block_text_align:"Text align",\r
+block_text_indent:"Text indent",\r
+block_whitespace:"Whitespace",\r
+block_display:"Display",\r
+box_width:"Width",\r
+box_height:"Height",\r
+box_float:"Float",\r
+box_clear:"Clear",\r
+padding:"Padding",\r
+same:"Same for all",\r
+top:"Top",\r
+right:"Right",\r
+bottom:"Bottom",\r
+left:"Left",\r
+margin:"Margin",\r
+style:"Style",\r
+width:"Width",\r
+height:"Height",\r
+color:"Color",\r
+list_type:"Type",\r
+bullet_image:"Bullet image",\r
+position:"Position",\r
+positioning_type:"Type",\r
+visibility:"Visibility",\r
+zindex:"Z-index",\r
+overflow:"Overflow",\r
+placement:"Placement",\r
+clip:"Clip"\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/style/props.htm b/docs/include/jscripts/tiny_mce/plugins/style/props.htm
new file mode 100644 (file)
index 0000000..08e02f1
--- /dev/null
@@ -0,0 +1,726 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <title>{#style_dlg.title}</title>
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>
+       <script type="text/javascript" src="../../utils/editable_selects.js"></script>
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>
+       <script type="text/javascript" src="js/props.js"></script>
+       <link href="css/props.css" rel="stylesheet" type="text/css" />
+</head>
+
+<body id="styleprops" style="display: none">
+<form onsubmit="updateAction();return false;" action="#">
+<div class="tabs">
+       <ul>
+               <li id="text_tab" class="current"><span><a href="javascript:mcTabs.displayTab('text_tab','text_panel');" onMouseDown="return false;">{#style_dlg.text_tab}</a></span></li>
+               <li id="background_tab"><span><a href="javascript:mcTabs.displayTab('background_tab','background_panel');" onMouseDown="return false;">{#style_dlg.background_tab}</a></span></li>
+               <li id="block_tab"><span><a href="javascript:mcTabs.displayTab('block_tab','block_panel');" onMouseDown="return false;">{#style_dlg.block_tab}</a></span></li>
+               <li id="box_tab"><span><a href="javascript:mcTabs.displayTab('box_tab','box_panel');" onMouseDown="return false;">{#style_dlg.box_tab}</a></span></li>
+               <li id="border_tab"><span><a href="javascript:mcTabs.displayTab('border_tab','border_panel');" onMouseDown="return false;">{#style_dlg.border_tab}</a></span></li>
+               <li id="list_tab"><span><a href="javascript:mcTabs.displayTab('list_tab','list_panel');" onMouseDown="return false;">{#style_dlg.list_tab}</a></span></li>
+               <li id="positioning_tab"><span><a href="javascript:mcTabs.displayTab('positioning_tab','positioning_panel');" onMouseDown="return false;">{#style_dlg.positioning_tab}</a></span></li>
+       </ul>
+</div>
+
+<div class="panel_wrapper">
+<div id="text_panel" class="panel current">
+       <table border="0" width="100%">
+               <tr>
+                       <td><label for="text_font">{#style_dlg.text_font}</label></td>
+                       <td colspan="3">
+                               <select id="text_font" name="text_font" class="mceEditableSelect mceFocus"></select>
+                       </td>
+               </tr>
+               <tr>
+                       <td><label for="text_size">{#style_dlg.text_size}</label></td>
+                       <td>
+                               <table border="0" cellspacing="0" cellpadding="0">
+                                       <tr>
+                                               <td><select id="text_size" name="text_size" class="mceEditableSelect"></select></td>
+                                               <td>&nbsp;</td>
+                                               <td><select id="text_size_measurement" name="text_size_measurement"></select></td>
+                                       </tr>
+                               </table>
+                       </td>
+                       <td><label for="text_weight">{#style_dlg.text_weight}</label></td>
+                       <td>
+                               <select id="text_weight" name="text_weight"></select>
+                       </td>
+               </tr>
+               <tr>
+                       <td><label for="text_style">{#style_dlg.text_style}</label></td>
+                       <td>
+                               <select id="text_style" name="text_style" class="mceEditableSelect"></select>
+                       </td>
+                       <td><label for="text_variant">{#style_dlg.text_variant}</label></td>
+                       <td>
+                               <select id="text_variant" name="text_variant"></select>
+                       </td>
+               </tr>
+               <tr>
+                       <td><label for="text_lineheight">{#style_dlg.text_lineheight}</label></td>
+                       <td>
+                               <table border="0" cellspacing="0" cellpadding="0">
+                                       <tr>
+                                               <td>
+                                                       <select id="text_lineheight" name="text_lineheight" class="mceEditableSelect"></select>
+                                               </td>
+                                               <td>&nbsp;</td>
+                                               <td><select id="text_lineheight_measurement" name="text_lineheight_measurement"></select></td>
+                                       </tr>
+                               </table>
+                       </td>
+                       <td><label for="text_case">{#style_dlg.text_case}</label></td>
+                       <td>
+                               <select id="text_case" name="text_case"></select>
+                       </td>
+               </tr>
+               <tr>
+                       <td><label for="text_color">{#style_dlg.text_color}</label></td>
+                       <td colspan="2">
+                               <table border="0" cellpadding="0" cellspacing="0">
+                                       <tr>
+                                               <td><input id="text_color" name="text_color" type="text" value="" size="9" onChange="updateColor('text_color_pick','text_color');" /></td>
+                                               <td id="text_color_pickcontainer">&nbsp;</td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+               <tr>
+                       <td valign="top" style="vertical-align: top; padding-top: 3px;">{#style_dlg.text_decoration}</td>
+                       <td colspan="2">
+                               <table border="0" cellspacing="0" cellpadding="0">
+                                       <tr>
+                                               <td><input id="text_underline" name="text_underline" class="checkbox" type="checkbox" /></td>
+                                               <td><label for="text_underline">{#style_dlg.text_underline}</label></td>
+                                       </tr>
+                                       <tr>
+                                               <td><input id="text_overline" name="text_overline" class="checkbox" type="checkbox" /></td>
+                                               <td><label for="text_overline">{#style_dlg.text_overline}</label></td>
+                                       </tr>
+                                       <tr>
+                                               <td><input id="text_linethrough" name="text_linethrough" class="checkbox" type="checkbox" /></td>
+                                               <td><label for="text_linethrough">{#style_dlg.text_striketrough}</label></td>
+                                       </tr>
+                                       <tr>
+                                               <td><input id="text_blink" name="text_blink" class="checkbox" type="checkbox" /></td>
+                                               <td><label for="text_blink">{#style_dlg.text_blink}</label></td>
+                                       </tr>
+                                       <tr>
+                                               <td><input id="text_none" name="text_none" class="checkbox" type="checkbox" /></td>
+                                               <td><label for="text_none">{#style_dlg.text_none}</label></td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+       </table>
+</div>
+
+<div id="background_panel" class="panel">
+       <table border="0">
+               <tr>
+                       <td><label for="background_color">{#style_dlg.background_color}</label></td>
+                       <td>
+                               <table border="0" cellpadding="0" cellspacing="0">
+                                       <tr>
+                                               <td><input id="background_color" name="background_color" type="text" value="" size="9" onChange="updateColor('background_color_pick','background_color');" /></td>
+                                               <td id="background_color_pickcontainer">&nbsp;</td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+
+               <tr>
+                       <td><label for="background_image">{#style_dlg.background_image}</label></td>
+                       <td><table border="0" cellspacing="0" cellpadding="0">
+                               <tr> 
+                                 <td><input id="background_image" name="background_image" type="text" /></td> 
+                                 <td id="background_image_browser">&nbsp;</td>
+                               </tr>
+                               </table>
+                       </td>
+               </tr>
+
+               <tr>
+                       <td><label for="background_repeat">{#style_dlg.background_repeat}</label></td>
+                       <td><select id="background_repeat" name="background_repeat" class="mceEditableSelect"></select></td>
+               </tr>
+
+               <tr>
+                       <td><label for="background_attachment">{#style_dlg.background_attachment}</label></td>
+                       <td><select id="background_attachment" name="background_attachment" class="mceEditableSelect"></select></td>
+               </tr>
+
+               <tr>
+                       <td><label for="background_hpos">{#style_dlg.background_hpos}</label></td>
+                       <td>
+                               <table border="0" cellspacing="0" cellpadding="0">
+                                       <tr>
+                                               <td><select id="background_hpos" name="background_hpos" class="mceEditableSelect"></select></td>
+                                               <td>&nbsp;</td>
+                                               <td><select id="background_hpos_measurement" name="background_hpos_measurement"></select></td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+
+               <tr>
+                       <td><label for="background_vpos">{#style_dlg.background_vpos}</label></td>
+                       <td>
+                               <table border="0" cellspacing="0" cellpadding="0">
+                                       <tr>
+                                               <td><select id="background_vpos" name="background_vpos" class="mceEditableSelect"></select></td>
+                                               <td>&nbsp;</td>
+                                               <td><select id="background_vpos_measurement" name="background_vpos_measurement"></select></td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+       </table>
+</div>
+
+<div id="block_panel" class="panel">
+       <table border="0">
+               <tr>
+                       <td><label for="block_wordspacing">{#style_dlg.block_wordspacing}</label></td>
+                       <td>
+                               <table border="0" cellspacing="0" cellpadding="0">
+                                       <tr>
+                                               <td><select id="block_wordspacing" name="block_wordspacing" class="mceEditableSelect"></select></td>
+                                               <td>&nbsp;</td>
+                                               <td><select id="block_wordspacing_measurement" name="block_wordspacing_measurement"></select></td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+
+               <tr>
+                       <td><label for="block_letterspacing">{#style_dlg.block_letterspacing}</label></td>
+                       <td>
+                               <table border="0" cellspacing="0" cellpadding="0">
+                                       <tr>
+                                               <td><select id="block_letterspacing" name="block_letterspacing" class="mceEditableSelect"></select></td>
+                                               <td>&nbsp;</td>
+                                               <td><select id="block_letterspacing_measurement" name="block_letterspacing_measurement"></select></td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+
+               <tr>
+                       <td><label for="block_vertical_alignment">{#style_dlg.block_vertical_alignment}</label></td>
+                       <td><select id="block_vertical_alignment" name="block_vertical_alignment" class="mceEditableSelect"></select></td>
+               </tr>
+
+               <tr>
+                       <td><label for="block_text_align">{#style_dlg.block_text_align}</label></td>
+                       <td><select id="block_text_align" name="block_text_align" class="mceEditableSelect"></select></td>
+               </tr>
+
+               <tr>
+                       <td><label for="block_text_indent">{#style_dlg.block_text_indent}</label></td>
+                       <td>
+                               <table border="0" cellspacing="0" cellpadding="0">
+                                       <tr>
+                                               <td><input type="text" id="block_text_indent" name="block_text_indent" /></td>
+                                               <td>&nbsp;</td>
+                                               <td><select id="block_text_indent_measurement" name="block_text_indent_measurement"></select></td>
+                                       </tr>
+                               </table>
+                       </td>
+               </tr>
+
+               <tr>
+                       <td><label for="block_whitespace">{#style_dlg.block_whitespace}</label></td>
+                       <td><select id="block_whitespace" name="block_whitespace" class="mceEditableSelect"></select></td>
+               </tr>
+
+               <tr>
+                       <td><label for="block_display">{#style_dlg.block_display}</label></td>
+                       <td><select id="block_display" name="block_display" class="mceEditableSelect"></select></td>
+               </tr>
+       </table>
+</div>
+
+<div id="box_panel" class="panel">
+<table border="0">
+       <tr>
+               <td><label for="box_width">{#style_dlg.box_width}</label></td>
+               <td>
+                       <table border="0" cellspacing="0" cellpadding="0">
+                               <tr>
+                                       <td><input type="text" id="box_width" name="box_width" class="mceEditableSelect" onChange="synch('box_width','positioning_width');" /></td>
+                                       <td>&nbsp;</td>
+                                       <td><select id="box_width_measurement" name="box_width_measurement"></select></td>
+                               </tr>
+                       </table>
+               </td>
+               <td>&nbsp;&nbsp;&nbsp;<label for="box_float">{#style_dlg.box_float}</label></td>
+               <td><select id="box_float" name="box_float" class="mceEditableSelect"></select></td>
+       </tr>
+
+       <tr>
+               <td><label for="box_height">{#style_dlg.box_height}</label></td>
+               <td>
+                       <table border="0" cellspacing="0" cellpadding="0">
+                               <tr>
+                                       <td><input type="text" id="box_height" name="box_height" class="mceEditableSelect" onChange="synch('box_height','positioning_height');" /></td>
+                                       <td>&nbsp;</td>
+                                       <td><select id="box_height_measurement" name="box_height_measurement"></select></td>
+                               </tr>
+                       </table>
+               </td>
+               <td>&nbsp;&nbsp;&nbsp;<label for="box_clear">{#style_dlg.box_clear}</label></td>
+               <td><select id="box_clear" name="box_clear" class="mceEditableSelect"></select></td>
+       </tr>
+</table>
+<div style="float: left; width: 49%">
+       <fieldset>
+               <legend>{#style_dlg.padding}</legend>
+
+               <table border="0">
+                       <tr>
+                               <td>&nbsp;</td>
+                               <td><input type="checkbox" id="box_padding_same" name="box_padding_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_padding');" /> <label for="box_padding_same">{#style_dlg.same}</label></td>
+                       </tr>
+                       <tr>
+                               <td><label for="box_padding_top">{#style_dlg.top}</label></td>
+                               <td>
+                                       <table border="0" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td><input type="text" id="box_padding_top" name="box_padding_top" class="mceEditableSelect" /></td>
+                                                       <td>&nbsp;</td>
+                                                       <td><select id="box_padding_top_measurement" name="box_padding_top_measurement"></select></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td><label for="box_padding_right">{#style_dlg.right}</label></td>
+                               <td>
+                                       <table border="0" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td><input type="text" id="box_padding_right" name="box_padding_right" class="mceEditableSelect" disabled="disabled" /></td>
+                                                       <td>&nbsp;</td>
+                                                       <td><select id="box_padding_right_measurement" name="box_padding_right_measurement" disabled="disabled"></select></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td><label for="box_padding_bottom">{#style_dlg.bottom}</label></td>
+                               <td>
+                                       <table border="0" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td><input type="text" id="box_padding_bottom" name="box_padding_bottom" class="mceEditableSelect" disabled="disabled" /></td>
+                                                       <td>&nbsp;</td>
+                                                       <td><select id="box_padding_bottom_measurement" name="box_padding_bottom_measurement" disabled="disabled"></select></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td><label for="box_padding_left">{#style_dlg.left}</label></td>
+                               <td>
+                                       <table border="0" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td><input type="text" id="box_padding_left" name="box_padding_left" class="mceEditableSelect" disabled="disabled" /></td>
+                                                       <td>&nbsp;</td>
+                                                       <td><select id="box_padding_left_measurement" name="box_padding_left_measurement" disabled="disabled"></select></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+               </table>
+       </fieldset>
+</div>
+
+<div style="float: right; width: 49%">
+       <fieldset>
+               <legend>{#style_dlg.margin}</legend>
+
+               <table border="0">
+                       <tr>
+                               <td>&nbsp;</td>
+                               <td><input type="checkbox" id="box_margin_same" name="box_margin_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_margin');" /> <label for="box_margin_same">{#style_dlg.same}</label></td>
+                       </tr>
+                       <tr>
+                               <td><label for="box_margin_top">{#style_dlg.top}</label></td>
+                               <td>
+                                       <table border="0" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td><input type="text" id="box_margin_top" name="box_margin_top" class="mceEditableSelect" /></td>
+                                                       <td>&nbsp;</td>
+                                                       <td><select id="box_margin_top_measurement" name="box_margin_top_measurement"></select></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td><label for="box_margin_right">{#style_dlg.right}</label></td>
+                               <td>
+                                       <table border="0" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td><input type="text" id="box_margin_right" name="box_margin_right" class="mceEditableSelect" disabled="disabled" /></td>
+                                                       <td>&nbsp;</td>
+                                                       <td><select id="box_margin_right_measurement" name="box_margin_right_measurement" disabled="disabled"></select></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td><label for="box_margin_bottom">{#style_dlg.bottom}</label></td>
+                               <td>
+                                       <table border="0" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td><input type="text" id="box_margin_bottom" name="box_margin_bottom" class="mceEditableSelect" disabled="disabled" /></td>
+                                                       <td>&nbsp;</td>
+                                                       <td><select id="box_margin_bottom_measurement" name="box_margin_bottom_measurement" disabled="disabled"></select></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td><label for="box_margin_left">{#style_dlg.left}</label></td>
+                               <td>
+                                       <table border="0" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td><input type="text" id="box_margin_left" name="box_margin_left" class="mceEditableSelect" disabled="disabled" /></td>
+                                                       <td>&nbsp;</td>
+                                                       <td><select id="box_margin_left_measurement" name="box_margin_left_measurement" disabled="disabled"></select></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+               </table>
+       </fieldset>
+</div>
+<br style="clear: both" />
+</div>
+
+<div id="border_panel" class="panel">
+<table border="0" cellspacing="0" cellpadding="0" width="100%">
+<tr>
+       <td class="tdelim">&nbsp;</td>
+       <td class="tdelim delim">&nbsp;</td>
+       <td class="tdelim">{#style_dlg.style}</td>
+       <td class="tdelim delim">&nbsp;</td>
+       <td class="tdelim">{#style_dlg.width}</td>
+       <td class="tdelim delim">&nbsp;</td>
+       <td class="tdelim">{#style_dlg.color}</td>
+</tr>
+
+<tr>
+       <td>&nbsp;</td>
+       <td class="delim">&nbsp;</td>
+       <td><input type="checkbox" id="border_style_same" name="border_style_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_style');" /> <label for="border_style_same">{#style_dlg.same}</label></td>
+       <td class="delim">&nbsp;</td>
+       <td><input type="checkbox" id="border_width_same" name="border_width_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_width');" /> <label for="border_width_same">{#style_dlg.same}</label></td>
+       <td class="delim">&nbsp;</td>
+       <td><input type="checkbox" id="border_color_same" name="border_color_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_color');" /> <label for="border_color_same">{#style_dlg.same}</label></td>
+</tr>
+
+<tr>
+       <td>{#style_dlg.top}</td>
+       <td class="delim">&nbsp;</td>
+       <td><select id="border_style_top" name="border_style_top" class="mceEditableSelect"></select></td>
+       <td class="delim">&nbsp;</td>
+       <td>
+               <table border="0" cellspacing="0" cellpadding="0">
+                       <tr>
+                               <td><select id="border_width_top" name="border_width_top" class="mceEditableSelect"></select></td>
+                               <td>&nbsp;</td>
+                               <td><select id="border_width_top_measurement" name="border_width_top_measurement"></select></td>
+                       </tr>
+               </table>
+       </td>
+       <td class="delim">&nbsp;</td>
+       <td>
+               <table border="0" cellpadding="0" cellspacing="0">
+                       <tr>
+                               <td><input id="border_color_top" name="border_color_top" type="text" value="" size="9" onChange="updateColor('border_color_top_pick','border_color_top');" /></td>
+                               <td id="border_color_top_pickcontainer">&nbsp;</td>
+                       </tr>
+               </table>
+       </td>
+</tr>
+
+<tr>
+       <td>{#style_dlg.right}</td>
+       <td class="delim">&nbsp;</td>
+       <td><select id="border_style_right" name="border_style_right" class="mceEditableSelect" disabled="disabled"></select></td>
+       <td class="delim">&nbsp;</td>
+       <td>
+               <table border="0" cellspacing="0" cellpadding="0">
+                       <tr>
+                               <td><select id="border_width_right" name="border_width_right" class="mceEditableSelect" disabled="disabled"></select></td>
+                               <td>&nbsp;</td>
+                               <td><select id="border_width_right_measurement" name="border_width_right_measurement" disabled="disabled"></select></td>
+                       </tr>
+               </table>
+       </td>
+       <td class="delim">&nbsp;</td>
+       <td>
+               <table border="0" cellpadding="0" cellspacing="0">
+                       <tr>
+                               <td><input id="border_color_right" name="border_color_right" type="text" value="" size="9" onChange="updateColor('border_color_right_pick','border_color_right');" disabled="disabled" /></td>
+                               <td id="border_color_right_pickcontainer">&nbsp;</td>
+                       </tr>
+               </table>
+       </td>
+</tr>
+
+<tr>
+       <td>{#style_dlg.bottom}</td>
+       <td class="delim">&nbsp;</td>
+       <td><select id="border_style_bottom" name="border_style_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
+       <td class="delim">&nbsp;</td>
+       <td>
+               <table border="0" cellspacing="0" cellpadding="0">
+                       <tr>
+                               <td><select id="border_width_bottom" name="border_width_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
+                               <td>&nbsp;</td>
+                               <td><select id="border_width_bottom_measurement" name="border_width_bottom_measurement" disabled="disabled"></select></td>
+                       </tr>
+               </table>
+       </td>
+       <td class="delim">&nbsp;</td>
+       <td>
+               <table border="0" cellpadding="0" cellspacing="0">
+                       <tr>
+                               <td><input id="border_color_bottom" name="border_color_bottom" type="text" value="" size="9" onChange="updateColor('border_color_bottom_pick','border_color_bottom');" disabled="disabled" /></td>
+                               <td id="border_color_bottom_pickcontainer">&nbsp;</td>
+                       </tr>
+               </table>
+       </td>
+</tr>
+
+<tr>
+       <td>{#style_dlg.left}</td>
+       <td class="delim">&nbsp;</td>
+       <td><select id="border_style_left" name="border_style_left" class="mceEditableSelect" disabled="disabled"></select></td>
+       <td class="delim">&nbsp;</td>
+       <td>
+               <table border="0" cellspacing="0" cellpadding="0">
+                       <tr>
+                               <td><select id="border_width_left" name="border_width_left" class="mceEditableSelect" disabled="disabled"></select></td>
+                               <td>&nbsp;</td>
+                               <td><select id="border_width_left_measurement" name="border_width_left_measurement" disabled="disabled"></select></td>
+                       </tr>
+               </table>
+       </td>
+       <td class="delim">&nbsp;</td>
+       <td>
+               <table border="0" cellpadding="0" cellspacing="0">
+                       <tr>
+                               <td><input id="border_color_left" name="border_color_left" type="text" value="" size="9" onChange="updateColor('border_color_left_pick','border_color_left');" disabled="disabled" /></td>
+                               <td id="border_color_left_pickcontainer">&nbsp;</td>
+                       </tr>
+               </table>
+       </td>
+</tr>
+</table>
+</div>
+
+<div id="list_panel" class="panel">
+       <table border="0">
+               <tr>
+                       <td><label for="list_type">{#style_dlg.list_type}</label></td>
+                       <td><select id="list_type" name="list_type" class="mceEditableSelect"></select></td>
+               </tr>
+
+               <tr>
+                       <td><label for="list_bullet_image">{#style_dlg.bullet_image}</label></td>
+                       <td><input id="list_bullet_image" name="list_bullet_image" type="text" /></td>
+               </tr>
+
+               <tr>
+                       <td><label for="list_position">{#style_dlg.position}</label></td>
+                       <td><select id="list_position" name="list_position" class="mceEditableSelect"></select></td>
+               </tr>
+       </table>
+</div>
+
+<div id="positioning_panel" class="panel">
+<table border="0">
+       <tr>
+               <td><label for="positioning_type">{#style_dlg.positioning_type}</label></td>
+               <td><select id="positioning_type" name="positioning_type" class="mceEditableSelect"></select></td>
+               <td>&nbsp;&nbsp;&nbsp;<label for="positioning_visibility">{#style_dlg.visibility}</label></td>
+               <td><select id="positioning_visibility" name="positioning_visibility" class="mceEditableSelect"></select></td>
+       </tr>
+
+       <tr>
+               <td><label for="positioning_width">{#style_dlg.width}</label></td>
+               <td>
+                       <table border="0" cellspacing="0" cellpadding="0">
+                               <tr>
+                                       <td><input type="text" id="positioning_width" name="positioning_width" onChange="synch('positioning_width','box_width');" /></td>
+                                       <td>&nbsp;</td>
+                                       <td><select id="positioning_width_measurement" name="positioning_width_measurement"></select></td>
+                               </tr>
+                       </table>
+               </td>
+               <td>&nbsp;&nbsp;&nbsp;<label for="positioning_zindex">{#style_dlg.zindex}</label></td>
+               <td><input type="text" id="positioning_zindex" name="positioning_zindex" /></td>
+       </tr>
+
+       <tr>
+               <td><label for="positioning_height">{#style_dlg.height}</label></td>
+               <td>
+                       <table border="0" cellspacing="0" cellpadding="0">
+                               <tr>
+                                       <td><input type="text" id="positioning_height" name="positioning_height" onChange="synch('positioning_height','box_height');" /></td>
+                                       <td>&nbsp;</td>
+                                       <td><select id="positioning_height_measurement" name="positioning_height_measurement"></select></td>
+                               </tr>
+                       </table>
+               </td>
+               <td>&nbsp;&nbsp;&nbsp;<label for="positioning_overflow">{#style_dlg.overflow}</label></td>
+               <td><select id="positioning_overflow" name="positioning_overflow" class="mceEditableSelect"></select></td>
+       </tr>
+</table>
+
+<div style="float: left; width: 49%">
+       <fieldset>
+               <legend>{#style_dlg.placement}</legend>
+
+               <table border="0">
+                       <tr>
+                               <td>&nbsp;</td>
+                               <td><input type="checkbox" id="positioning_placement_same" name="positioning_placement_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_placement');" /> <label for="positioning_placement_same">{#style_dlg.same}</label></td>
+                       </tr>
+                       <tr>
+                               <td>{#style_dlg.top}</td>
+                               <td>
+                                       <table border="0" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td><input type="text" id="positioning_placement_top" name="positioning_placement_top" /></td>
+                                                       <td>&nbsp;</td>
+                                                       <td><select id="positioning_placement_top_measurement" name="positioning_placement_top_measurement"></select></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td>{#style_dlg.right}</td>
+                               <td>
+                                       <table border="0" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td><input type="text" id="positioning_placement_right" name="positioning_placement_right" disabled="disabled" /></td>
+                                                       <td>&nbsp;</td>
+                                                       <td><select id="positioning_placement_right_measurement" name="positioning_placement_right_measurement" disabled="disabled"></select></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td>{#style_dlg.bottom}</td>
+                               <td>
+                                       <table border="0" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td><input type="text" id="positioning_placement_bottom" name="positioning_placement_bottom" disabled="disabled" /></td>
+                                                       <td>&nbsp;</td>
+                                                       <td><select id="positioning_placement_bottom_measurement" name="positioning_placement_bottom_measurement" disabled="disabled"></select></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td>{#style_dlg.left}</td>
+                               <td>
+                                       <table border="0" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td><input type="text" id="positioning_placement_left" name="positioning_placement_left" disabled="disabled" /></td>
+                                                       <td>&nbsp;</td>
+                                                       <td><select id="positioning_placement_left_measurement" name="positioning_placement_left_measurement" disabled="disabled"></select></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+               </table>
+       </fieldset>
+</div>
+
+<div style="float: right; width: 49%">
+       <fieldset>
+               <legend>{#style_dlg.clip}</legend>
+
+               <table border="0">
+                       <tr>
+                               <td>&nbsp;</td>
+                               <td><input type="checkbox" id="positioning_clip_same" name="positioning_clip_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_clip');" /> <label for="positioning_clip_same">{#style_dlg.same}</label></td>
+                       </tr>
+                       <tr>
+                               <td>{#style_dlg.top}</td>
+                               <td>
+                                       <table border="0" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td><input type="text" id="positioning_clip_top" name="positioning_clip_top" /></td>
+                                                       <td>&nbsp;</td>
+                                                       <td><select id="positioning_clip_top_measurement" name="positioning_clip_top_measurement"></select></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td>{#style_dlg.right}</td>
+                               <td>
+                                       <table border="0" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td><input type="text" id="positioning_clip_right" name="positioning_clip_right" disabled="disabled" /></td>
+                                                       <td>&nbsp;</td>
+                                                       <td><select id="positioning_clip_right_measurement" name="positioning_clip_right_measurement" disabled="disabled"></select></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td>{#style_dlg.bottom}</td>
+                               <td>
+                                       <table border="0" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td><input type="text" id="positioning_clip_bottom" name="positioning_clip_bottom" disabled="disabled" /></td>
+                                                       <td>&nbsp;</td>
+                                                       <td><select id="positioning_clip_bottom_measurement" name="positioning_clip_bottom_measurement" disabled="disabled"></select></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td>{#style_dlg.left}</td>
+                               <td>
+                                       <table border="0" cellspacing="0" cellpadding="0">
+                                               <tr>
+                                                       <td><input type="text" id="positioning_clip_left" name="positioning_clip_left" disabled="disabled" /></td>
+                                                       <td>&nbsp;</td>
+                                                       <td><select id="positioning_clip_left_measurement" name="positioning_clip_left_measurement" disabled="disabled"></select></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+               </table>
+       </fieldset>
+</div>
+<br style="clear: both" />
+</div>
+</div>
+
+<div class="mceActionPanel">
+       <div style="float: left">
+               <input type="submit" id="insert" name="insert" value="{#update}" />
+               <input type="button" class="button" id="apply" name="apply" value="{#style_dlg.apply}" onClick="applyAction();" />
+       </div>
+
+       <input type="button" id="cancel" name="cancel" value="{#cancel}" onClick="tinyMCEPopup.close();" />
+</div>
+</form>
+
+<div style="display: none">
+       <div id="container"></div>
+</div>
+
+</body>
+</html>
diff --git a/docs/include/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js
new file mode 100644 (file)
index 0000000..27d2440
--- /dev/null
@@ -0,0 +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<n.length;m++){if(n[m].type!="hidden"){return n[m]}}}else{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
diff --git a/docs/include/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..c2be2f4
--- /dev/null
@@ -0,0 +1,112 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode;\r
+\r
+       tinymce.create('tinymce.plugins.TabFocusPlugin', {\r
+               init : function(ed, url) {\r
+                       function tabCancel(ed, e) {\r
+                               if (e.keyCode === 9)\r
+                                       return Event.cancel(e);\r
+                       };\r
+\r
+                       function tabHandler(ed, e) {\r
+                               var x, i, f, el, v;\r
+\r
+                               function find(d) {\r
+                                       f = DOM.getParent(ed.id, 'form');\r
+                                       el = f.elements;\r
+\r
+                                       if (f) {\r
+                                               each(el, function(e, i) {\r
+                                                       if (e.id == ed.id) {\r
+                                                               x = i;\r
+                                                               return false;\r
+                                                       }\r
+                                               });\r
+\r
+                                               if (d > 0) {\r
+                                                       for (i = x + 1; i < el.length; i++) {\r
+                                                               if (el[i].type != 'hidden')\r
+                                                                       return el[i];\r
+                                                       }\r
+                                               } else {\r
+                                                       for (i = x - 1; i >= 0; i--) {\r
+                                                               if (el[i].type != 'hidden')\r
+                                                                       return el[i];\r
+                                                       }\r
+                                               }\r
+                                       }\r
+\r
+                                       return null;\r
+                               };\r
+\r
+                               if (e.keyCode === 9) {\r
+                                       v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next')));\r
+\r
+                                       if (v.length == 1) {\r
+                                               v[1] = v[0];\r
+                                               v[0] = ':prev';\r
+                                       }\r
+\r
+                                       // Find element to focus\r
+                                       if (e.shiftKey) {\r
+                                               if (v[0] == ':prev')\r
+                                                       el = find(-1);\r
+                                               else\r
+                                                       el = DOM.get(v[0]);\r
+                                       } else {\r
+                                               if (v[1] == ':next')\r
+                                                       el = find(1);\r
+                                               else\r
+                                                       el = DOM.get(v[1]);\r
+                                       }\r
+\r
+                                       if (el) {\r
+                                               if (ed = tinymce.get(el.id || el.name))\r
+                                                       ed.focus();\r
+                                               else\r
+                                                       window.setTimeout(function() {window.focus();el.focus();}, 10);\r
+\r
+                                               return Event.cancel(e);\r
+                                       }\r
+                               }\r
+                       };\r
+\r
+                       ed.onKeyUp.add(tabCancel);\r
+\r
+                       if (tinymce.isGecko) {\r
+                               ed.onKeyPress.add(tabHandler);\r
+                               ed.onKeyDown.add(tabCancel);\r
+                       } else\r
+                               ed.onKeyDown.add(tabHandler);\r
+\r
+                       ed.onInit.add(function() {\r
+                               each(DOM.select('a:first,a:last', ed.getContainer()), function(n) {\r
+                                       Event.add(n, 'focus', function() {ed.focus();});\r
+                               });\r
+                       });\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Tabfocus',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/table/cell.htm b/docs/include/jscripts/tiny_mce/plugins/table/cell.htm
new file mode 100644 (file)
index 0000000..d243e1d
--- /dev/null
@@ -0,0 +1,178 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#table_dlg.cell_title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+       <script type="text/javascript" src="js/cell.js"></script>\r
+       <link href="css/cell.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body id="tablecell" style="display: none">\r
+       <form onsubmit="updateAction();return false;" action="#">\r
+               <div class="tabs">\r
+                       <ul>\r
+                               <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>\r
+                               <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>\r
+                       </ul>\r
+               </div>\r
+\r
+               <div class="panel_wrapper">\r
+                       <div id="general_panel" class="panel current">\r
+                               <fieldset>\r
+                                       <legend>{#table_dlg.general_props}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td><label for="align">{#table_dlg.align}</label></td>\r
+                                                       <td>\r
+                                                               <select id="align" name="align" class="mceFocus">\r
+                                                                       <option value="">{#not_set}</option>\r
+                                                                       <option value="center">{#table_dlg.align_middle}</option>\r
+                                                                       <option value="left">{#table_dlg.align_left}</option>\r
+                                                                       <option value="right">{#table_dlg.align_right}</option>\r
+                                                               </select>\r
+                                                       </td>\r
+               \r
+                                                       <td><label for="celltype">{#table_dlg.cell_type}</label></td>\r
+                                                       <td>\r
+                                                               <select id="celltype" name="celltype">\r
+                                                                       <option value="td">{#table_dlg.td}</option>\r
+                                                                       <option value="th">{#table_dlg.th}</option>\r
+                                                               </select>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="valign">{#table_dlg.valign}</label></td>\r
+                                                       <td>\r
+                                                               <select id="valign" name="valign">\r
+                                                                       <option value="">{#not_set}</option>\r
+                                                                       <option value="top">{#table_dlg.align_top}</option>\r
+                                                                       <option value="middle">{#table_dlg.align_middle}</option>\r
+                                                                       <option value="bottom">{#table_dlg.align_bottom}</option>\r
+                                                               </select>\r
+                                                       </td>\r
+\r
+                                                       <td><label for="scope">{#table_dlg.scope}</label></td>\r
+                                                       <td>\r
+                                                               <select id="scope" name="scope">\r
+                                                                       <option value="">{#not_set}</option>\r
+                                                                       <option value="col">{#table.col}</option>\r
+                                                                       <option value="row">{#table.row}</option>\r
+                                                                       <option value="rowgroup">{#table_dlg.rowgroup}</option>\r
+                                                                       <option value="colgroup">{#table_dlg.colgroup}</option>\r
+                                                               </select>\r
+                                                       </td>\r
+\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="width">{#table_dlg.width}</label></td>\r
+                                                       <td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>\r
+\r
+                                                       <td><label for="height">{#table_dlg.height}</label></td>\r
+                                                       <td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr id="styleSelectRow">\r
+                                                       <td><label for="class">{#class_name}</label></td>\r
+                                                       <td colspan="3">\r
+                                                               <select id="class" name="class" class="mceEditableSelect">\r
+                                                                       <option value="" selected="selected">{#not_set}</option>\r
+                                                               </select>\r
+                                                       </td>\r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+                       </div>\r
+\r
+                       <div id="advanced_panel" class="panel">\r
+                               <fieldset>\r
+                                       <legend>{#table_dlg.advanced_props}</legend>\r
+\r
+                                       <table border="0" cellpadding="0" cellspacing="4">\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="id">{#table_dlg.id}</label></td> \r
+                                                       <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="style">{#table_dlg.style}</label></td>\r
+                                                       <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> \r
+                                                       <td>\r
+                                                               <select id="dir" name="dir" style="width: 200px"> \r
+                                                                               <option value="">{#not_set}</option> \r
+                                                                               <option value="ltr">{#table_dlg.ltr}</option> \r
+                                                                               <option value="rtl">{#table_dlg.rtl}</option> \r
+                                                               </select>\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td> \r
+                                                       <td>\r
+                                                               <input id="lang" name="lang" type="text" value="" style="width: 200px" />\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> \r
+                                                       <td>\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>\r
+                                                                               <td id="backgroundimagebrowsercontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td> \r
+                                                       <td>\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>\r
+                                                                               <td id="bordercolor_pickcontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td> \r
+                                                       <td>\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>\r
+                                                                               <td id="bgcolor_pickcontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td> \r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+                       </div>\r
+               </div>\r
+\r
+               <div class="mceActionPanel">\r
+                       <div>\r
+                               <select id="action" name="action">\r
+                                       <option value="cell">{#table_dlg.cell_cell}</option>\r
+                                       <option value="row">{#table_dlg.cell_row}</option>\r
+                                       <option value="all">{#table_dlg.cell_all}</option>\r
+                               </select>\r
+                       </div>\r
+\r
+                       <input type="submit" id="insert" name="insert" value="{#update}" />\r
+                       <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+               </div>\r
+       </form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/table/css/cell.css b/docs/include/jscripts/tiny_mce/plugins/table/css/cell.css
new file mode 100644 (file)
index 0000000..a067ecd
--- /dev/null
@@ -0,0 +1,17 @@
+/* CSS file for cell dialog in the table plugin */\r
+\r
+.panel_wrapper div.current {\r
+       height: 200px;\r
+}\r
+\r
+.advfield {\r
+       width: 200px;\r
+}\r
+\r
+#action {\r
+       margin-bottom: 3px;\r
+}\r
+\r
+#class {\r
+       width: 150px;\r
+}
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/table/css/row.css b/docs/include/jscripts/tiny_mce/plugins/table/css/row.css
new file mode 100644 (file)
index 0000000..1f7755d
--- /dev/null
@@ -0,0 +1,25 @@
+/* CSS file for row dialog in the table plugin */\r
+\r
+.panel_wrapper div.current {\r
+       height: 200px;\r
+}\r
+\r
+.advfield {\r
+       width: 200px;\r
+}\r
+\r
+#action {\r
+       margin-bottom: 3px;\r
+}\r
+\r
+#rowtype,#align,#valign,#class,#height {\r
+       width: 150px;\r
+}\r
+\r
+#height {\r
+       width: 50px;    \r
+}\r
+\r
+.col2 {\r
+       padding-left: 20px;\r
+}\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/table/css/table.css b/docs/include/jscripts/tiny_mce/plugins/table/css/table.css
new file mode 100644 (file)
index 0000000..d11c3f6
--- /dev/null
@@ -0,0 +1,13 @@
+/* CSS file for table dialog in the table plugin */\r
+\r
+.panel_wrapper div.current {\r
+       height: 245px;\r
+}\r
+\r
+.advfield {\r
+       width: 200px;\r
+}\r
+\r
+#class {\r
+       width: 150px;\r
+}\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/table/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/table/editor_plugin.js
new file mode 100644 (file)
index 0000000..39f2c69
--- /dev/null
@@ -0,0 +1 @@
+(function(b){var c=b.each;function a(E,D,H){var e,I,A,n;r();n=D.getParent(H.getStart(),"th,td");if(n){I=C(n);A=F();n=v(I.x,I.y)}function r(){var J=0;e=[];c(["thead","tbody","tfoot"],function(K){var L=D.select(K+" tr",E);c(L,function(M,N){N+=J;c(D.select("td,th",M),function(T,O){var P,Q,R,S;if(e[N]){while(e[N][O]){O++}}R=g(T,"rowspan");S=g(T,"colspan");for(Q=N;Q<N+R;Q++){if(!e[Q]){e[Q]=[]}for(P=O;P<O+S;P++){e[Q][P]={part:K,real:Q==N&&P==O,elm:T,rowspan:R,colspan:S}}}})});J+=L.length})}function v(J,L){var K;K=e[L];if(K){return K[J]}}function g(K,J){return parseInt(K.getAttribute(J)||1)}function h(J){return D.hasClass(J.elm,"mceSelected")||J==n}function j(){var J=[];c(E.rows,function(K){c(K.cells,function(L){if(D.hasClass(L,"mceSelected")||L==n.elm){J.push(K);return false}})});return J}function q(){var J=D.createRng();J.setStartAfter(E);J.setEndAfter(E);H.setRng(J);D.remove(E)}function d(J){var K;b.walk(J,function(M){var L;if(M.nodeType==3){c(D.getParents(M.parentNode,null,J).reverse(),function(N){N=N.cloneNode(false);if(!K){K=L=N}else{if(L){L.appendChild(N)}}L=N});if(L){L.innerHTML=b.isIE?"&nbsp;":'<br _mce_bogus="1" />'}return false}},"childNodes");J=J.cloneNode(false);J.rowSpan=J.colSpan=1;if(K){J.appendChild(K)}else{if(!b.isIE){J.innerHTML='<br _mce_bogus="1" />'}}return J}function p(){var J=D.createRng();c(D.select("tr",E),function(K){if(K.cells.length==0){D.remove(K)}});if(D.select("tr",E).length==0){J.setStartAfter(E);J.setEndAfter(E);H.setRng(J);D.remove(E);return}c(D.select("thead,tbody,tfoot",E),function(K){if(K.rows.length==0){D.remove(K)}});r();row=e[Math.min(e.length-1,I.y)];if(row){H.select(row[Math.min(row.length-1,I.x)].elm,true);H.collapse(true)}}function s(P,N,R,O){var M,K,J,L,Q;M=e[N][P].elm.parentNode;for(J=1;J<=R;J++){M=D.getNext(M,"tr");if(M){for(K=P;K>=0;K--){Q=e[N+J][K].elm;if(Q.parentNode==M){for(L=1;L<=O;L++){D.insertAfter(d(Q),Q)}break}}if(K==-1){for(L=1;L<=O;L++){M.insertBefore(d(M.cells[0]),M.cells[0])}}}}}function z(){c(e,function(J,K){c(J,function(M,L){var P,O,Q,N;if(h(M)){M=M.elm;P=g(M,"colspan");O=g(M,"rowspan");if(P>1||O>1){M.colSpan=M.rowSpan=1;for(N=0;N<P-1;N++){D.insertAfter(d(M),M)}s(L,K,O-1,P)}}})})}function o(R,O,U){var M,L,T,S,Q,N,P,J,R,K;if(R){pos=C(R);M=pos.x;L=pos.y;T=M+(O-1);S=L+(U-1)}else{M=I.x;L=I.y;T=A.x;S=A.y}P=v(M,L);J=v(T,S);if(P&&J&&P.part==J.part){z();r();P=v(M,L).elm;P.colSpan=(T-M)+1;P.rowSpan=(S-L)+1;for(N=L;N<=S;N++){for(Q=M;Q<=T;Q++){R=e[N][Q].elm;if(R!=P){K=b.grep(R.childNodes);c(K,function(W,V){if(W.nodeName!="BR"||V!=K.length-1){P.appendChild(W)}});D.remove(R)}}}p()}}function k(M){var J,O,L,N,P,Q,K,R;c(e,function(S,T){c(S,function(V,U){if(h(V)){V=V.elm;P=V.parentNode;Q=P.cloneNode(false);J=T;if(M){return false}}});if(M){return !J}});for(N=0;N<e[0].length;N++){O=e[J][N].elm;if(O!=L){if(!M){rowSpan=g(O,"rowspan");if(rowSpan>1){O.rowSpan=rowSpan+1;continue}}else{if(J>0&&e[J-1][N]){R=e[J-1][N].elm;rowSpan=g(R,"rowspan");if(rowSpan>1){R.rowSpan=rowSpan+1;continue}}}K=d(O);K.colSpan=O.colSpan;Q.appendChild(K);L=O}}if(Q.hasChildNodes()){if(!M){D.insertAfter(Q,P)}else{P.parentNode.insertBefore(Q,P)}}}function f(K){var L,J;c(e,function(M,N){c(M,function(P,O){if(h(P)){L=O;if(K){return false}}});if(K){return !L}});c(e,function(P,Q){var M=P[L].elm,N,O;if(M!=J){O=g(M,"colspan");N=g(M,"rowspan");if(O==1){if(!K){D.insertAfter(d(M),M);s(L,Q,N-1,O)}else{M.parentNode.insertBefore(d(M),M);s(L,Q,N-1,O)}}else{M.colSpan++}J=M}})}function m(){var J=[];c(e,function(K,L){c(K,function(N,M){if(h(N)&&b.inArray(J,M)===-1){c(e,function(Q){var O=Q[M].elm,P;P=g(O,"colspan");if(P>1){O.colSpan=P-1}else{D.remove(O)}});J.push(M)}})});p()}function l(){var K;function J(N){var M,O,L;M=D.getNext(N,"tr");c(N.cells,function(P){var Q=g(P,"rowspan");if(Q>1){P.rowSpan=Q-1;O=C(P);s(O.x,O.y,1,1)}});O=C(N.cells[0]);c(e[O.y],function(P){var Q;P=P.elm;if(P!=L){Q=g(P,"rowspan");if(Q<=1){D.remove(P)}else{P.rowSpan=Q-1}L=P}})}K=j();c(K.reverse(),function(L){J(L)});p()}function B(){var J=j();D.remove(J);p();return J}function G(){var J=j();c(J,function(L,K){J[K]=L.cloneNode(true)});return J}function w(L,K){var M=j(),J=M[K?0:M.length-1],N=J.cells.length;c(e,function(P){var O;N=0;c(P,function(R,Q){if(R.real){N+=R.colspan}if(R.elm.parentNode==J){O=1}});if(O){return false}});if(!K){L.reverse()}c(L,function(Q){var P=Q.cells.length,O;for(i=0;i<P;i++){O=Q.cells[i];O.colSpan=O.rowSpan=1}for(i=P;i<N;i++){Q.appendChild(d(Q.cells[P-1]))}for(i=N;i<P;i++){D.remove(Q.cells[i])}if(K){J.parentNode.insertBefore(Q,J)}else{D.insertAfter(Q,J)}})}function C(J){var K;c(e,function(L,M){c(L,function(O,N){if(O.elm==J){K={x:N,y:M};return false}});return !K});return K}function u(J){I=C(J)}function F(){var L,K,J;K=J=0;c(e,function(M,N){c(M,function(P,O){var R,Q;if(h(P)){P=e[N][O];if(O>K){K=O}if(N>J){J=N}if(P.real){R=P.colspan-1;Q=P.rowspan-1;if(R){if(O+R>K){K=O+R}}if(Q){if(N+Q>J){J=N+Q}}}}})});return{x:K,y:J}}function t(P){var M,L,R,Q,K,J,N,O;A=C(P);if(I&&A){M=Math.min(I.x,A.x);L=Math.min(I.y,A.y);R=Math.max(I.x,A.x);Q=Math.max(I.y,A.y);K=R;J=Q;for(y=L;y<=J;y++){P=e[y][M];if(!P.real){if(M-(P.colspan-1)<M){M-=P.colspan-1}}}for(x=M;x<=K;x++){P=e[L][x];if(!P.real){if(L-(P.rowspan-1)<L){L-=P.rowspan-1}}}for(y=L;y<=Q;y++){for(x=M;x<=R;x++){P=e[y][x];if(P.real){N=P.colspan-1;O=P.rowspan-1;if(N){if(x+N>K){K=x+N}}if(O){if(y+O>J){J=y+O}}}}}D.removeClass(D.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=L;y<=J;y++){for(x=M;x<=K;x++){D.addClass(e[y][x].elm,"mceSelected")}}}}b.extend(this,{deleteTable:q,split:z,merge:o,insertRow:k,insertCol:f,deleteCols:m,deleteRows:l,cutRows:B,copyRows:G,pasteRows:w,getPos:C,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")){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,'<br mce_bogus="1" />')}}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
diff --git a/docs/include/jscripts/tiny_mce/plugins/table/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/table/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..2260f34
--- /dev/null
@@ -0,0 +1,1118 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function(tinymce) {\r
+       var each = tinymce.each;\r
+\r
+       /**\r
+        * Table Grid class.\r
+        */\r
+       function TableGrid(table, dom, selection) {\r
+               var grid, startPos, endPos, selectedCell;\r
+\r
+               buildGrid();\r
+               selectedCell = dom.getParent(selection.getStart(), 'th,td');\r
+               if (selectedCell) {\r
+                       startPos = getPos(selectedCell);\r
+                       endPos = findEndPos();\r
+                       selectedCell = getCell(startPos.x, startPos.y);\r
+               }\r
+\r
+               function buildGrid() {\r
+                       var startY = 0;\r
+\r
+                       grid = [];\r
+\r
+                       each(['thead', 'tbody', 'tfoot'], function(part) {\r
+                               var rows = dom.select(part + ' tr', table);\r
+\r
+                               each(rows, function(tr, y) {\r
+                                       y += startY;\r
+\r
+                                       each(dom.select('td,th', tr), function(td, x) {\r
+                                               var x2, y2, rowspan, colspan;\r
+\r
+                                               // Skip over existing cells produced by rowspan\r
+                                               if (grid[y]) {\r
+                                                       while (grid[y][x])\r
+                                                               x++;\r
+                                               }\r
+\r
+                                               // Get col/rowspan from cell\r
+                                               rowspan = getSpanVal(td, 'rowspan');\r
+                                               colspan = getSpanVal(td, 'colspan');\r
+\r
+                                               // Fill out rowspan/colspan right and down\r
+                                               for (y2 = y; y2 < y + rowspan; y2++) {\r
+                                                       if (!grid[y2])\r
+                                                               grid[y2] = [];\r
+\r
+                                                       for (x2 = x; x2 < x + colspan; x2++) {\r
+                                                               grid[y2][x2] = {\r
+                                                                       part : part,\r
+                                                                       real : y2 == y && x2 == x,\r
+                                                                       elm : td,\r
+                                                                       rowspan : rowspan,\r
+                                                                       colspan : colspan\r
+                                                               };\r
+                                                       }\r
+                                               }\r
+                                       });\r
+                               });\r
+\r
+                               startY += rows.length;\r
+                       });\r
+               };\r
+\r
+               function getCell(x, y) {\r
+                       var row;\r
+\r
+                       row = grid[y];\r
+                       if (row)\r
+                               return row[x];\r
+               };\r
+\r
+               function getSpanVal(td, name) {\r
+                       return parseInt(td.getAttribute(name) || 1);\r
+               };\r
+\r
+               function isCellSelected(cell) {\r
+                       return dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell;\r
+               };\r
+\r
+               function getSelectedRows() {\r
+                       var rows = [];\r
+\r
+                       each(table.rows, function(row) {\r
+                               each(row.cells, function(cell) {\r
+                                       if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) {\r
+                                               rows.push(row);\r
+                                               return false;\r
+                                       }\r
+                               });\r
+                       });\r
+\r
+                       return rows;\r
+               };\r
+\r
+               function deleteTable() {\r
+                       var rng = dom.createRng();\r
+\r
+                       rng.setStartAfter(table);\r
+                       rng.setEndAfter(table);\r
+\r
+                       selection.setRng(rng);\r
+\r
+                       dom.remove(table);\r
+               };\r
+\r
+               function cloneCell(cell) {\r
+                       var formatNode;\r
+\r
+                       // Clone formats\r
+                       tinymce.walk(cell, function(node) {\r
+                               var curNode;\r
+\r
+                               if (node.nodeType == 3) {\r
+                                       each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) {\r
+                                               node = node.cloneNode(false);\r
+\r
+                                               if (!formatNode)\r
+                                                       formatNode = curNode = node;\r
+                                               else if (curNode)\r
+                                                       curNode.appendChild(node);\r
+\r
+                                               curNode = node;\r
+                                       });\r
+\r
+                                       // Add something to the inner node\r
+                                       if (curNode)\r
+                                               curNode.innerHTML = tinymce.isIE ? '&nbsp;' : '<br _mce_bogus="1" />';\r
+\r
+                                       return false;\r
+                               }\r
+                       }, 'childNodes');\r
+\r
+                       cell = cell.cloneNode(false);\r
+                       cell.rowSpan = cell.colSpan = 1;\r
+\r
+                       if (formatNode) {\r
+                               cell.appendChild(formatNode);\r
+                       } else {\r
+                               if (!tinymce.isIE)\r
+                                       cell.innerHTML = '<br _mce_bogus="1" />';\r
+                       }\r
+\r
+                       return cell;\r
+               };\r
+\r
+               function cleanup() {\r
+                       var rng = dom.createRng();\r
+\r
+                       // Empty rows\r
+                       each(dom.select('tr', table), function(tr) {\r
+                               if (tr.cells.length == 0)\r
+                                       dom.remove(tr);\r
+                       });\r
+\r
+                       // Empty table\r
+                       if (dom.select('tr', table).length == 0) {\r
+                               rng.setStartAfter(table);\r
+                               rng.setEndAfter(table);\r
+                               selection.setRng(rng);\r
+                               dom.remove(table);\r
+                               return;\r
+                       }\r
+\r
+                       // Empty header/body/footer\r
+                       each(dom.select('thead,tbody,tfoot', table), function(part) {\r
+                               if (part.rows.length == 0)\r
+                                       dom.remove(part);\r
+                       });\r
+\r
+                       // Restore selection to start position if it still exists\r
+                       buildGrid();\r
+\r
+                       // Restore the selection to the closest table position\r
+                       row = grid[Math.min(grid.length - 1, startPos.y)];\r
+                       if (row) {\r
+                               selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true);\r
+                               selection.collapse(true);\r
+                       }\r
+               };\r
+\r
+               function fillLeftDown(x, y, rows, cols) {\r
+                       var tr, x2, r, c, cell;\r
+\r
+                       tr = grid[y][x].elm.parentNode;\r
+                       for (r = 1; r <= rows; r++) {\r
+                               tr = dom.getNext(tr, 'tr');\r
+\r
+                               if (tr) {\r
+                                       // Loop left to find real cell\r
+                                       for (x2 = x; x2 >= 0; x2--) {\r
+                                               cell = grid[y + r][x2].elm;\r
+\r
+                                               if (cell.parentNode == tr) {\r
+                                                       // Append clones after\r
+                                                       for (c = 1; c <= cols; c++)\r
+                                                               dom.insertAfter(cloneCell(cell), cell);\r
+\r
+                                                       break;\r
+                                               }\r
+                                       }\r
+\r
+                                       if (x2 == -1) {\r
+                                               // Insert nodes before first cell\r
+                                               for (c = 1; c <= cols; c++)\r
+                                                       tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]);\r
+                                       }\r
+                               }\r
+                       }\r
+               };\r
+\r
+               function split() {\r
+                       each(grid, function(row, y) {\r
+                               each(row, function(cell, x) {\r
+                                       var colSpan, rowSpan, newCell, i;\r
+\r
+                                       if (isCellSelected(cell)) {\r
+                                               cell = cell.elm;\r
+                                               colSpan = getSpanVal(cell, 'colspan');\r
+                                               rowSpan = getSpanVal(cell, 'rowspan');\r
+\r
+                                               if (colSpan > 1 || rowSpan > 1) {\r
+                                                       cell.colSpan = cell.rowSpan = 1;\r
+\r
+                                                       // Insert cells right\r
+                                                       for (i = 0; i < colSpan - 1; i++)\r
+                                                               dom.insertAfter(cloneCell(cell), cell);\r
+\r
+                                                       fillLeftDown(x, y, rowSpan - 1, colSpan);\r
+                                               }\r
+                                       }\r
+                               });\r
+                       });\r
+               };\r
+\r
+               function merge(cell, cols, rows) {\r
+                       var startX, startY, endX, endY, x, y, startCell, endCell, cell, children;\r
+\r
+                       // Use specified cell and cols/rows\r
+                       if (cell) {\r
+                               pos = getPos(cell);\r
+                               startX = pos.x;\r
+                               startY = pos.y;\r
+                               endX = startX + (cols - 1);\r
+                               endY = startY + (rows - 1);\r
+                       } else {\r
+                               // Use selection\r
+                               startX = startPos.x;\r
+                               startY = startPos.y;\r
+                               endX = endPos.x;\r
+                               endY = endPos.y;\r
+                       }\r
+\r
+                       // Find start/end cells\r
+                       startCell = getCell(startX, startY);\r
+                       endCell = getCell(endX, endY);\r
+\r
+                       // Check if the cells exists and if they are of the same part for example tbody = tbody\r
+                       if (startCell && endCell && startCell.part == endCell.part) {\r
+                               // Split and rebuild grid\r
+                               split();\r
+                               buildGrid();\r
+\r
+                               // Set row/col span to start cell\r
+                               startCell = getCell(startX, startY).elm;\r
+                               startCell.colSpan = (endX - startX) + 1;\r
+                               startCell.rowSpan = (endY - startY) + 1;\r
+\r
+                               // Remove other cells and add it's contents to the start cell\r
+                               for (y = startY; y <= endY; y++) {\r
+                                       for (x = startX; x <= endX; x++) {\r
+                                               cell = grid[y][x].elm;\r
+\r
+                                               if (cell != startCell) {\r
+                                                       // Move children to startCell\r
+                                                       children = tinymce.grep(cell.childNodes);\r
+                                                       each(children, function(node, i) {\r
+                                                               // Jump over last BR element\r
+                                                               if (node.nodeName != 'BR' || i != children.length - 1)\r
+                                                                       startCell.appendChild(node);\r
+                                                       });\r
+\r
+                                                       // Remove cell\r
+                                                       dom.remove(cell);\r
+                                               }\r
+                                       }\r
+                               }\r
+\r
+                               // Remove empty rows etc and restore caret location\r
+                               cleanup();\r
+                       }\r
+               };\r
+\r
+               function insertRow(before) {\r
+                       var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell;\r
+\r
+                       // Find first/last row\r
+                       each(grid, function(row, y) {\r
+                               each(row, function(cell, x) {\r
+                                       if (isCellSelected(cell)) {\r
+                                               cell = cell.elm;\r
+                                               rowElm = cell.parentNode;\r
+                                               newRow = rowElm.cloneNode(false);\r
+                                               posY = y;\r
+\r
+                                               if (before)\r
+                                                       return false;\r
+                                       }\r
+                               });\r
+\r
+                               if (before)\r
+                                       return !posY;\r
+                       });\r
+\r
+                       for (x = 0; x < grid[0].length; x++) {\r
+                               cell = grid[posY][x].elm;\r
+\r
+                               if (cell != lastCell) {\r
+                                       if (!before) {\r
+                                               rowSpan = getSpanVal(cell, 'rowspan');\r
+                                               if (rowSpan > 1) {\r
+                                                       cell.rowSpan = rowSpan + 1;\r
+                                                       continue;\r
+                                               }\r
+                                       } else {\r
+                                               // Check if cell above can be expanded\r
+                                               if (posY > 0 && grid[posY - 1][x]) {\r
+                                                       otherCell = grid[posY - 1][x].elm;\r
+                                                       rowSpan = getSpanVal(otherCell, 'rowspan');\r
+                                                       if (rowSpan > 1) {\r
+                                                               otherCell.rowSpan = rowSpan + 1;\r
+                                                               continue;\r
+                                                       }\r
+                                               }\r
+                                       }\r
+\r
+                                       // Insert new cell into new row\r
+                                       newCell = cloneCell(cell)\r
+                                       newCell.colSpan = cell.colSpan;\r
+                                       newRow.appendChild(newCell);\r
+\r
+                                       lastCell = cell;\r
+                               }\r
+                       }\r
+\r
+                       if (newRow.hasChildNodes()) {\r
+                               if (!before)\r
+                                       dom.insertAfter(newRow, rowElm);\r
+                               else\r
+                                       rowElm.parentNode.insertBefore(newRow, rowElm);\r
+                       }\r
+               };\r
+\r
+               function insertCol(before) {\r
+                       var posX, lastCell;\r
+\r
+                       // Find first/last column\r
+                       each(grid, function(row, y) {\r
+                               each(row, function(cell, x) {\r
+                                       if (isCellSelected(cell)) {\r
+                                               posX = x;\r
+\r
+                                               if (before)\r
+                                                       return false;\r
+                                       }\r
+                               });\r
+\r
+                               if (before)\r
+                                       return !posX;\r
+                       });\r
+\r
+                       each(grid, function(row, y) {\r
+                               var cell = row[posX].elm, rowSpan, colSpan;\r
+\r
+                               if (cell != lastCell) {\r
+                                       colSpan = getSpanVal(cell, 'colspan');\r
+                                       rowSpan = getSpanVal(cell, 'rowspan');\r
+\r
+                                       if (colSpan == 1) {\r
+                                               if (!before) {\r
+                                                       dom.insertAfter(cloneCell(cell), cell);\r
+                                                       fillLeftDown(posX, y, rowSpan - 1, colSpan);\r
+                                               } else {\r
+                                                       cell.parentNode.insertBefore(cloneCell(cell), cell);\r
+                                                       fillLeftDown(posX, y, rowSpan - 1, colSpan);\r
+                                               }\r
+                                       } else\r
+                                               cell.colSpan++;\r
+\r
+                                       lastCell = cell;\r
+                               }\r
+                       });\r
+               };\r
+\r
+               function deleteCols() {\r
+                       var cols = [];\r
+\r
+                       // Get selected column indexes\r
+                       each(grid, function(row, y) {\r
+                               each(row, function(cell, x) {\r
+                                       if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) {\r
+                                               each(grid, function(row) {\r
+                                                       var cell = row[x].elm, colSpan;\r
+\r
+                                                       colSpan = getSpanVal(cell, 'colspan');\r
+\r
+                                                       if (colSpan > 1)\r
+                                                               cell.colSpan = colSpan - 1;\r
+                                                       else\r
+                                                               dom.remove(cell);\r
+                                               });\r
+\r
+                                               cols.push(x);\r
+                                       }\r
+                               });\r
+                       });\r
+\r
+                       cleanup();\r
+               };\r
+\r
+               function deleteRows() {\r
+                       var rows;\r
+\r
+                       function deleteRow(tr) {\r
+                               var nextTr, pos, lastCell;\r
+\r
+                               nextTr = dom.getNext(tr, 'tr');\r
+\r
+                               // Move down row spanned cells\r
+                               each(tr.cells, function(cell) {\r
+                                       var rowSpan = getSpanVal(cell, 'rowspan');\r
+\r
+                                       if (rowSpan > 1) {\r
+                                               cell.rowSpan = rowSpan - 1;\r
+                                               pos = getPos(cell);\r
+                                               fillLeftDown(pos.x, pos.y, 1, 1);\r
+                                       }\r
+                               });\r
+\r
+                               // Delete cells\r
+                               pos = getPos(tr.cells[0]);\r
+                               each(grid[pos.y], function(cell) {\r
+                                       var rowSpan;\r
+\r
+                                       cell = cell.elm;\r
+\r
+                                       if (cell != lastCell) {\r
+                                               rowSpan = getSpanVal(cell, 'rowspan');\r
+\r
+                                               if (rowSpan <= 1)\r
+                                                       dom.remove(cell);\r
+                                               else\r
+                                                       cell.rowSpan = rowSpan - 1;\r
+\r
+                                               lastCell = cell;\r
+                                       }\r
+                               });\r
+                       };\r
+\r
+                       // Get selected rows and move selection out of scope\r
+                       rows = getSelectedRows();\r
+\r
+                       // Delete all selected rows\r
+                       each(rows.reverse(), function(tr) {\r
+                               deleteRow(tr);\r
+                       });\r
+\r
+                       cleanup();\r
+               };\r
+\r
+               function cutRows() {\r
+                       var rows = getSelectedRows();\r
+\r
+                       dom.remove(rows);\r
+                       cleanup();\r
+\r
+                       return rows;\r
+               };\r
+\r
+               function copyRows() {\r
+                       var rows = getSelectedRows();\r
+\r
+                       each(rows, function(row, i) {\r
+                               rows[i] = row.cloneNode(true);\r
+                       });\r
+\r
+                       return rows;\r
+               };\r
+\r
+               function pasteRows(rows, before) {\r
+                       var selectedRows = getSelectedRows(),\r
+                               targetRow = selectedRows[before ? 0 : selectedRows.length - 1],\r
+                               targetCellCount = targetRow.cells.length;\r
+\r
+                       // Calc target cell count\r
+                       each(grid, function(row) {\r
+                               var match;\r
+\r
+                               targetCellCount = 0;\r
+                               each(row, function(cell, x) {\r
+                                       if (cell.real)\r
+                                               targetCellCount += cell.colspan;\r
+\r
+                                       if (cell.elm.parentNode == targetRow)\r
+                                               match = 1;\r
+                               });\r
+\r
+                               if (match)\r
+                                       return false;\r
+                       });\r
+\r
+                       if (!before)\r
+                               rows.reverse();\r
+\r
+                       each(rows, function(row) {\r
+                               var cellCount = row.cells.length, cell;\r
+\r
+                               // Remove col/rowspans\r
+                               for (i = 0; i < cellCount; i++) {\r
+                                       cell = row.cells[i];\r
+                                       cell.colSpan = cell.rowSpan = 1;\r
+                               }\r
+\r
+                               // Needs more cells\r
+                               for (i = cellCount; i < targetCellCount; i++)\r
+                                       row.appendChild(cloneCell(row.cells[cellCount - 1]));\r
+\r
+                               // Needs less cells\r
+                               for (i = targetCellCount; i < cellCount; i++)\r
+                                       dom.remove(row.cells[i]);\r
+\r
+                               // Add before/after\r
+                               if (before)\r
+                                       targetRow.parentNode.insertBefore(row, targetRow);\r
+                               else\r
+                                       dom.insertAfter(row, targetRow);\r
+                       });\r
+               };\r
+\r
+               function getPos(target) {\r
+                       var pos;\r
+\r
+                       each(grid, function(row, y) {\r
+                               each(row, function(cell, x) {\r
+                                       if (cell.elm == target) {\r
+                                               pos = {x : x, y : y};\r
+                                               return false;\r
+                                       }\r
+                               });\r
+\r
+                               return !pos;\r
+                       });\r
+\r
+                       return pos;\r
+               };\r
+\r
+               function setStartCell(cell) {\r
+                       startPos = getPos(cell);\r
+               };\r
+\r
+               function findEndPos() {\r
+                       var pos, maxX, maxY;\r
+\r
+                       maxX = maxY = 0;\r
+\r
+                       each(grid, function(row, y) {\r
+                               each(row, function(cell, x) {\r
+                                       var colSpan, rowSpan;\r
+\r
+                                       if (isCellSelected(cell)) {\r
+                                               cell = grid[y][x];\r
+\r
+                                               if (x > maxX)\r
+                                                       maxX = x;\r
+\r
+                                               if (y > maxY)\r
+                                                       maxY = y;\r
+\r
+                                               if (cell.real) {\r
+                                                       colSpan = cell.colspan - 1;\r
+                                                       rowSpan = cell.rowspan - 1;\r
+\r
+                                                       if (colSpan) {\r
+                                                               if (x + colSpan > maxX)\r
+                                                                       maxX = x + colSpan;\r
+                                                       }\r
+\r
+                                                       if (rowSpan) {\r
+                                                               if (y + rowSpan > maxY)\r
+                                                                       maxY = y + rowSpan;\r
+                                                       }\r
+                                               }\r
+                                       }\r
+                               });\r
+                       });\r
+\r
+                       return {x : maxX, y : maxY};\r
+               };\r
+\r
+               function setEndCell(cell) {\r
+                       var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan;\r
+\r
+                       endPos = getPos(cell);\r
+\r
+                       if (startPos && endPos) {\r
+                               // Get start/end positions\r
+                               startX = Math.min(startPos.x, endPos.x);\r
+                               startY = Math.min(startPos.y, endPos.y);\r
+                               endX = Math.max(startPos.x, endPos.x);\r
+                               endY = Math.max(startPos.y, endPos.y);\r
+\r
+                               // Expand end positon to include spans\r
+                               maxX = endX;\r
+                               maxY = endY;\r
+\r
+                               // Expand startX\r
+                               for (y = startY; y <= maxY; y++) {\r
+                                       cell = grid[y][startX];\r
+\r
+                                       if (!cell.real) {\r
+                                               if (startX - (cell.colspan - 1) < startX)\r
+                                                       startX -= cell.colspan - 1;\r
+                                       }\r
+                               }\r
+\r
+                               // Expand startY\r
+                               for (x = startX; x <= maxX; x++) {\r
+                                       cell = grid[startY][x];\r
+\r
+                                       if (!cell.real) {\r
+                                               if (startY - (cell.rowspan - 1) < startY)\r
+                                                       startY -= cell.rowspan - 1;\r
+                                       }\r
+                               }\r
+\r
+                               // Find max X, Y\r
+                               for (y = startY; y <= endY; y++) {\r
+                                       for (x = startX; x <= endX; x++) {\r
+                                               cell = grid[y][x];\r
+\r
+                                               if (cell.real) {\r
+                                                       colSpan = cell.colspan - 1;\r
+                                                       rowSpan = cell.rowspan - 1;\r
+\r
+                                                       if (colSpan) {\r
+                                                               if (x + colSpan > maxX)\r
+                                                                       maxX = x + colSpan;\r
+                                                       }\r
+\r
+                                                       if (rowSpan) {\r
+                                                               if (y + rowSpan > maxY)\r
+                                                                       maxY = y + rowSpan;\r
+                                                       }\r
+                                               }\r
+                                       }\r
+                               }\r
+\r
+                               // Remove current selection\r
+                               dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');\r
+\r
+                               // Add new selection\r
+                               for (y = startY; y <= maxY; y++) {\r
+                                       for (x = startX; x <= maxX; x++)\r
+                                               dom.addClass(grid[y][x].elm, 'mceSelected');\r
+                               }\r
+                       }\r
+               };\r
+\r
+               // Expose to public\r
+               tinymce.extend(this, {\r
+                       deleteTable : deleteTable,\r
+                       split : split,\r
+                       merge : merge,\r
+                       insertRow : insertRow,\r
+                       insertCol : insertCol,\r
+                       deleteCols : deleteCols,\r
+                       deleteRows : deleteRows,\r
+                       cutRows : cutRows,\r
+                       copyRows : copyRows,\r
+                       pasteRows : pasteRows,\r
+                       getPos : getPos,\r
+                       setStartCell : setStartCell,\r
+                       setEndCell : setEndCell\r
+               });\r
+       };\r
+\r
+       tinymce.create('tinymce.plugins.TablePlugin', {\r
+               init : function(ed, url) {\r
+                       var winMan, clipboardRows;\r
+\r
+                       function createTableGrid(node) {\r
+                               var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table');\r
+\r
+                               if (tblElm)\r
+                                       return new TableGrid(tblElm, ed.dom, selection);\r
+                       };\r
+\r
+                       function cleanup() {\r
+                               // Restore selection possibilities\r
+                               ed.getBody().style.webkitUserSelect = '';\r
+                               ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');\r
+                       };\r
+\r
+                       // Register buttons\r
+                       each([\r
+                               ['table', 'table.desc', 'mceInsertTable', true],\r
+                               ['delete_table', 'table.del', 'mceTableDelete'],\r
+                               ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'],\r
+                               ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'],\r
+                               ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'],\r
+                               ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'],\r
+                               ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'],\r
+                               ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'],\r
+                               ['row_props', 'table.row_desc', 'mceTableRowProps', true],\r
+                               ['cell_props', 'table.cell_desc', 'mceTableCellProps', true],\r
+                               ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true],\r
+                               ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true]\r
+                       ], function(c) {\r
+                               ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]});\r
+                       });\r
+\r
+                       // Select whole table is a table border is clicked\r
+                       if (!tinymce.isIE) {\r
+                               ed.onClick.add(function(ed, e) {\r
+                                       e = e.target;\r
+\r
+                                       if (e.nodeName === 'TABLE')\r
+                                               ed.selection.select(e);\r
+                               });\r
+                       }\r
+\r
+                       // Handle node change updates\r
+                       ed.onNodeChange.add(function(ed, cm, n) {\r
+                               var p;\r
+\r
+                               n = ed.selection.getStart();\r
+                               p = ed.dom.getParent(n, 'td,th,caption');\r
+                               cm.setActive('table', n.nodeName === 'TABLE' || !!p);\r
+\r
+                               // Disable table tools if we are in caption\r
+                               if (p && p.nodeName === 'CAPTION')\r
+                                       p = 0;\r
+\r
+                               cm.setDisabled('delete_table', !p);\r
+                               cm.setDisabled('delete_col', !p);\r
+                               cm.setDisabled('delete_table', !p);\r
+                               cm.setDisabled('delete_row', !p);\r
+                               cm.setDisabled('col_after', !p);\r
+                               cm.setDisabled('col_before', !p);\r
+                               cm.setDisabled('row_after', !p);\r
+                               cm.setDisabled('row_before', !p);\r
+                               cm.setDisabled('row_props', !p);\r
+                               cm.setDisabled('cell_props', !p);\r
+                               cm.setDisabled('split_cells', !p);\r
+                               cm.setDisabled('merge_cells', !p);\r
+                       });\r
+\r
+                       ed.onInit.add(function(ed) {\r
+                               var startTable, startCell, dom = ed.dom, tableGrid;\r
+\r
+                               winMan = ed.windowManager;\r
+\r
+                               // Add cell selection logic\r
+                               ed.onMouseDown.add(function(ed, e) {\r
+                                       if (e.button != 2) {\r
+                                               cleanup();\r
+\r
+                                               startCell = dom.getParent(e.target, 'td,th');\r
+                                               startTable = dom.getParent(startCell, 'table');\r
+                                       }\r
+                               });\r
+\r
+                               dom.bind(ed.getDoc(), 'mouseover', function(e) {\r
+                                       var sel, table, target = e.target;\r
+\r
+                                       if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) {\r
+                                               table = dom.getParent(target, 'table');\r
+                                               if (table == startTable) {\r
+                                                       if (!tableGrid) {\r
+                                                               tableGrid = createTableGrid(table);\r
+                                                               tableGrid.setStartCell(startCell);\r
+\r
+                                                               ed.getBody().style.webkitUserSelect = 'none';\r
+                                                       }\r
+\r
+                                                       tableGrid.setEndCell(target);\r
+                                               }\r
+\r
+                                               // Remove current selection\r
+                                               sel = ed.selection.getSel();\r
+\r
+                                               if (sel.removeAllRanges)\r
+                                                       sel.removeAllRanges();\r
+                                               else\r
+                                                       sel.empty();\r
+\r
+                                               e.preventDefault();\r
+                                       }\r
+                               });\r
+\r
+                               ed.onMouseUp.add(function(ed, e) {\r
+                                       var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode;\r
+\r
+                                       // Move selection to startCell\r
+                                       if (startCell) {\r
+                                               if (tableGrid)\r
+                                                       ed.getBody().style.webkitUserSelect = '';\r
+\r
+                                               function setPoint(node, start) {\r
+                                                       var walker = new tinymce.dom.TreeWalker(node, node);\r
+\r
+                                                       do {\r
+                                                               // Text node\r
+                                                               if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) {\r
+                                                                       if (start)\r
+                                                                               rng.setStart(node, 0);\r
+                                                                       else\r
+                                                                               rng.setEnd(node, node.nodeValue.length);\r
+\r
+                                                                       return;\r
+                                                               }\r
+\r
+                                                               // BR element\r
+                                                               if (node.nodeName == 'BR') {\r
+                                                                       if (start)\r
+                                                                               rng.setStartBefore(node);\r
+                                                                       else\r
+                                                                               rng.setEndBefore(node);\r
+\r
+                                                                       return;\r
+                                                               }\r
+                                                       } while (node = (start ? walker.next() : walker.prev()));\r
+                                               };\r
+\r
+                                               // Try to expand text selection as much as we can only Gecko supports cell selection\r
+                                               selectedCells = dom.select('td.mceSelected,th.mceSelected');\r
+                                               if (selectedCells.length > 0) {\r
+                                                       rng = dom.createRng();\r
+                                                       node = selectedCells[0];\r
+                                                       endNode = selectedCells[selectedCells.length - 1];\r
+\r
+                                                       setPoint(node, 1);\r
+                                                       walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table'));\r
+\r
+                                                       do {\r
+                                                               if (node.nodeName == 'TD' || node.nodeName == 'TH') {\r
+                                                                       if (!dom.hasClass(node, 'mceSelected'))\r
+                                                                               break;\r
+\r
+                                                                       lastNode = node;\r
+                                                               }\r
+                                                       } while (node = walker.next());\r
+\r
+                                                       setPoint(lastNode);\r
+\r
+                                                       sel.setRng(rng);\r
+                                               }\r
+\r
+                                               ed.nodeChanged();\r
+                                               startCell = tableGrid = startTable = null;\r
+                                       }\r
+                               });\r
+\r
+                               ed.onKeyUp.add(function(ed, e) {\r
+                                       cleanup();\r
+                               });\r
+\r
+                               // Add context menu\r
+                               if (ed && ed.plugins.contextmenu) {\r
+                                       ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {\r
+                                               var sm, se = ed.selection, el = se.getNode() || ed.getBody();\r
+\r
+                                               if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th')) {\r
+                                                       m.removeAll();\r
+\r
+                                                       if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) {\r
+                                                               m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});\r
+                                                               m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});\r
+                                                               m.addSeparator();\r
+                                                       }\r
+\r
+                                                       if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) {\r
+                                                               m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});\r
+                                                               m.addSeparator();\r
+                                                       }\r
+\r
+                                                       m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}});\r
+                                                       m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'});\r
+                                                       m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'});\r
+                                                       m.addSeparator();\r
+\r
+                                                       // Cell menu\r
+                                                       sm = m.addMenu({title : 'table.cell'});\r
+                                                       sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'});\r
+                                                       sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'});\r
+                                                       sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'});\r
+\r
+                                                       // Row menu\r
+                                                       sm = m.addMenu({title : 'table.row'});\r
+                                                       sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'});\r
+                                                       sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'});\r
+                                                       sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'});\r
+                                                       sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'});\r
+                                                       sm.addSeparator();\r
+                                                       sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'});\r
+                                                       sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'});\r
+                                                       sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows);\r
+                                                       sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows);\r
+\r
+                                                       // Column menu\r
+                                                       sm = m.addMenu({title : 'table.col'});\r
+                                                       sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'});\r
+                                                       sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'});\r
+                                                       sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'});\r
+                                               } else\r
+                                                       m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'});\r
+                                       });\r
+                               }\r
+\r
+                               // Fixes an issue on Gecko where it's impossible to place the caret behind a table\r
+                               // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled\r
+                               if (!tinymce.isIE) {\r
+                                       function fixTableCaretPos() {\r
+                                               var last;\r
+\r
+                                               // Skip empty text nodes form the end\r
+                                               for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;\r
+\r
+                                               if (last && last.nodeName == 'TABLE')\r
+                                                       ed.dom.add(ed.getBody(), 'p', null, '<br mce_bogus="1" />');\r
+                                       };\r
+\r
+                                       // Fixes an bug where it's impossible to place the caret before a table in Gecko\r
+                                       // this fix solves it by detecting when the caret is at the beginning of such a table\r
+                                       // and then manually moves the caret infront of the table\r
+                                       if (tinymce.isGecko) {\r
+                                               ed.onKeyDown.add(function(ed, e) {\r
+                                                       var rng, table, dom = ed.dom;\r
+\r
+                                                       // On gecko it's not possible to place the caret before a table\r
+                                                       if (e.keyCode == 37 || e.keyCode == 38) {\r
+                                                               rng = ed.selection.getRng();\r
+                                                               table = dom.getParent(rng.startContainer, 'table');\r
+\r
+                                                               if (table && ed.getBody().firstChild == table) {\r
+                                                                       if (isAtStart(rng, table)) {\r
+                                                                               rng = dom.createRng();\r
+\r
+                                                                               rng.setStartBefore(table);\r
+                                                                               rng.setEndBefore(table);\r
+\r
+                                                                               ed.selection.setRng(rng);\r
+\r
+                                                                               e.preventDefault();\r
+                                                                       }\r
+                                                               }\r
+                                                       }\r
+                                               });\r
+                                       }\r
+\r
+                                       ed.onKeyUp.add(fixTableCaretPos);\r
+                                       ed.onSetContent.add(fixTableCaretPos);\r
+                                       ed.onVisualAid.add(fixTableCaretPos);\r
+\r
+                                       ed.onPreProcess.add(function(ed, o) {\r
+                                               var last = o.node.lastChild;\r
+\r
+                                               if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR')\r
+                                                       ed.dom.remove(last);\r
+                                       });\r
+\r
+                                       fixTableCaretPos();\r
+                               }\r
+                       });\r
+\r
+                       // Register action commands\r
+                       each({\r
+                               mceTableSplitCells : function(grid) {\r
+                                       grid.split();\r
+                               },\r
+\r
+                               mceTableMergeCells : function(grid) {\r
+                                       var rowSpan, colSpan, cell;\r
+\r
+                                       cell = ed.dom.getParent(ed.selection.getNode(), 'th,td');\r
+                                       if (cell) {\r
+                                               rowSpan = cell.rowSpan;\r
+                                               colSpan = cell.colSpan;\r
+                                       }\r
+\r
+                                       if (!ed.dom.select('td.mceSelected,th.mceSelected').length) {\r
+                                               winMan.open({\r
+                                                       url : url + '/merge_cells.htm',\r
+                                                       width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)),\r
+                                                       height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)),\r
+                                                       inline : 1\r
+                                               }, {\r
+                                                       rows : rowSpan,\r
+                                                       cols : colSpan,\r
+                                                       onaction : function(data) {\r
+                                                               grid.merge(cell, data.cols, data.rows);\r
+                                                       },\r
+                                                       plugin_url : url\r
+                                               });\r
+                                       } else\r
+                                               grid.merge();\r
+                               },\r
+\r
+                               mceTableInsertRowBefore : function(grid) {\r
+                                       grid.insertRow(true);\r
+                               },\r
+\r
+                               mceTableInsertRowAfter : function(grid) {\r
+                                       grid.insertRow();\r
+                               },\r
+\r
+                               mceTableInsertColBefore : function(grid) {\r
+                                       grid.insertCol(true);\r
+                               },\r
+\r
+                               mceTableInsertColAfter : function(grid) {\r
+                                       grid.insertCol();\r
+                               },\r
+\r
+                               mceTableDeleteCol : function(grid) {\r
+                                       grid.deleteCols();\r
+                               },\r
+\r
+                               mceTableDeleteRow : function(grid) {\r
+                                       grid.deleteRows();\r
+                               },\r
+\r
+                               mceTableCutRow : function(grid) {\r
+                                       clipboardRows = grid.cutRows();\r
+                               },\r
+\r
+                               mceTableCopyRow : function(grid) {\r
+                                       clipboardRows = grid.copyRows();\r
+                               },\r
+\r
+                               mceTablePasteRowBefore : function(grid) {\r
+                                       grid.pasteRows(clipboardRows, true);\r
+                               },\r
+\r
+                               mceTablePasteRowAfter : function(grid) {\r
+                                       grid.pasteRows(clipboardRows);\r
+                               },\r
+\r
+                               mceTableDelete : function(grid) {\r
+                                       grid.deleteTable();\r
+                               }\r
+                       }, function(func, name) {\r
+                               ed.addCommand(name, function() {\r
+                                       var grid = createTableGrid();\r
+\r
+                                       if (grid) {\r
+                                               func(grid);\r
+                                               ed.execCommand('mceRepaint');\r
+                                               cleanup();\r
+                                       }\r
+                               });\r
+                       });\r
+\r
+                       // Register dialog commands\r
+                       each({\r
+                               mceInsertTable : function(val) {\r
+                                       winMan.open({\r
+                                               url : url + '/table.htm',\r
+                                               width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)),\r
+                                               height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)),\r
+                                               inline : 1\r
+                                       }, {\r
+                                               plugin_url : url,\r
+                                               action : val ? val.action : 0\r
+                                       });\r
+                               },\r
+\r
+                               mceTableRowProps : function() {\r
+                                       winMan.open({\r
+                                               url : url + '/row.htm',\r
+                                               width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)),\r
+                                               height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)),\r
+                                               inline : 1\r
+                                       }, {\r
+                                               plugin_url : url\r
+                                       });\r
+                               },\r
+\r
+                               mceTableCellProps : function() {\r
+                                       winMan.open({\r
+                                               url : url + '/cell.htm',\r
+                                               width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)),\r
+                                               height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)),\r
+                                               inline : 1\r
+                                       }, {\r
+                                               plugin_url : url\r
+                                       });\r
+                               }\r
+                       }, function(func, name) {\r
+                               ed.addCommand(name, function(ui, val) {\r
+                                       func(val);\r
+                               });\r
+                       });\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin);\r
+})(tinymce);
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/table/js/cell.js b/docs/include/jscripts/tiny_mce/plugins/table/js/cell.js
new file mode 100644 (file)
index 0000000..f246191
--- /dev/null
@@ -0,0 +1,286 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+var ed;\r
+\r
+function init() {\r
+       ed = tinyMCEPopup.editor;\r
+       tinyMCEPopup.resizeToInnerSize();\r
+\r
+       document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');\r
+       document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');\r
+       document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')\r
+\r
+       var inst = ed;\r
+       var tdElm = ed.dom.getParent(ed.selection.getStart(), "td,th");\r
+       var formObj = document.forms[0];\r
+       var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style"));\r
+\r
+       // Get table cell data\r
+       var celltype = tdElm.nodeName.toLowerCase();\r
+       var align = ed.dom.getAttrib(tdElm, 'align');\r
+       var valign = ed.dom.getAttrib(tdElm, 'valign');\r
+       var width = trimSize(getStyle(tdElm, 'width', 'width'));\r
+       var height = trimSize(getStyle(tdElm, 'height', 'height'));\r
+       var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));\r
+       var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor'));\r
+       var className = ed.dom.getAttrib(tdElm, 'class');\r
+       var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;\r
+       var id = ed.dom.getAttrib(tdElm, 'id');\r
+       var lang = ed.dom.getAttrib(tdElm, 'lang');\r
+       var dir = ed.dom.getAttrib(tdElm, 'dir');\r
+       var scope = ed.dom.getAttrib(tdElm, 'scope');\r
+\r
+       // Setup form\r
+       addClassesToList('class', 'table_cell_styles');\r
+       TinyMCE_EditableSelects.init();\r
+\r
+       if (!ed.dom.hasClass(tdElm, 'mceSelected')) {\r
+               formObj.bordercolor.value = bordercolor;\r
+               formObj.bgcolor.value = bgcolor;\r
+               formObj.backgroundimage.value = backgroundimage;\r
+               formObj.width.value = width;\r
+               formObj.height.value = height;\r
+               formObj.id.value = id;\r
+               formObj.lang.value = lang;\r
+               formObj.style.value = ed.dom.serializeStyle(st);\r
+               selectByValue(formObj, 'align', align);\r
+               selectByValue(formObj, 'valign', valign);\r
+               selectByValue(formObj, 'class', className, true, true);\r
+               selectByValue(formObj, 'celltype', celltype);\r
+               selectByValue(formObj, 'dir', dir);\r
+               selectByValue(formObj, 'scope', scope);\r
+\r
+               // Resize some elements\r
+               if (isVisible('backgroundimagebrowser'))\r
+                       document.getElementById('backgroundimage').style.width = '180px';\r
+\r
+               updateColor('bordercolor_pick', 'bordercolor');\r
+               updateColor('bgcolor_pick', 'bgcolor');\r
+       } else\r
+               tinyMCEPopup.dom.hide('action');\r
+}\r
+\r
+function updateAction() {\r
+       var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0];\r
+\r
+       tinyMCEPopup.restoreSelection();\r
+       el = ed.selection.getStart();\r
+       tdElm = ed.dom.getParent(el, "td,th");\r
+       trElm = ed.dom.getParent(el, "tr");\r
+       tableElm = ed.dom.getParent(el, "table");\r
+\r
+       // Cell is selected\r
+       if (ed.dom.hasClass(tdElm, 'mceSelected')) {\r
+               // Update all selected sells\r
+               tinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'), function(td) {\r
+                       updateCell(td);\r
+               });\r
+\r
+               ed.addVisual();\r
+               ed.nodeChanged();\r
+               inst.execCommand('mceEndUndoLevel');\r
+               tinyMCEPopup.close();\r
+               return;\r
+       }\r
+\r
+       ed.execCommand('mceBeginUndoLevel');\r
+\r
+       switch (getSelectValue(formObj, 'action')) {\r
+               case "cell":\r
+                       var celltype = getSelectValue(formObj, 'celltype');\r
+                       var scope = getSelectValue(formObj, 'scope');\r
+\r
+                       function doUpdate(s) {\r
+                               if (s) {\r
+                                       updateCell(tdElm);\r
+\r
+                                       ed.addVisual();\r
+                                       ed.nodeChanged();\r
+                                       inst.execCommand('mceEndUndoLevel');\r
+                                       tinyMCEPopup.close();\r
+                               }\r
+                       };\r
+\r
+                       if (ed.getParam("accessibility_warnings", 1)) {\r
+                               if (celltype == "th" && scope == "")\r
+                                       tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate);\r
+                               else\r
+                                       doUpdate(1);\r
+\r
+                               return;\r
+                       }\r
+\r
+                       updateCell(tdElm);\r
+                       break;\r
+\r
+               case "row":\r
+                       var cell = trElm.firstChild;\r
+\r
+                       if (cell.nodeName != "TD" && cell.nodeName != "TH")\r
+                               cell = nextCell(cell);\r
+\r
+                       do {\r
+                               cell = updateCell(cell, true);\r
+                       } while ((cell = nextCell(cell)) != null);\r
+\r
+                       break;\r
+\r
+               case "all":\r
+                       var rows = tableElm.getElementsByTagName("tr");\r
+\r
+                       for (var i=0; i<rows.length; i++) {\r
+                               var cell = rows[i].firstChild;\r
+\r
+                               if (cell.nodeName != "TD" && cell.nodeName != "TH")\r
+                                       cell = nextCell(cell);\r
+\r
+                               do {\r
+                                       cell = updateCell(cell, true);\r
+                               } while ((cell = nextCell(cell)) != null);\r
+                       }\r
+\r
+                       break;\r
+       }\r
+\r
+       ed.addVisual();\r
+       ed.nodeChanged();\r
+       inst.execCommand('mceEndUndoLevel');\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function nextCell(elm) {\r
+       while ((elm = elm.nextSibling) != null) {\r
+               if (elm.nodeName == "TD" || elm.nodeName == "TH")\r
+                       return elm;\r
+       }\r
+\r
+       return null;\r
+}\r
+\r
+function updateCell(td, skip_id) {\r
+       var inst = ed;\r
+       var formObj = document.forms[0];\r
+       var curCellType = td.nodeName.toLowerCase();\r
+       var celltype = getSelectValue(formObj, 'celltype');\r
+       var doc = inst.getDoc();\r
+       var dom = ed.dom;\r
+\r
+       if (!skip_id)\r
+               td.setAttribute('id', formObj.id.value);\r
+\r
+       td.setAttribute('align', formObj.align.value);\r
+       td.setAttribute('vAlign', formObj.valign.value);\r
+       td.setAttribute('lang', formObj.lang.value);\r
+       td.setAttribute('dir', getSelectValue(formObj, 'dir'));\r
+       td.setAttribute('style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value)));\r
+       td.setAttribute('scope', formObj.scope.value);\r
+       ed.dom.setAttrib(td, 'class', getSelectValue(formObj, 'class'));\r
+\r
+       // Clear deprecated attributes\r
+       ed.dom.setAttrib(td, 'width', '');\r
+       ed.dom.setAttrib(td, 'height', '');\r
+       ed.dom.setAttrib(td, 'bgColor', '');\r
+       ed.dom.setAttrib(td, 'borderColor', '');\r
+       ed.dom.setAttrib(td, 'background', '');\r
+\r
+       // Set styles\r
+       td.style.width = getCSSSize(formObj.width.value);\r
+       td.style.height = getCSSSize(formObj.height.value);\r
+       if (formObj.bordercolor.value != "") {\r
+               td.style.borderColor = formObj.bordercolor.value;\r
+               td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle;\r
+               td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth;\r
+       } else\r
+               td.style.borderColor = '';\r
+\r
+       td.style.backgroundColor = formObj.bgcolor.value;\r
+\r
+       if (formObj.backgroundimage.value != "")\r
+               td.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";\r
+       else\r
+               td.style.backgroundImage = '';\r
+\r
+       if (curCellType != celltype) {\r
+               // changing to a different node type\r
+               var newCell = doc.createElement(celltype);\r
+\r
+               for (var c=0; c<td.childNodes.length; c++)\r
+                       newCell.appendChild(td.childNodes[c].cloneNode(1));\r
+\r
+               for (var a=0; a<td.attributes.length; a++)\r
+                       ed.dom.setAttrib(newCell, td.attributes[a].name, ed.dom.getAttrib(td, td.attributes[a].name));\r
+\r
+               td.parentNode.replaceChild(newCell, td);\r
+               td = newCell;\r
+       }\r
+\r
+       dom.setAttrib(td, 'style', dom.serializeStyle(dom.parseStyle(td.style.cssText)));\r
+\r
+       return td;\r
+}\r
+\r
+function changedBackgroundImage() {\r
+       var formObj = document.forms[0];\r
+       var st = ed.dom.parseStyle(formObj.style.value);\r
+\r
+       st['background-image'] = "url('" + formObj.backgroundimage.value + "')";\r
+\r
+       formObj.style.value = ed.dom.serializeStyle(st);\r
+}\r
+\r
+function changedSize() {\r
+       var formObj = document.forms[0];\r
+       var st = ed.dom.parseStyle(formObj.style.value);\r
+\r
+       var width = formObj.width.value;\r
+       if (width != "")\r
+               st['width'] = getCSSSize(width);\r
+       else\r
+               st['width'] = "";\r
+\r
+       var height = formObj.height.value;\r
+       if (height != "")\r
+               st['height'] = getCSSSize(height);\r
+       else\r
+               st['height'] = "";\r
+\r
+       formObj.style.value = ed.dom.serializeStyle(st);\r
+}\r
+\r
+function changedColor() {\r
+       var formObj = document.forms[0];\r
+       var st = ed.dom.parseStyle(formObj.style.value);\r
+\r
+       st['background-color'] = formObj.bgcolor.value;\r
+       st['border-color'] = formObj.bordercolor.value;\r
+\r
+       formObj.style.value = ed.dom.serializeStyle(st);\r
+}\r
+\r
+function changedStyle() {\r
+       var formObj = document.forms[0];\r
+       var st = ed.dom.parseStyle(formObj.style.value);\r
+\r
+       if (st['background-image'])\r
+               formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");\r
+       else\r
+               formObj.backgroundimage.value = '';\r
+\r
+       if (st['width'])\r
+               formObj.width.value = trimSize(st['width']);\r
+\r
+       if (st['height'])\r
+               formObj.height.value = trimSize(st['height']);\r
+\r
+       if (st['background-color']) {\r
+               formObj.bgcolor.value = st['background-color'];\r
+               updateColor('bgcolor_pick','bgcolor');\r
+       }\r
+\r
+       if (st['border-color']) {\r
+               formObj.bordercolor.value = st['border-color'];\r
+               updateColor('bordercolor_pick','bordercolor');\r
+       }\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/table/js/merge_cells.js b/docs/include/jscripts/tiny_mce/plugins/table/js/merge_cells.js
new file mode 100644 (file)
index 0000000..7ee4bf0
--- /dev/null
@@ -0,0 +1,27 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+var MergeCellsDialog = {\r
+       init : function() {\r
+               var f = document.forms[0];\r
+\r
+               f.numcols.value = tinyMCEPopup.getWindowArg('cols', 1);\r
+               f.numrows.value = tinyMCEPopup.getWindowArg('rows', 1);\r
+       },\r
+\r
+       merge : function() {\r
+               var func, f = document.forms[0];\r
+\r
+               tinyMCEPopup.restoreSelection();\r
+\r
+               func = tinyMCEPopup.getWindowArg('onaction');\r
+\r
+               func({\r
+                       cols : f.numcols.value,\r
+                       rows : f.numrows.value\r
+               });\r
+\r
+               tinyMCEPopup.close();\r
+       }\r
+};\r
+\r
+tinyMCEPopup.onInit.add(MergeCellsDialog.init, MergeCellsDialog);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/table/js/row.js b/docs/include/jscripts/tiny_mce/plugins/table/js/row.js
new file mode 100644 (file)
index 0000000..7e188c3
--- /dev/null
@@ -0,0 +1,237 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+function init() {\r
+       tinyMCEPopup.resizeToInnerSize();\r
+\r
+       document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');\r
+       document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');\r
+\r
+       var inst = tinyMCEPopup.editor;\r
+       var dom = inst.dom;\r
+       var trElm = dom.getParent(inst.selection.getStart(), "tr");\r
+       var formObj = document.forms[0];\r
+       var st = dom.parseStyle(dom.getAttrib(trElm, "style"));\r
+\r
+       // Get table row data\r
+       var rowtype = trElm.parentNode.nodeName.toLowerCase();\r
+       var align = dom.getAttrib(trElm, 'align');\r
+       var valign = dom.getAttrib(trElm, 'valign');\r
+       var height = trimSize(getStyle(trElm, 'height', 'height'));\r
+       var className = dom.getAttrib(trElm, 'class');\r
+       var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));\r
+       var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;\r
+       var id = dom.getAttrib(trElm, 'id');\r
+       var lang = dom.getAttrib(trElm, 'lang');\r
+       var dir = dom.getAttrib(trElm, 'dir');\r
+\r
+       selectByValue(formObj, 'rowtype', rowtype);\r
+\r
+       // Any cells selected\r
+       if (dom.select('td.mceSelected,th.mceSelected', trElm).length == 0) {\r
+               // Setup form\r
+               addClassesToList('class', 'table_row_styles');\r
+               TinyMCE_EditableSelects.init();\r
+\r
+               formObj.bgcolor.value = bgcolor;\r
+               formObj.backgroundimage.value = backgroundimage;\r
+               formObj.height.value = height;\r
+               formObj.id.value = id;\r
+               formObj.lang.value = lang;\r
+               formObj.style.value = dom.serializeStyle(st);\r
+               selectByValue(formObj, 'align', align);\r
+               selectByValue(formObj, 'valign', valign);\r
+               selectByValue(formObj, 'class', className, true, true);\r
+               selectByValue(formObj, 'dir', dir);\r
+\r
+               // Resize some elements\r
+               if (isVisible('backgroundimagebrowser'))\r
+                       document.getElementById('backgroundimage').style.width = '180px';\r
+\r
+               updateColor('bgcolor_pick', 'bgcolor');\r
+       } else\r
+               tinyMCEPopup.dom.hide('action');\r
+}\r
+\r
+function updateAction() {\r
+       var inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0];\r
+       var action = getSelectValue(formObj, 'action');\r
+\r
+       tinyMCEPopup.restoreSelection();\r
+       trElm = dom.getParent(inst.selection.getStart(), "tr");\r
+       tableElm = dom.getParent(inst.selection.getStart(), "table");\r
+\r
+       // Update all selected rows\r
+       if (dom.select('td.mceSelected,th.mceSelected', trElm).length > 0) {\r
+               tinymce.each(tableElm.rows, function(tr) {\r
+                       var i;\r
+\r
+                       for (i = 0; i < tr.cells.length; i++) {\r
+                               if (dom.hasClass(tr.cells[i], 'mceSelected')) {\r
+                                       updateRow(tr, true);\r
+                                       return;\r
+                               }\r
+                       }\r
+               });\r
+\r
+               inst.addVisual();\r
+               inst.nodeChanged();\r
+               inst.execCommand('mceEndUndoLevel');\r
+               tinyMCEPopup.close();\r
+               return;\r
+       }\r
+\r
+       inst.execCommand('mceBeginUndoLevel');\r
+\r
+       switch (action) {\r
+               case "row":\r
+                       updateRow(trElm);\r
+                       break;\r
+\r
+               case "all":\r
+                       var rows = tableElm.getElementsByTagName("tr");\r
+\r
+                       for (var i=0; i<rows.length; i++)\r
+                               updateRow(rows[i], true);\r
+\r
+                       break;\r
+\r
+               case "odd":\r
+               case "even":\r
+                       var rows = tableElm.getElementsByTagName("tr");\r
+\r
+                       for (var i=0; i<rows.length; i++) {\r
+                               if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even"))\r
+                                       updateRow(rows[i], true, true);\r
+                       }\r
+\r
+                       break;\r
+       }\r
+\r
+       inst.addVisual();\r
+       inst.nodeChanged();\r
+       inst.execCommand('mceEndUndoLevel');\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function updateRow(tr_elm, skip_id, skip_parent) {\r
+       var inst = tinyMCEPopup.editor;\r
+       var formObj = document.forms[0];\r
+       var dom = inst.dom;\r
+       var curRowType = tr_elm.parentNode.nodeName.toLowerCase();\r
+       var rowtype = getSelectValue(formObj, 'rowtype');\r
+       var doc = inst.getDoc();\r
+\r
+       // Update row element\r
+       if (!skip_id)\r
+               tr_elm.setAttribute('id', formObj.id.value);\r
+\r
+       tr_elm.setAttribute('align', getSelectValue(formObj, 'align'));\r
+       tr_elm.setAttribute('vAlign', getSelectValue(formObj, 'valign'));\r
+       tr_elm.setAttribute('lang', formObj.lang.value);\r
+       tr_elm.setAttribute('dir', getSelectValue(formObj, 'dir'));\r
+       tr_elm.setAttribute('style', dom.serializeStyle(dom.parseStyle(formObj.style.value)));\r
+       dom.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));\r
+\r
+       // Clear deprecated attributes\r
+       tr_elm.setAttribute('background', '');\r
+       tr_elm.setAttribute('bgColor', '');\r
+       tr_elm.setAttribute('height', '');\r
+\r
+       // Set styles\r
+       tr_elm.style.height = getCSSSize(formObj.height.value);\r
+       tr_elm.style.backgroundColor = formObj.bgcolor.value;\r
+\r
+       if (formObj.backgroundimage.value != "")\r
+               tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";\r
+       else\r
+               tr_elm.style.backgroundImage = '';\r
+\r
+       // Setup new rowtype\r
+       if (curRowType != rowtype && !skip_parent) {\r
+               // first, clone the node we are working on\r
+               var newRow = tr_elm.cloneNode(1);\r
+\r
+               // next, find the parent of its new destination (creating it if necessary)\r
+               var theTable = dom.getParent(tr_elm, "table");\r
+               var dest = rowtype;\r
+               var newParent = null;\r
+               for (var i = 0; i < theTable.childNodes.length; i++) {\r
+                       if (theTable.childNodes[i].nodeName.toLowerCase() == dest)\r
+                               newParent = theTable.childNodes[i];\r
+               }\r
+\r
+               if (newParent == null) {\r
+                       newParent = doc.createElement(dest);\r
+\r
+                       if (dest == "thead") {\r
+                               if (theTable.firstChild.nodeName == 'CAPTION')\r
+                                       inst.dom.insertAfter(newParent, theTable.firstChild);\r
+                               else\r
+                                       theTable.insertBefore(newParent, theTable.firstChild);\r
+                       } else\r
+                               theTable.appendChild(newParent);\r
+               }\r
+\r
+               // append the row to the new parent\r
+               newParent.appendChild(newRow);\r
+\r
+               // remove the original\r
+               tr_elm.parentNode.removeChild(tr_elm);\r
+\r
+               // set tr_elm to the new node\r
+               tr_elm = newRow;\r
+       }\r
+\r
+       dom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(tr_elm.style.cssText)));\r
+}\r
+\r
+function changedBackgroundImage() {\r
+       var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\r
+       var st = dom.parseStyle(formObj.style.value);\r
+\r
+       st['background-image'] = "url('" + formObj.backgroundimage.value + "')";\r
+\r
+       formObj.style.value = dom.serializeStyle(st);\r
+}\r
+\r
+function changedStyle() {\r
+       var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\r
+       var st = dom.parseStyle(formObj.style.value);\r
+\r
+       if (st['background-image'])\r
+               formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");\r
+       else\r
+               formObj.backgroundimage.value = '';\r
+\r
+       if (st['height'])\r
+               formObj.height.value = trimSize(st['height']);\r
+\r
+       if (st['background-color']) {\r
+               formObj.bgcolor.value = st['background-color'];\r
+               updateColor('bgcolor_pick','bgcolor');\r
+       }\r
+}\r
+\r
+function changedSize() {\r
+       var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\r
+       var st = dom.parseStyle(formObj.style.value);\r
+\r
+       var height = formObj.height.value;\r
+       if (height != "")\r
+               st['height'] = getCSSSize(height);\r
+       else\r
+               st['height'] = "";\r
+\r
+       formObj.style.value = dom.serializeStyle(st);\r
+}\r
+\r
+function changedColor() {\r
+       var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\r
+       var st = dom.parseStyle(formObj.style.value);\r
+\r
+       st['background-color'] = formObj.bgcolor.value;\r
+\r
+       formObj.style.value = dom.serializeStyle(st);\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/table/js/table.js b/docs/include/jscripts/tiny_mce/plugins/table/js/table.js
new file mode 100644 (file)
index 0000000..f4b0862
--- /dev/null
@@ -0,0 +1,449 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+var action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom;\r
+\r
+function insertTable() {\r
+       var formObj = document.forms[0];\r
+       var inst = tinyMCEPopup.editor, dom = inst.dom;\r
+       var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules;\r
+       var html = '', capEl, elm;\r
+       var cellLimit, rowLimit, colLimit;\r
+\r
+       tinyMCEPopup.restoreSelection();\r
+\r
+       if (!AutoValidator.validate(formObj)) {\r
+               tinyMCEPopup.alert(inst.getLang('invalid_data'));\r
+               return false;\r
+       }\r
+\r
+       elm = dom.getParent(inst.selection.getNode(), 'table');\r
+\r
+       // Get form data\r
+       cols = formObj.elements['cols'].value;\r
+       rows = formObj.elements['rows'].value;\r
+       border = formObj.elements['border'].value != "" ? formObj.elements['border'].value  : 0;\r
+       cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";\r
+       cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";\r
+       align = getSelectValue(formObj, "align");\r
+       frame = getSelectValue(formObj, "tframe");\r
+       rules = getSelectValue(formObj, "rules");\r
+       width = formObj.elements['width'].value;\r
+       height = formObj.elements['height'].value;\r
+       bordercolor = formObj.elements['bordercolor'].value;\r
+       bgcolor = formObj.elements['bgcolor'].value;\r
+       className = getSelectValue(formObj, "class");\r
+       id = formObj.elements['id'].value;\r
+       summary = formObj.elements['summary'].value;\r
+       style = formObj.elements['style'].value;\r
+       dir = formObj.elements['dir'].value;\r
+       lang = formObj.elements['lang'].value;\r
+       background = formObj.elements['backgroundimage'].value;\r
+       caption = formObj.elements['caption'].checked;\r
+\r
+       cellLimit = tinyMCEPopup.getParam('table_cell_limit', false);\r
+       rowLimit = tinyMCEPopup.getParam('table_row_limit', false);\r
+       colLimit = tinyMCEPopup.getParam('table_col_limit', false);\r
+\r
+       // Validate table size\r
+       if (colLimit && cols > colLimit) {\r
+               tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit));\r
+               return false;\r
+       } else if (rowLimit && rows > rowLimit) {\r
+               tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit));\r
+               return false;\r
+       } else if (cellLimit && cols * rows > cellLimit) {\r
+               tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit));\r
+               return false;\r
+       }\r
+\r
+       // Update table\r
+       if (action == "update") {\r
+               inst.execCommand('mceBeginUndoLevel');\r
+\r
+               dom.setAttrib(elm, 'cellPadding', cellpadding, true);\r
+               dom.setAttrib(elm, 'cellSpacing', cellspacing, true);\r
+               dom.setAttrib(elm, 'border', border);\r
+               dom.setAttrib(elm, 'align', align);\r
+               dom.setAttrib(elm, 'frame', frame);\r
+               dom.setAttrib(elm, 'rules', rules);\r
+               dom.setAttrib(elm, 'class', className);\r
+               dom.setAttrib(elm, 'style', style);\r
+               dom.setAttrib(elm, 'id', id);\r
+               dom.setAttrib(elm, 'summary', summary);\r
+               dom.setAttrib(elm, 'dir', dir);\r
+               dom.setAttrib(elm, 'lang', lang);\r
+\r
+               capEl = inst.dom.select('caption', elm)[0];\r
+\r
+               if (capEl && !caption)\r
+                       capEl.parentNode.removeChild(capEl);\r
+\r
+               if (!capEl && caption) {\r
+                       capEl = elm.ownerDocument.createElement('caption');\r
+\r
+                       if (!tinymce.isIE)\r
+                               capEl.innerHTML = '<br _mce_bogus="1"/>';\r
+\r
+                       elm.insertBefore(capEl, elm.firstChild);\r
+               }\r
+\r
+               if (width && inst.settings.inline_styles) {\r
+                       dom.setStyle(elm, 'width', width);\r
+                       dom.setAttrib(elm, 'width', '');\r
+               } else {\r
+                       dom.setAttrib(elm, 'width', width, true);\r
+                       dom.setStyle(elm, 'width', '');\r
+               }\r
+\r
+               // Remove these since they are not valid XHTML\r
+               dom.setAttrib(elm, 'borderColor', '');\r
+               dom.setAttrib(elm, 'bgColor', '');\r
+               dom.setAttrib(elm, 'background', '');\r
+\r
+               if (height && inst.settings.inline_styles) {\r
+                       dom.setStyle(elm, 'height', height);\r
+                       dom.setAttrib(elm, 'height', '');\r
+               } else {\r
+                       dom.setAttrib(elm, 'height', height, true);\r
+                       dom.setStyle(elm, 'height', '');\r
+               }\r
+\r
+               if (background != '')\r
+                       elm.style.backgroundImage = "url('" + background + "')";\r
+               else\r
+                       elm.style.backgroundImage = '';\r
+\r
+/*             if (tinyMCEPopup.getParam("inline_styles")) {\r
+                       if (width != '')\r
+                               elm.style.width = getCSSSize(width);\r
+               }*/\r
+\r
+               if (bordercolor != "") {\r
+                       elm.style.borderColor = bordercolor;\r
+                       elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;\r
+                       elm.style.borderWidth = border == "" ? "1px" : border;\r
+               } else\r
+                       elm.style.borderColor = '';\r
+\r
+               elm.style.backgroundColor = bgcolor;\r
+               elm.style.height = getCSSSize(height);\r
+\r
+               inst.addVisual();\r
+\r
+               // Fix for stange MSIE align bug\r
+               //elm.outerHTML = elm.outerHTML;\r
+\r
+               inst.nodeChanged();\r
+               inst.execCommand('mceEndUndoLevel');\r
+\r
+               // Repaint if dimensions changed\r
+               if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight)\r
+                       inst.execCommand('mceRepaint');\r
+\r
+               tinyMCEPopup.close();\r
+               return true;\r
+       }\r
+\r
+       // Create new table\r
+       html += '<table';\r
+\r
+       html += makeAttrib('id', id);\r
+       html += makeAttrib('border', border);\r
+       html += makeAttrib('cellpadding', cellpadding);\r
+       html += makeAttrib('cellspacing', cellspacing);\r
+       html += makeAttrib('_mce_new', '1');\r
+\r
+       if (width && inst.settings.inline_styles) {\r
+               if (style)\r
+                       style += '; ';\r
+\r
+               // Force px\r
+               if (/^[0-9\.]+$/.test(width))\r
+                       width += 'px';\r
+\r
+               style += 'width: ' + width;\r
+       } else\r
+               html += makeAttrib('width', width);\r
+\r
+/*     if (height) {\r
+               if (style)\r
+                       style += '; ';\r
+\r
+               style += 'height: ' + height;\r
+       }*/\r
+\r
+       //html += makeAttrib('height', height);\r
+       //html += makeAttrib('bordercolor', bordercolor);\r
+       //html += makeAttrib('bgcolor', bgcolor);\r
+       html += makeAttrib('align', align);\r
+       html += makeAttrib('frame', frame);\r
+       html += makeAttrib('rules', rules);\r
+       html += makeAttrib('class', className);\r
+       html += makeAttrib('style', style);\r
+       html += makeAttrib('summary', summary);\r
+       html += makeAttrib('dir', dir);\r
+       html += makeAttrib('lang', lang);\r
+       html += '>';\r
+\r
+       if (caption) {\r
+               if (!tinymce.isIE)\r
+                       html += '<caption><br _mce_bogus="1"/></caption>';\r
+               else\r
+                       html += '<caption></caption>';\r
+       }\r
+\r
+       for (var y=0; y<rows; y++) {\r
+               html += "<tr>";\r
+\r
+               for (var x=0; x<cols; x++) {\r
+                       if (!tinymce.isIE)\r
+                               html += '<td><br _mce_bogus="1"/></td>';\r
+                       else\r
+                               html += '<td></td>';\r
+               }\r
+\r
+               html += "</tr>";\r
+       }\r
+\r
+       html += "</table>";\r
+\r
+       inst.execCommand('mceBeginUndoLevel');\r
+\r
+       // Move table\r
+       if (inst.settings.fix_table_elements) {\r
+               var patt = '';\r
+\r
+               inst.focus();\r
+               inst.selection.setContent('<br class="_mce_marker" />');\r
+\r
+               tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) {\r
+                       if (patt)\r
+                               patt += ',';\r
+\r
+                       patt += n + ' ._mce_marker';\r
+               });\r
+\r
+               tinymce.each(inst.dom.select(patt), function(n) {\r
+                       inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n);\r
+               });\r
+\r
+               dom.setOuterHTML(dom.select('br._mce_marker')[0], html);\r
+       } else\r
+               inst.execCommand('mceInsertContent', false, html);\r
+\r
+       tinymce.each(dom.select('table[_mce_new]'), function(node) {\r
+               var td = dom.select('td', node);\r
+\r
+               inst.selection.select(td[0], true);\r
+               inst.selection.collapse();\r
+\r
+               dom.setAttrib(node, '_mce_new', '');\r
+       });\r
+\r
+       inst.addVisual();\r
+       inst.execCommand('mceEndUndoLevel');\r
+\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function makeAttrib(attrib, value) {\r
+       var formObj = document.forms[0];\r
+       var valueElm = formObj.elements[attrib];\r
+\r
+       if (typeof(value) == "undefined" || value == null) {\r
+               value = "";\r
+\r
+               if (valueElm)\r
+                       value = valueElm.value;\r
+       }\r
+\r
+       if (value == "")\r
+               return "";\r
+\r
+       // XML encode it\r
+       value = value.replace(/&/g, '&amp;');\r
+       value = value.replace(/\"/g, '&quot;');\r
+       value = value.replace(/</g, '&lt;');\r
+       value = value.replace(/>/g, '&gt;');\r
+\r
+       return ' ' + attrib + '="' + value + '"';\r
+}\r
+\r
+function init() {\r
+       tinyMCEPopup.resizeToInnerSize();\r
+\r
+       document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');\r
+       document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');\r
+       document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');\r
+       document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');\r
+\r
+       var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', '');\r
+       var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";\r
+       var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules, frame;\r
+       var inst = tinyMCEPopup.editor, dom = inst.dom;\r
+       var formObj = document.forms[0];\r
+       var elm = dom.getParent(inst.selection.getNode(), "table");\r
+\r
+       action = tinyMCEPopup.getWindowArg('action');\r
+\r
+       if (!action)\r
+               action = elm ? "update" : "insert";\r
+\r
+       if (elm && action != "insert") {\r
+               var rowsAr = elm.rows;\r
+               var cols = 0;\r
+               for (var i=0; i<rowsAr.length; i++)\r
+                       if (rowsAr[i].cells.length > cols)\r
+                               cols = rowsAr[i].cells.length;\r
+\r
+               cols = cols;\r
+               rows = rowsAr.length;\r
+\r
+               st = dom.parseStyle(dom.getAttrib(elm, "style"));\r
+               border = trimSize(getStyle(elm, 'border', 'borderWidth'));\r
+               cellpadding = dom.getAttrib(elm, 'cellpadding', "");\r
+               cellspacing = dom.getAttrib(elm, 'cellspacing', "");\r
+               width = trimSize(getStyle(elm, 'width', 'width'));\r
+               height = trimSize(getStyle(elm, 'height', 'height'));\r
+               bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor'));\r
+               bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor'));\r
+               align = dom.getAttrib(elm, 'align', align);\r
+               frame = dom.getAttrib(elm, 'frame');\r
+               rules = dom.getAttrib(elm, 'rules');\r
+               className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, ''));\r
+               id = dom.getAttrib(elm, 'id');\r
+               summary = dom.getAttrib(elm, 'summary');\r
+               style = dom.serializeStyle(st);\r
+               dir = dom.getAttrib(elm, 'dir');\r
+               lang = dom.getAttrib(elm, 'lang');\r
+               background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");\r
+               formObj.caption.checked = elm.getElementsByTagName('caption').length > 0;\r
+\r
+               orgTableWidth = width;\r
+               orgTableHeight = height;\r
+\r
+               action = "update";\r
+               formObj.insert.value = inst.getLang('update');\r
+       }\r
+\r
+       addClassesToList('class', "table_styles");\r
+       TinyMCE_EditableSelects.init();\r
+\r
+       // Update form\r
+       selectByValue(formObj, 'align', align);\r
+       selectByValue(formObj, 'tframe', frame);\r
+       selectByValue(formObj, 'rules', rules);\r
+       selectByValue(formObj, 'class', className, true, true);\r
+       formObj.cols.value = cols;\r
+       formObj.rows.value = rows;\r
+       formObj.border.value = border;\r
+       formObj.cellpadding.value = cellpadding;\r
+       formObj.cellspacing.value = cellspacing;\r
+       formObj.width.value = width;\r
+       formObj.height.value = height;\r
+       formObj.bordercolor.value = bordercolor;\r
+       formObj.bgcolor.value = bgcolor;\r
+       formObj.id.value = id;\r
+       formObj.summary.value = summary;\r
+       formObj.style.value = style;\r
+       formObj.dir.value = dir;\r
+       formObj.lang.value = lang;\r
+       formObj.backgroundimage.value = background;\r
+\r
+       updateColor('bordercolor_pick', 'bordercolor');\r
+       updateColor('bgcolor_pick', 'bgcolor');\r
+\r
+       // Resize some elements\r
+       if (isVisible('backgroundimagebrowser'))\r
+               document.getElementById('backgroundimage').style.width = '180px';\r
+\r
+       // Disable some fields in update mode\r
+       if (action == "update") {\r
+               formObj.cols.disabled = true;\r
+               formObj.rows.disabled = true;\r
+       }\r
+}\r
+\r
+function changedSize() {\r
+       var formObj = document.forms[0];\r
+       var st = dom.parseStyle(formObj.style.value);\r
+\r
+/*     var width = formObj.width.value;\r
+       if (width != "")\r
+               st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : "";\r
+       else\r
+               st['width'] = "";*/\r
+\r
+       var height = formObj.height.value;\r
+       if (height != "")\r
+               st['height'] = getCSSSize(height);\r
+       else\r
+               st['height'] = "";\r
+\r
+       formObj.style.value = dom.serializeStyle(st);\r
+}\r
+\r
+function changedBackgroundImage() {\r
+       var formObj = document.forms[0];\r
+       var st = dom.parseStyle(formObj.style.value);\r
+\r
+       st['background-image'] = "url('" + formObj.backgroundimage.value + "')";\r
+\r
+       formObj.style.value = dom.serializeStyle(st);\r
+}\r
+\r
+function changedBorder() {\r
+       var formObj = document.forms[0];\r
+       var st = dom.parseStyle(formObj.style.value);\r
+\r
+       // Update border width if the element has a color\r
+       if (formObj.border.value != "" && formObj.bordercolor.value != "")\r
+               st['border-width'] = formObj.border.value + "px";\r
+\r
+       formObj.style.value = dom.serializeStyle(st);\r
+}\r
+\r
+function changedColor() {\r
+       var formObj = document.forms[0];\r
+       var st = dom.parseStyle(formObj.style.value);\r
+\r
+       st['background-color'] = formObj.bgcolor.value;\r
+\r
+       if (formObj.bordercolor.value != "") {\r
+               st['border-color'] = formObj.bordercolor.value;\r
+\r
+               // Add border-width if it's missing\r
+               if (!st['border-width'])\r
+                       st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px";\r
+       }\r
+\r
+       formObj.style.value = dom.serializeStyle(st);\r
+}\r
+\r
+function changedStyle() {\r
+       var formObj = document.forms[0];\r
+       var st = dom.parseStyle(formObj.style.value);\r
+\r
+       if (st['background-image'])\r
+               formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");\r
+       else\r
+               formObj.backgroundimage.value = '';\r
+\r
+       if (st['width'])\r
+               formObj.width.value = trimSize(st['width']);\r
+\r
+       if (st['height'])\r
+               formObj.height.value = trimSize(st['height']);\r
+\r
+       if (st['background-color']) {\r
+               formObj.bgcolor.value = st['background-color'];\r
+               updateColor('bgcolor_pick','bgcolor');\r
+       }\r
+\r
+       if (st['border-color']) {\r
+               formObj.bordercolor.value = st['border-color'];\r
+               updateColor('bordercolor_pick','bordercolor');\r
+       }\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/table/langs/en_dlg.js b/docs/include/jscripts/tiny_mce/plugins/table/langs/en_dlg.js
new file mode 100644 (file)
index 0000000..000332a
--- /dev/null
@@ -0,0 +1,74 @@
+tinyMCE.addI18n('en.table_dlg',{\r
+general_tab:"General",\r
+advanced_tab:"Advanced",\r
+general_props:"General properties",\r
+advanced_props:"Advanced properties",\r
+rowtype:"Row in table part",\r
+title:"Insert/Modify table",\r
+width:"Width",\r
+height:"Height",\r
+cols:"Cols",\r
+rows:"Rows",\r
+cellspacing:"Cellspacing",\r
+cellpadding:"Cellpadding",\r
+border:"Border",\r
+align:"Alignment",\r
+align_default:"Default",\r
+align_left:"Left",\r
+align_right:"Right",\r
+align_middle:"Center",\r
+row_title:"Table row properties",\r
+cell_title:"Table cell properties",\r
+cell_type:"Cell type",\r
+valign:"Vertical alignment",\r
+align_top:"Top",\r
+align_bottom:"Bottom",\r
+bordercolor:"Border color",\r
+bgcolor:"Background color",\r
+merge_cells_title:"Merge table cells",\r
+id:"Id",\r
+style:"Style",\r
+langdir:"Language direction",\r
+langcode:"Language code",\r
+mime:"Target MIME type",\r
+ltr:"Left to right",\r
+rtl:"Right to left",\r
+bgimage:"Background image",\r
+summary:"Summary",\r
+td:"Data",\r
+th:"Header",\r
+cell_cell:"Update current cell",\r
+cell_row:"Update all cells in row",\r
+cell_all:"Update all cells in table",\r
+row_row:"Update current row",\r
+row_odd:"Update odd rows in table",\r
+row_even:"Update even rows in table",\r
+row_all:"Update all rows in table",\r
+thead:"Table Head",\r
+tbody:"Table Body",\r
+tfoot:"Table Foot",\r
+scope:"Scope",\r
+rowgroup:"Row Group",\r
+colgroup:"Col Group",\r
+col_limit:"You've exceeded the maximum number of columns of {$cols}.",\r
+row_limit:"You've exceeded the maximum number of rows of {$rows}.",\r
+cell_limit:"You've exceeded the maximum number of cells of {$cells}.",\r
+missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",\r
+caption:"Table caption",\r
+frame:"Frame",\r
+frame_none:"none",\r
+frame_groups:"groups",\r
+frame_rows:"rows",\r
+frame_cols:"cols",\r
+frame_all:"all",\r
+rules:"Rules",\r
+rules_void:"void",\r
+rules_above:"above",\r
+rules_below:"below",\r
+rules_hsides:"hsides",\r
+rules_lhs:"lhs",\r
+rules_rhs:"rhs",\r
+rules_vsides:"vsides",\r
+rules_box:"box",\r
+rules_border:"border"\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/table/merge_cells.htm b/docs/include/jscripts/tiny_mce/plugins/table/merge_cells.htm
new file mode 100644 (file)
index 0000000..9736ed8
--- /dev/null
@@ -0,0 +1,32 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#table_dlg.merge_cells_title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/validate.js"></script>\r
+       <script type="text/javascript" src="js/merge_cells.js"></script>\r
+</head>\r
+<body style="margin: 8px">\r
+<form onsubmit="MergeCellsDialog.merge();return false;" action="#">\r
+       <fieldset>\r
+               <legend>{#table_dlg.merge_cells_title}</legend>\r
+                 <table border="0" cellpadding="0" cellspacing="3" width="100%">\r
+                         <tr>\r
+                               <td>{#table_dlg.cols}:</td>\r
+                               <td align="right"><input type="text" name="numcols" value="" class="number min1 mceFocus" style="width: 30px" /></td>\r
+                         </tr>\r
+                         <tr>\r
+                               <td>{#table_dlg.rows}:</td>\r
+                               <td align="right"><input type="text" name="numrows" value="" class="number min1" style="width: 30px" /></td>\r
+                         </tr>\r
+                 </table>\r
+       </fieldset>\r
+\r
+       <div class="mceActionPanel">\r
+               <input type="submit" id="insert" name="insert" value="{#update}" />\r
+               <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+       </div>\r
+</form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/table/row.htm b/docs/include/jscripts/tiny_mce/plugins/table/row.htm
new file mode 100644 (file)
index 0000000..092e6c8
--- /dev/null
@@ -0,0 +1,155 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#table_dlg.row_title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+       <script type="text/javascript" src="js/row.js"></script>\r
+       <link href="css/row.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body id="tablerow" style="display: none">\r
+       <form onsubmit="updateAction();return false;" action="#">\r
+               <div class="tabs">\r
+                       <ul>\r
+                               <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>\r
+                               <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>\r
+                       </ul>\r
+               </div>\r
+\r
+               <div class="panel_wrapper">\r
+                       <div id="general_panel" class="panel current">\r
+                               <fieldset>\r
+                                       <legend>{#table_dlg.general_props}</legend>\r
+\r
+                                       <table border="0" cellpadding="4" cellspacing="0">\r
+                                               <tr>\r
+                                                       <td><label for="rowtype">{#table_dlg.rowtype}</label></td>\r
+                                                       <td class="col2">\r
+                                                               <select id="rowtype" name="rowtype" class="mceFocus">\r
+                                                                       <option value="thead">{#table_dlg.thead}</option>\r
+                                                                       <option value="tbody">{#table_dlg.tbody}</option>\r
+                                                                       <option value="tfoot">{#table_dlg.tfoot}</option>\r
+                                                               </select>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="align">{#table_dlg.align}</label></td>\r
+                                                       <td class="col2">\r
+                                                               <select id="align" name="align">\r
+                                                                       <option value="">{#not_set}</option>\r
+                                                                       <option value="center">{#table_dlg.align_middle}</option>\r
+                                                                       <option value="left">{#table_dlg.align_left}</option>\r
+                                                                       <option value="right">{#table_dlg.align_right}</option>\r
+                                                               </select>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="valign">{#table_dlg.valign}</label></td>\r
+                                                       <td class="col2">\r
+                                                               <select id="valign" name="valign">\r
+                                                                       <option value="">{#not_set}</option>\r
+                                                                       <option value="top">{#table_dlg.align_top}</option>\r
+                                                                       <option value="middle">{#table_dlg.align_middle}</option>\r
+                                                                       <option value="bottom">{#table_dlg.align_bottom}</option>\r
+                                                               </select>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr id="styleSelectRow">\r
+                                                       <td><label for="class">{#class_name}</label></td>\r
+                                                       <td class="col2">\r
+                                                               <select id="class" name="class" class="mceEditableSelect">\r
+                                                                       <option value="" selected="selected">{#not_set}</option>\r
+                                                               </select>\r
+                                                       </td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="height">{#table_dlg.height}</label></td>\r
+                                                       <td class="col2"><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td>\r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+                       </div>\r
+\r
+                       <div id="advanced_panel" class="panel">\r
+                               <fieldset>\r
+                                       <legend>{#table_dlg.advanced_props}</legend>\r
+\r
+                                       <table border="0" cellpadding="0" cellspacing="4">\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="id">{#table_dlg.id}</label></td> \r
+                                                       <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="style">{#table_dlg.style}</label></td>\r
+                                                       <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> \r
+                                                       <td>\r
+                                                               <select id="dir" name="dir" style="width: 200px"> \r
+                                                                               <option value="">{#not_set}</option> \r
+                                                                               <option value="ltr">{#table_dlg.ltr}</option> \r
+                                                                               <option value="rtl">{#table_dlg.rtl}</option> \r
+                                                               </select>\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td> \r
+                                                       <td>\r
+                                                               <input id="lang" name="lang" type="text" value="" style="width: 200px" />\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> \r
+                                                       <td>\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>\r
+                                                                               <td id="backgroundimagebrowsercontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td> \r
+                                                       <td>\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>\r
+                                                                               <td id="bgcolor_pickcontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td> \r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+                       </div>\r
+               </div>\r
+\r
+               <div class="mceActionPanel">\r
+                       <div>\r
+                               <select id="action" name="action">\r
+                                       <option value="row">{#table_dlg.row_row}</option>\r
+                                       <option value="odd">{#table_dlg.row_odd}</option>\r
+                                       <option value="even">{#table_dlg.row_even}</option>\r
+                                       <option value="all">{#table_dlg.row_all}</option>\r
+                               </select>\r
+                       </div>\r
+\r
+                       <input type="submit" id="insert" name="insert" value="{#update}" />\r
+                       <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+               </div>\r
+       </form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/table/table.htm b/docs/include/jscripts/tiny_mce/plugins/table/table.htm
new file mode 100644 (file)
index 0000000..f269039
--- /dev/null
@@ -0,0 +1,187 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#table_dlg.title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <script type="text/javascript" src="../../utils/validate.js"></script>\r
+       <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+       <script type="text/javascript" src="js/table.js"></script>\r
+       <link href="css/table.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body id="table" style="display: none">\r
+       <form onsubmit="insertTable();return false;" action="#">\r
+               <div class="tabs">\r
+                       <ul>\r
+                               <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>\r
+                               <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>\r
+                       </ul>\r
+               </div>\r
+\r
+               <div class="panel_wrapper">\r
+                       <div id="general_panel" class="panel current">\r
+                               <fieldset>\r
+                                       <legend>{#table_dlg.general_props}</legend>\r
+                                         <table border="0" cellpadding="4" cellspacing="0" width="100%">\r
+                                                         <tr>\r
+                                                               <td><label id="colslabel" for="cols">{#table_dlg.cols}</label></td>\r
+                                                               <td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1 mceFocus" /></td>\r
+                                                               <td><label id="rowslabel" for="rows">{#table_dlg.rows}</label></td>\r
+                                                               <td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" /></td>\r
+                                                         </tr>\r
+                                                         <tr>\r
+                                                               <td><label id="cellpaddinglabel" for="cellpadding">{#table_dlg.cellpadding}</label></td>\r
+                                                               <td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td>\r
+                                                               <td><label id="cellspacinglabel" for="cellspacing">{#table_dlg.cellspacing}</label></td>\r
+                                                               <td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td>\r
+                                                         </tr>\r
+                                                         <tr>\r
+                                                               <td><label id="alignlabel" for="align">{#table_dlg.align}</label></td>\r
+                                                               <td><select id="align" name="align">\r
+                                                                       <option value="">{#not_set}</option>\r
+                                                                       <option value="center">{#table_dlg.align_middle}</option>\r
+                                                                       <option value="left">{#table_dlg.align_left}</option>\r
+                                                                       <option value="right">{#table_dlg.align_right}</option>\r
+                                                                 </select></td>\r
+                                                               <td><label id="borderlabel" for="border">{#table_dlg.border}</label></td>\r
+                                                               <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" class="number" /></td>\r
+                                                         </tr>\r
+                                                         <tr id="width_row">\r
+                                                               <td><label id="widthlabel" for="width">{#table_dlg.width}</label></td>\r
+                                                               <td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>\r
+                                                               <td><label id="heightlabel" for="height">{#table_dlg.height}</label></td>\r
+                                                               <td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>\r
+                                                         </tr>\r
+                                                         <tr id="styleSelectRow">\r
+                                                               <td><label id="classlabel" for="class">{#class_name}</label></td>\r
+                                                               <td colspan="3">\r
+                                                                <select id="class" name="class" class="mceEditableSelect">\r
+                                                                       <option value="" selected="selected">{#not_set}</option>\r
+                                                                </select></td>\r
+                                                         </tr>\r
+                                                         <tr>\r
+                                                               <td class="column1"><label for="caption">{#table_dlg.caption}</label></td> \r
+                                                               <td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td> \r
+                                                         </tr>\r
+                                                       </table>\r
+                               </fieldset>\r
+                       </div>\r
+\r
+                       <div id="advanced_panel" class="panel">\r
+                               <fieldset>\r
+                                       <legend>{#table_dlg.advanced_props}</legend>\r
+\r
+                                       <table border="0" cellpadding="0" cellspacing="4">\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="id">{#table_dlg.id}</label></td> \r
+                                                       <td><input id="id" name="id" type="text" value="" class="advfield" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="summary">{#table_dlg.summary}</label></td> \r
+                                                       <td><input id="summary" name="summary" type="text" value="" class="advfield" /></td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label for="style">{#table_dlg.style}</label></td>\r
+                                                       <td><input type="text" id="style" name="style" value="" class="advfield" onchange="changedStyle();" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label id="langlabel" for="lang">{#table_dlg.langcode}</label></td> \r
+                                                       <td>\r
+                                                               <input id="lang" name="lang" type="text" value="" class="advfield" />\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> \r
+                                                       <td>\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="backgroundimage" name="backgroundimage" type="text" value="" class="advfield" onchange="changedBackgroundImage();" /></td>\r
+                                                                               <td id="backgroundimagebrowsercontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="tframe">{#table_dlg.frame}</label></td> \r
+                                                       <td>\r
+                                                               <select id="tframe" name="tframe" class="advfield"> \r
+                                                                               <option value="">{#not_set}</option>\r
+                                                                               <option value="void">{#table_dlg.rules_void}</option>\r
+                                                                               <option value="above">{#table_dlg.rules_above}</option> \r
+                                                                               <option value="below">{#table_dlg.rules_below}</option> \r
+                                                                               <option value="hsides">{#table_dlg.rules_hsides}</option> \r
+                                                                               <option value="lhs">{#table_dlg.rules_lhs}</option> \r
+                                                                               <option value="rhs">{#table_dlg.rules_rhs}</option> \r
+                                                                               <option value="vsides">{#table_dlg.rules_vsides}</option> \r
+                                                                               <option value="box">{#table_dlg.rules_box}</option> \r
+                                                                               <option value="border">{#table_dlg.rules_border}</option> \r
+                                                               </select>\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="rules">{#table_dlg.rules}</label></td> \r
+                                                       <td>\r
+                                                               <select id="rules" name="rules" class="advfield"> \r
+                                                                               <option value="">{#not_set}</option> \r
+                                                                               <option value="none">{#table_dlg.frame_none}</option>\r
+                                                                               <option value="groups">{#table_dlg.frame_groups}</option>\r
+                                                                               <option value="rows">{#table_dlg.frame_rows}</option>\r
+                                                                               <option value="cols">{#table_dlg.frame_cols}</option>\r
+                                                                               <option value="all">{#table_dlg.frame_all}</option>\r
+                                                                       </select>\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> \r
+                                                       <td>\r
+                                                               <select id="dir" name="dir" class="advfield"> \r
+                                                                               <option value="">{#not_set}</option> \r
+                                                                               <option value="ltr">{#table_dlg.ltr}</option> \r
+                                                                               <option value="rtl">{#table_dlg.rtl}</option> \r
+                                                               </select>\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td> \r
+                                                       <td>\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>\r
+                                                                               <td id="bordercolor_pickcontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td> \r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td> \r
+                                                       <td>\r
+                                                               <table border="0" cellpadding="0" cellspacing="0">\r
+                                                                       <tr>\r
+                                                                               <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>\r
+                                                                               <td id="bgcolor_pickcontainer">&nbsp;</td>\r
+                                                                       </tr>\r
+                                                               </table>\r
+                                                       </td> \r
+                                               </tr>\r
+                                       </table>\r
+                               </fieldset>\r
+                       </div>\r
+               </div>\r
+\r
+               <div class="mceActionPanel">\r
+                       <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+                       <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+               </div>\r
+       </form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/template/blank.htm b/docs/include/jscripts/tiny_mce/plugins/template/blank.htm
new file mode 100644 (file)
index 0000000..ecde53f
--- /dev/null
@@ -0,0 +1,12 @@
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>blank_page</title>\r
+       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+       <script type="text/javascript">\r
+               parent.TemplateDialog.loadCSSFiles(document);\r
+       </script>\r
+</head>\r
+<body id="mceTemplatePreview" class="mceContentBody">\r
+\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/template/css/template.css b/docs/include/jscripts/tiny_mce/plugins/template/css/template.css
new file mode 100644 (file)
index 0000000..2d23a49
--- /dev/null
@@ -0,0 +1,23 @@
+#frmbody {\r
+       padding: 10px;\r
+       background-color: #FFF;\r
+       border: 1px solid #CCC;\r
+}\r
+\r
+.frmRow {\r
+       margin-bottom: 10px;\r
+}\r
+\r
+#templatesrc {\r
+       border: none;\r
+       width: 320px;\r
+       height: 240px;\r
+}\r
+\r
+.title {\r
+       padding-bottom: 5px;\r
+}\r
+\r
+.mceActionPanel {\r
+       padding-top: 5px;\r
+}\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/template/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/template/editor_plugin.js
new file mode 100644 (file)
index 0000000..ebe3c27
--- /dev/null
@@ -0,0 +1 @@
+(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",750),height:b.getParam("template_popup_height",600),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length<d){for(f=0;f<(d-g.length);f++){g="0"+g}}return g}b=b.replace("%D","%m/%d/%y");b=b.replace("%r","%I:%M:%S %p");b=b.replace("%Y",""+e.getFullYear());b=b.replace("%y",""+e.getYear());b=b.replace("%m",c(e.getMonth()+1,2));b=b.replace("%d",c(e.getDate(),2));b=b.replace("%H",""+c(e.getHours(),2));b=b.replace("%M",""+c(e.getMinutes(),2));b=b.replace("%S",""+c(e.getSeconds(),2));b=b.replace("%I",""+((e.getHours()+11)%12+1));b=b.replace("%p",""+(e.getHours()<12?"AM":"PM"));b=b.replace("%B",""+this.editor.getLang("template_months_long").split(",")[e.getMonth()]);b=b.replace("%b",""+this.editor.getLang("template_months_short").split(",")[e.getMonth()]);b=b.replace("%A",""+this.editor.getLang("template_day_long").split(",")[e.getDay()]);b=b.replace("%a",""+this.editor.getLang("template_day_short").split(",")[e.getDay()]);b=b.replace("%%","%");return b}});tinymce.PluginManager.add("template",tinymce.plugins.TemplatePlugin)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/template/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/template/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..9cac269
--- /dev/null
@@ -0,0 +1,159 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       var each = tinymce.each;\r
+\r
+       tinymce.create('tinymce.plugins.TemplatePlugin', {\r
+               init : function(ed, url) {\r
+                       var t = this;\r
+\r
+                       t.editor = ed;\r
+\r
+                       // Register commands\r
+                       ed.addCommand('mceTemplate', function(ui) {\r
+                               ed.windowManager.open({\r
+                                       file : url + '/template.htm',\r
+                                       width : ed.getParam('template_popup_width', 750),\r
+                                       height : ed.getParam('template_popup_height', 600),\r
+                                       inline : 1\r
+                               }, {\r
+                                       plugin_url : url\r
+                               });\r
+                       });\r
+\r
+                       ed.addCommand('mceInsertTemplate', t._insertTemplate, t);\r
+\r
+                       // Register buttons\r
+                       ed.addButton('template', {title : 'template.desc', cmd : 'mceTemplate'});\r
+\r
+                       ed.onPreProcess.add(function(ed, o) {\r
+                               var dom = ed.dom;\r
+\r
+                               each(dom.select('div', o.node), function(e) {\r
+                                       if (dom.hasClass(e, 'mceTmpl')) {\r
+                                               each(dom.select('*', e), function(e) {\r
+                                                       if (dom.hasClass(e, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|')))\r
+                                                               e.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format")));\r
+                                               });\r
+\r
+                                               t._replaceVals(e);\r
+                                       }\r
+                               });\r
+                       });\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Template plugin',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://www.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               },\r
+\r
+               _insertTemplate : function(ui, v) {\r
+                       var t = this, ed = t.editor, h, el, dom = ed.dom, sel = ed.selection.getContent();\r
+\r
+                       h = v.content;\r
+\r
+                       each(t.editor.getParam('template_replace_values'), function(v, k) {\r
+                               if (typeof(v) != 'function')\r
+                                       h = h.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v);\r
+                       });\r
+\r
+                       el = dom.create('div', null, h);\r
+\r
+                       // Find template element within div\r
+                       n = dom.select('.mceTmpl', el);\r
+                       if (n && n.length > 0) {\r
+                               el = dom.create('div', null);\r
+                               el.appendChild(n[0].cloneNode(true));\r
+                       }\r
+\r
+                       function hasClass(n, c) {\r
+                               return new RegExp('\\b' + c + '\\b', 'g').test(n.className);\r
+                       };\r
+\r
+                       each(dom.select('*', el), function(n) {\r
+                               // Replace cdate\r
+                               if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|')))\r
+                                       n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format")));\r
+\r
+                               // Replace mdate\r
+                               if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|')))\r
+                                       n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format")));\r
+\r
+                               // Replace selection\r
+                               if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|')))\r
+                                       n.innerHTML = sel;\r
+                       });\r
+\r
+                       t._replaceVals(el);\r
+\r
+                       ed.execCommand('mceInsertContent', false, el.innerHTML);\r
+                       ed.addVisual();\r
+               },\r
+\r
+               _replaceVals : function(e) {\r
+                       var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values');\r
+\r
+                       each(dom.select('*', e), function(e) {\r
+                               each(vl, function(v, k) {\r
+                                       if (dom.hasClass(e, k)) {\r
+                                               if (typeof(vl[k]) == 'function')\r
+                                                       vl[k](e);\r
+                                       }\r
+                               });\r
+                       });\r
+               },\r
+\r
+               _getDateTime : function(d, fmt) {\r
+                               if (!fmt)\r
+                                       return "";\r
+\r
+                               function addZeros(value, len) {\r
+                                       var i;\r
+\r
+                                       value = "" + value;\r
+\r
+                                       if (value.length < len) {\r
+                                               for (i=0; i<(len-value.length); i++)\r
+                                                       value = "0" + value;\r
+                                       }\r
+\r
+                                       return value;\r
+                               }\r
+\r
+                               fmt = fmt.replace("%D", "%m/%d/%y");\r
+                               fmt = fmt.replace("%r", "%I:%M:%S %p");\r
+                               fmt = fmt.replace("%Y", "" + d.getFullYear());\r
+                               fmt = fmt.replace("%y", "" + d.getYear());\r
+                               fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));\r
+                               fmt = fmt.replace("%d", addZeros(d.getDate(), 2));\r
+                               fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));\r
+                               fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));\r
+                               fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));\r
+                               fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));\r
+                               fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));\r
+                               fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]);\r
+                               fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]);\r
+                               fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]);\r
+                               fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]);\r
+                               fmt = fmt.replace("%%", "%");\r
+\r
+                               return fmt;\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/template/js/template.js b/docs/include/jscripts/tiny_mce/plugins/template/js/template.js
new file mode 100644 (file)
index 0000000..24045d7
--- /dev/null
@@ -0,0 +1,106 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+var TemplateDialog = {\r
+       preInit : function() {\r
+               var url = tinyMCEPopup.getParam("template_external_list_url");\r
+\r
+               if (url != null)\r
+                       document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></sc'+'ript>');\r
+       },\r
+\r
+       init : function() {\r
+               var ed = tinyMCEPopup.editor, tsrc, sel, x, u;\r
+\r
+               tsrc = ed.getParam("template_templates", false);\r
+               sel = document.getElementById('tpath');\r
+\r
+               // Setup external template list\r
+               if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') {\r
+                       for (x=0, tsrc = []; x<tinyMCETemplateList.length; x++)\r
+                               tsrc.push({title : tinyMCETemplateList[x][0], src : tinyMCETemplateList[x][1], description : tinyMCETemplateList[x][2]});\r
+               }\r
+\r
+               for (x=0; x<tsrc.length; x++)\r
+                       sel.options[sel.options.length] = new Option(tsrc[x].title, tinyMCEPopup.editor.documentBaseURI.toAbsolute(tsrc[x].src));\r
+\r
+               this.resize();\r
+               this.tsrc = tsrc;\r
+       },\r
+\r
+       resize : function() {\r
+               var w, h, e;\r
+\r
+               if (!self.innerWidth) {\r
+                       w = document.body.clientWidth - 50;\r
+                       h = document.body.clientHeight - 160;\r
+               } else {\r
+                       w = self.innerWidth - 50;\r
+                       h = self.innerHeight - 170;\r
+               }\r
+\r
+               e = document.getElementById('templatesrc');\r
+\r
+               if (e) {\r
+                       e.style.height = Math.abs(h) + 'px';\r
+                       e.style.width  = Math.abs(w - 5) + 'px';\r
+               }\r
+       },\r
+\r
+       loadCSSFiles : function(d) {\r
+               var ed = tinyMCEPopup.editor;\r
+\r
+               tinymce.each(ed.getParam("content_css", '').split(','), function(u) {\r
+                       d.write('<link href="' + ed.documentBaseURI.toAbsolute(u) + '" rel="stylesheet" type="text/css" />');\r
+               });\r
+       },\r
+\r
+       selectTemplate : function(u, ti) {\r
+               var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc;\r
+\r
+               if (!u)\r
+                       return;\r
+\r
+               d.body.innerHTML = this.templateHTML = this.getFileContents(u);\r
+\r
+               for (x=0; x<tsrc.length; x++) {\r
+                       if (tsrc[x].title == ti)\r
+                               document.getElementById('tmpldesc').innerHTML = tsrc[x].description || '';\r
+               }\r
+       },\r
+\r
+       insert : function() {\r
+               tinyMCEPopup.execCommand('mceInsertTemplate', false, {\r
+                       content : this.templateHTML,\r
+                       selection : tinyMCEPopup.editor.selection.getContent()\r
+               });\r
+\r
+               tinyMCEPopup.close();\r
+       },\r
+\r
+       getFileContents : function(u) {\r
+               var x, d, t = 'text/plain';\r
+\r
+               function g(s) {\r
+                       x = 0;\r
+\r
+                       try {\r
+                               x = new ActiveXObject(s);\r
+                       } catch (s) {\r
+                       }\r
+\r
+                       return x;\r
+               };\r
+\r
+               x = window.ActiveXObject ? g('Msxml2.XMLHTTP') || g('Microsoft.XMLHTTP') : new XMLHttpRequest();\r
+\r
+               // Synchronous AJAX load file\r
+               x.overrideMimeType && x.overrideMimeType(t);\r
+               x.open("GET", u, false);\r
+               x.send(null);\r
+\r
+               return x.responseText;\r
+       }\r
+};\r
+\r
+TemplateDialog.preInit();\r
+tinyMCEPopup.onInit.add(TemplateDialog.init, TemplateDialog);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/template/langs/en_dlg.js b/docs/include/jscripts/tiny_mce/plugins/template/langs/en_dlg.js
new file mode 100644 (file)
index 0000000..2471c3f
--- /dev/null
@@ -0,0 +1,15 @@
+tinyMCE.addI18n('en.template_dlg',{\r
+title:"Templates",\r
+label:"Template",\r
+desc_label:"Description",\r
+desc:"Insert predefined template content",\r
+select:"Select a template",\r
+preview:"Preview",\r
+warning:"Warning: Updating a template with a different one may cause data loss.",\r
+mdate_format:"%Y-%m-%d %H:%M:%S",\r
+cdate_format:"%Y-%m-%d %H:%M:%S",\r
+months_long:"January,February,March,April,May,June,July,August,September,October,November,December",\r
+months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",\r
+day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",\r
+day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/template/template.htm b/docs/include/jscripts/tiny_mce/plugins/template/template.htm
new file mode 100644 (file)
index 0000000..4bf49f1
--- /dev/null
@@ -0,0 +1,32 @@
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#template_dlg.title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="js/template.js"></script>\r
+       <link href="css/template.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body onresize="TemplateDialog.resize();"> \r
+       <form onsubmit="TemplateDialog.insert();return false;">\r
+               <div id="frmbody">\r
+                       <div class="title">{#template_dlg.desc}</div>\r
+                       <div class="frmRow"><label for="tpath" title="{#template_dlg.select}">{#template_dlg.label}:</label>\r
+                       <select id="tpath" name="tpath" onchange="TemplateDialog.selectTemplate(this.options[this.selectedIndex].value, this.options[this.selectedIndex].text);" class="mceFocus">\r
+                               <option value="">{#template_dlg.select}...</option>\r
+                       </select>\r
+                       <span id="warning"></span></div>\r
+                       <div class="frmRow"><label for="tdesc">{#template_dlg.desc_label}:</label>\r
+                       <span id="tmpldesc"></span></div>\r
+                       <fieldset>\r
+                               <legend>{#template_dlg.preview}</legend>\r
+                               <iframe id="templatesrc" name="templatesrc" src="blank.htm" width="690" height="400" frameborder="0"></iframe>\r
+                       </fieldset>\r
+               </div>\r
+               \r
+               <div class="mceActionPanel">\r
+                       <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+                       <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+                       <br style="clear:both" />\r
+               </div>\r
+       </form>\r
+</body> \r
+</html> \r
diff --git a/docs/include/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js
new file mode 100644 (file)
index 0000000..53d31c4
--- /dev/null
@@ -0,0 +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<a.length;e++){j=a[e].nodeValue;j=j.replace(/(\u00a0+)/g,'<span class="mceItemHidden mceVisualNbsp">$1</span>');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<a.length;e++){g.dom.setOuterHTML(a[e],a[e].innerHTML.replace(/(&middot;|\u00b7)/g,"&nbsp;"),k)}}}});tinymce.PluginManager.add("visualchars",tinymce.plugins.VisualChars)})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..0a5275f
--- /dev/null
@@ -0,0 +1,76 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.VisualChars', {\r
+               init : function(ed, url) {\r
+                       var t = this;\r
+\r
+                       t.editor = ed;\r
+\r
+                       // Register commands\r
+                       ed.addCommand('mceVisualChars', t._toggleVisualChars, t);\r
+\r
+                       // Register buttons\r
+                       ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'});\r
+\r
+                       ed.onBeforeGetContent.add(function(ed, o) {\r
+                               if (t.state) {\r
+                                       t.state = true;\r
+                                       t._toggleVisualChars();\r
+                               }\r
+                       });\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Visual characters',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               },\r
+\r
+               // Private methods\r
+\r
+               _toggleVisualChars : function() {\r
+                       var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo;\r
+\r
+                       t.state = !t.state;\r
+                       ed.controlManager.setActive('visualchars', t.state);\r
+\r
+                       if (t.state) {\r
+                               nl = [];\r
+                               tinymce.walk(b, function(n) {\r
+                                       if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1)\r
+                                               nl.push(n);\r
+                               }, 'childNodes');\r
+\r
+                               for (i=0; i<nl.length; i++) {\r
+                                       nv = nl[i].nodeValue;\r
+                                       nv = nv.replace(/(\u00a0+)/g, '<span class="mceItemHidden mceVisualNbsp">$1</span>');\r
+                                       nv = nv.replace(/\u00a0/g, '\u00b7');\r
+                                       ed.dom.setOuterHTML(nl[i], nv, d);\r
+                               }\r
+                       } else {\r
+                               nl = tinymce.grep(ed.dom.select('span', b), function(n) {\r
+                                       return ed.dom.hasClass(n, 'mceVisualNbsp');\r
+                               });\r
+\r
+                               for (i=0; i<nl.length; i++)\r
+                                       ed.dom.setOuterHTML(nl[i], nl[i].innerHTML.replace(/(&middot;|\u00b7)/g, '&nbsp;'), d);\r
+                       }\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js
new file mode 100644 (file)
index 0000000..f192835
--- /dev/null
@@ -0,0 +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: ")+'<span id="'+c.id+'">0</span>')}}else{tinymce.DOM.add(h,"span",{},'<span id="'+c.id+'">0</span>')}});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(/&nbsp;|&#160;/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
diff --git a/docs/include/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..bdfebf1
--- /dev/null
@@ -0,0 +1,98 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+    tinymce.create('tinymce.plugins.WordCount', {\r
+               block : 0,\r
+               id : null,\r
+               countre : null,\r
+               cleanre : null,\r
+\r
+               init : function(ed, url) {\r
+                       var t = this, last = 0;\r
+\r
+                       t.countre = ed.getParam('wordcount_countregex', /\S\s+/g);\r
+                       t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$¿'"_+=\\/-]*/g);\r
+                       t.id = ed.id + '-word-count';\r
+\r
+                       ed.onPostRender.add(function(ed, cm) {\r
+                               var row, id;\r
+\r
+                               // Add it to the specified id or the theme advanced path\r
+                               id = ed.getParam('wordcount_target_id');\r
+                               if (!id) {\r
+                                       row = tinymce.DOM.get(ed.id + '_path_row');\r
+\r
+                                       if (row)\r
+                                               tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '<span id="' + t.id + '">0</span>');\r
+                               } else\r
+                                       tinymce.DOM.add(id, 'span', {}, '<span id="' + t.id + '">0</span>');\r
+                       });\r
+\r
+            ed.onInit.add(function(ed) {\r
+                               ed.selection.onSetContent.add(function() {\r
+                                       t._count(ed);\r
+                               });\r
+\r
+                               t._count(ed);\r
+                       });\r
+\r
+                       ed.onSetContent.add(function(ed) {\r
+                               t._count(ed);\r
+                       });\r
+\r
+                       ed.onKeyUp.add(function(ed, e) {\r
+                               if (e.keyCode == last)\r
+                                       return;\r
+\r
+                               if (13 == e.keyCode || 8 == last || 46 == last)\r
+                                       t._count(ed);\r
+\r
+                               last = e.keyCode;\r
+                       });\r
+               },\r
+\r
+               _count : function(ed) {\r
+                       var t = this, tc = 0;\r
+\r
+                       // Keep multiple calls from happening at the same time\r
+                       if (t.block)\r
+                               return;\r
+\r
+                       t.block = 1;\r
+\r
+                       setTimeout(function() {\r
+                               var tx = ed.getContent({format : 'raw'});\r
+\r
+                               if (tx) {\r
+                                       tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/&nbsp;|&#160;/gi, ' '); // remove html tags and space chars\r
+                                       tx = tx.replace(t.cleanre, ''); // remove numbers and punctuation\r
+                                       tx.replace(t.countre, function() {tc++;}); // count the words\r
+                               }\r
+\r
+                               tinymce.DOM.setHTML(t.id, tc.toString());\r
+\r
+                               setTimeout(function() {t.block = 0;}, 2000);\r
+                       }, 1);\r
+               },\r
+\r
+        getInfo: function() {\r
+                       return {\r
+                               longname : 'Word Count plugin',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+        }\r
+    });\r
+\r
+    tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount);\r
+})();\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm
new file mode 100644 (file)
index 0000000..3aeac0d
--- /dev/null
@@ -0,0 +1,141 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#xhtmlxtras_dlg.title_abbr_element}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+       <script type="text/javascript" src="js/element_common.js"></script>\r
+       <script type="text/javascript" src="js/abbr.js"></script>\r
+       <link rel="stylesheet" type="text/css" href="css/popup.css" />\r
+</head>\r
+<body style="display: none">\r
+<form onsubmit="insertAbbr();return false;" action="#">\r
+       <div class="tabs">\r
+               <ul>\r
+                       <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>\r
+                       <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->\r
+               </ul>\r
+       </div>\r
+\r
+       <div class="panel_wrapper">\r
+               <div id="general_panel" class="panel current">\r
+                       <fieldset>\r
+                               <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>\r
+                               <table border="0" cellpadding="0" cellspacing="4">\r
+                                       <tr>\r
+                                               <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
+                                               <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
+                                               <td><input id="id" name="id" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> \r
+                                               <td>\r
+                                                       <select id="class" name="class" class="field mceEditableSelect">\r
+                                                               <option value="">{#not_set}</option> \r
+                                                       </select>\r
+                                               </td>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
+                                               <td><input id="style" name="style" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
+                                               <td>\r
+                                                       <select id="dir" name="dir" class="field"> \r
+                                                               <option value="">{#not_set}</option> \r
+                                                               <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> \r
+                                                               <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> \r
+                                                       </select>\r
+                                               </td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
+                                               <td>\r
+                                                       <input id="lang" name="lang" type="text" value="" class="field" />\r
+                                               </td> \r
+                                       </tr>\r
+                               </table>\r
+                       </fieldset>\r
+               </div>\r
+               <div id="events_panel" class="panel">\r
+                       <fieldset>\r
+                               <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>\r
+\r
+                               <table border="0" cellpadding="0" cellspacing="4">\r
+                                       <tr>\r
+                                               <td class="label"><label for="onfocus">onfocus</label>:</td> \r
+                                               <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onblur">onblur</label>:</td> \r
+                                               <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onclick">onclick</label>:</td> \r
+                                               <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
+                                               <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
+                                               <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
+                                               <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
+                                               <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
+                                               <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
+                                               <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
+                                               <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
+                                               <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
+                                               <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                               </table>\r
+                       </fieldset>\r
+               </div>\r
+       </div>\r
+       <div class="mceActionPanel">\r
+               <input type="submit" id="insert" name="insert" value="{#update}" />\r
+               <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAbbr();" style="display: none;" />\r
+               <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+       </div>\r
+</form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm
new file mode 100644 (file)
index 0000000..31ee7b7
--- /dev/null
@@ -0,0 +1,141 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#xhtmlxtras_dlg.title_acronym_element}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+       <script type="text/javascript" src="js/element_common.js"></script>\r
+       <script type="text/javascript" src="js/acronym.js"></script>\r
+       <link rel="stylesheet" type="text/css" href="css/popup.css" />\r
+</head>\r
+<body style="display: none">\r
+<form onsubmit="insertAcronym();return false;" action="#">\r
+       <div class="tabs">\r
+               <ul>\r
+                       <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>\r
+                       <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->\r
+               </ul>\r
+       </div>\r
+\r
+       <div class="panel_wrapper">\r
+               <div id="general_panel" class="panel current">\r
+                       <fieldset>\r
+                               <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>\r
+                               <table border="0" cellpadding="0" cellspacing="4">\r
+                                       <tr>\r
+                                               <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
+                                               <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
+                                               <td><input id="id" name="id" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> \r
+                                               <td>\r
+                                                       <select id="class" name="class" class="field mceEditableSelect">\r
+                                                               <option value="">{#not_set}</option> \r
+                                                       </select>\r
+                                               </td>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
+                                               <td><input id="style" name="style" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
+                                               <td>\r
+                                                       <select id="dir" name="dir" class="field"> \r
+                                                               <option value="">{#not_set}</option> \r
+                                                               <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> \r
+                                                               <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> \r
+                                                       </select>\r
+                                               </td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
+                                               <td>\r
+                                                       <input id="lang" name="lang" type="text" value="" class="field" />\r
+                                               </td> \r
+                                       </tr>\r
+                               </table>\r
+                       </fieldset>\r
+               </div>\r
+               <div id="events_panel" class="panel">\r
+                       <fieldset>\r
+                               <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>\r
+\r
+                               <table border="0" cellpadding="0" cellspacing="4">\r
+                                       <tr>\r
+                                               <td class="label"><label for="onfocus">onfocus</label>:</td> \r
+                                               <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onblur">onblur</label>:</td> \r
+                                               <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onclick">onclick</label>:</td> \r
+                                               <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
+                                               <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
+                                               <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
+                                               <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
+                                               <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
+                                               <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
+                                               <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
+                                               <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
+                                               <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
+                                               <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                               </table>\r
+                       </fieldset>\r
+               </div>\r
+       </div>\r
+       <div class="mceActionPanel">\r
+               <input type="submit" id="insert" name="insert" value="{#update}" />\r
+               <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAcronym();" style="display: none;" />\r
+               <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+       </div>\r
+</form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm
new file mode 100644 (file)
index 0000000..17054da
--- /dev/null
@@ -0,0 +1,148 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#xhtmlxtras_dlg.attribs_title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <script type="text/javascript" src="js/attributes.js"></script>\r
+       <link rel="stylesheet" type="text/css" href="css/attributes.css" />\r
+</head>\r
+<body style="display: none">\r
+<form onsubmit="insertAction();return false;" action="#">\r
+       <div class="tabs">\r
+               <ul>\r
+                       <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_attrib_tab}</a></span></li>\r
+                       <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_events_tab}</a></span></li>\r
+               </ul>\r
+       </div>\r
+\r
+       <div class="panel_wrapper">\r
+               <div id="general_panel" class="panel current">\r
+                       <fieldset>\r
+                               <legend>{#xhtmlxtras_dlg.attribute_attrib_tab}</legend>\r
+                               <table border="0" cellpadding="0" cellspacing="4">\r
+                                       <tr>\r
+                                               <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
+                                               <td><input id="title" name="title" type="text" value="" class="mceFocus" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
+                                               <td><input id="id" name="id" type="text" value="" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td><label id="classlabel" for="classlist">{#class_name}</label></td>\r
+                                               <td>\r
+                                                       <select id="classlist" name="classlist" class="mceEditableSelect">\r
+                                                               <option value="" selected="selected">{#not_set}</option>\r
+                                                       </select>\r
+                                               </td>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="stylelabel" for="style">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
+                                               <td><input id="style" name="style" type="text" value="" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
+                                               <td>\r
+                                                       <select id="dir" name="dir"> \r
+                                                               <option value="">{#not_set}</option> \r
+                                                               <option value="ltr">{#xhtmlxtras_dlg.option_ltr}</option> \r
+                                                               <option value="rtl">{#xhtmlxtras_dlg.option_rtl}</option> \r
+                                                       </select>\r
+                                               </td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
+                                               <td>\r
+                                                       <input id="lang" name="lang" type="text" value="" />\r
+                                               </td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                                       <td><label id="tabindexlabel" for="tabindex">{#xhtmlxtras_dlg.attribute_label_tabindex}</label></td>\r
+                                                       <td><input type="text" id="tabindex" name="tabindex" value="" /></td>\r
+                                               </tr>\r
+\r
+                                               <tr>\r
+                                                       <td><label id="accesskeylabel" for="accesskey">{#xhtmlxtras_dlg.attribute_label_accesskey}</label></td>\r
+                                                       <td><input type="text" id="accesskey" name="accesskey" value="" /></td>\r
+                                               </tr>\r
+                               </table>\r
+                       </fieldset>\r
+               </div>\r
+               <div id="events_panel" class="panel">\r
+                       <fieldset>\r
+                               <legend>{#xhtmlxtras_dlg.attribute_events_tab}</legend>\r
+\r
+                               <table border="0" cellpadding="0" cellspacing="4">\r
+                                       <tr>\r
+                                               <td class="label"><label for="onfocus">onfocus</label>:</td> \r
+                                               <td><input id="onfocus" name="onfocus" type="text" value="" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onblur">onblur</label>:</td> \r
+                                               <td><input id="onblur" name="onblur" type="text" value="" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onclick">onclick</label>:</td> \r
+                                               <td><input id="onclick" name="onclick" type="text" value="" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
+                                               <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
+                                               <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
+                                               <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
+                                               <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
+                                               <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
+                                               <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
+                                               <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
+                                               <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
+                                               <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td> \r
+                                       </tr>\r
+                               </table>\r
+                       </fieldset>\r
+               </div>\r
+       </div>\r
+       <div class="mceActionPanel">\r
+               <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+               <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+       </div>\r
+</form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm
new file mode 100644 (file)
index 0000000..d0a3e3a
--- /dev/null
@@ -0,0 +1,141 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#xhtmlxtras_dlg.title_cite_element}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+       <script type="text/javascript" src="js/element_common.js"></script>\r
+       <script type="text/javascript" src="js/cite.js"></script>\r
+       <link rel="stylesheet" type="text/css" href="css/popup.css" />\r
+</head>\r
+<body style="display: none">\r
+<form onsubmit="insertCite();return false;" action="#">\r
+       <div class="tabs">\r
+               <ul>\r
+                       <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>\r
+                       <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->\r
+               </ul>\r
+       </div>\r
+\r
+       <div class="panel_wrapper">\r
+               <div id="general_panel" class="panel current">\r
+                       <fieldset>\r
+                               <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>\r
+                               <table border="0" cellpadding="0" cellspacing="4">\r
+                                       <tr>\r
+                                               <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
+                                               <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
+                                               <td><input id="id" name="id" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> \r
+                                               <td>\r
+                                                       <select id="class" name="class" class="field mceEditableSelect">\r
+                                                               <option value="">{#not_set}</option> \r
+                                                       </select>\r
+                                               </td>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
+                                               <td><input id="style" name="style" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
+                                               <td>\r
+                                                       <select id="dir" name="dir" class="field"> \r
+                                                               <option value="">{#not_set}</option> \r
+                                                               <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> \r
+                                                               <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> \r
+                                                       </select>\r
+                                               </td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
+                                               <td>\r
+                                                       <input id="lang" name="lang" type="text" value="" class="field" />\r
+                                               </td> \r
+                                       </tr>\r
+                               </table>\r
+                       </fieldset>\r
+               </div>\r
+               <div id="events_panel" class="panel">\r
+                       <fieldset>\r
+                               <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>\r
+\r
+                               <table border="0" cellpadding="0" cellspacing="4">\r
+                                       <tr>\r
+                                               <td class="label"><label for="onfocus">onfocus</label>:</td> \r
+                                               <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onblur">onblur</label>:</td> \r
+                                               <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onclick">onclick</label>:</td> \r
+                                               <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
+                                               <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
+                                               <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
+                                               <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
+                                               <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
+                                               <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
+                                               <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
+                                               <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
+                                               <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
+                                               <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                               </table>\r
+                       </fieldset>\r
+               </div>\r
+       </div>\r
+       <div class="mceActionPanel">\r
+               <input type="submit" id="insert" name="insert" value="{#update}" />\r
+               <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeCite();" style="display: none;" />\r
+               <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+       </div>\r
+</form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css
new file mode 100644 (file)
index 0000000..9a6a235
--- /dev/null
@@ -0,0 +1,11 @@
+.panel_wrapper div.current {\r
+       height: 290px;\r
+}\r
+\r
+#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey {\r
+       width: 200px;\r
+}\r
+\r
+#events_panel input {\r
+       width: 200px;\r
+}\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css
new file mode 100644 (file)
index 0000000..e67114d
--- /dev/null
@@ -0,0 +1,9 @@
+input.field, select.field {width:200px;}\r
+input.picker {width:179px; margin-left: 5px;}\r
+input.disabled {border-color:#F2F2F2;}\r
+img.picker {vertical-align:text-bottom; cursor:pointer;}\r
+h1 {padding: 0 0 5px 0;}\r
+.panel_wrapper div.current {height:160px;}\r
+#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;}\r
+a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;}\r
+#datetime {width:180px;}\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm
new file mode 100644 (file)
index 0000000..8b07fa8
--- /dev/null
@@ -0,0 +1,161 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#xhtmlxtras_dlg.title_del_element}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+       <script type="text/javascript" src="js/element_common.js"></script>\r
+       <script type="text/javascript" src="js/del.js"></script>\r
+       <link rel="stylesheet" type="text/css" href="css/popup.css" />\r
+</head>\r
+<body id="xhtmlxtrasins" style="display: none">\r
+<form onsubmit="insertDel();return false;" action="#">\r
+       <div class="tabs">\r
+               <ul>\r
+                       <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>\r
+                       <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->\r
+               </ul>\r
+       </div>\r
+\r
+       <div class="panel_wrapper">\r
+               <div id="general_panel" class="panel current">\r
+                       <fieldset>\r
+                               <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend>\r
+                               <table border="0" cellpadding="0" cellspacing="4">\r
+                                       <tr>\r
+                                               <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td>\r
+                                               <td>\r
+                                                       <table border="0" cellspacing="0" cellpadding="0">\r
+                                                               <tr> \r
+                                                                       <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td> \r
+                                                                       <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>\r
+                                                               </tr>\r
+                                                       </table>\r
+                                               </td>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td>\r
+                                               <td><input id="cite" name="cite" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                               </table>\r
+                       </fieldset>\r
+                       <fieldset>\r
+                               <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>\r
+                               <table border="0" cellpadding="0" cellspacing="4">\r
+                                       <tr>\r
+                                               <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
+                                               <td><input id="title" name="title" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
+                                               <td><input id="id" name="id" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> \r
+                                               <td>\r
+                                                       <select id="class" name="class" class="field mceEditableSelect">\r
+                                                               <option value="">{#not_set}</option> \r
+                                                       </select>\r
+                                               </td>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
+                                               <td><input id="style" name="style" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
+                                               <td>\r
+                                                       <select id="dir" name="dir" class="field"> \r
+                                                               <option value="">{#not_set}</option> \r
+                                                               <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> \r
+                                                               <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> \r
+                                                       </select>\r
+                                               </td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
+                                               <td>\r
+                                                       <input id="lang" name="lang" type="text" value="" class="field" />\r
+                                               </td> \r
+                                       </tr>\r
+                               </table>\r
+                       </fieldset>\r
+               </div>\r
+               <div id="events_panel" class="panel">\r
+                       <fieldset>\r
+                               <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>\r
+\r
+                               <table border="0" cellpadding="0" cellspacing="4">\r
+                                       <tr>\r
+                                               <td class="label"><label for="onfocus">onfocus</label>:</td> \r
+                                               <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onblur">onblur</label>:</td> \r
+                                               <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onclick">onclick</label>:</td> \r
+                                               <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
+                                               <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
+                                               <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
+                                               <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
+                                               <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
+                                               <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
+                                               <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
+                                               <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
+                                               <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
+                                               <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                               </table>\r
+                       </fieldset>\r
+               </div>\r
+       </div>\r
+       <div class="mceActionPanel">\r
+               <input type="submit" id="insert" name="insert" value="{#update}" />\r
+               <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeDel();" style="display: none;" />\r
+               <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+       </div>\r
+</form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js
new file mode 100644 (file)
index 0000000..e519526
--- /dev/null
@@ -0,0 +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(/<abbr([^>]+)>/gi,"<html:abbr $1>");e.content=e.content.replace(/<\/abbr>/gi,"</html:abbr>")}}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
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..9b51b83
--- /dev/null
@@ -0,0 +1,144 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', {\r
+               init : function(ed, url) {\r
+                       // Register commands\r
+                       ed.addCommand('mceCite', function() {\r
+                               ed.windowManager.open({\r
+                                       file : url + '/cite.htm',\r
+                                       width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)),\r
+                                       height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)),\r
+                                       inline : 1\r
+                               }, {\r
+                                       plugin_url : url\r
+                               });\r
+                       });\r
+\r
+                       ed.addCommand('mceAcronym', function() {\r
+                               ed.windowManager.open({\r
+                                       file : url + '/acronym.htm',\r
+                                       width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)),\r
+                                       height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)),\r
+                                       inline : 1\r
+                               }, {\r
+                                       plugin_url : url\r
+                               });\r
+                       });\r
+\r
+                       ed.addCommand('mceAbbr', function() {\r
+                               ed.windowManager.open({\r
+                                       file : url + '/abbr.htm',\r
+                                       width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)),\r
+                                       height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)),\r
+                                       inline : 1\r
+                               }, {\r
+                                       plugin_url : url\r
+                               });\r
+                       });\r
+\r
+                       ed.addCommand('mceDel', function() {\r
+                               ed.windowManager.open({\r
+                                       file : url + '/del.htm',\r
+                                       width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)),\r
+                                       height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)),\r
+                                       inline : 1\r
+                               }, {\r
+                                       plugin_url : url\r
+                               });\r
+                       });\r
+\r
+                       ed.addCommand('mceIns', function() {\r
+                               ed.windowManager.open({\r
+                                       file : url + '/ins.htm',\r
+                                       width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)),\r
+                                       height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)),\r
+                                       inline : 1\r
+                               }, {\r
+                                       plugin_url : url\r
+                               });\r
+                       });\r
+\r
+                       ed.addCommand('mceAttributes', function() {\r
+                               ed.windowManager.open({\r
+                                       file : url + '/attributes.htm',\r
+                                       width : 380,\r
+                                       height : 370,\r
+                                       inline : 1\r
+                               }, {\r
+                                       plugin_url : url\r
+                               });\r
+                       });\r
+\r
+                       // Register buttons\r
+                       ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'});\r
+                       ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'});\r
+                       ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'});\r
+                       ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'});\r
+                       ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'});\r
+                       ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'});\r
+\r
+                       if (tinymce.isIE) {\r
+                               function fix(ed, o) {\r
+                                       if (o.set) {\r
+                                               o.content = o.content.replace(/<abbr([^>]+)>/gi, '<html:abbr $1>');\r
+                                               o.content = o.content.replace(/<\/abbr>/gi, '</html:abbr>');\r
+                                       }\r
+                               };\r
+\r
+                               ed.onBeforeSetContent.add(fix);\r
+                               ed.onPostProcess.add(fix);\r
+                       }\r
+\r
+                       ed.onNodeChange.add(function(ed, cm, n, co) {\r
+                               n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS');\r
+\r
+                               cm.setDisabled('cite', co);\r
+                               cm.setDisabled('acronym', co);\r
+                               cm.setDisabled('abbr', co);\r
+                               cm.setDisabled('del', co);\r
+                               cm.setDisabled('ins', co);\r
+                               cm.setDisabled('attribs', n && n.nodeName == 'BODY');\r
+                               cm.setActive('cite', 0);\r
+                               cm.setActive('acronym', 0);\r
+                               cm.setActive('abbr', 0);\r
+                               cm.setActive('del', 0);\r
+                               cm.setActive('ins', 0);\r
+\r
+                               // Activate all\r
+                               if (n) {\r
+                                       do {\r
+                                               cm.setDisabled(n.nodeName.toLowerCase(), 0);\r
+                                               cm.setActive(n.nodeName.toLowerCase(), 1);\r
+                                       } while (n = n.parentNode);\r
+                               }\r
+                       });\r
+\r
+                       ed.onPreInit.add(function() {\r
+                               // Fixed IE issue where it can't handle these elements correctly\r
+                               ed.dom.create('abbr');\r
+                       });\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'XHTML Xtras Plugin',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm
new file mode 100644 (file)
index 0000000..6c5470c
--- /dev/null
@@ -0,0 +1,161 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#xhtmlxtras_dlg.title_ins_element}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+       <script type="text/javascript" src="js/element_common.js"></script>\r
+       <script type="text/javascript" src="js/ins.js"></script>\r
+       <link rel="stylesheet" type="text/css" href="css/popup.css" />\r
+</head>\r
+<body id="xhtmlxtrasins" style="display: none">\r
+<form onsubmit="insertIns();return false;" action="#">\r
+       <div class="tabs">\r
+               <ul>\r
+                       <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>\r
+                       <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->\r
+               </ul>\r
+       </div>\r
+\r
+       <div class="panel_wrapper">\r
+               <div id="general_panel" class="panel current">\r
+                       <fieldset>\r
+                               <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend>\r
+                               <table border="0" cellpadding="0" cellspacing="4">\r
+                                       <tr>\r
+                                               <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td> \r
+                                               <td>\r
+                                                       <table border="0" cellspacing="0" cellpadding="0">\r
+                                                               <tr> \r
+                                                                       <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td> \r
+                                                                       <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>\r
+                                                               </tr>\r
+                                                       </table>\r
+                                               </td>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td> \r
+                                               <td><input id="cite" name="cite" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                               </table>\r
+                       </fieldset>\r
+                       <fieldset>\r
+                               <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>\r
+                               <table border="0" cellpadding="0" cellspacing="4">\r
+                                       <tr>\r
+                                               <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
+                                               <td><input id="title" name="title" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
+                                               <td><input id="id" name="id" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> \r
+                                               <td>\r
+                                                       <select id="class" name="class" class="field mceEditableSelect">\r
+                                                               <option value="">{#not_set}</option> \r
+                                                       </select>\r
+                                               </td>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
+                                               <td><input id="style" name="style" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
+                                               <td>\r
+                                                       <select id="dir" name="dir" class="field"> \r
+                                                               <option value="">{#not_set}</option> \r
+                                                               <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> \r
+                                                               <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> \r
+                                                       </select>\r
+                                               </td> \r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
+                                               <td>\r
+                                                       <input id="lang" name="lang" type="text" value="" class="field" />\r
+                                               </td> \r
+                                       </tr>\r
+                               </table>\r
+                       </fieldset>\r
+               </div>\r
+               <div id="events_panel" class="panel">\r
+                       <fieldset>\r
+                               <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>\r
+\r
+                               <table border="0" cellpadding="0" cellspacing="4">\r
+                                       <tr>\r
+                                               <td class="label"><label for="onfocus">onfocus</label>:</td> \r
+                                               <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onblur">onblur</label>:</td> \r
+                                               <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onclick">onclick</label>:</td> \r
+                                               <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
+                                               <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
+                                               <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
+                                               <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
+                                               <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
+                                               <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
+                                               <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
+                                               <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
+                                               <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+\r
+                                       <tr>\r
+                                               <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
+                                               <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> \r
+                                       </tr>\r
+                               </table>\r
+                       </fieldset>\r
+               </div>\r
+       </div>\r
+       <div class="mceActionPanel">\r
+               <input type="submit" id="insert" name="insert" value="{#update}" />\r
+               <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeIns();" style="display: none;" />\r
+               <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+       </div>\r
+</form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js
new file mode 100644 (file)
index 0000000..4b51a25
--- /dev/null
@@ -0,0 +1,28 @@
+/**\r
+ * abbr.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+function init() {\r
+       SXE.initElementDialog('abbr');\r
+       if (SXE.currentAction == "update") {\r
+               SXE.showRemoveButton();\r
+       }\r
+}\r
+\r
+function insertAbbr() {\r
+       SXE.insertElement('abbr');\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function removeAbbr() {\r
+       SXE.removeElement('abbr');\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js
new file mode 100644 (file)
index 0000000..6ec2f88
--- /dev/null
@@ -0,0 +1,28 @@
+/**\r
+ * acronym.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+function init() {\r
+       SXE.initElementDialog('acronym');\r
+       if (SXE.currentAction == "update") {\r
+               SXE.showRemoveButton();\r
+       }\r
+}\r
+\r
+function insertAcronym() {\r
+       SXE.insertElement('acronym');\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function removeAcronym() {\r
+       SXE.removeElement('acronym');\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js
new file mode 100644 (file)
index 0000000..d62a219
--- /dev/null
@@ -0,0 +1,126 @@
+/**\r
+ * attributes.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+function init() {\r
+       tinyMCEPopup.resizeToInnerSize();\r
+       var inst = tinyMCEPopup.editor;\r
+       var dom = inst.dom;\r
+       var elm = inst.selection.getNode();\r
+       var f = document.forms[0];\r
+       var onclick = dom.getAttrib(elm, 'onclick');\r
+\r
+       setFormValue('title', dom.getAttrib(elm, 'title'));\r
+       setFormValue('id', dom.getAttrib(elm, 'id'));\r
+       setFormValue('style', dom.getAttrib(elm, "style"));\r
+       setFormValue('dir', dom.getAttrib(elm, 'dir'));\r
+       setFormValue('lang', dom.getAttrib(elm, 'lang'));\r
+       setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));\r
+       setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));\r
+       setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));\r
+       setFormValue('onblur', dom.getAttrib(elm, 'onblur'));\r
+       setFormValue('onclick', onclick);\r
+       setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));\r
+       setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));\r
+       setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));\r
+       setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));\r
+       setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));\r
+       setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));\r
+       setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));\r
+       setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));\r
+       setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));\r
+       className = dom.getAttrib(elm, 'class');\r
+\r
+       addClassesToList('classlist', 'advlink_styles');\r
+       selectByValue(f, 'classlist', className, true);\r
+\r
+       TinyMCE_EditableSelects.init();\r
+}\r
+\r
+function setFormValue(name, value) {\r
+       if(value && document.forms[0].elements[name]){\r
+               document.forms[0].elements[name].value = value;\r
+       }\r
+}\r
+\r
+function insertAction() {\r
+       var inst = tinyMCEPopup.editor;\r
+       var elm = inst.selection.getNode();\r
+\r
+       tinyMCEPopup.execCommand("mceBeginUndoLevel");  \r
+       setAllAttribs(elm);\r
+       tinyMCEPopup.execCommand("mceEndUndoLevel");\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function setAttrib(elm, attrib, value) {\r
+       var formObj = document.forms[0];\r
+       var valueElm = formObj.elements[attrib.toLowerCase()];\r
+       var inst = tinyMCEPopup.editor;\r
+       var dom = inst.dom;\r
+\r
+       if (typeof(value) == "undefined" || value == null) {\r
+               value = "";\r
+\r
+               if (valueElm)\r
+                       value = valueElm.value;\r
+       }\r
+\r
+       if (value != "") {\r
+               dom.setAttrib(elm, attrib.toLowerCase(), value);\r
+\r
+               if (attrib == "style")\r
+                       attrib = "style.cssText";\r
+\r
+               if (attrib.substring(0, 2) == 'on')\r
+                       value = 'return true;' + value;\r
+\r
+               if (attrib == "class")\r
+                       attrib = "className";\r
+\r
+               elm[attrib]=value;\r
+       } else\r
+               elm.removeAttribute(attrib);\r
+}\r
+\r
+function setAllAttribs(elm) {\r
+       var f = document.forms[0];\r
+\r
+       setAttrib(elm, 'title');\r
+       setAttrib(elm, 'id');\r
+       setAttrib(elm, 'style');\r
+       setAttrib(elm, 'class', getSelectValue(f, 'classlist'));\r
+       setAttrib(elm, 'dir');\r
+       setAttrib(elm, 'lang');\r
+       setAttrib(elm, 'tabindex');\r
+       setAttrib(elm, 'accesskey');\r
+       setAttrib(elm, 'onfocus');\r
+       setAttrib(elm, 'onblur');\r
+       setAttrib(elm, 'onclick');\r
+       setAttrib(elm, 'ondblclick');\r
+       setAttrib(elm, 'onmousedown');\r
+       setAttrib(elm, 'onmouseup');\r
+       setAttrib(elm, 'onmouseover');\r
+       setAttrib(elm, 'onmousemove');\r
+       setAttrib(elm, 'onmouseout');\r
+       setAttrib(elm, 'onkeypress');\r
+       setAttrib(elm, 'onkeydown');\r
+       setAttrib(elm, 'onkeyup');\r
+\r
+       // Refresh in old MSIE\r
+//     if (tinyMCE.isMSIE5)\r
+//             elm.outerHTML = elm.outerHTML;\r
+}\r
+\r
+function insertAttribute() {\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
+tinyMCEPopup.requireLangPack();\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js
new file mode 100644 (file)
index 0000000..009b715
--- /dev/null
@@ -0,0 +1,28 @@
+/**\r
+ * cite.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+function init() {\r
+       SXE.initElementDialog('cite');\r
+       if (SXE.currentAction == "update") {\r
+               SXE.showRemoveButton();\r
+       }\r
+}\r
+\r
+function insertCite() {\r
+       SXE.insertElement('cite');\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function removeCite() {\r
+       SXE.removeElement('cite');\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js
new file mode 100644 (file)
index 0000000..9e5d8c5
--- /dev/null
@@ -0,0 +1,63 @@
+/**\r
+ * del.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+function init() {\r
+       SXE.initElementDialog('del');\r
+       if (SXE.currentAction == "update") {\r
+               setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));\r
+               setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));\r
+               SXE.showRemoveButton();\r
+       }\r
+}\r
+\r
+function setElementAttribs(elm) {\r
+       setAllCommonAttribs(elm);\r
+       setAttrib(elm, 'datetime');\r
+       setAttrib(elm, 'cite');\r
+}\r
+\r
+function insertDel() {\r
+       var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL');\r
+\r
+       tinyMCEPopup.execCommand('mceBeginUndoLevel');\r
+       if (elm == null) {\r
+               var s = SXE.inst.selection.getContent();\r
+               if(s.length > 0) {\r
+                       insertInlineElement('del');\r
+                       var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';});\r
+                       for (var i=0; i<elementArray.length; i++) {\r
+                               var elm = elementArray[i];\r
+                               setElementAttribs(elm);\r
+                       }\r
+               }\r
+       } else {\r
+               setElementAttribs(elm);\r
+       }\r
+       tinyMCEPopup.editor.nodeChanged();\r
+       tinyMCEPopup.execCommand('mceEndUndoLevel');\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function insertInlineElement(en) {\r
+       var ed = tinyMCEPopup.editor, dom = ed.dom;\r
+\r
+       ed.getDoc().execCommand('FontName', false, 'mceinline');\r
+       tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {\r
+               if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')\r
+                       dom.replace(dom.create(en), n, 1);\r
+       });\r
+}\r
+\r
+function removeDel() {\r
+       SXE.removeElement('del');\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js
new file mode 100644 (file)
index 0000000..5b494a5
--- /dev/null
@@ -0,0 +1,231 @@
+/**\r
+ * element_common.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+tinyMCEPopup.requireLangPack();\r
+\r
+function initCommonAttributes(elm) {\r
+       var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\r
+\r
+       // Setup form data for common element attributes\r
+       setFormValue('title', dom.getAttrib(elm, 'title'));\r
+       setFormValue('id', dom.getAttrib(elm, 'id'));\r
+       selectByValue(formObj, 'class', dom.getAttrib(elm, 'class'), true);\r
+       setFormValue('style', dom.getAttrib(elm, 'style'));\r
+       selectByValue(formObj, 'dir', dom.getAttrib(elm, 'dir'));\r
+       setFormValue('lang', dom.getAttrib(elm, 'lang'));\r
+       setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));\r
+       setFormValue('onblur', dom.getAttrib(elm, 'onblur'));\r
+       setFormValue('onclick', dom.getAttrib(elm, 'onclick'));\r
+       setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));\r
+       setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));\r
+       setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));\r
+       setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));\r
+       setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));\r
+       setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));\r
+       setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));\r
+       setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));\r
+       setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));\r
+}\r
+\r
+function setFormValue(name, value) {\r
+       if(document.forms[0].elements[name]) document.forms[0].elements[name].value = value;\r
+}\r
+\r
+function insertDateTime(id) {\r
+       document.getElementById(id).value = getDateTime(new Date(), "%Y-%m-%dT%H:%M:%S");\r
+}\r
+\r
+function getDateTime(d, fmt) {\r
+       fmt = fmt.replace("%D", "%m/%d/%y");\r
+       fmt = fmt.replace("%r", "%I:%M:%S %p");\r
+       fmt = fmt.replace("%Y", "" + d.getFullYear());\r
+       fmt = fmt.replace("%y", "" + d.getYear());\r
+       fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));\r
+       fmt = fmt.replace("%d", addZeros(d.getDate(), 2));\r
+       fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));\r
+       fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));\r
+       fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));\r
+       fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));\r
+       fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));\r
+       fmt = fmt.replace("%%", "%");\r
+\r
+       return fmt;\r
+}\r
+\r
+function addZeros(value, len) {\r
+       var i;\r
+\r
+       value = "" + value;\r
+\r
+       if (value.length < len) {\r
+               for (i=0; i<(len-value.length); i++)\r
+                       value = "0" + value;\r
+       }\r
+\r
+       return value;\r
+}\r
+\r
+function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {\r
+       if (!form_obj || !form_obj.elements[field_name])\r
+               return;\r
+\r
+       var sel = form_obj.elements[field_name];\r
+\r
+       var found = false;\r
+       for (var i=0; i<sel.options.length; i++) {\r
+               var option = sel.options[i];\r
+\r
+               if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {\r
+                       option.selected = true;\r
+                       found = true;\r
+               } else\r
+                       option.selected = false;\r
+       }\r
+\r
+       if (!found && add_custom && value != '') {\r
+               var option = new Option('Value: ' + value, value);\r
+               option.selected = true;\r
+               sel.options[sel.options.length] = option;\r
+       }\r
+\r
+       return found;\r
+}\r
+\r
+function setAttrib(elm, attrib, value) {\r
+       var formObj = document.forms[0];\r
+       var valueElm = formObj.elements[attrib.toLowerCase()];\r
+       tinyMCEPopup.editor.dom.setAttrib(elm, attrib, value || valueElm.value);\r
+}\r
+\r
+function setAllCommonAttribs(elm) {\r
+       setAttrib(elm, 'title');\r
+       setAttrib(elm, 'id');\r
+       setAttrib(elm, 'class');\r
+       setAttrib(elm, 'style');\r
+       setAttrib(elm, 'dir');\r
+       setAttrib(elm, 'lang');\r
+       /*setAttrib(elm, 'onfocus');\r
+       setAttrib(elm, 'onblur');\r
+       setAttrib(elm, 'onclick');\r
+       setAttrib(elm, 'ondblclick');\r
+       setAttrib(elm, 'onmousedown');\r
+       setAttrib(elm, 'onmouseup');\r
+       setAttrib(elm, 'onmouseover');\r
+       setAttrib(elm, 'onmousemove');\r
+       setAttrib(elm, 'onmouseout');\r
+       setAttrib(elm, 'onkeypress');\r
+       setAttrib(elm, 'onkeydown');\r
+       setAttrib(elm, 'onkeyup');*/\r
+}\r
+\r
+SXE = {\r
+       currentAction : "insert",\r
+       inst : tinyMCEPopup.editor,\r
+       updateElement : null\r
+}\r
+\r
+SXE.focusElement = SXE.inst.selection.getNode();\r
+\r
+SXE.initElementDialog = function(element_name) {\r
+       addClassesToList('class', 'xhtmlxtras_styles');\r
+       TinyMCE_EditableSelects.init();\r
+\r
+       element_name = element_name.toLowerCase();\r
+       var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());\r
+       if (elm != null && elm.nodeName.toUpperCase() == element_name.toUpperCase()) {\r
+               SXE.currentAction = "update";\r
+       }\r
+\r
+       if (SXE.currentAction == "update") {\r
+               initCommonAttributes(elm);\r
+               SXE.updateElement = elm;\r
+       }\r
+\r
+       document.forms[0].insert.value = tinyMCEPopup.getLang(SXE.currentAction, 'Insert', true); \r
+}\r
+\r
+SXE.insertElement = function(element_name) {\r
+       var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()), h, tagName;\r
+\r
+       tinyMCEPopup.execCommand('mceBeginUndoLevel');\r
+       if (elm == null) {\r
+               var s = SXE.inst.selection.getContent();\r
+               if(s.length > 0) {\r
+                       tagName = element_name;\r
+\r
+                       insertInlineElement(element_name);\r
+                       var elementArray = tinymce.grep(SXE.inst.dom.select(element_name));\r
+                       for (var i=0; i<elementArray.length; i++) {\r
+                               var elm = elementArray[i];\r
+\r
+                               if (SXE.inst.dom.getAttrib(elm, '_mce_new')) {\r
+                                       elm.id = '';\r
+                                       elm.setAttribute('id', '');\r
+                                       elm.removeAttribute('id');\r
+                                       elm.removeAttribute('_mce_new');\r
+\r
+                                       setAllCommonAttribs(elm);\r
+                               }\r
+                       }\r
+               }\r
+       } else {\r
+               setAllCommonAttribs(elm);\r
+       }\r
+       SXE.inst.nodeChanged();\r
+       tinyMCEPopup.execCommand('mceEndUndoLevel');\r
+}\r
+\r
+SXE.removeElement = function(element_name){\r
+       element_name = element_name.toLowerCase();\r
+       elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());\r
+       if(elm && elm.nodeName.toUpperCase() == element_name.toUpperCase()){\r
+               tinyMCEPopup.execCommand('mceBeginUndoLevel');\r
+               tinyMCE.execCommand('mceRemoveNode', false, elm);\r
+               SXE.inst.nodeChanged();\r
+               tinyMCEPopup.execCommand('mceEndUndoLevel');\r
+       }\r
+}\r
+\r
+SXE.showRemoveButton = function() {\r
+               document.getElementById("remove").style.display = '';\r
+}\r
+\r
+SXE.containsClass = function(elm,cl) {\r
+       return (elm.className.indexOf(cl) > -1) ? true : false;\r
+}\r
+\r
+SXE.removeClass = function(elm,cl) {\r
+       if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) {\r
+               return true;\r
+       }\r
+       var classNames = elm.className.split(" ");\r
+       var newClassNames = "";\r
+       for (var x = 0, cnl = classNames.length; x < cnl; x++) {\r
+               if (classNames[x] != cl) {\r
+                       newClassNames += (classNames[x] + " ");\r
+               }\r
+       }\r
+       elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end\r
+}\r
+\r
+SXE.addClass = function(elm,cl) {\r
+       if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl;\r
+       return true;\r
+}\r
+\r
+function insertInlineElement(en) {\r
+       var ed = tinyMCEPopup.editor, dom = ed.dom;\r
+\r
+       ed.getDoc().execCommand('FontName', false, 'mceinline');\r
+       tinymce.each(dom.select('span,font'), function(n) {\r
+               if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')\r
+                       dom.replace(dom.create(en, {_mce_new : 1}), n, 1);\r
+       });\r
+}\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
new file mode 100644 (file)
index 0000000..3774f0a
--- /dev/null
@@ -0,0 +1,62 @@
+/**\r
+ * ins.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+function init() {\r
+       SXE.initElementDialog('ins');\r
+       if (SXE.currentAction == "update") {\r
+               setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));\r
+               setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));\r
+               SXE.showRemoveButton();\r
+       }\r
+}\r
+\r
+function setElementAttribs(elm) {\r
+       setAllCommonAttribs(elm);\r
+       setAttrib(elm, 'datetime');\r
+       setAttrib(elm, 'cite');\r
+}\r
+\r
+function insertIns() {\r
+       var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS');\r
+       tinyMCEPopup.execCommand('mceBeginUndoLevel');\r
+       if (elm == null) {\r
+               var s = SXE.inst.selection.getContent();\r
+               if(s.length > 0) {\r
+                       insertInlineElement('INS');\r
+                       var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';});\r
+                       for (var i=0; i<elementArray.length; i++) {\r
+                               var elm = elementArray[i];\r
+                               setElementAttribs(elm);\r
+                       }\r
+               }\r
+       } else {\r
+               setElementAttribs(elm);\r
+       }\r
+       tinyMCEPopup.editor.nodeChanged();\r
+       tinyMCEPopup.execCommand('mceEndUndoLevel');\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function removeIns() {\r
+       SXE.removeElement('ins');\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function insertInlineElement(en) {\r
+       var ed = tinyMCEPopup.editor, dom = ed.dom;\r
+\r
+       ed.getDoc().execCommand('FontName', false, 'mceinline');\r
+       tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {\r
+               if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')\r
+                       dom.replace(dom.create(en), n, 1);\r
+       });\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
diff --git a/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js b/docs/include/jscripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js
new file mode 100644 (file)
index 0000000..45b6b26
--- /dev/null
@@ -0,0 +1,32 @@
+tinyMCE.addI18n('en.xhtmlxtras_dlg',{\r
+attribute_label_title:"Title",\r
+attribute_label_id:"ID",\r
+attribute_label_class:"Class",\r
+attribute_label_style:"Style",\r
+attribute_label_cite:"Cite",\r
+attribute_label_datetime:"Date/Time",\r
+attribute_label_langdir:"Text Direction",\r
+attribute_option_ltr:"Left to right",\r
+attribute_option_rtl:"Right to left",\r
+attribute_label_langcode:"Language",\r
+attribute_label_tabindex:"TabIndex",\r
+attribute_label_accesskey:"AccessKey",\r
+attribute_events_tab:"Events",\r
+attribute_attrib_tab:"Attributes",\r
+general_tab:"General",\r
+attrib_tab:"Attributes",\r
+events_tab:"Events",\r
+fieldset_general_tab:"General Settings",\r
+fieldset_attrib_tab:"Element Attributes",\r
+fieldset_events_tab:"Element Events",\r
+title_ins_element:"Insertion Element",\r
+title_del_element:"Deletion Element",\r
+title_acronym_element:"Acronym Element",\r
+title_abbr_element:"Abbreviation Element",\r
+title_cite_element:"Citation Element",\r
+remove:"Remove",\r
+insert_date:"Insert current date/time",\r
+option_ltr:"Left to right",\r
+option_rtl:"Right to left",\r
+attribs_title:"Insert/Edit Attributes"\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/about.htm b/docs/include/jscripts/tiny_mce/themes/advanced/about.htm
new file mode 100644 (file)
index 0000000..267f837
--- /dev/null
@@ -0,0 +1,54 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> \r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#advanced_dlg.about_title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="js/about.js"></script>\r
+</head>\r
+<body id="about" style="display: none">\r
+               <div class="tabs">\r
+                       <ul>\r
+                               <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.about_general}</a></span></li>\r
+                               <li id="help_tab" style="display:none"><span><a href="javascript:mcTabs.displayTab('help_tab','help_panel');" onmousedown="return false;">{#advanced_dlg.about_help}</a></span></li>\r
+                               <li id="plugins_tab"><span><a href="javascript:mcTabs.displayTab('plugins_tab','plugins_panel');" onmousedown="return false;">{#advanced_dlg.about_plugins}</a></span></li>\r
+                       </ul>\r
+               </div>\r
+\r
+               <div class="panel_wrapper">\r
+                       <div id="general_panel" class="panel current">\r
+                               <h3>{#advanced_dlg.about_title}</h3>\r
+                               <p>Version: <span id="version"></span> (<span id="date"></span>)</p>\r
+                               <p>TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under <a href="../../license.txt" target="_blank">LGPL</a>\r
+                               by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</p>\r
+                               <p>Copyright &copy; 2003-2008, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.</p>\r
+                               <p>For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.</p>\r
+\r
+                               <div id="buttoncontainer">\r
+                                       <a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a>\r
+                                       <a href="http://sourceforge.net/projects/tinymce/" target="_blank"><img src="http://sourceforge.net/sflogo.php?group_id=103281" alt="Hosted By Sourceforge" border="0" /></a>\r
+                                       <a href="http://www.freshmeat.net/projects/tinymce" target="_blank"><img src="http://tinymce.moxiecode.com/images/fm.gif" alt="Also on freshmeat" border="0" /></a>\r
+                               </div>\r
+                       </div>\r
+\r
+                       <div id="plugins_panel" class="panel">\r
+                               <div id="pluginscontainer">\r
+                                       <h3>{#advanced_dlg.about_loaded}</h3>\r
+\r
+                                       <div id="plugintablecontainer">\r
+                                       </div>\r
+\r
+                                       <p>&nbsp;</p>\r
+                               </div>\r
+                       </div>\r
+\r
+                       <div id="help_panel" class="panel noscroll" style="overflow: visible;">\r
+                               <div id="iframecontainer"></div>\r
+                       </div>\r
+               </div>\r
+\r
+               <div class="mceActionPanel">\r
+                       <input type="button" id="cancel" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" />\r
+               </div>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/anchor.htm b/docs/include/jscripts/tiny_mce/themes/advanced/anchor.htm
new file mode 100644 (file)
index 0000000..2bc63fc
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#advanced_dlg.anchor_title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="js/anchor.js"></script>\r
+</head>\r
+<body style="display: none">\r
+<form onsubmit="AnchorDialog.update();return false;" action="#">\r
+       <table border="0" cellpadding="4" cellspacing="0">\r
+               <tr>\r
+                       <td colspan="2" class="title">{#advanced_dlg.anchor_title}</td>\r
+               </tr>\r
+               <tr>\r
+                       <td class="nowrap">{#advanced_dlg.anchor_name}:</td>\r
+                       <td><input name="anchorName" type="text" class="mceFocus" id="anchorName" value="" style="width: 200px" /></td>\r
+               </tr>\r
+       </table>\r
+\r
+       <div class="mceActionPanel">\r
+               <input type="submit" id="insert" name="insert" value="{#update}" />\r
+               <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+       </div>\r
+</form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/charmap.htm b/docs/include/jscripts/tiny_mce/themes/advanced/charmap.htm
new file mode 100644 (file)
index 0000000..f11a38a
--- /dev/null
@@ -0,0 +1,53 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#advanced_dlg.charmap_title}</title>\r
+       <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="js/charmap.js"></script>\r
+</head>\r
+<body id="charmap" style="display:none">\r
+<table align="center" border="0" cellspacing="0" cellpadding="2">\r
+    <tr>\r
+        <td colspan="2" class="title">{#advanced_dlg.charmap_title}</td>\r
+    </tr>\r
+    <tr>\r
+        <td id="charmapView" rowspan="2" align="left" valign="top">\r
+                       <!-- Chars will be rendered here -->\r
+        </td>\r
+        <td width="100" align="center" valign="top">\r
+            <table border="0" cellpadding="0" cellspacing="0" width="100" style="height:100px">\r
+                <tr>\r
+                    <td id="codeV">&nbsp;</td>\r
+                </tr>\r
+                <tr>\r
+                    <td id="codeN">&nbsp;</td>\r
+                </tr>\r
+            </table>\r
+        </td>\r
+    </tr>\r
+    <tr>\r
+        <td valign="bottom" style="padding-bottom: 3px;">\r
+            <table width="100" align="center" border="0" cellpadding="2" cellspacing="0">\r
+                <tr>\r
+                    <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">HTML-Code</td>\r
+                </tr>\r
+                <tr>\r
+                    <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeA" align="center">&nbsp;</td>\r
+                </tr>\r
+                <tr>\r
+                    <td style="font-size: 1px;">&nbsp;</td>\r
+                </tr>\r
+                <tr>\r
+                    <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">NUM-Code</td>\r
+                </tr>\r
+                <tr>\r
+                    <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeB" align="center">&nbsp;</td>\r
+                </tr>\r
+            </table>\r
+        </td>\r
+    </tr>\r
+</table>\r
+\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/color_picker.htm b/docs/include/jscripts/tiny_mce/themes/advanced/color_picker.htm
new file mode 100644 (file)
index 0000000..096e755
--- /dev/null
@@ -0,0 +1,73 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#advanced_dlg.colorpicker_title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="js/color_picker.js"></script>\r
+</head>\r
+<body id="colorpicker" style="display: none">\r
+<form onsubmit="insertAction();return false" action="#">\r
+       <div class="tabs">\r
+               <ul>\r
+                       <li id="picker_tab" class="current"><span><a href="javascript:mcTabs.displayTab('picker_tab','picker_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_picker_tab}</a></span></li>\r
+                       <li id="rgb_tab"><span><a href="javascript:;" onclick="generateWebColors();mcTabs.displayTab('rgb_tab','rgb_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_palette_tab}</a></span></li>\r
+                       <li id="named_tab"><span><a  href="javascript:;" onclick="generateNamedColors();javascript:mcTabs.displayTab('named_tab','named_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_named_tab}</a></span></li>\r
+               </ul>\r
+       </div>\r
+\r
+       <div class="panel_wrapper">\r
+               <div id="picker_panel" class="panel current">\r
+                       <fieldset>\r
+                               <legend>{#advanced_dlg.colorpicker_picker_title}</legend>\r
+                               <div id="picker">\r
+                                       <img id="colors" src="img/colorpicker.jpg" onclick="computeColor(event)" onmousedown="isMouseDown = true;return false;" onmouseup="isMouseDown = false;" onmousemove="if (isMouseDown && isMouseOver) computeColor(event); return false;" onmouseover="isMouseOver=true;" onmouseout="isMouseOver=false;" alt="" />\r
+\r
+                                       <div id="light">\r
+                                               <!-- Will be filled with divs -->\r
+                                       </div>\r
+\r
+                                       <br style="clear: both" />\r
+                               </div>\r
+                       </fieldset>\r
+               </div>\r
+\r
+               <div id="rgb_panel" class="panel">\r
+                       <fieldset>\r
+                               <legend>{#advanced_dlg.colorpicker_palette_title}</legend>\r
+                               <div id="webcolors">\r
+                                       <!-- Gets filled with web safe colors-->\r
+                               </div>\r
+\r
+                               <br style="clear: both" />\r
+                       </fieldset>\r
+               </div>\r
+\r
+               <div id="named_panel" class="panel">\r
+                       <fieldset>\r
+                               <legend>{#advanced_dlg.colorpicker_named_title}</legend>\r
+                               <div id="namedcolors">\r
+                                       <!-- Gets filled with named colors-->\r
+                               </div>\r
+\r
+                               <br style="clear: both" />\r
+\r
+                               <div id="colornamecontainer">\r
+                                       {#advanced_dlg.colorpicker_name} <span id="colorname"></span>\r
+                               </div>\r
+                       </fieldset>\r
+               </div>\r
+       </div>\r
+\r
+       <div class="mceActionPanel">\r
+               <input type="submit" id="insert" name="insert" value="{#apply}" />\r
+\r
+               <div id="preview"></div>\r
+\r
+               <div id="previewblock">\r
+                       <label for="color">{#advanced_dlg.colorpicker_color}</label> <input id="color" type="text" size="8" maxlength="8" class="text mceFocus" />\r
+               </div>\r
+       </div>\r
+</form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/editor_template.js b/docs/include/jscripts/tiny_mce/themes/advanced/editor_template.js
new file mode 100644 (file)
index 0000000..914b9f4
--- /dev/null
@@ -0,0 +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",classes:n["class"]});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(n){i.focus();i.formatter.toggle(n);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});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);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.fontSize){k.execCommand("FontSize",false,i.fontSize)}else{f(m.settings.theme_advanced_font_sizes,function(p,o){if(p["class"]){j.push(p["class"])}});k.editorCommands._applyInlineStyle("span",{"class":i["class"]},{check_classes:j})}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:"#"},"<!-- IE -->"),"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=j.settings,n=d.get(j.id+"_tbl"),o=d.get(j.id+"_ifr"),m;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);m=n.clientHeight-o.clientHeight;d.setStyle(o,"height",l-m);d.setStyles(n,{width:i,height:l})},destroy:function(){var i=this.editor.id;b.clear(i+"_resize");b.clear(i+"_path_row");b.clear(i+"_external_close")},_simpleLayout:function(y,r,k,i){var x=this,u=x.editor,v=y.theme_advanced_toolbar_location,m=y.theme_advanced_statusbar_location,l,j,q,w;if(y.readonly){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});return j}if(v=="top"){x._addToolbars(r,k)}if(v=="external"){l=w=d.create("div",{style:"position:relative"});l=d.add(l,"div",{id:u.id+"_external","class":"mceExternalToolbar"});d.add(l,"a",{id:u.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});l=d.add(l,"table",{id:u.id+"_tblext",cellSpacing:0,cellPadding:0});q=d.add(l,"tbody");if(i.firstChild.className=="mceOldBoxModel"){i.firstChild.appendChild(w)}else{i.insertBefore(w,i.firstChild)}x._addToolbars(q,k);u.onMouseUp.add(function(){var o=d.get(u.id+"_external");d.show(o);d.hide(g);var n=b.add(u.id+"_external_close","click",function(){d.hide(u.id+"_external");b.remove(u.id+"_external_close","click",n)});d.show(o);d.setStyle(o,"top",0-d.getRect(u.id+"_tblext").h-1);d.hide(o);d.show(o);o.style.filter="";g=u.id+"_external";o=null})}if(m=="top"){x._addStatusBar(r,k)}if(!y.theme_advanced_toolbar_container){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"})}if(v=="bottom"){x._addToolbars(r,k)}if(m=="bottom"){x._addStatusBar(r,k)}return j},_rowLayout:function(w,m,k){var v=this,p=v.editor,u,x,i=p.controlManager,l,j,r,q;u=w.theme_advanced_containers_default_class||"";x=w.theme_advanced_containers_default_align||"center";f(c(w.theme_advanced_containers||""),function(s,o){var n=w["theme_advanced_container_"+s]||"";switch(n.toLowerCase()){case"mceeditor":l=d.add(m,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":v._addStatusBar(m,k);break;default:q=(w["theme_advanced_container_"+s+"_align"]||x).toLowerCase();q="mce"+v._ufirst(q);l=d.add(d.add(m,"tr"),"td",{"class":"mceToolbar "+(w["theme_advanced_container_"+s+"_class"]||u)+" "+q||x});r=i.createToolbar("toolbar"+o);v._addControls(n,r);d.setHTML(l,r.renderHTML());k.deltaHeight-=w.theme_advanced_row_height}});return j},_addControls:function(j,i){var k=this,l=k.settings,m,n=k.editor.controlManager;if(l.theme_advanced_disable&&!k._disabled){m={};f(c(l.theme_advanced_disable),function(o){m[o]=1});k._disabled=m}else{m=k._disabled}f(c(j),function(p){var o;if(m&&m[p]){return}if(p=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(q){q=k.createControl(q,n);if(q){i.add(q)}});return}o=k.createControl(p,n);if(o){i.add(o)}})},_addToolbars:function(w,k){var z=this,p,m,r=z.editor,A=z.settings,y,j=r.controlManager,u,l,q=[],x;x=A.theme_advanced_toolbar_align.toLowerCase();x="mce"+z._ufirst(x);l=d.add(d.add(w,"tr"),"td",{"class":"mceToolbar "+x});if(!r.getParam("accessibility_focus")){q.push(d.createHTML("a",{href:"#",onfocus:"tinyMCE.get('"+r.id+"').focus();"},"<!-- IE -->"))}q.push(d.createHTML("a",{href:"#",accesskey:"q",title:r.getLang("advanced.toolbar_focus")},"<!-- IE -->"));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();"},"<!-- IE -->"));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")+": ":"&#160;");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}if(w.theme_advanced_resize_horizontal){r.style.width=Math.max(10,n.cw)+"px"}r.style.height=Math.max(10,n.ch)+"px";d.get(p.id+"_ifr").style.height=Math.max(10,parseInt(n.ch)+v.deltaHeight)+"px"})}p.onPostRender.add(function(){b.add(p.id+"_resize","mousedown",function(x){var z,t,o,s,y,r;z=d.get(p.id+"_tbl");o=z.clientWidth;s=z.clientHeight;miw=w.theme_advanced_resizing_min_width||100;mih=w.theme_advanced_resizing_min_height||100;maw=w.theme_advanced_resizing_max_width||65535;mah=w.theme_advanced_resizing_max_height||65535;t=d.add(d.get(p.id+"_parent"),"div",{"class":"mcePlaceHolder"});d.setStyles(t,{width:o,height:s});d.hide(z);d.show(t);i={x:x.screenX,y:x.screenY,w:o,h:s,dx:null,dy:null};q=b.add(d.doc,"mousemove",function(B){var n,A;i.dx=B.screenX-i.x;i.dy=B.screenY-i.y;n=Math.max(miw,i.w+i.dx);A=Math.max(mih,i.h+i.dy);n=Math.min(maw,n);A=Math.min(mah,A);if(w.theme_advanced_resize_horizontal){t.style.width=n+"px"}t.style.height=A+"px";return b.cancel(B)});u=b.add(d.doc,"mouseup",function(n){var A;b.remove(d.doc,"mousemove",q);b.remove(d.doc,"mouseup",u);z.style.display="";d.remove(t);if(i.dx===null){return}A=d.get(p.id+"_ifr");if(w.theme_advanced_resize_horizontal){z.style.width=Math.max(10,i.w+i.dx)+"px"}z.style.height=Math.max(10,i.h+i.dy)+"px";A.style.height=Math.max(10,A.clientHeight+i.dy)+"px";if(w.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+p.id+"_size",{cw:i.w+i.dx,ch:i.h+i.dy})}});return b.cancel(x)})})}j.deltaHeight-=21;k=m=null},_nodeChanged:function(o,x,l,u,j){var A=this,i,w=0,z,q,B=A.settings,y,k,r;e.each(A.stateControls,function(n){x.setActive(n,o.queryCommandState(A.controls[n][1]))});function m(p){var s,n=j.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s<n.length;s++){if(t(n[s])){return n[s]}}}x.setActive("visualaid",o.hasVisual);x.setDisabled("undo",!o.undoManager.hasUndo()&&!o.typing);x.setDisabled("redo",!o.undoManager.hasRedo());x.setDisabled("outdent",!o.queryCommandState("Outdent"));i=m("A");if(q=x.get("link")){if(!i||!i.name){q.setDisabled(!i&&u);q.setActive(!!i)}}if(q=x.get("unlink")){q.setDisabled(!i&&u);q.setActive(!!i&&!i.name)}if(q=x.get("anchor")){q.setActive(!!i&&i.name)}i=m("IMG");if(q=x.get("image")){q.setActive(!!i&&l.className.indexOf("mceItem")==-1)}if(q=x.get("styleselect")){A._importClasses();q.select(function(n){return !!o.formatter.match(n)})}if(q=x.get("formatselect")){i=m(d.isBlock);if(i){q.select(i.nodeName.toLowerCase())}}m(function(p){if(p.nodeName==="SPAN"){if(!y&&p.className){y=p.className}if(!k&&p.style.fontSize){k=p.style.fontSize}if(!r&&p.style.fontFamily){r=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}}return false});if(q=x.get("fontselect")){q.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==r})}if(q=x.get("fontsizeselect")){if(B.theme_advanced_runtime_fontsize&&!k&&!y){k=o.dom.getStyle(l,"fontSize",true)}q.select(function(n){if(n.fontSize&&n.fontSize===k){return true}if(n["class"]&&n["class"]===y){return true}})}if(B.theme_advanced_path&&B.theme_advanced_statusbar_location){i=d.get(o.id+"_path")||d.add(o.id+"_path_row","span",{id:o.id+"_path"});d.setHTML(i,"");m(function(C){var p=C.nodeName.toLowerCase(),s,v,t="";if(C.nodeType!=1||C.nodeName==="BR"||(d.hasClass(C,"mceItemHidden")||d.hasClass(C,"mceItemRemoved"))){return}if(z=d.getAttrib(C,"mce_name")){p=z}if(e.isIE&&C.scopeName!=="HTML"){p=C.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(z=d.getAttrib(C,"src")){t+="src: "+z+" "}break;case"a":if(z=d.getAttrib(C,"name")){t+="name: "+z+" ";p+="#"+z}if(z=d.getAttrib(C,"href")){t+="href: "+z+" "}break;case"font":if(z=d.getAttrib(C,"face")){t+="font: "+z+" "}if(z=d.getAttrib(C,"size")){t+="size: "+z+" "}if(z=d.getAttrib(C,"color")){t+="color: "+z+" "}break;case"span":if(z=d.getAttrib(C,"style")){t+="style: "+z+" "}break}if(z=d.getAttrib(C,"id")){t+="id: "+z+" "}if(z=C.className){z=z.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(z){t+="class: "+z+" ";if(d.isBlock(C)||p=="img"||p=="span"){p+="."+z}}}p=p.replace(/(html:)/g,"");p={name:p,node:C,title:t};A.onResolveName.dispatch(A,p);t=p.title;p=p.name;v=d.create("a",{href:"javascript:;",onmousedown:"return false;",title:t,"class":"mcePath_"+(w++)},p);if(i.hasChildNodes()){i.insertBefore(d.doc.createTextNode(" \u00bb "),i.firstChild);i.insertBefore(v,i.firstChild)}else{i.appendChild(v)}},o.getBody())}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:e.baseURL+"/themes/advanced/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:e.baseURL+"/themes/advanced/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce));
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/editor_template_src.js b/docs/include/jscripts/tiny_mce/themes/advanced/editor_template_src.js
new file mode 100644 (file)
index 0000000..4a3a308
--- /dev/null
@@ -0,0 +1,1204 @@
+/**\r
+ * editor_template_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function(tinymce) {\r
+       var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode;\r
+\r
+       // Tell it to load theme specific language pack(s)\r
+       tinymce.ThemeManager.requireLangPack('advanced');\r
+\r
+       tinymce.create('tinymce.themes.AdvancedTheme', {\r
+               sizes : [8, 10, 12, 14, 18, 24, 36],\r
+\r
+               // Control name lookup, format: title, command\r
+               controls : {\r
+                       bold : ['bold_desc', 'Bold'],\r
+                       italic : ['italic_desc', 'Italic'],\r
+                       underline : ['underline_desc', 'Underline'],\r
+                       strikethrough : ['striketrough_desc', 'Strikethrough'],\r
+                       justifyleft : ['justifyleft_desc', 'JustifyLeft'],\r
+                       justifycenter : ['justifycenter_desc', 'JustifyCenter'],\r
+                       justifyright : ['justifyright_desc', 'JustifyRight'],\r
+                       justifyfull : ['justifyfull_desc', 'JustifyFull'],\r
+                       bullist : ['bullist_desc', 'InsertUnorderedList'],\r
+                       numlist : ['numlist_desc', 'InsertOrderedList'],\r
+                       outdent : ['outdent_desc', 'Outdent'],\r
+                       indent : ['indent_desc', 'Indent'],\r
+                       cut : ['cut_desc', 'Cut'],\r
+                       copy : ['copy_desc', 'Copy'],\r
+                       paste : ['paste_desc', 'Paste'],\r
+                       undo : ['undo_desc', 'Undo'],\r
+                       redo : ['redo_desc', 'Redo'],\r
+                       link : ['link_desc', 'mceLink'],\r
+                       unlink : ['unlink_desc', 'unlink'],\r
+                       image : ['image_desc', 'mceImage'],\r
+                       cleanup : ['cleanup_desc', 'mceCleanup'],\r
+                       help : ['help_desc', 'mceHelp'],\r
+                       code : ['code_desc', 'mceCodeEditor'],\r
+                       hr : ['hr_desc', 'InsertHorizontalRule'],\r
+                       removeformat : ['removeformat_desc', 'RemoveFormat'],\r
+                       sub : ['sub_desc', 'subscript'],\r
+                       sup : ['sup_desc', 'superscript'],\r
+                       forecolor : ['forecolor_desc', 'ForeColor'],\r
+                       forecolorpicker : ['forecolor_desc', 'mceForeColor'],\r
+                       backcolor : ['backcolor_desc', 'HiliteColor'],\r
+                       backcolorpicker : ['backcolor_desc', 'mceBackColor'],\r
+                       charmap : ['charmap_desc', 'mceCharMap'],\r
+                       visualaid : ['visualaid_desc', 'mceToggleVisualAid'],\r
+                       anchor : ['anchor_desc', 'mceInsertAnchor'],\r
+                       newdocument : ['newdocument_desc', 'mceNewDocument'],\r
+                       blockquote : ['blockquote_desc', 'mceBlockQuote']\r
+               },\r
+\r
+               stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'],\r
+\r
+               init : function(ed, url) {\r
+                       var t = this, s, v, o;\r
+       \r
+                       t.editor = ed;\r
+                       t.url = url;\r
+                       t.onResolveName = new tinymce.util.Dispatcher(this);\r
+\r
+                       // Default settings\r
+                       t.settings = s = extend({\r
+                               theme_advanced_path : true,\r
+                               theme_advanced_toolbar_location : 'bottom',\r
+                               theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",\r
+                               theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",\r
+                               theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap",\r
+                               theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",\r
+                               theme_advanced_toolbar_align : "center",\r
+                               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",\r
+                               theme_advanced_more_colors : 1,\r
+                               theme_advanced_row_height : 23,\r
+                               theme_advanced_resize_horizontal : 1,\r
+                               theme_advanced_resizing_use_cookie : 1,\r
+                               theme_advanced_font_sizes : "1,2,3,4,5,6,7",\r
+                               readonly : ed.settings.readonly\r
+                       }, ed.settings);\r
+\r
+                       // Setup default font_size_style_values\r
+                       if (!s.font_size_style_values)\r
+                               s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt";\r
+\r
+                       if (tinymce.is(s.theme_advanced_font_sizes, 'string')) {\r
+                               s.font_size_style_values = tinymce.explode(s.font_size_style_values);\r
+                               s.font_size_classes = tinymce.explode(s.font_size_classes || '');\r
+\r
+                               // Parse string value\r
+                               o = {};\r
+                               ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes;\r
+                               each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) {\r
+                                       var cl;\r
+\r
+                                       if (k == v && v >= 1 && v <= 7) {\r
+                                               k = v + ' (' + t.sizes[v - 1] + 'pt)';\r
+                                               cl = s.font_size_classes[v - 1];\r
+                                               v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt');\r
+                                       }\r
+\r
+                                       if (/^\s*\./.test(v))\r
+                                               cl = v.replace(/\./g, '');\r
+\r
+                                       o[k] = cl ? {'class' : cl} : {fontSize : v};\r
+                               });\r
+\r
+                               s.theme_advanced_font_sizes = o;\r
+                       }\r
+\r
+                       if ((v = s.theme_advanced_path_location) && v != 'none')\r
+                               s.theme_advanced_statusbar_location = s.theme_advanced_path_location;\r
+\r
+                       if (s.theme_advanced_statusbar_location == 'none')\r
+                               s.theme_advanced_statusbar_location = 0;\r
+\r
+                       // Init editor\r
+                       ed.onInit.add(function() {\r
+                               if (!ed.settings.readonly)\r
+                                       ed.onNodeChange.add(t._nodeChanged, t);\r
+\r
+                               if (ed.settings.content_css !== false)\r
+                                       ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/" + ed.settings.skin + "/content.css"));\r
+                       });\r
+\r
+                       ed.onSetProgressState.add(function(ed, b, ti) {\r
+                               var co, id = ed.id, tb;\r
+\r
+                               if (b) {\r
+                                       t.progressTimer = setTimeout(function() {\r
+                                               co = ed.getContainer();\r
+                                               co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild);\r
+                                               tb = DOM.get(ed.id + '_tbl');\r
+\r
+                                               DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}});\r
+                                               DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}});\r
+                                       }, ti || 0);\r
+                               } else {\r
+                                       DOM.remove(id + '_blocker');\r
+                                       DOM.remove(id + '_progress');\r
+                                       clearTimeout(t.progressTimer);\r
+                               }\r
+                       });\r
+\r
+                       DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css");\r
+\r
+                       if (s.skin_variant)\r
+                               DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css");\r
+               },\r
+\r
+               createControl : function(n, cf) {\r
+                       var cd, c;\r
+\r
+                       if (c = cf.createControl(n))\r
+                               return c;\r
+\r
+                       switch (n) {\r
+                               case "styleselect":\r
+                                       return this._createStyleSelect();\r
+\r
+                               case "formatselect":\r
+                                       return this._createBlockFormats();\r
+\r
+                               case "fontselect":\r
+                                       return this._createFontSelect();\r
+\r
+                               case "fontsizeselect":\r
+                                       return this._createFontSizeSelect();\r
+\r
+                               case "forecolor":\r
+                                       return this._createForeColorMenu();\r
+\r
+                               case "backcolor":\r
+                                       return this._createBackColorMenu();\r
+                       }\r
+\r
+                       if ((cd = this.controls[n]))\r
+                               return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]});\r
+               },\r
+\r
+               execCommand : function(cmd, ui, val) {\r
+                       var f = this['_' + cmd];\r
+\r
+                       if (f) {\r
+                               f.call(this, ui, val);\r
+                               return true;\r
+                       }\r
+\r
+                       return false;\r
+               },\r
+\r
+               _importClasses : function(e) {\r
+                       var ed = this.editor, ctrl = ed.controlManager.get('styleselect');\r
+\r
+                       if (ctrl.getLength() == 0) {\r
+                               each(ed.dom.getClasses(), function(o, idx) {\r
+                                       var name = 'style_' + idx;\r
+\r
+                                       ed.formatter.register(name, {\r
+                                               inline : 'span',\r
+                                               classes : o['class']\r
+                                       });\r
+\r
+                                       ctrl.add(o['class'], name);\r
+                               });\r
+                       }\r
+               },\r
+\r
+               _createStyleSelect : function(n) {\r
+                       var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl;\r
+\r
+                       // Setup style select box\r
+                       ctrl = ctrlMan.createListBox('styleselect', {\r
+                               title : 'advanced.style_select',\r
+                               onselect : function(name) {\r
+                                       ed.focus();\r
+                                       ed.formatter.toggle(name);\r
+\r
+                                       return false; // No auto select\r
+                               }\r
+                       });\r
+\r
+                       // Handle specified format\r
+                       ed.onInit.add(function() {\r
+                               var counter = 0, formats = ed.getParam('style_formats');\r
+\r
+                               if (formats) {\r
+                                       each(formats, function(fmt) {\r
+                                               var name, keys = 0;\r
+\r
+                                               each(fmt, function() {keys++;});\r
+\r
+                                               if (keys > 1) {\r
+                                                       name = fmt.name = fmt.name || 'style_' + (counter++);\r
+                                                       ed.formatter.register(name, fmt);\r
+                                                       ctrl.add(fmt.title, name);\r
+                                               } else\r
+                                                       ctrl.add(fmt.title);\r
+                                       });\r
+                               } else {\r
+                                       each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) {\r
+                                               var name;\r
+\r
+                                               if (val) {\r
+                                                       name = 'style_' + (counter++);\r
+\r
+                                                       ed.formatter.register(name, {\r
+                                                               inline : 'span',\r
+                                                               classes : val\r
+                                                       });\r
+\r
+                                                       ctrl.add(t.editor.translate(key), name);\r
+                                               }\r
+                                       });\r
+                               }\r
+                       });\r
+\r
+                       // Auto import classes if the ctrl box is empty\r
+                       if (ctrl.getLength() == 0) {\r
+                               ctrl.onPostRender.add(function(ed, n) {\r
+                                       if (!ctrl.NativeListBox) {\r
+                                               Event.add(n.id + '_text', 'focus', t._importClasses, t);\r
+                                               Event.add(n.id + '_text', 'mousedown', t._importClasses, t);\r
+                                               Event.add(n.id + '_open', 'focus', t._importClasses, t);\r
+                                               Event.add(n.id + '_open', 'mousedown', t._importClasses, t);\r
+                                       } else\r
+                                               Event.add(n.id, 'focus', t._importClasses, t);\r
+                               });\r
+                       }\r
+\r
+                       return ctrl;\r
+               },\r
+\r
+               _createFontSelect : function() {\r
+                       var c, t = this, ed = t.editor;\r
+\r
+                       c = ed.controlManager.createListBox('fontselect', {\r
+                               title : 'advanced.fontdefault',\r
+                               onselect : function(v) {\r
+                                       ed.execCommand('FontName', false, v);\r
+                                       return false; // No auto select\r
+                               }\r
+                       });\r
+\r
+                       if (c) {\r
+                               each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) {\r
+                                       c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''});\r
+                               });\r
+                       }\r
+\r
+                       return c;\r
+               },\r
+\r
+               _createFontSizeSelect : function() {\r
+                       var t = this, ed = t.editor, c, i = 0, cl = [];\r
+\r
+                       c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) {\r
+                               if (v.fontSize)\r
+                                       ed.execCommand('FontSize', false, v.fontSize);\r
+                               else {\r
+                                       each(t.settings.theme_advanced_font_sizes, function(v, k) {\r
+                                               if (v['class'])\r
+                                                       cl.push(v['class']);\r
+                                       });\r
+\r
+                                       ed.editorCommands._applyInlineStyle('span', {'class' : v['class']}, {check_classes : cl});\r
+                               }\r
+\r
+                               return false; // No auto select\r
+                       }});\r
+\r
+                       if (c) {\r
+                               each(t.settings.theme_advanced_font_sizes, function(v, k) {\r
+                                       var fz = v.fontSize;\r
+\r
+                                       if (fz >= 1 && fz <= 7)\r
+                                               fz = t.sizes[parseInt(fz) - 1] + 'pt';\r
+\r
+                                       c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))});\r
+                               });\r
+                       }\r
+\r
+                       return c;\r
+               },\r
+\r
+               _createBlockFormats : function() {\r
+                       var c, fmts = {\r
+                               p : 'advanced.paragraph',\r
+                               address : 'advanced.address',\r
+                               pre : 'advanced.pre',\r
+                               h1 : 'advanced.h1',\r
+                               h2 : 'advanced.h2',\r
+                               h3 : 'advanced.h3',\r
+                               h4 : 'advanced.h4',\r
+                               h5 : 'advanced.h5',\r
+                               h6 : 'advanced.h6',\r
+                               div : 'advanced.div',\r
+                               blockquote : 'advanced.blockquote',\r
+                               code : 'advanced.code',\r
+                               dt : 'advanced.dt',\r
+                               dd : 'advanced.dd',\r
+                               samp : 'advanced.samp'\r
+                       }, t = this;\r
+\r
+                       c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'});\r
+                       if (c) {\r
+                               each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) {\r
+                                       c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v});\r
+                               });\r
+                       }\r
+\r
+                       return c;\r
+               },\r
+\r
+               _createForeColorMenu : function() {\r
+                       var c, t = this, s = t.settings, o = {}, v;\r
+\r
+                       if (s.theme_advanced_more_colors) {\r
+                               o.more_colors_func = function() {\r
+                                       t._mceColorPicker(0, {\r
+                                               color : c.value,\r
+                                               func : function(co) {\r
+                                                       c.setColor(co);\r
+                                               }\r
+                                       });\r
+                               };\r
+                       }\r
+\r
+                       if (v = s.theme_advanced_text_colors)\r
+                               o.colors = v;\r
+\r
+                       if (s.theme_advanced_default_foreground_color)\r
+                               o.default_color = s.theme_advanced_default_foreground_color;\r
+\r
+                       o.title = 'advanced.forecolor_desc';\r
+                       o.cmd = 'ForeColor';\r
+                       o.scope = this;\r
+\r
+                       c = t.editor.controlManager.createColorSplitButton('forecolor', o);\r
+\r
+                       return c;\r
+               },\r
+\r
+               _createBackColorMenu : function() {\r
+                       var c, t = this, s = t.settings, o = {}, v;\r
+\r
+                       if (s.theme_advanced_more_colors) {\r
+                               o.more_colors_func = function() {\r
+                                       t._mceColorPicker(0, {\r
+                                               color : c.value,\r
+                                               func : function(co) {\r
+                                                       c.setColor(co);\r
+                                               }\r
+                                       });\r
+                               };\r
+                       }\r
+\r
+                       if (v = s.theme_advanced_background_colors)\r
+                               o.colors = v;\r
+\r
+                       if (s.theme_advanced_default_background_color)\r
+                               o.default_color = s.theme_advanced_default_background_color;\r
+\r
+                       o.title = 'advanced.backcolor_desc';\r
+                       o.cmd = 'HiliteColor';\r
+                       o.scope = this;\r
+\r
+                       c = t.editor.controlManager.createColorSplitButton('backcolor', o);\r
+\r
+                       return c;\r
+               },\r
+\r
+               renderUI : function(o) {\r
+                       var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl;\r
+\r
+                       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) : '')});\r
+\r
+                       if (!DOM.boxModel)\r
+                               n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'});\r
+\r
+                       n = sc = DOM.add(n, 'table', {id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0});\r
+                       n = tb = DOM.add(n, 'tbody');\r
+\r
+                       switch ((s.theme_advanced_layout_manager || '').toLowerCase()) {\r
+                               case "rowlayout":\r
+                                       ic = t._rowLayout(s, tb, o);\r
+                                       break;\r
+\r
+                               case "customlayout":\r
+                                       ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p);\r
+                                       break;\r
+\r
+                               default:\r
+                                       ic = t._simpleLayout(s, tb, o, p);\r
+                       }\r
+\r
+                       n = o.targetNode;\r
+\r
+                       // Add classes to first and last TRs\r
+                       nl = DOM.stdMode ? sc.getElementsByTagName('tr') : sc.rows; // Quick fix for IE 8\r
+                       DOM.addClass(nl[0], 'mceFirst');\r
+                       DOM.addClass(nl[nl.length - 1], 'mceLast');\r
+\r
+                       // Add classes to first and last TDs\r
+                       each(DOM.select('tr', tb), function(n) {\r
+                               DOM.addClass(n.firstChild, 'mceFirst');\r
+                               DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast');\r
+                       });\r
+\r
+                       if (DOM.get(s.theme_advanced_toolbar_container))\r
+                               DOM.get(s.theme_advanced_toolbar_container).appendChild(p);\r
+                       else\r
+                               DOM.insertAfter(p, n);\r
+\r
+                       Event.add(ed.id + '_path_row', 'click', function(e) {\r
+                               e = e.target;\r
+\r
+                               if (e.nodeName == 'A') {\r
+                                       t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1'));\r
+\r
+                                       return Event.cancel(e);\r
+                               }\r
+                       });\r
+/*\r
+                       if (DOM.get(ed.id + '_path_row')) {\r
+                               Event.add(ed.id + '_tbl', 'mouseover', function(e) {\r
+                                       var re;\r
+       \r
+                                       e = e.target;\r
+\r
+                                       if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) {\r
+                                               re = DOM.get(ed.id + '_path_row');\r
+                                               t.lastPath = re.innerHTML;\r
+                                               DOM.setHTML(re, e.parentNode.title);\r
+                                       }\r
+                               });\r
+\r
+                               Event.add(ed.id + '_tbl', 'mouseout', function(e) {\r
+                                       if (t.lastPath) {\r
+                                               DOM.setHTML(ed.id + '_path_row', t.lastPath);\r
+                                               t.lastPath = 0;\r
+                                       }\r
+                               });\r
+                       }\r
+*/\r
+\r
+                       if (!ed.getParam('accessibility_focus'))\r
+                               Event.add(DOM.add(p, 'a', {href : '#'}, '<!-- IE -->'), 'focus', function() {tinyMCE.get(ed.id).focus();});\r
+\r
+                       if (s.theme_advanced_toolbar_location == 'external')\r
+                               o.deltaHeight = 0;\r
+\r
+                       t.deltaHeight = o.deltaHeight;\r
+                       o.targetNode = null;\r
+\r
+                       return {\r
+                               iframeContainer : ic,\r
+                               editorContainer : ed.id + '_parent',\r
+                               sizeContainer : sc,\r
+                               deltaHeight : o.deltaHeight\r
+                       };\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Advanced theme',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       }\r
+               },\r
+\r
+               resizeBy : function(dw, dh) {\r
+                       var e = DOM.get(this.editor.id + '_tbl');\r
+\r
+                       this.resizeTo(e.clientWidth + dw, e.clientHeight + dh);\r
+               },\r
+\r
+               resizeTo : function(w, h) {\r
+                       var ed = this.editor, s = ed.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'), dh;\r
+\r
+                       // Boundery fix box\r
+                       w = Math.max(s.theme_advanced_resizing_min_width || 100, w);\r
+                       h = Math.max(s.theme_advanced_resizing_min_height || 100, h);\r
+                       w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w);\r
+                       h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h);\r
+\r
+                       // Calc difference between iframe and container\r
+                       dh = e.clientHeight - ifr.clientHeight;\r
+\r
+                       // Resize iframe and container\r
+                       DOM.setStyle(ifr, 'height', h - dh);\r
+                       DOM.setStyles(e, {width : w, height : h});\r
+               },\r
+\r
+               destroy : function() {\r
+                       var id = this.editor.id;\r
+\r
+                       Event.clear(id + '_resize');\r
+                       Event.clear(id + '_path_row');\r
+                       Event.clear(id + '_external_close');\r
+               },\r
+\r
+               // Internal functions\r
+\r
+               _simpleLayout : function(s, tb, o, p) {\r
+                       var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c;\r
+\r
+                       if (s.readonly) {\r
+                               n = DOM.add(tb, 'tr');\r
+                               n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});\r
+                               return ic;\r
+                       }\r
+\r
+                       // Create toolbar container at top\r
+                       if (lo == 'top')\r
+                               t._addToolbars(tb, o);\r
+\r
+                       // Create external toolbar\r
+                       if (lo == 'external') {\r
+                               n = c = DOM.create('div', {style : 'position:relative'});\r
+                               n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'});\r
+                               DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'});\r
+                               n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0});\r
+                               etb = DOM.add(n, 'tbody');\r
+\r
+                               if (p.firstChild.className == 'mceOldBoxModel')\r
+                                       p.firstChild.appendChild(c);\r
+                               else\r
+                                       p.insertBefore(c, p.firstChild);\r
+\r
+                               t._addToolbars(etb, o);\r
+\r
+                               ed.onMouseUp.add(function() {\r
+                                       var e = DOM.get(ed.id + '_external');\r
+                                       DOM.show(e);\r
+\r
+                                       DOM.hide(lastExtID);\r
+\r
+                                       var f = Event.add(ed.id + '_external_close', 'click', function() {\r
+                                               DOM.hide(ed.id + '_external');\r
+                                               Event.remove(ed.id + '_external_close', 'click', f);\r
+                                       });\r
+\r
+                                       DOM.show(e);\r
+                                       DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1);\r
+\r
+                                       // Fixes IE rendering bug\r
+                                       DOM.hide(e);\r
+                                       DOM.show(e);\r
+                                       e.style.filter = '';\r
+\r
+                                       lastExtID = ed.id + '_external';\r
+\r
+                                       e = null;\r
+                               });\r
+                       }\r
+\r
+                       if (sl == 'top')\r
+                               t._addStatusBar(tb, o);\r
+\r
+                       // Create iframe container\r
+                       if (!s.theme_advanced_toolbar_container) {\r
+                               n = DOM.add(tb, 'tr');\r
+                               n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});\r
+                       }\r
+\r
+                       // Create toolbar container at bottom\r
+                       if (lo == 'bottom')\r
+                               t._addToolbars(tb, o);\r
+\r
+                       if (sl == 'bottom')\r
+                               t._addStatusBar(tb, o);\r
+\r
+                       return ic;\r
+               },\r
+\r
+               _rowLayout : function(s, tb, o) {\r
+                       var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a;\r
+\r
+                       dc = s.theme_advanced_containers_default_class || '';\r
+                       da = s.theme_advanced_containers_default_align || 'center';\r
+\r
+                       each(explode(s.theme_advanced_containers || ''), function(c, i) {\r
+                               var v = s['theme_advanced_container_' + c] || '';\r
+\r
+                               switch (v.toLowerCase()) {\r
+                                       case 'mceeditor':\r
+                                               n = DOM.add(tb, 'tr');\r
+                                               n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});\r
+                                               break;\r
+\r
+                                       case 'mceelementpath':\r
+                                               t._addStatusBar(tb, o);\r
+                                               break;\r
+\r
+                                       default:\r
+                                               a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase();\r
+                                               a = 'mce' + t._ufirst(a);\r
+\r
+                                               n = DOM.add(DOM.add(tb, 'tr'), 'td', {\r
+                                                       'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da\r
+                                               });\r
+\r
+                                               to = cf.createToolbar("toolbar" + i);\r
+                                               t._addControls(v, to);\r
+                                               DOM.setHTML(n, to.renderHTML());\r
+                                               o.deltaHeight -= s.theme_advanced_row_height;\r
+                               }\r
+                       });\r
+\r
+                       return ic;\r
+               },\r
+\r
+               _addControls : function(v, tb) {\r
+                       var t = this, s = t.settings, di, cf = t.editor.controlManager;\r
+\r
+                       if (s.theme_advanced_disable && !t._disabled) {\r
+                               di = {};\r
+\r
+                               each(explode(s.theme_advanced_disable), function(v) {\r
+                                       di[v] = 1;\r
+                               });\r
+\r
+                               t._disabled = di;\r
+                       } else\r
+                               di = t._disabled;\r
+\r
+                       each(explode(v), function(n) {\r
+                               var c;\r
+\r
+                               if (di && di[n])\r
+                                       return;\r
+\r
+                               // Compatiblity with 2.x\r
+                               if (n == 'tablecontrols') {\r
+                                       each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) {\r
+                                               n = t.createControl(n, cf);\r
+\r
+                                               if (n)\r
+                                                       tb.add(n);\r
+                                       });\r
+\r
+                                       return;\r
+                               }\r
+\r
+                               c = t.createControl(n, cf);\r
+\r
+                               if (c)\r
+                                       tb.add(c);\r
+                       });\r
+               },\r
+\r
+               _addToolbars : function(c, o) {\r
+                       var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a;\r
+\r
+                       a = s.theme_advanced_toolbar_align.toLowerCase();\r
+                       a = 'mce' + t._ufirst(a);\r
+\r
+                       n = DOM.add(DOM.add(c, 'tr'), 'td', {'class' : 'mceToolbar ' + a});\r
+\r
+                       if (!ed.getParam('accessibility_focus'))\r
+                               h.push(DOM.createHTML('a', {href : '#', onfocus : 'tinyMCE.get(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));\r
+\r
+                       h.push(DOM.createHTML('a', {href : '#', accesskey : 'q', title : ed.getLang("advanced.toolbar_focus")}, '<!-- IE -->'));\r
+\r
+                       // Create toolbar and add the controls\r
+                       for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {\r
+                               tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i});\r
+\r
+                               if (s['theme_advanced_buttons' + i + '_add'])\r
+                                       v += ',' + s['theme_advanced_buttons' + i + '_add'];\r
+\r
+                               if (s['theme_advanced_buttons' + i + '_add_before'])\r
+                                       v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v;\r
+\r
+                               t._addControls(v, tb);\r
+\r
+                               //n.appendChild(n = tb.render());\r
+                               h.push(tb.renderHTML());\r
+\r
+                               o.deltaHeight -= s.theme_advanced_row_height;\r
+                       }\r
+\r
+                       h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));\r
+                       DOM.setHTML(n, h.join(''));\r
+               },\r
+\r
+               _addStatusBar : function(tb, o) {\r
+                       var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;\r
+\r
+                       n = DOM.add(tb, 'tr');\r
+                       n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});\r
+                       n = DOM.add(n, 'div', {id : ed.id + '_path_row'}, s.theme_advanced_path ? ed.translate('advanced.path') + ': ' : '&#160;');\r
+                       DOM.add(n, 'a', {href : '#', accesskey : 'x'});\r
+\r
+                       if (s.theme_advanced_resizing) {\r
+                               DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'});\r
+\r
+                               if (s.theme_advanced_resizing_use_cookie) {\r
+                                       ed.onPostRender.add(function() {\r
+                                               var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl');\r
+\r
+                                               if (!o)\r
+                                                       return;\r
+\r
+                                               if (s.theme_advanced_resize_horizontal)\r
+                                                       c.style.width = Math.max(10, o.cw) + 'px';\r
+\r
+                                               c.style.height = Math.max(10, o.ch) + 'px';\r
+                                               DOM.get(ed.id + '_ifr').style.height = Math.max(10, parseInt(o.ch) + t.deltaHeight) + 'px';\r
+                                       });\r
+                               }\r
+\r
+                               ed.onPostRender.add(function() {\r
+                                       Event.add(ed.id + '_resize', 'mousedown', function(e) {\r
+                                               var c, p, w, h, n, pa;\r
+\r
+                                               // Measure container\r
+                                               c = DOM.get(ed.id + '_tbl');\r
+                                               w = c.clientWidth;\r
+                                               h = c.clientHeight;\r
+\r
+                                               miw = s.theme_advanced_resizing_min_width || 100;\r
+                                               mih = s.theme_advanced_resizing_min_height || 100;\r
+                                               maw = s.theme_advanced_resizing_max_width || 0xFFFF;\r
+                                               mah = s.theme_advanced_resizing_max_height || 0xFFFF;\r
+\r
+                                               // Setup placeholder\r
+                                               p = DOM.add(DOM.get(ed.id + '_parent'), 'div', {'class' : 'mcePlaceHolder'});\r
+                                               DOM.setStyles(p, {width : w, height : h});\r
+\r
+                                               // Replace with placeholder\r
+                                               DOM.hide(c);\r
+                                               DOM.show(p);\r
+\r
+                                               // Create internal resize obj\r
+                                               r = {\r
+                                                       x : e.screenX,\r
+                                                       y : e.screenY,\r
+                                                       w : w,\r
+                                                       h : h,\r
+                                                       dx : null,\r
+                                                       dy : null\r
+                                               };\r
+\r
+                                               // Start listening\r
+                                               mf = Event.add(DOM.doc, 'mousemove', function(e) {\r
+                                                       var w, h;\r
+\r
+                                                       // Calc delta values\r
+                                                       r.dx = e.screenX - r.x;\r
+                                                       r.dy = e.screenY - r.y;\r
+\r
+                                                       // Boundery fix box\r
+                                                       w = Math.max(miw, r.w + r.dx);\r
+                                                       h = Math.max(mih, r.h + r.dy);\r
+                                                       w = Math.min(maw, w);\r
+                                                       h = Math.min(mah, h);\r
+\r
+                                                       // Resize placeholder\r
+                                                       if (s.theme_advanced_resize_horizontal)\r
+                                                               p.style.width = w + 'px';\r
+\r
+                                                       p.style.height = h + 'px';\r
+\r
+                                                       return Event.cancel(e);\r
+                                               });\r
+\r
+                                               me = Event.add(DOM.doc, 'mouseup', function(e) {\r
+                                                       var ifr;\r
+\r
+                                                       // Stop listening\r
+                                                       Event.remove(DOM.doc, 'mousemove', mf);\r
+                                                       Event.remove(DOM.doc, 'mouseup', me);\r
+\r
+                                                       c.style.display = '';\r
+                                                       DOM.remove(p);\r
+\r
+                                                       if (r.dx === null)\r
+                                                               return;\r
+\r
+                                                       ifr = DOM.get(ed.id + '_ifr');\r
+\r
+                                                       if (s.theme_advanced_resize_horizontal)\r
+                                                               c.style.width = Math.max(10, r.w + r.dx) + 'px';\r
+\r
+                                                       c.style.height = Math.max(10, r.h + r.dy) + 'px';\r
+                                                       ifr.style.height = Math.max(10, ifr.clientHeight + r.dy) + 'px';\r
+\r
+                                                       if (s.theme_advanced_resizing_use_cookie) {\r
+                                                               Cookie.setHash("TinyMCE_" + ed.id + "_size", {\r
+                                                                       cw : r.w + r.dx,\r
+                                                                       ch : r.h + r.dy\r
+                                                               });\r
+                                                       }\r
+                                               });\r
+\r
+                                               return Event.cancel(e);\r
+                                       });\r
+                               });\r
+                       }\r
+\r
+                       o.deltaHeight -= 21;\r
+                       n = tb = null;\r
+               },\r
+\r
+               _nodeChanged : function(ed, cm, n, co, ob) {\r
+                       var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn;\r
+\r
+                       tinymce.each(t.stateControls, function(c) {\r
+                               cm.setActive(c, ed.queryCommandState(t.controls[c][1]));\r
+                       });\r
+\r
+                       function getParent(name) {\r
+                               var i, parents = ob.parents, func = name;\r
+\r
+                               if (typeof(name) == 'string') {\r
+                                       func = function(node) {\r
+                                               return node.nodeName == name;\r
+                                       };\r
+                               }\r
+\r
+                               for (i = 0; i < parents.length; i++) {\r
+                                       if (func(parents[i]))\r
+                                               return parents[i];\r
+                               }\r
+                       };\r
+\r
+                       cm.setActive('visualaid', ed.hasVisual);\r
+                       cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing);\r
+                       cm.setDisabled('redo', !ed.undoManager.hasRedo());\r
+                       cm.setDisabled('outdent', !ed.queryCommandState('Outdent'));\r
+\r
+                       p = getParent('A');\r
+                       if (c = cm.get('link')) {\r
+                               if (!p || !p.name) {\r
+                                       c.setDisabled(!p && co);\r
+                                       c.setActive(!!p);\r
+                               }\r
+                       }\r
+\r
+                       if (c = cm.get('unlink')) {\r
+                               c.setDisabled(!p && co);\r
+                               c.setActive(!!p && !p.name);\r
+                       }\r
+\r
+                       if (c = cm.get('anchor')) {\r
+                               c.setActive(!!p && p.name);\r
+                       }\r
+\r
+                       p = getParent('IMG');\r
+                       if (c = cm.get('image'))\r
+                               c.setActive(!!p && n.className.indexOf('mceItem') == -1);\r
+\r
+                       if (c = cm.get('styleselect')) {\r
+                               t._importClasses();\r
+\r
+                               // Check each format and update\r
+                               c.select(function(fmt) {\r
+                                       return !!ed.formatter.match(fmt);\r
+                               });\r
+                       }\r
+\r
+                       if (c = cm.get('formatselect')) {\r
+                               p = getParent(DOM.isBlock);\r
+\r
+                               if (p)\r
+                                       c.select(p.nodeName.toLowerCase());\r
+                       }\r
+\r
+                       // Find out current fontSize, fontFamily and fontClass\r
+                       getParent(function(n) {\r
+                               if (n.nodeName === 'SPAN') {\r
+                                       if (!cl && n.className)\r
+                                               cl = n.className;\r
+\r
+                                       if (!fz && n.style.fontSize)\r
+                                               fz = n.style.fontSize;\r
+\r
+                                       if (!fn && n.style.fontFamily)\r
+                                               fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();\r
+                               }\r
+\r
+                               return false;\r
+                       });\r
+\r
+                       if (c = cm.get('fontselect')) {\r
+                               c.select(function(v) {\r
+                                       return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn;\r
+                               });\r
+                       }\r
+\r
+                       // Select font size\r
+                       if (c = cm.get('fontsizeselect')) {\r
+                               // Use computed style\r
+                               if (s.theme_advanced_runtime_fontsize && !fz && !cl)\r
+                                       fz = ed.dom.getStyle(n, 'fontSize', true);\r
+\r
+                               c.select(function(v) {\r
+                                       if (v.fontSize && v.fontSize === fz)\r
+                                               return true;\r
+\r
+                                       if (v['class'] && v['class'] === cl)\r
+                                               return true;\r
+                               });\r
+                       }\r
+\r
+                       if (s.theme_advanced_path && s.theme_advanced_statusbar_location) {\r
+                               p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'});\r
+                               DOM.setHTML(p, '');\r
+\r
+                               getParent(function(n) {\r
+                                       var na = n.nodeName.toLowerCase(), u, pi, ti = '';\r
+\r
+                                       /*if (n.getAttribute('_mce_bogus'))\r
+                                               return;\r
+*/\r
+                                       // Ignore non element and hidden elements\r
+                                       if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')))\r
+                                               return;\r
+\r
+                                       // Fake name\r
+                                       if (v = DOM.getAttrib(n, 'mce_name'))\r
+                                               na = v;\r
+\r
+                                       // Handle prefix\r
+                                       if (tinymce.isIE && n.scopeName !== 'HTML')\r
+                                               na = n.scopeName + ':' + na;\r
+\r
+                                       // Remove internal prefix\r
+                                       na = na.replace(/mce\:/g, '');\r
+\r
+                                       // Handle node name\r
+                                       switch (na) {\r
+                                               case 'b':\r
+                                                       na = 'strong';\r
+                                                       break;\r
+\r
+                                               case 'i':\r
+                                                       na = 'em';\r
+                                                       break;\r
+\r
+                                               case 'img':\r
+                                                       if (v = DOM.getAttrib(n, 'src'))\r
+                                                               ti += 'src: ' + v + ' ';\r
+\r
+                                                       break;\r
+\r
+                                               case 'a':\r
+                                                       if (v = DOM.getAttrib(n, 'name')) {\r
+                                                               ti += 'name: ' + v + ' ';\r
+                                                               na += '#' + v;\r
+                                                       }\r
+\r
+                                                       if (v = DOM.getAttrib(n, 'href'))\r
+                                                               ti += 'href: ' + v + ' ';\r
+\r
+                                                       break;\r
+\r
+                                               case 'font':\r
+                                                       if (v = DOM.getAttrib(n, 'face'))\r
+                                                               ti += 'font: ' + v + ' ';\r
+\r
+                                                       if (v = DOM.getAttrib(n, 'size'))\r
+                                                               ti += 'size: ' + v + ' ';\r
+\r
+                                                       if (v = DOM.getAttrib(n, 'color'))\r
+                                                               ti += 'color: ' + v + ' ';\r
+\r
+                                                       break;\r
+\r
+                                               case 'span':\r
+                                                       if (v = DOM.getAttrib(n, 'style'))\r
+                                                               ti += 'style: ' + v + ' ';\r
+\r
+                                                       break;\r
+                                       }\r
+\r
+                                       if (v = DOM.getAttrib(n, 'id'))\r
+                                               ti += 'id: ' + v + ' ';\r
+\r
+                                       if (v = n.className) {\r
+                                               v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '')\r
+\r
+                                               if (v) {\r
+                                                       ti += 'class: ' + v + ' ';\r
+\r
+                                                       if (DOM.isBlock(n) || na == 'img' || na == 'span')\r
+                                                               na += '.' + v;\r
+                                               }\r
+                                       }\r
+\r
+                                       na = na.replace(/(html:)/g, '');\r
+                                       na = {name : na, node : n, title : ti};\r
+                                       t.onResolveName.dispatch(t, na);\r
+                                       ti = na.title;\r
+                                       na = na.name;\r
+\r
+                                       //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');";\r
+                                       pi = DOM.create('a', {'href' : "javascript:;", onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na);\r
+\r
+                                       if (p.hasChildNodes()) {\r
+                                               p.insertBefore(DOM.doc.createTextNode(' \u00bb '), p.firstChild);\r
+                                               p.insertBefore(pi, p.firstChild);\r
+                                       } else\r
+                                               p.appendChild(pi);\r
+                               }, ed.getBody());\r
+                       }\r
+               },\r
+\r
+               // Commands gets called by execCommand\r
+\r
+               _sel : function(v) {\r
+                       this.editor.execCommand('mceSelectNodeDepth', false, v);\r
+               },\r
+\r
+               _mceInsertAnchor : function(ui, v) {\r
+                       var ed = this.editor;\r
+\r
+                       ed.windowManager.open({\r
+                               url : tinymce.baseURL + '/themes/advanced/anchor.htm',\r
+                               width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)),\r
+                               height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)),\r
+                               inline : true\r
+                       }, {\r
+                               theme_url : this.url\r
+                       });\r
+               },\r
+\r
+               _mceCharMap : function() {\r
+                       var ed = this.editor;\r
+\r
+                       ed.windowManager.open({\r
+                               url : tinymce.baseURL + '/themes/advanced/charmap.htm',\r
+                               width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)),\r
+                               height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),\r
+                               inline : true\r
+                       }, {\r
+                               theme_url : this.url\r
+                       });\r
+               },\r
+\r
+               _mceHelp : function() {\r
+                       var ed = this.editor;\r
+\r
+                       ed.windowManager.open({\r
+                               url : tinymce.baseURL + '/themes/advanced/about.htm',\r
+                               width : 480,\r
+                               height : 380,\r
+                               inline : true\r
+                       }, {\r
+                               theme_url : this.url\r
+                       });\r
+               },\r
+\r
+               _mceColorPicker : function(u, v) {\r
+                       var ed = this.editor;\r
+\r
+                       v = v || {};\r
+\r
+                       ed.windowManager.open({\r
+                               url : tinymce.baseURL + '/themes/advanced/color_picker.htm',\r
+                               width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)),\r
+                               height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)),\r
+                               close_previous : false,\r
+                               inline : true\r
+                       }, {\r
+                               input_color : v.color,\r
+                               func : v.func,\r
+                               theme_url : this.url\r
+                       });\r
+               },\r
+\r
+               _mceCodeEditor : function(ui, val) {\r
+                       var ed = this.editor;\r
+\r
+                       ed.windowManager.open({\r
+                               url : tinymce.baseURL + '/themes/advanced/source_editor.htm',\r
+                               width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)),\r
+                               height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)),\r
+                               inline : true,\r
+                               resizable : true,\r
+                               maximizable : true\r
+                       }, {\r
+                               theme_url : this.url\r
+                       });\r
+               },\r
+\r
+               _mceImage : function(ui, val) {\r
+                       var ed = this.editor;\r
+\r
+                       // Internal image object like a flash placeholder\r
+                       if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)\r
+                               return;\r
+\r
+                       ed.windowManager.open({\r
+                               url : tinymce.baseURL + '/themes/advanced/image.htm',\r
+                               width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)),\r
+                               height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)),\r
+                               inline : true\r
+                       }, {\r
+                               theme_url : this.url\r
+                       });\r
+               },\r
+\r
+               _mceLink : function(ui, val) {\r
+                       var ed = this.editor;\r
+\r
+                       ed.windowManager.open({\r
+                               url : tinymce.baseURL + '/themes/advanced/link.htm',\r
+                               width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)),\r
+                               height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)),\r
+                               inline : true\r
+                       }, {\r
+                               theme_url : this.url\r
+                       });\r
+               },\r
+\r
+               _mceNewDocument : function() {\r
+                       var ed = this.editor;\r
+\r
+                       ed.windowManager.confirm('advanced.newdocument', function(s) {\r
+                               if (s)\r
+                                       ed.execCommand('mceSetContent', false, '');\r
+                       });\r
+               },\r
+\r
+               _mceForeColor : function() {\r
+                       var t = this;\r
+\r
+                       this._mceColorPicker(0, {\r
+                               color: t.fgColor,\r
+                               func : function(co) {\r
+                                       t.fgColor = co;\r
+                                       t.editor.execCommand('ForeColor', false, co);\r
+                               }\r
+                       });\r
+               },\r
+\r
+               _mceBackColor : function() {\r
+                       var t = this;\r
+\r
+                       this._mceColorPicker(0, {\r
+                               color: t.bgColor,\r
+                               func : function(co) {\r
+                                       t.bgColor = co;\r
+                                       t.editor.execCommand('HiliteColor', false, co);\r
+                               }\r
+                       });\r
+               },\r
+\r
+               _ufirst : function(s) {\r
+                       return s.substring(0, 1).toUpperCase() + s.substring(1);\r
+               }\r
+       });\r
+\r
+       tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme);\r
+}(tinymce));
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/image.htm b/docs/include/jscripts/tiny_mce/themes/advanced/image.htm
new file mode 100644 (file)
index 0000000..f30d670
--- /dev/null
@@ -0,0 +1,80 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#advanced_dlg.image_title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <script type="text/javascript" src="js/image.js"></script>\r
+</head>\r
+<body id="image" style="display: none">\r
+<form onsubmit="ImageDialog.update();return false;" action="#">\r
+       <div class="tabs">\r
+               <ul>\r
+                       <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.image_title}</a></span></li>\r
+               </ul>\r
+       </div>\r
+\r
+       <div class="panel_wrapper">\r
+               <div id="general_panel" class="panel current">\r
+     <table border="0" cellpadding="4" cellspacing="0">\r
+          <tr>\r
+            <td class="nowrap"><label for="src">{#advanced_dlg.image_src}</label></td>\r
+            <td><table border="0" cellspacing="0" cellpadding="0">\r
+                <tr>\r
+                  <td><input id="src" name="src" type="text" class="mceFocus" value="" style="width: 200px" onchange="ImageDialog.getImageData();" /></td>\r
+                  <td id="srcbrowsercontainer">&nbsp;</td>\r
+                </tr>\r
+              </table></td>\r
+          </tr>\r
+                 <tr>\r
+                       <td><label for="image_list">{#advanced_dlg.image_list}</label></td>\r
+                       <td><select id="image_list" name="image_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;"></select></td>\r
+                 </tr>\r
+          <tr>\r
+            <td class="nowrap"><label for="alt">{#advanced_dlg.image_alt}</label></td>\r
+            <td><input id="alt" name="alt" type="text" value="" style="width: 200px" /></td>\r
+          </tr>\r
+          <tr>\r
+            <td class="nowrap"><label for="align">{#advanced_dlg.image_align}</label></td>\r
+            <td><select id="align" name="align" onchange="ImageDialog.updateStyle();">\r
+                <option value="">{#not_set}</option>\r
+                <option value="baseline">{#advanced_dlg.image_align_baseline}</option>\r
+                <option value="top">{#advanced_dlg.image_align_top}</option>\r
+                <option value="middle">{#advanced_dlg.image_align_middle}</option>\r
+                <option value="bottom">{#advanced_dlg.image_align_bottom}</option>\r
+                <option value="text-top">{#advanced_dlg.image_align_texttop}</option>\r
+                <option value="text-bottom">{#advanced_dlg.image_align_textbottom}</option>\r
+                <option value="left">{#advanced_dlg.image_align_left}</option>\r
+                <option value="right">{#advanced_dlg.image_align_right}</option>\r
+              </select></td>\r
+          </tr>\r
+          <tr>\r
+            <td class="nowrap"><label for="width">{#advanced_dlg.image_dimensions}</label></td>\r
+            <td><input id="width" name="width" type="text" value="" size="3" maxlength="5" />\r
+              x\r
+              <input id="height" name="height" type="text" value="" size="3" maxlength="5" /></td>\r
+          </tr>\r
+          <tr>\r
+            <td class="nowrap"><label for="border">{#advanced_dlg.image_border}</label></td>\r
+            <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>\r
+          </tr>\r
+          <tr>\r
+            <td class="nowrap"><label for="vspace">{#advanced_dlg.image_vspace}</label></td>\r
+            <td><input id="vspace" name="vspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>\r
+          </tr>\r
+          <tr>\r
+            <td class="nowrap"><label for="hspace">{#advanced_dlg.image_hspace}</label></td>\r
+            <td><input id="hspace" name="hspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>\r
+          </tr>\r
+        </table>\r
+               </div>\r
+       </div>\r
+\r
+       <div class="mceActionPanel">\r
+               <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+               <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+       </div>\r
+</form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg b/docs/include/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg
new file mode 100644 (file)
index 0000000..b4c542d
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg differ
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/img/icons.gif b/docs/include/jscripts/tiny_mce/themes/advanced/img/icons.gif
new file mode 100644 (file)
index 0000000..e46de53
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/themes/advanced/img/icons.gif differ
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/js/about.js b/docs/include/jscripts/tiny_mce/themes/advanced/js/about.js
new file mode 100644 (file)
index 0000000..5cee9ed
--- /dev/null
@@ -0,0 +1,72 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+function init() {\r
+       var ed, tcont;\r
+\r
+       tinyMCEPopup.resizeToInnerSize();\r
+       ed = tinyMCEPopup.editor;\r
+\r
+       // Give FF some time\r
+       window.setTimeout(insertHelpIFrame, 10);\r
+\r
+       tcont = document.getElementById('plugintablecontainer');\r
+       document.getElementById('plugins_tab').style.display = 'none';\r
+\r
+       var html = "";\r
+       html += '<table id="plugintable">';\r
+       html += '<thead>';\r
+       html += '<tr>';\r
+       html += '<td>' + ed.getLang('advanced_dlg.about_plugin') + '</td>';\r
+       html += '<td>' + ed.getLang('advanced_dlg.about_author') + '</td>';\r
+       html += '<td>' + ed.getLang('advanced_dlg.about_version') + '</td>';\r
+       html += '</tr>';\r
+       html += '</thead>';\r
+       html += '<tbody>';\r
+\r
+       tinymce.each(ed.plugins, function(p, n) {\r
+               var info;\r
+\r
+               if (!p.getInfo)\r
+                       return;\r
+\r
+               html += '<tr>';\r
+\r
+               info = p.getInfo();\r
+\r
+               if (info.infourl != null && info.infourl != '')\r
+                       html += '<td width="50%" title="' + n + '"><a href="' + info.infourl + '" target="_blank">' + info.longname + '</a></td>';\r
+               else\r
+                       html += '<td width="50%" title="' + n + '">' + info.longname + '</td>';\r
+\r
+               if (info.authorurl != null && info.authorurl != '')\r
+                       html += '<td width="35%"><a href="' + info.authorurl + '" target="_blank">' + info.author + '</a></td>';\r
+               else\r
+                       html += '<td width="35%">' + info.author + '</td>';\r
+\r
+               html += '<td width="15%">' + info.version + '</td>';\r
+               html += '</tr>';\r
+\r
+               document.getElementById('plugins_tab').style.display = '';\r
+\r
+       });\r
+\r
+       html += '</tbody>';\r
+       html += '</table>';\r
+\r
+       tcont.innerHTML = html;\r
+\r
+       tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion;\r
+       tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate;\r
+}\r
+\r
+function insertHelpIFrame() {\r
+       var html;\r
+\r
+       if (tinyMCEPopup.getParam('docs_url')) {\r
+               html = '<iframe width="100%" height="300" src="' + tinyMCEPopup.editor.baseURI.toAbsolute(tinyMCEPopup.getParam('docs_url')) + '"></iframe>';\r
+               document.getElementById('iframecontainer').innerHTML = html;\r
+               document.getElementById('help_tab').style.display = 'block';\r
+       }\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/js/anchor.js b/docs/include/jscripts/tiny_mce/themes/advanced/js/anchor.js
new file mode 100644 (file)
index 0000000..7fe7810
--- /dev/null
@@ -0,0 +1,37 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+var AnchorDialog = {\r
+       init : function(ed) {\r
+               var action, elm, f = document.forms[0];\r
+\r
+               this.editor = ed;\r
+               elm = ed.dom.getParent(ed.selection.getNode(), 'A');\r
+               v = ed.dom.getAttrib(elm, 'name');\r
+\r
+               if (v) {\r
+                       this.action = 'update';\r
+                       f.anchorName.value = v;\r
+               }\r
+\r
+               f.insert.value = ed.getLang(elm ? 'update' : 'insert');\r
+       },\r
+\r
+       update : function() {\r
+               var ed = this.editor, elm, name = document.forms[0].anchorName.value;\r
+\r
+               tinyMCEPopup.restoreSelection();\r
+\r
+               if (this.action != 'update')\r
+                       ed.selection.collapse(1);\r
+\r
+               elm = ed.dom.getParent(ed.selection.getNode(), 'A');\r
+               if (elm)\r
+                       elm.name = name;\r
+               else\r
+                       ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, ''));\r
+\r
+               tinyMCEPopup.close();\r
+       }\r
+};\r
+\r
+tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog);\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/js/charmap.js b/docs/include/jscripts/tiny_mce/themes/advanced/js/charmap.js
new file mode 100644 (file)
index 0000000..8c5aea1
--- /dev/null
@@ -0,0 +1,335 @@
+/**\r
+ * charmap.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+tinyMCEPopup.requireLangPack();\r
+\r
+var charmap = [\r
+       ['&nbsp;',    '&#160;',  true, 'no-break space'],\r
+       ['&amp;',     '&#38;',   true, 'ampersand'],\r
+       ['&quot;',    '&#34;',   true, 'quotation mark'],\r
+// finance\r
+       ['&cent;',    '&#162;',  true, 'cent sign'],\r
+       ['&euro;',    '&#8364;', true, 'euro sign'],\r
+       ['&pound;',   '&#163;',  true, 'pound sign'],\r
+       ['&yen;',     '&#165;',  true, 'yen sign'],\r
+// signs\r
+       ['&copy;',    '&#169;',  true, 'copyright sign'],\r
+       ['&reg;',     '&#174;',  true, 'registered sign'],\r
+       ['&trade;',   '&#8482;', true, 'trade mark sign'],\r
+       ['&permil;',  '&#8240;', true, 'per mille sign'],\r
+       ['&micro;',   '&#181;',  true, 'micro sign'],\r
+       ['&middot;',  '&#183;',  true, 'middle dot'],\r
+       ['&bull;',    '&#8226;', true, 'bullet'],\r
+       ['&hellip;',  '&#8230;', true, 'three dot leader'],\r
+       ['&prime;',   '&#8242;', true, 'minutes / feet'],\r
+       ['&Prime;',   '&#8243;', true, 'seconds / inches'],\r
+       ['&sect;',    '&#167;',  true, 'section sign'],\r
+       ['&para;',    '&#182;',  true, 'paragraph sign'],\r
+       ['&szlig;',   '&#223;',  true, 'sharp s / ess-zed'],\r
+// quotations\r
+       ['&lsaquo;',  '&#8249;', true, 'single left-pointing angle quotation mark'],\r
+       ['&rsaquo;',  '&#8250;', true, 'single right-pointing angle quotation mark'],\r
+       ['&laquo;',   '&#171;',  true, 'left pointing guillemet'],\r
+       ['&raquo;',   '&#187;',  true, 'right pointing guillemet'],\r
+       ['&lsquo;',   '&#8216;', true, 'left single quotation mark'],\r
+       ['&rsquo;',   '&#8217;', true, 'right single quotation mark'],\r
+       ['&ldquo;',   '&#8220;', true, 'left double quotation mark'],\r
+       ['&rdquo;',   '&#8221;', true, 'right double quotation mark'],\r
+       ['&sbquo;',   '&#8218;', true, 'single low-9 quotation mark'],\r
+       ['&bdquo;',   '&#8222;', true, 'double low-9 quotation mark'],\r
+       ['&lt;',      '&#60;',   true, 'less-than sign'],\r
+       ['&gt;',      '&#62;',   true, 'greater-than sign'],\r
+       ['&le;',      '&#8804;', true, 'less-than or equal to'],\r
+       ['&ge;',      '&#8805;', true, 'greater-than or equal to'],\r
+       ['&ndash;',   '&#8211;', true, 'en dash'],\r
+       ['&mdash;',   '&#8212;', true, 'em dash'],\r
+       ['&macr;',    '&#175;',  true, 'macron'],\r
+       ['&oline;',   '&#8254;', true, 'overline'],\r
+       ['&curren;',  '&#164;',  true, 'currency sign'],\r
+       ['&brvbar;',  '&#166;',  true, 'broken bar'],\r
+       ['&uml;',     '&#168;',  true, 'diaeresis'],\r
+       ['&iexcl;',   '&#161;',  true, 'inverted exclamation mark'],\r
+       ['&iquest;',  '&#191;',  true, 'turned question mark'],\r
+       ['&circ;',    '&#710;',  true, 'circumflex accent'],\r
+       ['&tilde;',   '&#732;',  true, 'small tilde'],\r
+       ['&deg;',     '&#176;',  true, 'degree sign'],\r
+       ['&minus;',   '&#8722;', true, 'minus sign'],\r
+       ['&plusmn;',  '&#177;',  true, 'plus-minus sign'],\r
+       ['&divide;',  '&#247;',  true, 'division sign'],\r
+       ['&frasl;',   '&#8260;', true, 'fraction slash'],\r
+       ['&times;',   '&#215;',  true, 'multiplication sign'],\r
+       ['&sup1;',    '&#185;',  true, 'superscript one'],\r
+       ['&sup2;',    '&#178;',  true, 'superscript two'],\r
+       ['&sup3;',    '&#179;',  true, 'superscript three'],\r
+       ['&frac14;',  '&#188;',  true, 'fraction one quarter'],\r
+       ['&frac12;',  '&#189;',  true, 'fraction one half'],\r
+       ['&frac34;',  '&#190;',  true, 'fraction three quarters'],\r
+// math / logical\r
+       ['&fnof;',    '&#402;',  true, 'function / florin'],\r
+       ['&int;',     '&#8747;', true, 'integral'],\r
+       ['&sum;',     '&#8721;', true, 'n-ary sumation'],\r
+       ['&infin;',   '&#8734;', true, 'infinity'],\r
+       ['&radic;',   '&#8730;', true, 'square root'],\r
+       ['&sim;',     '&#8764;', false,'similar to'],\r
+       ['&cong;',    '&#8773;', false,'approximately equal to'],\r
+       ['&asymp;',   '&#8776;', true, 'almost equal to'],\r
+       ['&ne;',      '&#8800;', true, 'not equal to'],\r
+       ['&equiv;',   '&#8801;', true, 'identical to'],\r
+       ['&isin;',    '&#8712;', false,'element of'],\r
+       ['&notin;',   '&#8713;', false,'not an element of'],\r
+       ['&ni;',      '&#8715;', false,'contains as member'],\r
+       ['&prod;',    '&#8719;', true, 'n-ary product'],\r
+       ['&and;',     '&#8743;', false,'logical and'],\r
+       ['&or;',      '&#8744;', false,'logical or'],\r
+       ['&not;',     '&#172;',  true, 'not sign'],\r
+       ['&cap;',     '&#8745;', true, 'intersection'],\r
+       ['&cup;',     '&#8746;', false,'union'],\r
+       ['&part;',    '&#8706;', true, 'partial differential'],\r
+       ['&forall;',  '&#8704;', false,'for all'],\r
+       ['&exist;',   '&#8707;', false,'there exists'],\r
+       ['&empty;',   '&#8709;', false,'diameter'],\r
+       ['&nabla;',   '&#8711;', false,'backward difference'],\r
+       ['&lowast;',  '&#8727;', false,'asterisk operator'],\r
+       ['&prop;',    '&#8733;', false,'proportional to'],\r
+       ['&ang;',     '&#8736;', false,'angle'],\r
+// undefined\r
+       ['&acute;',   '&#180;',  true, 'acute accent'],\r
+       ['&cedil;',   '&#184;',  true, 'cedilla'],\r
+       ['&ordf;',    '&#170;',  true, 'feminine ordinal indicator'],\r
+       ['&ordm;',    '&#186;',  true, 'masculine ordinal indicator'],\r
+       ['&dagger;',  '&#8224;', true, 'dagger'],\r
+       ['&Dagger;',  '&#8225;', true, 'double dagger'],\r
+// alphabetical special chars\r
+       ['&Agrave;',  '&#192;',  true, 'A - grave'],\r
+       ['&Aacute;',  '&#193;',  true, 'A - acute'],\r
+       ['&Acirc;',   '&#194;',  true, 'A - circumflex'],\r
+       ['&Atilde;',  '&#195;',  true, 'A - tilde'],\r
+       ['&Auml;',    '&#196;',  true, 'A - diaeresis'],\r
+       ['&Aring;',   '&#197;',  true, 'A - ring above'],\r
+       ['&AElig;',   '&#198;',  true, 'ligature AE'],\r
+       ['&Ccedil;',  '&#199;',  true, 'C - cedilla'],\r
+       ['&Egrave;',  '&#200;',  true, 'E - grave'],\r
+       ['&Eacute;',  '&#201;',  true, 'E - acute'],\r
+       ['&Ecirc;',   '&#202;',  true, 'E - circumflex'],\r
+       ['&Euml;',    '&#203;',  true, 'E - diaeresis'],\r
+       ['&Igrave;',  '&#204;',  true, 'I - grave'],\r
+       ['&Iacute;',  '&#205;',  true, 'I - acute'],\r
+       ['&Icirc;',   '&#206;',  true, 'I - circumflex'],\r
+       ['&Iuml;',    '&#207;',  true, 'I - diaeresis'],\r
+       ['&ETH;',     '&#208;',  true, 'ETH'],\r
+       ['&Ntilde;',  '&#209;',  true, 'N - tilde'],\r
+       ['&Ograve;',  '&#210;',  true, 'O - grave'],\r
+       ['&Oacute;',  '&#211;',  true, 'O - acute'],\r
+       ['&Ocirc;',   '&#212;',  true, 'O - circumflex'],\r
+       ['&Otilde;',  '&#213;',  true, 'O - tilde'],\r
+       ['&Ouml;',    '&#214;',  true, 'O - diaeresis'],\r
+       ['&Oslash;',  '&#216;',  true, 'O - slash'],\r
+       ['&OElig;',   '&#338;',  true, 'ligature OE'],\r
+       ['&Scaron;',  '&#352;',  true, 'S - caron'],\r
+       ['&Ugrave;',  '&#217;',  true, 'U - grave'],\r
+       ['&Uacute;',  '&#218;',  true, 'U - acute'],\r
+       ['&Ucirc;',   '&#219;',  true, 'U - circumflex'],\r
+       ['&Uuml;',    '&#220;',  true, 'U - diaeresis'],\r
+       ['&Yacute;',  '&#221;',  true, 'Y - acute'],\r
+       ['&Yuml;',    '&#376;',  true, 'Y - diaeresis'],\r
+       ['&THORN;',   '&#222;',  true, 'THORN'],\r
+       ['&agrave;',  '&#224;',  true, 'a - grave'],\r
+       ['&aacute;',  '&#225;',  true, 'a - acute'],\r
+       ['&acirc;',   '&#226;',  true, 'a - circumflex'],\r
+       ['&atilde;',  '&#227;',  true, 'a - tilde'],\r
+       ['&auml;',    '&#228;',  true, 'a - diaeresis'],\r
+       ['&aring;',   '&#229;',  true, 'a - ring above'],\r
+       ['&aelig;',   '&#230;',  true, 'ligature ae'],\r
+       ['&ccedil;',  '&#231;',  true, 'c - cedilla'],\r
+       ['&egrave;',  '&#232;',  true, 'e - grave'],\r
+       ['&eacute;',  '&#233;',  true, 'e - acute'],\r
+       ['&ecirc;',   '&#234;',  true, 'e - circumflex'],\r
+       ['&euml;',    '&#235;',  true, 'e - diaeresis'],\r
+       ['&igrave;',  '&#236;',  true, 'i - grave'],\r
+       ['&iacute;',  '&#237;',  true, 'i - acute'],\r
+       ['&icirc;',   '&#238;',  true, 'i - circumflex'],\r
+       ['&iuml;',    '&#239;',  true, 'i - diaeresis'],\r
+       ['&eth;',     '&#240;',  true, 'eth'],\r
+       ['&ntilde;',  '&#241;',  true, 'n - tilde'],\r
+       ['&ograve;',  '&#242;',  true, 'o - grave'],\r
+       ['&oacute;',  '&#243;',  true, 'o - acute'],\r
+       ['&ocirc;',   '&#244;',  true, 'o - circumflex'],\r
+       ['&otilde;',  '&#245;',  true, 'o - tilde'],\r
+       ['&ouml;',    '&#246;',  true, 'o - diaeresis'],\r
+       ['&oslash;',  '&#248;',  true, 'o slash'],\r
+       ['&oelig;',   '&#339;',  true, 'ligature oe'],\r
+       ['&scaron;',  '&#353;',  true, 's - caron'],\r
+       ['&ugrave;',  '&#249;',  true, 'u - grave'],\r
+       ['&uacute;',  '&#250;',  true, 'u - acute'],\r
+       ['&ucirc;',   '&#251;',  true, 'u - circumflex'],\r
+       ['&uuml;',    '&#252;',  true, 'u - diaeresis'],\r
+       ['&yacute;',  '&#253;',  true, 'y - acute'],\r
+       ['&thorn;',   '&#254;',  true, 'thorn'],\r
+       ['&yuml;',    '&#255;',  true, 'y - diaeresis'],\r
+    ['&Alpha;',   '&#913;',  true, 'Alpha'],\r
+       ['&Beta;',    '&#914;',  true, 'Beta'],\r
+       ['&Gamma;',   '&#915;',  true, 'Gamma'],\r
+       ['&Delta;',   '&#916;',  true, 'Delta'],\r
+       ['&Epsilon;', '&#917;',  true, 'Epsilon'],\r
+       ['&Zeta;',    '&#918;',  true, 'Zeta'],\r
+       ['&Eta;',     '&#919;',  true, 'Eta'],\r
+       ['&Theta;',   '&#920;',  true, 'Theta'],\r
+       ['&Iota;',    '&#921;',  true, 'Iota'],\r
+       ['&Kappa;',   '&#922;',  true, 'Kappa'],\r
+       ['&Lambda;',  '&#923;',  true, 'Lambda'],\r
+       ['&Mu;',      '&#924;',  true, 'Mu'],\r
+       ['&Nu;',      '&#925;',  true, 'Nu'],\r
+       ['&Xi;',      '&#926;',  true, 'Xi'],\r
+       ['&Omicron;', '&#927;',  true, 'Omicron'],\r
+       ['&Pi;',      '&#928;',  true, 'Pi'],\r
+       ['&Rho;',     '&#929;',  true, 'Rho'],\r
+       ['&Sigma;',   '&#931;',  true, 'Sigma'],\r
+       ['&Tau;',     '&#932;',  true, 'Tau'],\r
+       ['&Upsilon;', '&#933;',  true, 'Upsilon'],\r
+       ['&Phi;',     '&#934;',  true, 'Phi'],\r
+       ['&Chi;',     '&#935;',  true, 'Chi'],\r
+       ['&Psi;',     '&#936;',  true, 'Psi'],\r
+       ['&Omega;',   '&#937;',  true, 'Omega'],\r
+       ['&alpha;',   '&#945;',  true, 'alpha'],\r
+       ['&beta;',    '&#946;',  true, 'beta'],\r
+       ['&gamma;',   '&#947;',  true, 'gamma'],\r
+       ['&delta;',   '&#948;',  true, 'delta'],\r
+       ['&epsilon;', '&#949;',  true, 'epsilon'],\r
+       ['&zeta;',    '&#950;',  true, 'zeta'],\r
+       ['&eta;',     '&#951;',  true, 'eta'],\r
+       ['&theta;',   '&#952;',  true, 'theta'],\r
+       ['&iota;',    '&#953;',  true, 'iota'],\r
+       ['&kappa;',   '&#954;',  true, 'kappa'],\r
+       ['&lambda;',  '&#955;',  true, 'lambda'],\r
+       ['&mu;',      '&#956;',  true, 'mu'],\r
+       ['&nu;',      '&#957;',  true, 'nu'],\r
+       ['&xi;',      '&#958;',  true, 'xi'],\r
+       ['&omicron;', '&#959;',  true, 'omicron'],\r
+       ['&pi;',      '&#960;',  true, 'pi'],\r
+       ['&rho;',     '&#961;',  true, 'rho'],\r
+       ['&sigmaf;',  '&#962;',  true, 'final sigma'],\r
+       ['&sigma;',   '&#963;',  true, 'sigma'],\r
+       ['&tau;',     '&#964;',  true, 'tau'],\r
+       ['&upsilon;', '&#965;',  true, 'upsilon'],\r
+       ['&phi;',     '&#966;',  true, 'phi'],\r
+       ['&chi;',     '&#967;',  true, 'chi'],\r
+       ['&psi;',     '&#968;',  true, 'psi'],\r
+       ['&omega;',   '&#969;',  true, 'omega'],\r
+// symbols\r
+       ['&alefsym;', '&#8501;', false,'alef symbol'],\r
+       ['&piv;',     '&#982;',  false,'pi symbol'],\r
+       ['&real;',    '&#8476;', false,'real part symbol'],\r
+       ['&thetasym;','&#977;',  false,'theta symbol'],\r
+       ['&upsih;',   '&#978;',  false,'upsilon - hook symbol'],\r
+       ['&weierp;',  '&#8472;', false,'Weierstrass p'],\r
+       ['&image;',   '&#8465;', false,'imaginary part'],\r
+// arrows\r
+       ['&larr;',    '&#8592;', true, 'leftwards arrow'],\r
+       ['&uarr;',    '&#8593;', true, 'upwards arrow'],\r
+       ['&rarr;',    '&#8594;', true, 'rightwards arrow'],\r
+       ['&darr;',    '&#8595;', true, 'downwards arrow'],\r
+       ['&harr;',    '&#8596;', true, 'left right arrow'],\r
+       ['&crarr;',   '&#8629;', false,'carriage return'],\r
+       ['&lArr;',    '&#8656;', false,'leftwards double arrow'],\r
+       ['&uArr;',    '&#8657;', false,'upwards double arrow'],\r
+       ['&rArr;',    '&#8658;', false,'rightwards double arrow'],\r
+       ['&dArr;',    '&#8659;', false,'downwards double arrow'],\r
+       ['&hArr;',    '&#8660;', false,'left right double arrow'],\r
+       ['&there4;',  '&#8756;', false,'therefore'],\r
+       ['&sub;',     '&#8834;', false,'subset of'],\r
+       ['&sup;',     '&#8835;', false,'superset of'],\r
+       ['&nsub;',    '&#8836;', false,'not a subset of'],\r
+       ['&sube;',    '&#8838;', false,'subset of or equal to'],\r
+       ['&supe;',    '&#8839;', false,'superset of or equal to'],\r
+       ['&oplus;',   '&#8853;', false,'circled plus'],\r
+       ['&otimes;',  '&#8855;', false,'circled times'],\r
+       ['&perp;',    '&#8869;', false,'perpendicular'],\r
+       ['&sdot;',    '&#8901;', false,'dot operator'],\r
+       ['&lceil;',   '&#8968;', false,'left ceiling'],\r
+       ['&rceil;',   '&#8969;', false,'right ceiling'],\r
+       ['&lfloor;',  '&#8970;', false,'left floor'],\r
+       ['&rfloor;',  '&#8971;', false,'right floor'],\r
+       ['&lang;',    '&#9001;', false,'left-pointing angle bracket'],\r
+       ['&rang;',    '&#9002;', false,'right-pointing angle bracket'],\r
+       ['&loz;',     '&#9674;', true,'lozenge'],\r
+       ['&spades;',  '&#9824;', false,'black spade suit'],\r
+       ['&clubs;',   '&#9827;', true, 'black club suit'],\r
+       ['&hearts;',  '&#9829;', true, 'black heart suit'],\r
+       ['&diams;',   '&#9830;', true, 'black diamond suit'],\r
+       ['&ensp;',    '&#8194;', false,'en space'],\r
+       ['&emsp;',    '&#8195;', false,'em space'],\r
+       ['&thinsp;',  '&#8201;', false,'thin space'],\r
+       ['&zwnj;',    '&#8204;', false,'zero width non-joiner'],\r
+       ['&zwj;',     '&#8205;', false,'zero width joiner'],\r
+       ['&lrm;',     '&#8206;', false,'left-to-right mark'],\r
+       ['&rlm;',     '&#8207;', false,'right-to-left mark'],\r
+       ['&shy;',     '&#173;',  false,'soft hyphen']\r
+];\r
+\r
+tinyMCEPopup.onInit.add(function() {\r
+       tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML());\r
+});\r
+\r
+function renderCharMapHTML() {\r
+       var charsPerRow = 20, tdWidth=20, tdHeight=20, i;\r
+       var html = '<table border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) + '"><tr height="' + tdHeight + '">';\r
+       var cols=-1;\r
+\r
+       for (i=0; i<charmap.length; i++) {\r
+               if (charmap[i][2]==true) {\r
+                       cols++;\r
+                       html += ''\r
+                               + '<td class="charmap">'\r
+                               + '<a onmouseover="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" onfocus="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" href="javascript:void(0)" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + '">'\r
+                               + charmap[i][1]\r
+                               + '</a></td>';\r
+                       if ((cols+1) % charsPerRow == 0)\r
+                               html += '</tr><tr height="' + tdHeight + '">';\r
+               }\r
+        }\r
+\r
+       if (cols % charsPerRow > 0) {\r
+               var padd = charsPerRow - (cols % charsPerRow);\r
+               for (var i=0; i<padd-1; i++)\r
+                       html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap">&nbsp;</td>';\r
+       }\r
+\r
+       html += '</tr></table>';\r
+\r
+       return html;\r
+}\r
+\r
+function insertChar(chr) {\r
+       tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';');\r
+\r
+       // Refocus in window\r
+       if (tinyMCEPopup.isWindow)\r
+               window.focus();\r
+\r
+       tinyMCEPopup.editor.focus();\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function previewChar(codeA, codeB, codeN) {\r
+       var elmA = document.getElementById('codeA');\r
+       var elmB = document.getElementById('codeB');\r
+       var elmV = document.getElementById('codeV');\r
+       var elmN = document.getElementById('codeN');\r
+\r
+       if (codeA=='#160;') {\r
+               elmV.innerHTML = '__';\r
+       } else {\r
+               elmV.innerHTML = '&' + codeA;\r
+       }\r
+\r
+       elmB.innerHTML = '&amp;' + codeA;\r
+       elmA.innerHTML = '&amp;' + codeB;\r
+       elmN.innerHTML = codeN;\r
+}\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/js/color_picker.js b/docs/include/jscripts/tiny_mce/themes/advanced/js/color_picker.js
new file mode 100644 (file)
index 0000000..fd9700f
--- /dev/null
@@ -0,0 +1,253 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;\r
+\r
+var colors = [\r
+       "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",\r
+       "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",\r
+       "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",\r
+       "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",\r
+       "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",\r
+       "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",\r
+       "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",\r
+       "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",\r
+       "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",\r
+       "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",\r
+       "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",\r
+       "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",\r
+       "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",\r
+       "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",\r
+       "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",\r
+       "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",\r
+       "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",\r
+       "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",\r
+       "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",\r
+       "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",\r
+       "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",\r
+       "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",\r
+       "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",\r
+       "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",\r
+       "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",\r
+       "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",\r
+       "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"\r
+];\r
+\r
+var named = {\r
+       '#F0F8FF':'AliceBlue','#FAEBD7':'AntiqueWhite','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',\r
+       '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'BlanchedAlmond','#0000FF':'Blue','#8A2BE2':'BlueViolet','#A52A2A':'Brown',\r
+       '#DEB887':'BurlyWood','#5F9EA0':'CadetBlue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'CornflowerBlue',\r
+       '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'DarkBlue','#008B8B':'DarkCyan','#B8860B':'DarkGoldenRod',\r
+       '#A9A9A9':'DarkGray','#A9A9A9':'DarkGrey','#006400':'DarkGreen','#BDB76B':'DarkKhaki','#8B008B':'DarkMagenta','#556B2F':'DarkOliveGreen',\r
+       '#FF8C00':'Darkorange','#9932CC':'DarkOrchid','#8B0000':'DarkRed','#E9967A':'DarkSalmon','#8FBC8F':'DarkSeaGreen','#483D8B':'DarkSlateBlue',\r
+       '#2F4F4F':'DarkSlateGray','#2F4F4F':'DarkSlateGrey','#00CED1':'DarkTurquoise','#9400D3':'DarkViolet','#FF1493':'DeepPink','#00BFFF':'DeepSkyBlue',\r
+       '#696969':'DimGray','#696969':'DimGrey','#1E90FF':'DodgerBlue','#B22222':'FireBrick','#FFFAF0':'FloralWhite','#228B22':'ForestGreen',\r
+       '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'GhostWhite','#FFD700':'Gold','#DAA520':'GoldenRod','#808080':'Gray','#808080':'Grey',\r
+       '#008000':'Green','#ADFF2F':'GreenYellow','#F0FFF0':'HoneyDew','#FF69B4':'HotPink','#CD5C5C':'IndianRed','#4B0082':'Indigo','#FFFFF0':'Ivory',\r
+       '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'LavenderBlush','#7CFC00':'LawnGreen','#FFFACD':'LemonChiffon','#ADD8E6':'LightBlue',\r
+       '#F08080':'LightCoral','#E0FFFF':'LightCyan','#FAFAD2':'LightGoldenRodYellow','#D3D3D3':'LightGray','#D3D3D3':'LightGrey','#90EE90':'LightGreen',\r
+       '#FFB6C1':'LightPink','#FFA07A':'LightSalmon','#20B2AA':'LightSeaGreen','#87CEFA':'LightSkyBlue','#778899':'LightSlateGray','#778899':'LightSlateGrey',\r
+       '#B0C4DE':'LightSteelBlue','#FFFFE0':'LightYellow','#00FF00':'Lime','#32CD32':'LimeGreen','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',\r
+       '#66CDAA':'MediumAquaMarine','#0000CD':'MediumBlue','#BA55D3':'MediumOrchid','#9370D8':'MediumPurple','#3CB371':'MediumSeaGreen','#7B68EE':'MediumSlateBlue',\r
+       '#00FA9A':'MediumSpringGreen','#48D1CC':'MediumTurquoise','#C71585':'MediumVioletRed','#191970':'MidnightBlue','#F5FFFA':'MintCream','#FFE4E1':'MistyRose','#FFE4B5':'Moccasin',\r
+       '#FFDEAD':'NavajoWhite','#000080':'Navy','#FDF5E6':'OldLace','#808000':'Olive','#6B8E23':'OliveDrab','#FFA500':'Orange','#FF4500':'OrangeRed','#DA70D6':'Orchid',\r
+       '#EEE8AA':'PaleGoldenRod','#98FB98':'PaleGreen','#AFEEEE':'PaleTurquoise','#D87093':'PaleVioletRed','#FFEFD5':'PapayaWhip','#FFDAB9':'PeachPuff',\r
+       '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'PowderBlue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'RosyBrown','#4169E1':'RoyalBlue',\r
+       '#8B4513':'SaddleBrown','#FA8072':'Salmon','#F4A460':'SandyBrown','#2E8B57':'SeaGreen','#FFF5EE':'SeaShell','#A0522D':'Sienna','#C0C0C0':'Silver',\r
+       '#87CEEB':'SkyBlue','#6A5ACD':'SlateBlue','#708090':'SlateGray','#708090':'SlateGrey','#FFFAFA':'Snow','#00FF7F':'SpringGreen',\r
+       '#4682B4':'SteelBlue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',\r
+       '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'WhiteSmoke','#FFFF00':'Yellow','#9ACD32':'YellowGreen'\r
+};\r
+\r
+function init() {\r
+       var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color'));\r
+\r
+       tinyMCEPopup.resizeToInnerSize();\r
+\r
+       generatePicker();\r
+\r
+       if (inputColor) {\r
+               changeFinalColor(inputColor);\r
+\r
+               col = convertHexToRGB(inputColor);\r
+\r
+               if (col)\r
+                       updateLight(col.r, col.g, col.b);\r
+       }\r
+}\r
+\r
+function insertAction() {\r
+       var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');\r
+\r
+       tinyMCEPopup.restoreSelection();\r
+\r
+       if (f)\r
+               f(color);\r
+\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function showColor(color, name) {\r
+       if (name)\r
+               document.getElementById("colorname").innerHTML = name;\r
+\r
+       document.getElementById("preview").style.backgroundColor = color;\r
+       document.getElementById("color").value = color.toLowerCase();\r
+}\r
+\r
+function convertRGBToHex(col) {\r
+       var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");\r
+\r
+       if (!col)\r
+               return col;\r
+\r
+       var rgb = col.replace(re, "$1,$2,$3").split(',');\r
+       if (rgb.length == 3) {\r
+               r = parseInt(rgb[0]).toString(16);\r
+               g = parseInt(rgb[1]).toString(16);\r
+               b = parseInt(rgb[2]).toString(16);\r
+\r
+               r = r.length == 1 ? '0' + r : r;\r
+               g = g.length == 1 ? '0' + g : g;\r
+               b = b.length == 1 ? '0' + b : b;\r
+\r
+               return "#" + r + g + b;\r
+       }\r
+\r
+       return col;\r
+}\r
+\r
+function convertHexToRGB(col) {\r
+       if (col.indexOf('#') != -1) {\r
+               col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');\r
+\r
+               r = parseInt(col.substring(0, 2), 16);\r
+               g = parseInt(col.substring(2, 4), 16);\r
+               b = parseInt(col.substring(4, 6), 16);\r
+\r
+               return {r : r, g : g, b : b};\r
+       }\r
+\r
+       return null;\r
+}\r
+\r
+function generatePicker() {\r
+       var el = document.getElementById('light'), h = '', i;\r
+\r
+       for (i = 0; i < detail; i++){\r
+               h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'\r
+               + ' onclick="changeFinalColor(this.style.backgroundColor)"'\r
+               + ' onmousedown="isMouseDown = true; return false;"'\r
+               + ' onmouseup="isMouseDown = false;"'\r
+               + ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'\r
+               + ' onmouseover="isMouseOver = true;"'\r
+               + ' onmouseout="isMouseOver = false;"'\r
+               + '></div>';\r
+       }\r
+\r
+       el.innerHTML = h;\r
+}\r
+\r
+function generateWebColors() {\r
+       var el = document.getElementById('webcolors'), h = '', i;\r
+\r
+       if (el.className == 'generated')\r
+               return;\r
+\r
+       h += '<table border="0" cellspacing="1" cellpadding="0">'\r
+               + '<tr>';\r
+\r
+       for (i=0; i<colors.length; i++) {\r
+               h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'\r
+                       + '<a href="javascript:insertAction();" onfocus="showColor(\'' + colors[i] +  '\');" onmouseover="showColor(\'' + colors[i] +  '\');" style="display:block;width:10px;height:10px;overflow:hidden;">'\r
+                       + '</a></td>';\r
+               if ((i+1) % 18 == 0)\r
+                       h += '</tr><tr>';\r
+       }\r
+\r
+       h += '</table>';\r
+\r
+       el.innerHTML = h;\r
+       el.className = 'generated';\r
+}\r
+\r
+function generateNamedColors() {\r
+       var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;\r
+\r
+       if (el.className == 'generated')\r
+               return;\r
+\r
+       for (n in named) {\r
+               v = named[n];\r
+               h += '<a href="javascript:insertAction();" onmouseover="showColor(\'' + n +  '\',\'' + v + '\');" style="background-color: ' + n + '"><!-- IE --></a>'\r
+       }\r
+\r
+       el.innerHTML = h;\r
+       el.className = 'generated';\r
+}\r
+\r
+function dechex(n) {\r
+       return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);\r
+}\r
+\r
+function computeColor(e) {\r
+       var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB;\r
+\r
+       x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0);\r
+       y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0);\r
+\r
+       partWidth = document.getElementById('colors').width / 6;\r
+       partDetail = detail / 2;\r
+       imHeight = document.getElementById('colors').height;\r
+\r
+       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;\r
+       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);\r
+       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);\r
+\r
+       coef = (imHeight - y) / imHeight;\r
+       r = 128 + (r - 128) * coef;\r
+       g = 128 + (g - 128) * coef;\r
+       b = 128 + (b - 128) * coef;\r
+\r
+       changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));\r
+       updateLight(r, g, b);\r
+}\r
+\r
+function updateLight(r, g, b) {\r
+       var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;\r
+\r
+       for (i=0; i<detail; i++) {\r
+               if ((i>=0) && (i<partDetail)) {\r
+                       finalCoef = i / partDetail;\r
+                       finalR = dechex(255 - (255 - r) * finalCoef);\r
+                       finalG = dechex(255 - (255 - g) * finalCoef);\r
+                       finalB = dechex(255 - (255 - b) * finalCoef);\r
+               } else {\r
+                       finalCoef = 2 - i / partDetail;\r
+                       finalR = dechex(r * finalCoef);\r
+                       finalG = dechex(g * finalCoef);\r
+                       finalB = dechex(b * finalCoef);\r
+               }\r
+\r
+               color = finalR + finalG + finalB;\r
+\r
+               setCol('gs' + i, '#'+color);\r
+       }\r
+}\r
+\r
+function changeFinalColor(color) {\r
+       if (color.indexOf('#') == -1)\r
+               color = convertRGBToHex(color);\r
+\r
+       setCol('preview', color);\r
+       document.getElementById('color').value = color;\r
+}\r
+\r
+function setCol(e, c) {\r
+       try {\r
+               document.getElementById(e).style.backgroundColor = c;\r
+       } catch (ex) {\r
+               // Ignore IE warning\r
+       }\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/js/image.js b/docs/include/jscripts/tiny_mce/themes/advanced/js/image.js
new file mode 100644 (file)
index 0000000..6423d90
--- /dev/null
@@ -0,0 +1,245 @@
+var ImageDialog = {\r
+       preInit : function() {\r
+               var url;\r
+\r
+               tinyMCEPopup.requireLangPack();\r
+\r
+               if (url = tinyMCEPopup.getParam("external_image_list_url"))\r
+                       document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
+       },\r
+\r
+       init : function() {\r
+               var f = document.forms[0], ed = tinyMCEPopup.editor;\r
+\r
+               // Setup browse button\r
+               document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');\r
+               if (isVisible('srcbrowser'))\r
+                       document.getElementById('src').style.width = '180px';\r
+\r
+               e = ed.selection.getNode();\r
+\r
+               this.fillFileList('image_list', 'tinyMCEImageList');\r
+\r
+               if (e.nodeName == 'IMG') {\r
+                       f.src.value = ed.dom.getAttrib(e, 'src');\r
+                       f.alt.value = ed.dom.getAttrib(e, 'alt');\r
+                       f.border.value = this.getAttrib(e, 'border');\r
+                       f.vspace.value = this.getAttrib(e, 'vspace');\r
+                       f.hspace.value = this.getAttrib(e, 'hspace');\r
+                       f.width.value = ed.dom.getAttrib(e, 'width');\r
+                       f.height.value = ed.dom.getAttrib(e, 'height');\r
+                       f.insert.value = ed.getLang('update');\r
+                       this.styleVal = ed.dom.getAttrib(e, 'style');\r
+                       selectByValue(f, 'image_list', f.src.value);\r
+                       selectByValue(f, 'align', this.getAttrib(e, 'align'));\r
+                       this.updateStyle();\r
+               }\r
+       },\r
+\r
+       fillFileList : function(id, l) {\r
+               var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
+\r
+               l = window[l];\r
+\r
+               if (l && l.length > 0) {\r
+                       lst.options[lst.options.length] = new Option('', '');\r
+\r
+                       tinymce.each(l, function(o) {\r
+                               lst.options[lst.options.length] = new Option(o[0], o[1]);\r
+                       });\r
+               } else\r
+                       dom.remove(dom.getParent(id, 'tr'));\r
+       },\r
+\r
+       update : function() {\r
+               var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el;\r
+\r
+               tinyMCEPopup.restoreSelection();\r
+\r
+               if (f.src.value === '') {\r
+                       if (ed.selection.getNode().nodeName == 'IMG') {\r
+                               ed.dom.remove(ed.selection.getNode());\r
+                               ed.execCommand('mceRepaint');\r
+                       }\r
+\r
+                       tinyMCEPopup.close();\r
+                       return;\r
+               }\r
+\r
+               if (!ed.settings.inline_styles) {\r
+                       args = tinymce.extend(args, {\r
+                               vspace : nl.vspace.value,\r
+                               hspace : nl.hspace.value,\r
+                               border : nl.border.value,\r
+                               align : getSelectValue(f, 'align')\r
+                       });\r
+               } else\r
+                       args.style = this.styleVal;\r
+\r
+               tinymce.extend(args, {\r
+                       src : f.src.value,\r
+                       alt : f.alt.value,\r
+                       width : f.width.value,\r
+                       height : f.height.value\r
+               });\r
+\r
+               el = ed.selection.getNode();\r
+\r
+               if (el && el.nodeName == 'IMG') {\r
+                       ed.dom.setAttribs(el, args);\r
+               } else {\r
+                       ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});\r
+                       ed.dom.setAttribs('__mce_tmp', args);\r
+                       ed.dom.setAttrib('__mce_tmp', 'id', '');\r
+                       ed.undoManager.add();\r
+               }\r
+\r
+               tinyMCEPopup.close();\r
+       },\r
+\r
+       updateStyle : function() {\r
+               var dom = tinyMCEPopup.dom, st, v, f = document.forms[0];\r
+\r
+               if (tinyMCEPopup.editor.settings.inline_styles) {\r
+                       st = tinyMCEPopup.dom.parseStyle(this.styleVal);\r
+\r
+                       // Handle align\r
+                       v = getSelectValue(f, 'align');\r
+                       if (v) {\r
+                               if (v == 'left' || v == 'right') {\r
+                                       st['float'] = v;\r
+                                       delete st['vertical-align'];\r
+                               } else {\r
+                                       st['vertical-align'] = v;\r
+                                       delete st['float'];\r
+                               }\r
+                       } else {\r
+                               delete st['float'];\r
+                               delete st['vertical-align'];\r
+                       }\r
+\r
+                       // Handle border\r
+                       v = f.border.value;\r
+                       if (v || v == '0') {\r
+                               if (v == '0')\r
+                                       st['border'] = '0';\r
+                               else\r
+                                       st['border'] = v + 'px solid black';\r
+                       } else\r
+                               delete st['border'];\r
+\r
+                       // Handle hspace\r
+                       v = f.hspace.value;\r
+                       if (v) {\r
+                               delete st['margin'];\r
+                               st['margin-left'] = v + 'px';\r
+                               st['margin-right'] = v + 'px';\r
+                       } else {\r
+                               delete st['margin-left'];\r
+                               delete st['margin-right'];\r
+                       }\r
+\r
+                       // Handle vspace\r
+                       v = f.vspace.value;\r
+                       if (v) {\r
+                               delete st['margin'];\r
+                               st['margin-top'] = v + 'px';\r
+                               st['margin-bottom'] = v + 'px';\r
+                       } else {\r
+                               delete st['margin-top'];\r
+                               delete st['margin-bottom'];\r
+                       }\r
+\r
+                       // Merge\r
+                       st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img');\r
+                       this.styleVal = dom.serializeStyle(st, 'img');\r
+               }\r
+       },\r
+\r
+       getAttrib : function(e, at) {\r
+               var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;\r
+\r
+               if (ed.settings.inline_styles) {\r
+                       switch (at) {\r
+                               case 'align':\r
+                                       if (v = dom.getStyle(e, 'float'))\r
+                                               return v;\r
+\r
+                                       if (v = dom.getStyle(e, 'vertical-align'))\r
+                                               return v;\r
+\r
+                                       break;\r
+\r
+                               case 'hspace':\r
+                                       v = dom.getStyle(e, 'margin-left')\r
+                                       v2 = dom.getStyle(e, 'margin-right');\r
+                                       if (v && v == v2)\r
+                                               return parseInt(v.replace(/[^0-9]/g, ''));\r
+\r
+                                       break;\r
+\r
+                               case 'vspace':\r
+                                       v = dom.getStyle(e, 'margin-top')\r
+                                       v2 = dom.getStyle(e, 'margin-bottom');\r
+                                       if (v && v == v2)\r
+                                               return parseInt(v.replace(/[^0-9]/g, ''));\r
+\r
+                                       break;\r
+\r
+                               case 'border':\r
+                                       v = 0;\r
+\r
+                                       tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {\r
+                                               sv = dom.getStyle(e, 'border-' + sv + '-width');\r
+\r
+                                               // False or not the same as prev\r
+                                               if (!sv || (sv != v && v !== 0)) {\r
+                                                       v = 0;\r
+                                                       return false;\r
+                                               }\r
+\r
+                                               if (sv)\r
+                                                       v = sv;\r
+                                       });\r
+\r
+                                       if (v)\r
+                                               return parseInt(v.replace(/[^0-9]/g, ''));\r
+\r
+                                       break;\r
+                       }\r
+               }\r
+\r
+               if (v = dom.getAttrib(e, at))\r
+                       return v;\r
+\r
+               return '';\r
+       },\r
+\r
+       resetImageData : function() {\r
+               var f = document.forms[0];\r
+\r
+               f.width.value = f.height.value = "";    \r
+       },\r
+\r
+       updateImageData : function() {\r
+               var f = document.forms[0], t = ImageDialog;\r
+\r
+               if (f.width.value == "")\r
+                       f.width.value = t.preloadImg.width;\r
+\r
+               if (f.height.value == "")\r
+                       f.height.value = t.preloadImg.height;\r
+       },\r
+\r
+       getImageData : function() {\r
+               var f = document.forms[0];\r
+\r
+               this.preloadImg = new Image();\r
+               this.preloadImg.onload = this.updateImageData;\r
+               this.preloadImg.onerror = this.resetImageData;\r
+               this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value);\r
+       }\r
+};\r
+\r
+ImageDialog.preInit();\r
+tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/js/link.js b/docs/include/jscripts/tiny_mce/themes/advanced/js/link.js
new file mode 100644 (file)
index 0000000..f67a5bc
--- /dev/null
@@ -0,0 +1,156 @@
+tinyMCEPopup.requireLangPack();\r
+\r
+var LinkDialog = {\r
+       preInit : function() {\r
+               var url;\r
+\r
+               if (url = tinyMCEPopup.getParam("external_link_list_url"))\r
+                       document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
+       },\r
+\r
+       init : function() {\r
+               var f = document.forms[0], ed = tinyMCEPopup.editor;\r
+\r
+               // Setup browse button\r
+               document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link');\r
+               if (isVisible('hrefbrowser'))\r
+                       document.getElementById('href').style.width = '180px';\r
+\r
+               this.fillClassList('class_list');\r
+               this.fillFileList('link_list', 'tinyMCELinkList');\r
+               this.fillTargetList('target_list');\r
+\r
+               if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) {\r
+                       f.href.value = ed.dom.getAttrib(e, 'href');\r
+                       f.linktitle.value = ed.dom.getAttrib(e, 'title');\r
+                       f.insert.value = ed.getLang('update');\r
+                       selectByValue(f, 'link_list', f.href.value);\r
+                       selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target'));\r
+                       selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class'));\r
+               }\r
+       },\r
+\r
+       update : function() {\r
+               var f = document.forms[0], ed = tinyMCEPopup.editor, e, b;\r
+\r
+               tinyMCEPopup.restoreSelection();\r
+               e = ed.dom.getParent(ed.selection.getNode(), 'A');\r
+\r
+               // Remove element if there is no href\r
+               if (!f.href.value) {\r
+                       if (e) {\r
+                               tinyMCEPopup.execCommand("mceBeginUndoLevel");\r
+                               b = ed.selection.getBookmark();\r
+                               ed.dom.remove(e, 1);\r
+                               ed.selection.moveToBookmark(b);\r
+                               tinyMCEPopup.execCommand("mceEndUndoLevel");\r
+                               tinyMCEPopup.close();\r
+                               return;\r
+                       }\r
+               }\r
+\r
+               tinyMCEPopup.execCommand("mceBeginUndoLevel");\r
+\r
+               // Create new anchor elements\r
+               if (e == null) {\r
+                       ed.getDoc().execCommand("unlink", false, null);\r
+                       tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});\r
+\r
+                       tinymce.each(ed.dom.select("a"), function(n) {\r
+                               if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {\r
+                                       e = n;\r
+\r
+                                       ed.dom.setAttribs(e, {\r
+                                               href : f.href.value,\r
+                                               title : f.linktitle.value,\r
+                                               target : f.target_list ? getSelectValue(f, "target_list") : null,\r
+                                               'class' : f.class_list ? getSelectValue(f, "class_list") : null\r
+                                       });\r
+                               }\r
+                       });\r
+               } else {\r
+                       ed.dom.setAttribs(e, {\r
+                               href : f.href.value,\r
+                               title : f.linktitle.value,\r
+                               target : f.target_list ? getSelectValue(f, "target_list") : null,\r
+                               'class' : f.class_list ? getSelectValue(f, "class_list") : null\r
+                       });\r
+               }\r
+\r
+               // Don't move caret if selection was image\r
+               if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') {\r
+                       ed.focus();\r
+                       ed.selection.select(e);\r
+                       ed.selection.collapse(0);\r
+                       tinyMCEPopup.storeSelection();\r
+               }\r
+\r
+               tinyMCEPopup.execCommand("mceEndUndoLevel");\r
+               tinyMCEPopup.close();\r
+       },\r
+\r
+       checkPrefix : function(n) {\r
+               if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email')))\r
+                       n.value = 'mailto:' + n.value;\r
+\r
+               if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external')))\r
+                       n.value = 'http://' + n.value;\r
+       },\r
+\r
+       fillFileList : function(id, l) {\r
+               var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
+\r
+               l = window[l];\r
+\r
+               if (l && l.length > 0) {\r
+                       lst.options[lst.options.length] = new Option('', '');\r
+\r
+                       tinymce.each(l, function(o) {\r
+                               lst.options[lst.options.length] = new Option(o[0], o[1]);\r
+                       });\r
+               } else\r
+                       dom.remove(dom.getParent(id, 'tr'));\r
+       },\r
+\r
+       fillClassList : function(id) {\r
+               var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
+\r
+               if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {\r
+                       cl = [];\r
+\r
+                       tinymce.each(v.split(';'), function(v) {\r
+                               var p = v.split('=');\r
+\r
+                               cl.push({'title' : p[0], 'class' : p[1]});\r
+                       });\r
+               } else\r
+                       cl = tinyMCEPopup.editor.dom.getClasses();\r
+\r
+               if (cl.length > 0) {\r
+                       lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');\r
+\r
+                       tinymce.each(cl, function(o) {\r
+                               lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);\r
+                       });\r
+               } else\r
+                       dom.remove(dom.getParent(id, 'tr'));\r
+       },\r
+\r
+       fillTargetList : function(id) {\r
+               var dom = tinyMCEPopup.dom, lst = dom.get(id), v;\r
+\r
+               lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');\r
+               lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self');\r
+               lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank');\r
+\r
+               if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) {\r
+                       tinymce.each(v.split(','), function(v) {\r
+                               v = v.split('=');\r
+                               lst.options[lst.options.length] = new Option(v[0], v[1]);\r
+                       });\r
+               }\r
+       }\r
+};\r
+\r
+LinkDialog.preInit();\r
+tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog);\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/js/source_editor.js b/docs/include/jscripts/tiny_mce/themes/advanced/js/source_editor.js
new file mode 100644 (file)
index 0000000..2793286
--- /dev/null
@@ -0,0 +1,62 @@
+tinyMCEPopup.requireLangPack();\r
+tinyMCEPopup.onInit.add(onLoadInit);\r
+\r
+function saveContent() {\r
+       tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true});\r
+       tinyMCEPopup.close();\r
+}\r
+\r
+function onLoadInit() {\r
+       tinyMCEPopup.resizeToInnerSize();\r
+\r
+       // Remove Gecko spellchecking\r
+       if (tinymce.isGecko)\r
+               document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck");\r
+\r
+       document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true});\r
+\r
+       if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) {\r
+               setWrap('soft');\r
+               document.getElementById('wraped').checked = true;\r
+       }\r
+\r
+       resizeInputs();\r
+}\r
+\r
+function setWrap(val) {\r
+       var v, n, s = document.getElementById('htmlSource');\r
+\r
+       s.wrap = val;\r
+\r
+       if (!tinymce.isIE) {\r
+               v = s.value;\r
+               n = s.cloneNode(false);\r
+               n.setAttribute("wrap", val);\r
+               s.parentNode.replaceChild(n, s);\r
+               n.value = v;\r
+       }\r
+}\r
+\r
+function toggleWordWrap(elm) {\r
+       if (elm.checked)\r
+               setWrap('soft');\r
+       else\r
+               setWrap('off');\r
+}\r
+\r
+var wHeight=0, wWidth=0, owHeight=0, owWidth=0;\r
+\r
+function resizeInputs() {\r
+       var el = document.getElementById('htmlSource');\r
+\r
+       if (!tinymce.isIE) {\r
+                wHeight = self.innerHeight - 65;\r
+                wWidth = self.innerWidth - 16;\r
+       } else {\r
+                wHeight = document.body.clientHeight - 70;\r
+                wWidth = document.body.clientWidth - 16;\r
+       }\r
+\r
+       el.style.height = Math.abs(wHeight) + 'px';\r
+       el.style.width  = Math.abs(wWidth) + 'px';\r
+}\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/langs/en.js b/docs/include/jscripts/tiny_mce/themes/advanced/langs/en.js
new file mode 100644 (file)
index 0000000..69694b1
--- /dev/null
@@ -0,0 +1,62 @@
+tinyMCE.addI18n('en.advanced',{\r
+style_select:"Styles",\r
+font_size:"Font size",\r
+fontdefault:"Font family",\r
+block:"Format",\r
+paragraph:"Paragraph",\r
+div:"Div",\r
+address:"Address",\r
+pre:"Preformatted",\r
+h1:"Heading 1",\r
+h2:"Heading 2",\r
+h3:"Heading 3",\r
+h4:"Heading 4",\r
+h5:"Heading 5",\r
+h6:"Heading 6",\r
+blockquote:"Blockquote",\r
+code:"Code",\r
+samp:"Code sample",\r
+dt:"Definition term ",\r
+dd:"Definition description",\r
+bold_desc:"Bold (Ctrl+B)",\r
+italic_desc:"Italic (Ctrl+I)",\r
+underline_desc:"Underline (Ctrl+U)",\r
+striketrough_desc:"Strikethrough",\r
+justifyleft_desc:"Align left",\r
+justifycenter_desc:"Align center",\r
+justifyright_desc:"Align right",\r
+justifyfull_desc:"Align full",\r
+bullist_desc:"Unordered list",\r
+numlist_desc:"Ordered list",\r
+outdent_desc:"Outdent",\r
+indent_desc:"Indent",\r
+undo_desc:"Undo (Ctrl+Z)",\r
+redo_desc:"Redo (Ctrl+Y)",\r
+link_desc:"Insert/edit link",\r
+unlink_desc:"Unlink",\r
+image_desc:"Insert/edit image",\r
+cleanup_desc:"Cleanup messy code",\r
+code_desc:"Edit HTML Source",\r
+sub_desc:"Subscript",\r
+sup_desc:"Superscript",\r
+hr_desc:"Insert horizontal ruler",\r
+removeformat_desc:"Remove formatting",\r
+custom1_desc:"Your custom description here",\r
+forecolor_desc:"Select text color",\r
+backcolor_desc:"Select background color",\r
+charmap_desc:"Insert custom character",\r
+visualaid_desc:"Toggle guidelines/invisible elements",\r
+anchor_desc:"Insert/edit anchor",\r
+cut_desc:"Cut",\r
+copy_desc:"Copy",\r
+paste_desc:"Paste",\r
+image_props_desc:"Image properties",\r
+newdocument_desc:"New document",\r
+help_desc:"Help",\r
+blockquote_desc:"Blockquote",\r
+clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?",\r
+path:"Path",\r
+newdocument:"Are you sure you want clear all contents?",\r
+toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",\r
+more_colors:"More colors"\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js b/docs/include/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js
new file mode 100644 (file)
index 0000000..9d124d7
--- /dev/null
@@ -0,0 +1,51 @@
+tinyMCE.addI18n('en.advanced_dlg',{\r
+about_title:"About TinyMCE",\r
+about_general:"About",\r
+about_help:"Help",\r
+about_license:"License",\r
+about_plugins:"Plugins",\r
+about_plugin:"Plugin",\r
+about_author:"Author",\r
+about_version:"Version",\r
+about_loaded:"Loaded plugins",\r
+anchor_title:"Insert/edit anchor",\r
+anchor_name:"Anchor name",\r
+code_title:"HTML Source Editor",\r
+code_wordwrap:"Word wrap",\r
+colorpicker_title:"Select a color",\r
+colorpicker_picker_tab:"Picker",\r
+colorpicker_picker_title:"Color picker",\r
+colorpicker_palette_tab:"Palette",\r
+colorpicker_palette_title:"Palette colors",\r
+colorpicker_named_tab:"Named",\r
+colorpicker_named_title:"Named colors",\r
+colorpicker_color:"Color:",\r
+colorpicker_name:"Name:",\r
+charmap_title:"Select custom character",\r
+image_title:"Insert/edit image",\r
+image_src:"Image URL",\r
+image_alt:"Image description",\r
+image_list:"Image list",\r
+image_border:"Border",\r
+image_dimensions:"Dimensions",\r
+image_vspace:"Vertical space",\r
+image_hspace:"Horizontal space",\r
+image_align:"Alignment",\r
+image_align_baseline:"Baseline",\r
+image_align_top:"Top",\r
+image_align_middle:"Middle",\r
+image_align_bottom:"Bottom",\r
+image_align_texttop:"Text top",\r
+image_align_textbottom:"Text bottom",\r
+image_align_left:"Left",\r
+image_align_right:"Right",\r
+link_title:"Insert/edit link",\r
+link_url:"Link URL",\r
+link_target:"Target",\r
+link_target_same:"Open link in the same window",\r
+link_target_blank:"Open link in a new window",\r
+link_titlefield:"Title",\r
+link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",\r
+link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",\r
+link_list:"Link list"\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/link.htm b/docs/include/jscripts/tiny_mce/themes/advanced/link.htm
new file mode 100644 (file)
index 0000000..7565b9a
--- /dev/null
@@ -0,0 +1,58 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <title>{#advanced_dlg.link_title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+       <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+       <script type="text/javascript" src="../../utils/validate.js"></script>\r
+       <script type="text/javascript" src="js/link.js"></script>\r
+</head>\r
+<body id="link" style="display: none">\r
+<form onsubmit="LinkDialog.update();return false;" action="#">\r
+       <div class="tabs">\r
+               <ul>\r
+                       <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.link_title}</a></span></li>\r
+               </ul>\r
+       </div>\r
+\r
+       <div class="panel_wrapper">\r
+               <div id="general_panel" class="panel current">\r
+\r
+               <table border="0" cellpadding="4" cellspacing="0">\r
+          <tr>\r
+            <td class="nowrap"><label for="href">{#advanced_dlg.link_url}</label></td>\r
+            <td><table border="0" cellspacing="0" cellpadding="0"> \r
+                                 <tr> \r
+                                       <td><input id="href" name="href" type="text" class="mceFocus" value="" style="width: 200px" onchange="LinkDialog.checkPrefix(this);" /></td> \r
+                                       <td id="hrefbrowsercontainer">&nbsp;</td>\r
+                                 </tr> \r
+                               </table></td>\r
+          </tr>\r
+                 <tr>\r
+                       <td><label for="link_list">{#advanced_dlg.link_list}</label></td>\r
+                       <td><select id="link_list" name="link_list" onchange="document.getElementById('href').value=this.options[this.selectedIndex].value;"></select></td>\r
+                 </tr>\r
+               <tr>\r
+                       <td><label id="targetlistlabel" for="targetlist">{#advanced_dlg.link_target}</label></td>\r
+                       <td><select id="target_list" name="target_list"></select></td>\r
+               </tr>\r
+          <tr>\r
+            <td class="nowrap"><label for="linktitle">{#advanced_dlg.link_titlefield}</label></td>\r
+            <td><input id="linktitle" name="linktitle" type="text" value="" style="width: 200px" /></td>\r
+          </tr>\r
+                       <tr>\r
+                               <td><label for="class_list">{#class_name}</label></td>\r
+                               <td><select id="class_list" name="class_list"></select></td>\r
+                       </tr>\r
+        </table>\r
+               </div>\r
+       </div>\r
+\r
+       <div class="mceActionPanel">\r
+               <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+               <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+       </div>\r
+</form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/content.css b/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/content.css
new file mode 100644 (file)
index 0000000..36f38ab
--- /dev/null
@@ -0,0 +1,35 @@
+body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}\r
+body {background:#FFF;}\r
+body.mceForceColors {background:#FFF; color:#000;}\r
+h1 {font-size: 2em}\r
+h2 {font-size: 1.5em}\r
+h3 {font-size: 1.17em}\r
+h4 {font-size: 1em}\r
+h5 {font-size: .83em}\r
+h6 {font-size: .75em}\r
+.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}\r
+a.mceItemAnchor {display:inline-block; width:11px !important; height:11px  !important; background:url(img/items.gif) no-repeat 0 0;}\r
+td.mceSelected, th.mceSelected {background-color:#3399ff !important}\r
+img {border:0;}\r
+table {cursor:default}\r
+table td, table th {cursor:text}\r
+ins {border-bottom:1px solid green; text-decoration: none; color:green}\r
+del {color:red; text-decoration:line-through}\r
+cite {border-bottom:1px dashed blue}\r
+acronym {border-bottom:1px dotted #CCC; cursor:help}\r
+abbr {border-bottom:1px dashed #CCC; cursor:help}\r
+\r
+/* IE */\r
+* html body {\r
+scrollbar-3dlight-color:#F0F0EE;\r
+scrollbar-arrow-color:#676662;\r
+scrollbar-base-color:#F0F0EE;\r
+scrollbar-darkshadow-color:#DDD;\r
+scrollbar-face-color:#E0E0DD;\r
+scrollbar-highlight-color:#F0F0EE;\r
+scrollbar-shadow-color:#F0F0EE;\r
+scrollbar-track-color:#F5F5F5;\r
+}\r
+\r
+img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}\r
+font[face=mceinline] {font-family:inherit !important}\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css b/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css
new file mode 100644 (file)
index 0000000..f012226
--- /dev/null
@@ -0,0 +1,117 @@
+/* Generic */\r
+body {\r
+font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;\r
+scrollbar-3dlight-color:#F0F0EE;\r
+scrollbar-arrow-color:#676662;\r
+scrollbar-base-color:#F0F0EE;\r
+scrollbar-darkshadow-color:#DDDDDD;\r
+scrollbar-face-color:#E0E0DD;\r
+scrollbar-highlight-color:#F0F0EE;\r
+scrollbar-shadow-color:#F0F0EE;\r
+scrollbar-track-color:#F5F5F5;\r
+background:#F0F0EE;\r
+padding:0;\r
+margin:8px 8px 0 8px;\r
+}\r
+\r
+html {background:#F0F0EE;}\r
+td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
+textarea {resize:none;outline:none;}\r
+a:link, a:visited {color:black;}\r
+a:hover {color:#2B6FB6;}\r
+.nowrap {white-space: nowrap}\r
+\r
+/* Forms */\r
+fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}\r
+legend {color:#2B6FB6; font-weight:bold;}\r
+label.msg {display:none;}\r
+label.invalid {color:#EE0000; display:inline;}\r
+input.invalid {border:1px solid #EE0000;}\r
+input {background:#FFF; border:1px solid #CCC;}\r
+input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
+input, select, textarea {border:1px solid #808080;}\r
+input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}\r
+input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}\r
+.input_noborder {border:0;}\r
+\r
+/* Buttons */\r
+#insert, #cancel, input.button, .updateButton {\r
+border:0; margin:0; padding:0;\r
+font-weight:bold;\r
+width:94px; height:26px;\r
+background:url(img/buttons.png) 0 -26px;\r
+cursor:pointer;\r
+padding-bottom:2px;\r
+float:left;\r
+}\r
+\r
+#insert {background:url(img/buttons.png) 0 -52px}\r
+#cancel {background:url(img/buttons.png) 0 0; float:right}\r
+\r
+/* Browse */\r
+a.pickcolor, a.browse {text-decoration:none}\r
+a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}\r
+.mceOldBoxModel a.browse span {width:22px; height:20px;}\r
+a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}\r
+a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
+a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}\r
+a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}\r
+.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}\r
+a.pickcolor:hover span {background-color:#B2BBD0;}\r
+a.pickcolor:hover span.disabled {}\r
+\r
+/* Charmap */\r
+table.charmap {border:1px solid #AAA; text-align:center}\r
+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;}\r
+#charmap a {display:block; color:#000; text-decoration:none; border:0}\r
+#charmap a:hover {background:#CCC;color:#2B6FB6}\r
+#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}\r
+#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}\r
+\r
+/* Source */\r
+.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}\r
+.mceActionPanel {margin-top:5px;}\r
+\r
+/* Tabs classes */\r
+.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;}\r
+.tabs ul {margin:0; padding:0; list-style:none;}\r
+.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;}\r
+.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}\r
+.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}\r
+.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;}\r
+.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}\r
+.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}\r
+\r
+/* Panels */\r
+.panel_wrapper div.panel {display:none;}\r
+.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}\r
+.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}\r
+\r
+/* Columns */\r
+.column {float:left;}\r
+.properties {width:100%;}\r
+.properties .column1 {}\r
+.properties .column2 {text-align:left;}\r
+\r
+/* Titles */\r
+h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}\r
+h3 {font-size:14px;}\r
+.title {font-size:12px; font-weight:bold; color:#2B6FB6;}\r
+\r
+/* Dialog specific */\r
+#link .panel_wrapper, #link div.current {height:125px;}\r
+#image .panel_wrapper, #image div.current {height:200px;}\r
+#plugintable thead {font-weight:bold; background:#DDD;}\r
+#plugintable, #about #plugintable td {border:1px solid #919B9C;}\r
+#plugintable {width:96%; margin-top:10px;}\r
+#pluginscontainer {height:290px; overflow:auto;}\r
+#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}\r
+#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}\r
+#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}\r
+#colorpicker #light div {overflow:hidden;}\r
+#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}\r
+#colorpicker .panel_wrapper div.current {height:175px;}\r
+#colorpicker #namedcolors {width:150px;}\r
+#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}\r
+#colorpicker #colornamecontainer {margin-top:5px;}\r
+#colorpicker #picker_panel fieldset {margin:auto;width:325px;}\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png b/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png
new file mode 100644 (file)
index 0000000..7dd5841
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png differ
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/items.gif b/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/items.gif
new file mode 100644 (file)
index 0000000..2eafd79
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/items.gif differ
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif b/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif
new file mode 100644 (file)
index 0000000..85e31df
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif differ
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif b/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif
new file mode 100644 (file)
index 0000000..adfdddc
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif differ
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/progress.gif b/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/progress.gif
new file mode 100644 (file)
index 0000000..5bb90fd
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/progress.gif differ
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif b/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif
new file mode 100644 (file)
index 0000000..ce4be63
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif differ
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/ui.css b/docs/include/jscripts/tiny_mce/themes/advanced/skins/default/ui.css
new file mode 100644 (file)
index 0000000..aea6105
--- /dev/null
@@ -0,0 +1,214 @@
+/* Reset */\r
+.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}\r
+.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}\r
+.defaultSkin table td {vertical-align:middle}\r
+\r
+/* Containers */\r
+.defaultSkin table {direction:ltr; background:#F0F0EE}\r
+.defaultSkin iframe {display:block; background:#FFF}\r
+.defaultSkin .mceToolbar {height:26px}\r
+.defaultSkin .mceLeft {text-align:left}\r
+.defaultSkin .mceRight {text-align:right}\r
+\r
+/* External */\r
+.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;}\r
+.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;}\r
+.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}\r
+\r
+/* Layout */\r
+.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC}\r
+.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC}\r
+.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC}\r
+.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;}\r
+.defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top}\r
+.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC}\r
+.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}\r
+.defaultSkin .mceStatusbar div {float:left; margin:2px}\r
+.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize}\r
+.defaultSkin .mceStatusbar a:hover {text-decoration:underline}\r
+.defaultSkin table.mceToolbar {margin-left:3px}\r
+.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px}\r
+.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}\r
+.defaultSkin td.mceCenter {text-align:center;}\r
+.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;}\r
+.defaultSkin td.mceRight table {margin:0 0 0 auto;}\r
+\r
+/* Button */\r
+.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px}\r
+.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}\r
+.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0}\r
+.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
+.defaultSkin .mceButtonLabeled {width:auto}\r
+.defaultSkin .mceButtonLabeled span.mceIcon {float:left}\r
+.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica}\r
+.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888}\r
+\r
+/* Separator */\r
+.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px}\r
+\r
+/* ListBox */\r
+.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block}\r
+.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}\r
+.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;}\r
+.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF}\r
+.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0}\r
+.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;}\r
+.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden}\r
+.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px}\r
+.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;}\r
+.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;}\r
+\r
+/* SplitButton */\r
+.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr}\r
+.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block}\r
+.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;}\r
+.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);}\r
+.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;}\r
+.defaultSkin .mceSplitButton span.mceOpen {display:none}\r
+.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0}\r
+.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;}\r
+.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
+.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0}\r
+.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;}\r
+\r
+/* ColorSplitButton */\r
+.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}\r
+.defaultSkin .mceColorSplitMenu td {padding:2px}\r
+.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}\r
+.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}\r
+.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}\r
+.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}\r
+.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A}\r
+.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a}\r
+.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px}\r
+\r
+/* Menu */\r
+.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8}\r
+.defaultSkin .mceNoIcons span.mceIcon {width:0;}\r
+.defaultSkin .mceNoIcons a .mceText {padding-left:10px}\r
+.defaultSkin .mceMenu table {background:#FFF}\r
+.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block}\r
+.defaultSkin .mceMenu td {height:20px}\r
+.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0}\r
+.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}\r
+.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px}\r
+.defaultSkin .mceMenu pre.mceText {font-family:Monospace}\r
+.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;}\r
+.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3}\r
+.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px}\r
+.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD}\r
+.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px}\r
+.defaultSkin .mceMenuItemDisabled .mceText {color:#888}\r
+.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)}\r
+.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center}\r
+.defaultSkin .mceMenu span.mceMenuLine {display:none}\r
+.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;}\r
+\r
+/* Progress,Resize */\r
+.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}\r
+.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}\r
+.defaultSkin .mcePlaceHolder {border:1px dotted gray}\r
+\r
+/* Formats */\r
+.defaultSkin .mce_formatPreview a {font-size:10px}\r
+.defaultSkin .mce_p span.mceText {}\r
+.defaultSkin .mce_address span.mceText {font-style:italic}\r
+.defaultSkin .mce_pre span.mceText {font-family:monospace}\r
+.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}\r
+.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}\r
+.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}\r
+.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}\r
+.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}\r
+.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}\r
+\r
+/* Theme */\r
+.defaultSkin span.mce_bold {background-position:0 0}\r
+.defaultSkin span.mce_italic {background-position:-60px 0}\r
+.defaultSkin span.mce_underline {background-position:-140px 0}\r
+.defaultSkin span.mce_strikethrough {background-position:-120px 0}\r
+.defaultSkin span.mce_undo {background-position:-160px 0}\r
+.defaultSkin span.mce_redo {background-position:-100px 0}\r
+.defaultSkin span.mce_cleanup {background-position:-40px 0}\r
+.defaultSkin span.mce_bullist {background-position:-20px 0}\r
+.defaultSkin span.mce_numlist {background-position:-80px 0}\r
+.defaultSkin span.mce_justifyleft {background-position:-460px 0}\r
+.defaultSkin span.mce_justifyright {background-position:-480px 0}\r
+.defaultSkin span.mce_justifycenter {background-position:-420px 0}\r
+.defaultSkin span.mce_justifyfull {background-position:-440px 0}\r
+.defaultSkin span.mce_anchor {background-position:-200px 0}\r
+.defaultSkin span.mce_indent {background-position:-400px 0}\r
+.defaultSkin span.mce_outdent {background-position:-540px 0}\r
+.defaultSkin span.mce_link {background-position:-500px 0}\r
+.defaultSkin span.mce_unlink {background-position:-640px 0}\r
+.defaultSkin span.mce_sub {background-position:-600px 0}\r
+.defaultSkin span.mce_sup {background-position:-620px 0}\r
+.defaultSkin span.mce_removeformat {background-position:-580px 0}\r
+.defaultSkin span.mce_newdocument {background-position:-520px 0}\r
+.defaultSkin span.mce_image {background-position:-380px 0}\r
+.defaultSkin span.mce_help {background-position:-340px 0}\r
+.defaultSkin span.mce_code {background-position:-260px 0}\r
+.defaultSkin span.mce_hr {background-position:-360px 0}\r
+.defaultSkin span.mce_visualaid {background-position:-660px 0}\r
+.defaultSkin span.mce_charmap {background-position:-240px 0}\r
+.defaultSkin span.mce_paste {background-position:-560px 0}\r
+.defaultSkin span.mce_copy {background-position:-700px 0}\r
+.defaultSkin span.mce_cut {background-position:-680px 0}\r
+.defaultSkin span.mce_blockquote {background-position:-220px 0}\r
+.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0}\r
+.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0}\r
+.defaultSkin span.mce_forecolorpicker {background-position:-720px 0}\r
+.defaultSkin span.mce_backcolorpicker {background-position:-760px 0}\r
+\r
+/* Plugins */\r
+.defaultSkin span.mce_advhr {background-position:-0px -20px}\r
+.defaultSkin span.mce_ltr {background-position:-20px -20px}\r
+.defaultSkin span.mce_rtl {background-position:-40px -20px}\r
+.defaultSkin span.mce_emotions {background-position:-60px -20px}\r
+.defaultSkin span.mce_fullpage {background-position:-80px -20px}\r
+.defaultSkin span.mce_fullscreen {background-position:-100px -20px}\r
+.defaultSkin span.mce_iespell {background-position:-120px -20px}\r
+.defaultSkin span.mce_insertdate {background-position:-140px -20px}\r
+.defaultSkin span.mce_inserttime {background-position:-160px -20px}\r
+.defaultSkin span.mce_absolute {background-position:-180px -20px}\r
+.defaultSkin span.mce_backward {background-position:-200px -20px}\r
+.defaultSkin span.mce_forward {background-position:-220px -20px}\r
+.defaultSkin span.mce_insert_layer {background-position:-240px -20px}\r
+.defaultSkin span.mce_insertlayer {background-position:-260px -20px}\r
+.defaultSkin span.mce_movebackward {background-position:-280px -20px}\r
+.defaultSkin span.mce_moveforward {background-position:-300px -20px}\r
+.defaultSkin span.mce_media {background-position:-320px -20px}\r
+.defaultSkin span.mce_nonbreaking {background-position:-340px -20px}\r
+.defaultSkin span.mce_pastetext {background-position:-360px -20px}\r
+.defaultSkin span.mce_pasteword {background-position:-380px -20px}\r
+.defaultSkin span.mce_selectall {background-position:-400px -20px}\r
+.defaultSkin span.mce_preview {background-position:-420px -20px}\r
+.defaultSkin span.mce_print {background-position:-440px -20px}\r
+.defaultSkin span.mce_cancel {background-position:-460px -20px}\r
+.defaultSkin span.mce_save {background-position:-480px -20px}\r
+.defaultSkin span.mce_replace {background-position:-500px -20px}\r
+.defaultSkin span.mce_search {background-position:-520px -20px}\r
+.defaultSkin span.mce_styleprops {background-position:-560px -20px}\r
+.defaultSkin span.mce_table {background-position:-580px -20px}\r
+.defaultSkin span.mce_cell_props {background-position:-600px -20px}\r
+.defaultSkin span.mce_delete_table {background-position:-620px -20px}\r
+.defaultSkin span.mce_delete_col {background-position:-640px -20px}\r
+.defaultSkin span.mce_delete_row {background-position:-660px -20px}\r
+.defaultSkin span.mce_col_after {background-position:-680px -20px}\r
+.defaultSkin span.mce_col_before {background-position:-700px -20px}\r
+.defaultSkin span.mce_row_after {background-position:-720px -20px}\r
+.defaultSkin span.mce_row_before {background-position:-740px -20px}\r
+.defaultSkin span.mce_merge_cells {background-position:-760px -20px}\r
+.defaultSkin span.mce_table_props {background-position:-980px -20px}\r
+.defaultSkin span.mce_row_props {background-position:-780px -20px}\r
+.defaultSkin span.mce_split_cells {background-position:-800px -20px}\r
+.defaultSkin span.mce_template {background-position:-820px -20px}\r
+.defaultSkin span.mce_visualchars {background-position:-840px -20px}\r
+.defaultSkin span.mce_abbr {background-position:-860px -20px}\r
+.defaultSkin span.mce_acronym {background-position:-880px -20px}\r
+.defaultSkin span.mce_attribs {background-position:-900px -20px}\r
+.defaultSkin span.mce_cite {background-position:-920px -20px}\r
+.defaultSkin span.mce_del {background-position:-940px -20px}\r
+.defaultSkin span.mce_ins {background-position:-960px -20px}\r
+.defaultSkin span.mce_pagebreak {background-position:0 -40px}\r
+.defaultSkin span.mce_restoredraft {background-position:-20px -40px}\r
+.defaultSkin .mce_spellchecker span.mceAction {background-position:-540px -20px}\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css b/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css
new file mode 100644 (file)
index 0000000..3cea5ff
--- /dev/null
@@ -0,0 +1,35 @@
+body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}\r
+body {background:#FFF;}\r
+body.mceForceColors {background:#FFF; color:#000;}\r
+h1 {font-size: 2em}\r
+h2 {font-size: 1.5em}\r
+h3 {font-size: 1.17em}\r
+h4 {font-size: 1em}\r
+h5 {font-size: .83em}\r
+h6 {font-size: .75em}\r
+.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}\r
+a.mceItemAnchor {display:inline-block; width:11px !important; height:11px  !important; background:url(../default/img/items.gif) no-repeat 0 0;}\r
+td.mceSelected, th.mceSelected {background-color:#3399ff !important}\r
+img {border:0;}\r
+table {cursor:default}\r
+table td, table th {cursor:text}\r
+ins {border-bottom:1px solid green; text-decoration: none; color:green}\r
+del {color:red; text-decoration:line-through}\r
+cite {border-bottom:1px dashed blue}\r
+acronym {border-bottom:1px dotted #CCC; cursor:help}\r
+abbr {border-bottom:1px dashed #CCC; cursor:help}\r
+\r
+/* IE */\r
+* html body {\r
+scrollbar-3dlight-color:#F0F0EE;\r
+scrollbar-arrow-color:#676662;\r
+scrollbar-base-color:#F0F0EE;\r
+scrollbar-darkshadow-color:#DDD;\r
+scrollbar-face-color:#E0E0DD;\r
+scrollbar-highlight-color:#F0F0EE;\r
+scrollbar-shadow-color:#F0F0EE;\r
+scrollbar-track-color:#F5F5F5;\r
+}\r
+\r
+img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}\r
+font[face=mceinline] {font-family:inherit !important}\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css b/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css
new file mode 100644 (file)
index 0000000..e3af139
--- /dev/null
@@ -0,0 +1,116 @@
+/* Generic */\r
+body {\r
+font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;\r
+scrollbar-3dlight-color:#F0F0EE;\r
+scrollbar-arrow-color:#676662;\r
+scrollbar-base-color:#F0F0EE;\r
+scrollbar-darkshadow-color:#DDDDDD;\r
+scrollbar-face-color:#E0E0DD;\r
+scrollbar-highlight-color:#F0F0EE;\r
+scrollbar-shadow-color:#F0F0EE;\r
+scrollbar-track-color:#F5F5F5;\r
+background:#F0F0EE;\r
+padding:0;\r
+margin:8px 8px 0 8px;\r
+}\r
+\r
+html {background:#F0F0EE;}\r
+td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
+textarea {resize:none;outline:none;}\r
+a:link, a:visited {color:black;}\r
+a:hover {color:#2B6FB6;}\r
+.nowrap {white-space: nowrap}\r
+\r
+/* Forms */\r
+fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}\r
+legend {color:#2B6FB6; font-weight:bold;}\r
+label.msg {display:none;}\r
+label.invalid {color:#EE0000; display:inline;}\r
+input.invalid {border:1px solid #EE0000;}\r
+input {background:#FFF; border:1px solid #CCC;}\r
+input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
+input, select, textarea {border:1px solid #808080;}\r
+input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}\r
+input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}\r
+.input_noborder {border:0;}\r
+\r
+/* Buttons */\r
+#insert, #cancel, input.button, .updateButton {\r
+border:0; margin:0; padding:0;\r
+font-weight:bold;\r
+width:94px; height:26px;\r
+background:url(../default/img/buttons.png) 0 -26px;\r
+cursor:pointer;\r
+padding-bottom:2px;\r
+float:left;\r
+}\r
+\r
+#insert {background:url(../default/img/buttons.png) 0 -52px}\r
+#cancel {background:url(../default/img/buttons.png) 0 0; float:right}\r
+\r
+/* Browse */\r
+a.pickcolor, a.browse {text-decoration:none}\r
+a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}\r
+.mceOldBoxModel a.browse span {width:22px; height:20px;}\r
+a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}\r
+a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
+a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}\r
+a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}\r
+.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}\r
+a.pickcolor:hover span {background-color:#B2BBD0;}\r
+a.pickcolor:hover span.disabled {}\r
+\r
+/* Charmap */\r
+table.charmap {border:1px solid #AAA; text-align:center}\r
+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;}\r
+#charmap a {display:block; color:#000; text-decoration:none; border:0}\r
+#charmap a:hover {background:#CCC;color:#2B6FB6}\r
+#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}\r
+#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}\r
+\r
+/* Source */\r
+.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}\r
+.mceActionPanel {margin-top:5px;}\r
+\r
+/* Tabs classes */\r
+.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;}\r
+.tabs ul {margin:0; padding:0; list-style:none;}\r
+.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}\r
+.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}\r
+.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}\r
+.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;}\r
+.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}\r
+.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}\r
+\r
+/* Panels */\r
+.panel_wrapper div.panel {display:none;}\r
+.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}\r
+.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}\r
+\r
+/* Columns */\r
+.column {float:left;}\r
+.properties {width:100%;}\r
+.properties .column1 {}\r
+.properties .column2 {text-align:left;}\r
+\r
+/* Titles */\r
+h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}\r
+h3 {font-size:14px;}\r
+.title {font-size:12px; font-weight:bold; color:#2B6FB6;}\r
+\r
+/* Dialog specific */\r
+#link .panel_wrapper, #link div.current {height:125px;}\r
+#image .panel_wrapper, #image div.current {height:200px;}\r
+#plugintable thead {font-weight:bold; background:#DDD;}\r
+#plugintable, #about #plugintable td {border:1px solid #919B9C;}\r
+#plugintable {width:96%; margin-top:10px;}\r
+#pluginscontainer {height:290px; overflow:auto;}\r
+#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}\r
+#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}\r
+#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}\r
+#colorpicker #light div {overflow:hidden;}\r
+#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}\r
+#colorpicker .panel_wrapper div.current {height:175px;}\r
+#colorpicker #namedcolors {width:150px;}\r
+#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}\r
+#colorpicker #colornamecontainer {margin-top:5px;}\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png b/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png
new file mode 100644 (file)
index 0000000..12cfb41
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png differ
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png b/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png
new file mode 100644 (file)
index 0000000..8996c74
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png differ
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png b/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png
new file mode 100644 (file)
index 0000000..bd5d255
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png differ
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css b/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css
new file mode 100644 (file)
index 0000000..bb6b613
--- /dev/null
@@ -0,0 +1,216 @@
+/* Reset */\r
+.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .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}\r
+.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}\r
+.o2k7Skin table td {vertical-align:middle}\r
+\r
+/* Containers */\r
+.o2k7Skin table {background:#E5EFFD}\r
+.o2k7Skin iframe {display:block; background:#FFF}\r
+.o2k7Skin .mceToolbar {height:26px}\r
+\r
+/* External */\r
+.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none}\r
+.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;}\r
+.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}\r
+\r
+/* Layout */\r
+.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD}\r
+.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD}\r
+.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD}\r
+.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0}\r
+.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD}\r
+.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}\r
+.o2k7Skin .mceStatusbar div {float:left; padding:2px}\r
+.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize}\r
+.o2k7Skin .mceStatusbar a:hover {text-decoration:underline}\r
+.o2k7Skin table.mceToolbar {margin-left:3px}\r
+.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;}\r
+.o2k7Skin .mceToolbar td.mceFirst span {margin:0}\r
+.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px}\r
+.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none}\r
+.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px}\r
+.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}\r
+.o2k7Skin td.mceCenter {text-align:center;}\r
+.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;}\r
+.o2k7Skin td.mceRight table {margin:0 0 0 auto;}\r
+\r
+/* Button */\r
+.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px}\r
+.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px}\r
+.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px}\r
+.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px}\r
+.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px}\r
+.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
+.o2k7Skin .mceButtonLabeled {width:auto}\r
+.o2k7Skin .mceButtonLabeled span.mceIcon {float:left}\r
+.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica}\r
+.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888}\r
+\r
+/* Separator */\r
+.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}\r
+\r
+/* ListBox */\r
+.o2k7Skin .mceListBox {margin-left:3px}\r
+.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block}\r
+.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}\r
+.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0}\r
+.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF}\r
+.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px}\r
+.o2k7Skin .mceListBoxDisabled .mceText {color:gray}\r
+.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden}\r
+.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px}\r
+.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;}\r
+\r
+/* SplitButton */\r
+.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px}\r
+.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)}\r
+.o2k7Skin .mceSplitButton a.mceAction {width:22px}\r
+.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)}\r
+.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0}\r
+.o2k7Skin .mceSplitButton span.mceOpen {display:none}\r
+.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px}\r
+.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px}\r
+.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
+.o2k7Skin .mceSplitButtonActive {background-position:0 -44px}\r
+\r
+/* ColorSplitButton */\r
+.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}\r
+.o2k7Skin .mceColorSplitMenu td {padding:2px}\r
+.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}\r
+.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}\r
+.o2k7Skin .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}\r
+.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}\r
+.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A}\r
+.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden}\r
+.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden}\r
+\r
+/* Menu */\r
+.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD}\r
+.o2k7Skin .mceNoIcons span.mceIcon {width:0;}\r
+.o2k7Skin .mceNoIcons a .mceText {padding-left:10px}\r
+.o2k7Skin .mceMenu table {background:#FFF}\r
+.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block}\r
+.o2k7Skin .mceMenu td {height:20px}\r
+.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0}\r
+.o2k7Skin .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}\r
+.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px}\r
+.o2k7Skin .mceMenu pre.mceText {font-family:Monospace}\r
+.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;}\r
+.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3}\r
+.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px}\r
+.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD}\r
+.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px}\r
+.o2k7Skin .mceMenuItemDisabled .mceText {color:#888}\r
+.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)}\r
+.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center}\r
+.o2k7Skin .mceMenu span.mceMenuLine {display:none}\r
+.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;}\r
+\r
+/* Progress,Resize */\r
+.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}\r
+.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}\r
+.o2k7Skin .mcePlaceHolder {border:1px dotted gray}\r
+\r
+/* Formats */\r
+.o2k7Skin .mce_formatPreview a {font-size:10px}\r
+.o2k7Skin .mce_p span.mceText {}\r
+.o2k7Skin .mce_address span.mceText {font-style:italic}\r
+.o2k7Skin .mce_pre span.mceText {font-family:monospace}\r
+.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}\r
+.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}\r
+.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}\r
+.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}\r
+.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}\r
+.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}\r
+\r
+/* Theme */\r
+.o2k7Skin span.mce_bold {background-position:0 0}\r
+.o2k7Skin span.mce_italic {background-position:-60px 0}\r
+.o2k7Skin span.mce_underline {background-position:-140px 0}\r
+.o2k7Skin span.mce_strikethrough {background-position:-120px 0}\r
+.o2k7Skin span.mce_undo {background-position:-160px 0}\r
+.o2k7Skin span.mce_redo {background-position:-100px 0}\r
+.o2k7Skin span.mce_cleanup {background-position:-40px 0}\r
+.o2k7Skin span.mce_bullist {background-position:-20px 0}\r
+.o2k7Skin span.mce_numlist {background-position:-80px 0}\r
+.o2k7Skin span.mce_justifyleft {background-position:-460px 0}\r
+.o2k7Skin span.mce_justifyright {background-position:-480px 0}\r
+.o2k7Skin span.mce_justifycenter {background-position:-420px 0}\r
+.o2k7Skin span.mce_justifyfull {background-position:-440px 0}\r
+.o2k7Skin span.mce_anchor {background-position:-200px 0}\r
+.o2k7Skin span.mce_indent {background-position:-400px 0}\r
+.o2k7Skin span.mce_outdent {background-position:-540px 0}\r
+.o2k7Skin span.mce_link {background-position:-500px 0}\r
+.o2k7Skin span.mce_unlink {background-position:-640px 0}\r
+.o2k7Skin span.mce_sub {background-position:-600px 0}\r
+.o2k7Skin span.mce_sup {background-position:-620px 0}\r
+.o2k7Skin span.mce_removeformat {background-position:-580px 0}\r
+.o2k7Skin span.mce_newdocument {background-position:-520px 0}\r
+.o2k7Skin span.mce_image {background-position:-380px 0}\r
+.o2k7Skin span.mce_help {background-position:-340px 0}\r
+.o2k7Skin span.mce_code {background-position:-260px 0}\r
+.o2k7Skin span.mce_hr {background-position:-360px 0}\r
+.o2k7Skin span.mce_visualaid {background-position:-660px 0}\r
+.o2k7Skin span.mce_charmap {background-position:-240px 0}\r
+.o2k7Skin span.mce_paste {background-position:-560px 0}\r
+.o2k7Skin span.mce_copy {background-position:-700px 0}\r
+.o2k7Skin span.mce_cut {background-position:-680px 0}\r
+.o2k7Skin span.mce_blockquote {background-position:-220px 0}\r
+.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0}\r
+.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0}\r
+.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0}\r
+.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0}\r
+\r
+/* Plugins */\r
+.o2k7Skin span.mce_advhr {background-position:-0px -20px}\r
+.o2k7Skin span.mce_ltr {background-position:-20px -20px}\r
+.o2k7Skin span.mce_rtl {background-position:-40px -20px}\r
+.o2k7Skin span.mce_emotions {background-position:-60px -20px}\r
+.o2k7Skin span.mce_fullpage {background-position:-80px -20px}\r
+.o2k7Skin span.mce_fullscreen {background-position:-100px -20px}\r
+.o2k7Skin span.mce_iespell {background-position:-120px -20px}\r
+.o2k7Skin span.mce_insertdate {background-position:-140px -20px}\r
+.o2k7Skin span.mce_inserttime {background-position:-160px -20px}\r
+.o2k7Skin span.mce_absolute {background-position:-180px -20px}\r
+.o2k7Skin span.mce_backward {background-position:-200px -20px}\r
+.o2k7Skin span.mce_forward {background-position:-220px -20px}\r
+.o2k7Skin span.mce_insert_layer {background-position:-240px -20px}\r
+.o2k7Skin span.mce_insertlayer {background-position:-260px -20px}\r
+.o2k7Skin span.mce_movebackward {background-position:-280px -20px}\r
+.o2k7Skin span.mce_moveforward {background-position:-300px -20px}\r
+.o2k7Skin span.mce_media {background-position:-320px -20px}\r
+.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px}\r
+.o2k7Skin span.mce_pastetext {background-position:-360px -20px}\r
+.o2k7Skin span.mce_pasteword {background-position:-380px -20px}\r
+.o2k7Skin span.mce_selectall {background-position:-400px -20px}\r
+.o2k7Skin span.mce_preview {background-position:-420px -20px}\r
+.o2k7Skin span.mce_print {background-position:-440px -20px}\r
+.o2k7Skin span.mce_cancel {background-position:-460px -20px}\r
+.o2k7Skin span.mce_save {background-position:-480px -20px}\r
+.o2k7Skin span.mce_replace {background-position:-500px -20px}\r
+.o2k7Skin span.mce_search {background-position:-520px -20px}\r
+.o2k7Skin span.mce_styleprops {background-position:-560px -20px}\r
+.o2k7Skin span.mce_table {background-position:-580px -20px}\r
+.o2k7Skin span.mce_cell_props {background-position:-600px -20px}\r
+.o2k7Skin span.mce_delete_table {background-position:-620px -20px}\r
+.o2k7Skin span.mce_delete_col {background-position:-640px -20px}\r
+.o2k7Skin span.mce_delete_row {background-position:-660px -20px}\r
+.o2k7Skin span.mce_col_after {background-position:-680px -20px}\r
+.o2k7Skin span.mce_col_before {background-position:-700px -20px}\r
+.o2k7Skin span.mce_row_after {background-position:-720px -20px}\r
+.o2k7Skin span.mce_row_before {background-position:-740px -20px}\r
+.o2k7Skin span.mce_merge_cells {background-position:-760px -20px}\r
+.o2k7Skin span.mce_table_props {background-position:-980px -20px}\r
+.o2k7Skin span.mce_row_props {background-position:-780px -20px}\r
+.o2k7Skin span.mce_split_cells {background-position:-800px -20px}\r
+.o2k7Skin span.mce_template {background-position:-820px -20px}\r
+.o2k7Skin span.mce_visualchars {background-position:-840px -20px}\r
+.o2k7Skin span.mce_abbr {background-position:-860px -20px}\r
+.o2k7Skin span.mce_acronym {background-position:-880px -20px}\r
+.o2k7Skin span.mce_attribs {background-position:-900px -20px}\r
+.o2k7Skin span.mce_cite {background-position:-920px -20px}\r
+.o2k7Skin span.mce_del {background-position:-940px -20px}\r
+.o2k7Skin span.mce_ins {background-position:-960px -20px}\r
+.o2k7Skin span.mce_pagebreak {background-position:0 -40px}\r
+.o2k7Skin span.mce_restoredraft {background-position:-20px -40px}\r
+.o2k7Skin .mce_spellchecker span.mceAction {background-position:-540px -20px}\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css b/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css
new file mode 100644 (file)
index 0000000..153f0c3
--- /dev/null
@@ -0,0 +1,8 @@
+/* Black */\r
+.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)}\r
+.o2k7SkinBlack table, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF}\r
+.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0}\r
+.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0}\r
+.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;}\r
+.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)}\r
+.o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1}
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css b/docs/include/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css
new file mode 100644 (file)
index 0000000..7fe3b45
--- /dev/null
@@ -0,0 +1,5 @@
+/* Silver */\r
+.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)}\r
+.o2k7SkinSilver table, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee}\r
+.o2k7SkinSilver .mceListBox .mceText {background:#FFF}\r
+.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}\r
diff --git a/docs/include/jscripts/tiny_mce/themes/advanced/source_editor.htm b/docs/include/jscripts/tiny_mce/themes/advanced/source_editor.htm
new file mode 100644 (file)
index 0000000..1c81d23
--- /dev/null
@@ -0,0 +1,26 @@
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />\r
+       <title>{#advanced_dlg.code_title}</title>\r
+       <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+       <script type="text/javascript" src="js/source_editor.js"></script>\r
+</head>\r
+<body onresize="resizeInputs();" style="display:none; overflow:hidden;">\r
+       <form name="source" onsubmit="saveContent();return false;" action="#">\r
+               <div style="float: left" class="title">{#advanced_dlg.code_title}</div>\r
+\r
+               <div id="wrapline" style="float: right">\r
+                       <input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{#advanced_dlg.code_wordwrap}</label>\r
+               </div>\r
+\r
+               <br style="clear: both" />\r
+\r
+               <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,monospace; font-size: 12px;" dir="ltr" wrap="off" class="mceFocus"></textarea>\r
+\r
+               <div class="mceActionPanel">\r
+                       <input type="submit" name="insert" value="{#update}" id="insert" />\r
+                       <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />\r
+               </div>\r
+       </form>\r
+</body>\r
+</html>\r
diff --git a/docs/include/jscripts/tiny_mce/themes/simple/editor_template.js b/docs/include/jscripts/tiny_mce/themes/simple/editor_template.js
new file mode 100644 (file)
index 0000000..ed89abc
--- /dev/null
@@ -0,0 +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
diff --git a/docs/include/jscripts/tiny_mce/themes/simple/editor_template_src.js b/docs/include/jscripts/tiny_mce/themes/simple/editor_template_src.js
new file mode 100644 (file)
index 0000000..4b862d4
--- /dev/null
@@ -0,0 +1,85 @@
+/**\r
+ * editor_template_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+       var DOM = tinymce.DOM;\r
+\r
+       // Tell it to load theme specific language pack(s)\r
+       tinymce.ThemeManager.requireLangPack('simple');\r
+\r
+       tinymce.create('tinymce.themes.SimpleTheme', {\r
+               init : function(ed, url) {\r
+                       var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings;\r
+\r
+                       t.editor = ed;\r
+\r
+                       ed.onInit.add(function() {\r
+                               ed.onNodeChange.add(function(ed, cm) {\r
+                                       tinymce.each(states, function(c) {\r
+                                               cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));\r
+                                       });\r
+                               });\r
+\r
+                               ed.dom.loadCSS(url + "/skins/" + s.skin + "/content.css");\r
+                       });\r
+\r
+                       DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css");\r
+               },\r
+\r
+               renderUI : function(o) {\r
+                       var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc;\r
+\r
+                       n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n);\r
+                       n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'});\r
+                       n = tb = DOM.add(n, 'tbody');\r
+\r
+                       // Create iframe container\r
+                       n = DOM.add(tb, 'tr');\r
+                       n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'});\r
+\r
+                       // Create toolbar container\r
+                       n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'});\r
+\r
+                       // Create toolbar\r
+                       tb = t.toolbar = cf.createToolbar("tools1");\r
+                       tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'}));\r
+                       tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'}));\r
+                       tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'}));\r
+                       tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'}));\r
+                       tb.add(cf.createSeparator());\r
+                       tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'}));\r
+                       tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'}));\r
+                       tb.add(cf.createSeparator());\r
+                       tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'}));\r
+                       tb.add(cf.createSeparator());\r
+                       tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'}));\r
+                       tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'}));\r
+                       tb.renderTo(n);\r
+\r
+                       return {\r
+                               iframeContainer : ic,\r
+                               editorContainer : ed.id + '_container',\r
+                               sizeContainer : sc,\r
+                               deltaHeight : -20\r
+                       };\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Simple theme',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       }\r
+               }\r
+       });\r
+\r
+       tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme);\r
+})();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/themes/simple/img/icons.gif b/docs/include/jscripts/tiny_mce/themes/simple/img/icons.gif
new file mode 100644 (file)
index 0000000..16af141
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/themes/simple/img/icons.gif differ
diff --git a/docs/include/jscripts/tiny_mce/themes/simple/langs/en.js b/docs/include/jscripts/tiny_mce/themes/simple/langs/en.js
new file mode 100644 (file)
index 0000000..9f08f10
--- /dev/null
@@ -0,0 +1,11 @@
+tinyMCE.addI18n('en.simple',{\r
+bold_desc:"Bold (Ctrl+B)",\r
+italic_desc:"Italic (Ctrl+I)",\r
+underline_desc:"Underline (Ctrl+U)",\r
+striketrough_desc:"Strikethrough",\r
+bullist_desc:"Unordered list",\r
+numlist_desc:"Ordered list",\r
+undo_desc:"Undo (Ctrl+Z)",\r
+redo_desc:"Redo (Ctrl+Y)",\r
+cleanup_desc:"Cleanup messy code"\r
+});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/themes/simple/skins/default/content.css b/docs/include/jscripts/tiny_mce/themes/simple/skins/default/content.css
new file mode 100644 (file)
index 0000000..2506c80
--- /dev/null
@@ -0,0 +1,25 @@
+body, td, pre {\r
+       font-family: Verdana, Arial, Helvetica, sans-serif;\r
+       font-size: 10px;\r
+}\r
+\r
+body {\r
+       background-color: #FFFFFF;\r
+}\r
+\r
+.mceVisualAid {\r
+       border: 1px dashed #BBBBBB;\r
+}\r
+\r
+/* MSIE specific */\r
+\r
+* html body {\r
+       scrollbar-3dlight-color: #F0F0EE;\r
+       scrollbar-arrow-color: #676662;\r
+       scrollbar-base-color: #F0F0EE;\r
+       scrollbar-darkshadow-color: #DDDDDD;\r
+       scrollbar-face-color: #E0E0DD;\r
+       scrollbar-highlight-color: #F0F0EE;\r
+       scrollbar-shadow-color: #F0F0EE;\r
+       scrollbar-track-color: #F5F5F5; \r
+}\r
diff --git a/docs/include/jscripts/tiny_mce/themes/simple/skins/default/ui.css b/docs/include/jscripts/tiny_mce/themes/simple/skins/default/ui.css
new file mode 100644 (file)
index 0000000..076fe84
--- /dev/null
@@ -0,0 +1,32 @@
+/* Reset */\r
+.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000}\r
+\r
+/* Containers */\r
+.defaultSimpleSkin {position:relative}\r
+.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;}\r
+.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;}\r
+.defaultSimpleSkin .mceToolbar {height:24px;}\r
+\r
+/* Layout */\r
+.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px}\r
+.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}\r
+\r
+/* Button */\r
+.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px}\r
+.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}\r
+.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0}\r
+.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
+\r
+/* Separator */\r
+.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px}\r
+\r
+/* Theme */\r
+.defaultSimpleSkin span.mce_bold {background-position:0 0}\r
+.defaultSimpleSkin span.mce_italic {background-position:-60px 0}\r
+.defaultSimpleSkin span.mce_underline {background-position:-140px 0}\r
+.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0}\r
+.defaultSimpleSkin span.mce_undo {background-position:-160px 0}\r
+.defaultSimpleSkin span.mce_redo {background-position:-100px 0}\r
+.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0}\r
+.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0}\r
+.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0}\r
diff --git a/docs/include/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css b/docs/include/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css
new file mode 100644 (file)
index 0000000..595809f
--- /dev/null
@@ -0,0 +1,17 @@
+body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
+\r
+body {background: #FFF;}\r
+.mceVisualAid {border: 1px dashed #BBB;}\r
+\r
+/* IE */\r
+\r
+* html body {\r
+scrollbar-3dlight-color: #F0F0EE;\r
+scrollbar-arrow-color: #676662;\r
+scrollbar-base-color: #F0F0EE;\r
+scrollbar-darkshadow-color: #DDDDDD;\r
+scrollbar-face-color: #E0E0DD;\r
+scrollbar-highlight-color: #F0F0EE;\r
+scrollbar-shadow-color: #F0F0EE;\r
+scrollbar-track-color: #F5F5F5;        \r
+}\r
diff --git a/docs/include/jscripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png b/docs/include/jscripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png
new file mode 100644 (file)
index 0000000..527e349
Binary files /dev/null and b/docs/include/jscripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png differ
diff --git a/docs/include/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css b/docs/include/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css
new file mode 100644 (file)
index 0000000..cf6c35d
--- /dev/null
@@ -0,0 +1,35 @@
+/* Reset */\r
+.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000}\r
+\r
+/* Containers */\r
+.o2k7SimpleSkin {position:relative}\r
+.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;}\r
+.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;}\r
+.o2k7SimpleSkin .mceToolbar {height:26px;}\r
+\r
+/* Layout */\r
+.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; }\r
+.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px}\r
+.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px}\r
+.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}\r
+\r
+/* Button */\r
+.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px}\r
+.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px}\r
+.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px}\r
+.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px}\r
+.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
+\r
+/* Separator */\r
+.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}\r
+\r
+/* Theme */\r
+.o2k7SimpleSkin span.mce_bold {background-position:0 0}\r
+.o2k7SimpleSkin span.mce_italic {background-position:-60px 0}\r
+.o2k7SimpleSkin span.mce_underline {background-position:-140px 0}\r
+.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0}\r
+.o2k7SimpleSkin span.mce_undo {background-position:-160px 0}\r
+.o2k7SimpleSkin span.mce_redo {background-position:-100px 0}\r
+.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0}\r
+.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0}\r
+.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0}\r
diff --git a/docs/include/jscripts/tiny_mce/tiny_mce.js b/docs/include/jscripts/tiny_mce/tiny_mce.js
new file mode 100644 (file)
index 0000000..045e0db
--- /dev/null
@@ -0,0 +1 @@
+(function(c){var a=/^\s*|\s*$/g,d;var b={majorVersion:"3",minorVersion:"3",releaseDate:"2010-03-10",_init:function(){var r=this,o=document,m=navigator,f=m.userAgent,l,e,k,j,h,q;r.isOpera=c.opera&&opera.buildNumber;r.isWebKit=/WebKit/.test(f);r.isIE=!r.isWebKit&&!r.isOpera&&(/MSIE/gi).test(f)&&(/Explorer/gi).test(m.appName);r.isIE6=r.isIE&&/MSIE [56]/.test(f);r.isGecko=!r.isWebKit&&/Gecko/.test(f);r.isMac=f.indexOf("Mac")!=-1;r.isAir=/adobeair/i.test(f);if(c.tinyMCEPreInit){r.suffix=tinyMCEPreInit.suffix;r.baseURL=tinyMCEPreInit.base;r.query=tinyMCEPreInit.query;return}r.suffix="";e=o.getElementsByTagName("base");for(l=0;l<e.length;l++){if(q=e[l].href){if(/^https?:\/\/[^\/]+$/.test(q)){q+="/"}j=q?q.match(/.*\//)[0]:""}}function g(i){if(i.src&&/tiny_mce(|_gzip|_jquery|_prototype)(_dev|_src)?.js/.test(i.src)){if(/_(src|dev)\.js/g.test(i.src)){r.suffix="_src"}if((h=i.src.indexOf("?"))!=-1){r.query=i.src.substring(h+1)}r.baseURL=i.src.substring(0,i.src.lastIndexOf("/"));if(j&&r.baseURL.indexOf("://")==-1&&r.baseURL.indexOf("/")!==0){r.baseURL=j+r.baseURL}return r.baseURL}return null}e=o.getElementsByTagName("script");for(l=0;l<e.length;l++){if(g(e[l])){return}}k=o.getElementsByTagName("head")[0];if(k){e=k.getElementsByTagName("script");for(l=0;l<e.length;l++){if(g(e[l])){return}}}return},is:function(f,e){if(!e){return f!==d}if(e=="array"&&(f.hasOwnProperty&&f instanceof Array)){return true}return typeof(f)==e},each:function(h,e,g){var i,f;if(!h){return 0}g=g||h;if(h.length!==d){for(i=0,f=h.length;i<f;i++){if(e.call(g,h[i],i,h)===false){return 0}}}else{for(i in h){if(h.hasOwnProperty(i)){if(e.call(g,h[i],i,h)===false){return 0}}}}return 1},map:function(e,g){var h=[];b.each(e,function(f){h.push(g(f))});return h},grep:function(e,g){var h=[];b.each(e,function(f){if(!g||g(f)){h.push(f)}});return h},inArray:function(f,g){var h,e;if(f){for(h=0,e=f.length;h<e;h++){if(f[h]===g){return h}}}return -1},extend:function(k,j){var h,g,f=arguments;for(h=1,g=f.length;h<g;h++){j=f[h];b.each(j,function(e,i){if(e!==d){k[i]=e}})}return k},trim:function(e){return(e?""+e:"").replace(a,"")},create:function(m,e){var l=this,f,h,i,j,g,k=0;m=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(m);i=m[3].match(/(^|\.)(\w+)$/i)[2];h=l.createNS(m[3].replace(/\.\w+$/,""));if(h[i]){return}if(m[2]=="static"){h[i]=e;if(this.onCreate){this.onCreate(m[2],m[3],h[i])}return}if(!e[i]){e[i]=function(){};k=1}h[i]=e[i];l.extend(h[i].prototype,e);if(m[5]){f=l.resolve(m[5]).prototype;j=m[5].match(/\.(\w+)$/i)[1];g=h[i];if(k){h[i]=function(){return f[j].apply(this,arguments)}}else{h[i]=function(){this.parent=f[j];return g.apply(this,arguments)}}h[i].prototype[i]=h[i];l.each(f,function(o,p){h[i].prototype[p]=f[p]});l.each(e,function(o,p){if(f[p]){h[i].prototype[p]=function(){this.parent=f[p];return o.apply(this,arguments)}}else{if(p!=i){h[i].prototype[p]=o}}})}l.each(e["static"],function(o,p){h[i][p]=o});if(this.onCreate){this.onCreate(m[2],m[3],h[i].prototype)}},walk:function(h,g,i,e){e=e||this;if(h){if(i){h=h[i]}b.each(h,function(j,f){if(g.call(e,j,f,i)===false){return false}b.walk(j,g,i,e)})}},createNS:function(h,g){var f,e;g=g||c;h=h.split(".");for(f=0;f<h.length;f++){e=h[f];if(!g[e]){g[e]={}}g=g[e]}return g},resolve:function(h,g){var f,e;g=g||c;h=h.split(".");for(f=0,e=h.length;f<e;f++){g=g[h[f]];if(!g){break}}return g},addUnload:function(i,h){var g=this;i={func:i,scope:h||this};if(!g.unloads){function e(){var f=g.unloads,k,l;if(f){for(l in f){k=f[l];if(k&&k.func){k.func.call(k.scope,1)}}if(c.detachEvent){c.detachEvent("onbeforeunload",j);c.detachEvent("onunload",e)}else{if(c.removeEventListener){c.removeEventListener("unload",e,false)}}g.unloads=k=f=w=e=0;if(c.CollectGarbage){CollectGarbage()}}}function j(){var k=document;if(k.readyState=="interactive"){function f(){k.detachEvent("onstop",f);if(e){e()}k=0}if(k){k.attachEvent("onstop",f)}c.setTimeout(function(){if(k){k.detachEvent("onstop",f)}},0)}}if(c.attachEvent){c.attachEvent("onunload",e);c.attachEvent("onbeforeunload",j)}else{if(c.addEventListener){c.addEventListener("unload",e,false)}}g.unloads=[i]}else{g.unloads.push(i)}return i},removeUnload:function(h){var e=this.unloads,g=null;b.each(e,function(j,f){if(j&&j.func==h){e.splice(f,1);g=h;return false}});return g},explode:function(e,f){return e?b.map(e.split(f||","),b.trim):e},_addVer:function(f){var e;if(!this.query){return f}e=(f.indexOf("?")==-1?"?":"&")+this.query;if(f.indexOf("#")==-1){return f+e}return f.replace("#",e+"#")}};b._init();c.tinymce=c.tinyMCE=b})(window);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;e=tinymce.trim(e);g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about|data):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^\w*:?\/\//.test(e)){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=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="[";c<e.length;c++){a+=(c>0?",":"")+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={"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"},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+"</"+v+">"}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(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")}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="<br />"+p;v.removeChild(v.firstChild)}catch(x){r=o.create("div");r.innerHTML="<br />"+p;k(r.childNodes,function(B,A){if(A){v.appendChild(B)}})}}if(o.settings.fix_ie_paragraphs){p=p.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 _mce_keep="true">&nbsp;</p>')}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(/<p ([^>]+)>|<p>/ig,'<div $1 _mce_tmp="1">');p=p.replace(/<\/p>/g,"</div>");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<z.childNodes.length;r++){u.appendChild(z.childNodes[r].cloneNode(true))}z.swapNode(u)}}}}}else{v.innerHTML=p}return p})},processHTML:function(r){var p=this,q=p.settings,v=[];if(!q.process_html){return r}if(d){r=r.replace(/&apos;/g,"&#39;");r=r.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,"")}r=r.replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(q.keep_values){if(/<script|noscript|style/i.test(r)){function o(t){t=t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n");t=t.replace(/^[\r\n]*|[\r\n]*$/g,"");t=t.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"");t=t.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"");return t}r=r.replace(/<script([^>]+|)>([\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="<!--\nMCE_SCRIPT:"+(v.length-1)+"\n// -->"}return"<mce:script"+x+">"+t+"</mce:script>"});r=r.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi,function(s,x,t){if(t){v.push(o(t));t="<!--\nMCE_SCRIPT:"+(v.length-1)+"\n-->"}return"<mce:style"+x+">"+t+"</mce:style><style "+x+' _mce_bogus="1">'+t+"</style>"});r=r.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(s,x,t){return"<mce:noscript"+x+"><!--"+p.encode(t).replace(/--/g,"&#45;&#45;")+"--></mce:noscript>"})}r=r.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,"<!--[CDATA[$1]]-->");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(r,s){var o=0,q,p;if(r){for(r=r.previousSibling,q=r;r;r=r.previousSibling){p=r.nodeType;if(s&&p==3){if(r.nodeValue.length>0&&(q.nodeType!=p||q.nodeValue.length===0)){o++}}else{o++}q=r}}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(Z<Y){return -1}return 1}aa=V;while(aa&&aa.parentNode!=X){aa=aa.parentNode}if(aa){W=0;t=X.firstChild;while(t!=aa&&W<Z){W++;t=t.nextSibling}if(Z<=W){return -1}return 1}aa=X;while(aa&&aa.parentNode!=V){aa=aa.parentNode}if(aa){W=0;t=V.firstChild;while(t!=aa&&W<Y){W++;t=t.nextSibling}if(W<Y){return -1}return 1}ab=c.findCommonAncestor(X,V);ad=X;while(ad&&ad.parentNode!=ab){ad=ad.parentNode}if(!ad){ad=ab}ac=V;while(ac&&ac.parentNode!=ab){ac=ac.parentNode}if(!ac){ac=ab}if(ad==ac){return 0}t=ab.firstChild;while(t){if(t==ad){return -1}if(t==ac){return 1}t=t.nextSibling}}function B(V,Y,X){var t,W;if(V){N[h]=Y;N[U]=X}else{N[P]=Y;N[z]=X}t=N[P];while(t.parentNode){t=t.parentNode}W=N[h];while(W.parentNode){W=W.parentNode}if(W==t){if(G(N[h],N[U],N[P],N[z])>0){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(h){var j=this,k="\uFEFF",f,i,e=h.dom,d=true,g=false;function c(m,l){if(m&&l){if(m.item&&l.item&&m.item(0)===l.item(0)){return d}if(m.isEqual&&l.isEqual&&l.isEqual(m)){try{f.startContainer.nextSibling;return d}catch(n){}}}return g}function b(){var p=h.getRng(),l=e.createRng(),m,n,r,q;n=p.item?p.item(0):p.parentElement();if(n.ownerDocument!=e.doc){return l}if(p.item||!n.hasChildNodes()){l.setStart(n.parentNode,e.nodeIndex(n));l.setEnd(l.startContainer,l.startOffset+1);return l}m=p.duplicate();r=h.isCollapsed();p.collapse();p.pasteHTML('<span id="_mce_start" style="display:none;line-height:0">'+k+"</span>");if(!r){m.collapse(g);m.pasteHTML('<span id="_mce_end" style="display:none;line-height:0">'+k+"</span>")}function o(x){var t,v,s,u;s=e.get("_mce_"+(x?"start":"end"));u=s.previousSibling;if(u&&u.nodeType==3){t=u;v=t.nodeValue.length;e.remove(s);u=t.nextSibling;if(u&&u.nodeType==3){q=d;t.appendData(u.nodeValue);e.remove(u)}}else{u=s.nextSibling;if(u&&u.nodeType==3){t=u;v=0}else{if(u){v=e.nodeIndex(u)-1}else{v=e.nodeIndex(s)}t=s.parentNode}e.remove(s)}if(x){l.setStart(t,v)}if(!x||r){l.setEnd(t,v)}}o(d);if(!r){o(g)}if(q){j.addRange(l)}return l}this.addRange=function(m){var u,A,z=h.dom.doc,s=z.body,v,o,y,p,t,l,q,r,x,n;this.destroy();y=m.startContainer;p=m.startOffset;t=m.endContainer;l=m.endOffset;u=s.createTextRange();if(y==z||t==z){u=s.createTextRange();u.collapse();u.select();return}if(y.nodeType==1&&y.hasChildNodes()){r=y.childNodes.length-1;if(p>r){x=1;y=y.childNodes[r]}else{y=y.childNodes[p]}if(y.nodeType==3){p=0}}if(t.nodeType==1&&t.hasChildNodes()){r=t.childNodes.length-1;if(l==0){n=1;t=t.childNodes[0]}else{t=t.childNodes[Math.min(r,l-1)];if(t.nodeType==3){l=t.nodeValue.length}}}if(y==t&&y.nodeType==1){if(/^(IMG|TABLE)$/.test(y.nodeName)&&p!=l){u=s.createControlRange();u.addElement(y)}else{u=s.createTextRange();if(!y.hasChildNodes()&&y.canHaveHTML){y.innerHTML=k}u.moveToElementText(y);if(y.innerHTML==k){u.collapse(d);y.removeChild(y.firstChild)}}if(p==l){u.collapse(l<=m.endContainer.childNodes.length-1)}u.select();u.scrollIntoView();return}u=s.createTextRange();q=z.createElement("span");q.innerHTML=" ";if(y.nodeType==3){if(x){e.insertAfter(q,y)}else{y.parentNode.insertBefore(q,y)}u.moveToElementText(q);q.parentNode.removeChild(q);u.move("character",p)}else{u.moveToElementText(y);if(x){u.collapse(g)}}if(y==t&&y.nodeType==3){u.moveEnd("character",l-p);u.select();u.scrollIntoView();return}A=s.createTextRange();if(t.nodeType==3){t.parentNode.insertBefore(q,t);A.moveToElementText(q);q.parentNode.removeChild(q);A.move("character",l);u.setEndPoint("EndToStart",A)}else{A.moveToElementText(t);A.collapse(!!n);u.setEndPoint("EndToEnd",A)}u.select();u.scrollIntoView()};this.getRangeAt=function(){if(!f||!c(i,h.getRng())){f=b();i=h.getRng()}return f};this.destroy=function(){i=f=null};if(h.dom.boxModel){(function(){var r=e.doc,m=r.body,o,p;r.documentElement.unselectable=d;function q(s,v){var t=m.createTextRange();try{t.moveToPoint(s,v)}catch(u){t=null}return t}function n(t){var s;if(t.button){s=q(t.x,t.y);if(s){if(s.compareEndPoints("StartToStart",p)>0){s.setEndPoint("StartToStart",p)}else{s.setEndPoint("EndToEnd",p)}s.select()}}else{l()}}function l(){e.unbind(r,"mouseup",l);e.unbind(r,"mousemove",n);o=0}e.bind(r,"mousedown",function(s){if(s.target.nodeName==="HTML"){if(o){l()}o=1;p=q(s.x,s.y);if(p){e.bind(r,"mouseup",l);e.bind(r,"mousemove",n);p.select()}}})})()}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,i=0,d=Object.prototype.toString,n=false;var b=function(E,t,B,v){B=B||[];var e=t=t||document;if(t.nodeType!==1&&t.nodeType!==9){return[]}if(!E||typeof E!=="string"){return B}var C=[],D,z,H,G,A,s,r=true,x=o(t);p.lastIndex=0;while((D=p.exec(E))!==null){C.push(D[1]);if(D[2]){s=RegExp.rightContext;break}}if(C.length>1&&j.exec(E)){if(C.length===2&&f.relative[C[0]]){z=g(C[0]+C[1],t)}else{z=f.relative[C[0]]?[t]:b(C.shift(),t);while(C.length){E=C.shift();if(f.relative[E]){E+=C.shift()}z=g(E,z)}}}else{if(!v&&C.length>1&&t.nodeType===9&&!x&&f.match.ID.test(C[0])&&!f.match.ID.test(C[C.length-1])){var I=b.find(C.shift(),t,x);t=I.expr?b.filter(I.expr,I.set)[0]:I.set[0]}if(t){var I=v?{expr:C.pop(),set:a(v)}:b.find(C.pop(),C.length===1&&(C[0]==="~"||C[0]==="+")&&t.parentNode?t.parentNode:t,x);z=I.expr?b.filter(I.expr,I.set):I.set;if(C.length>0){H=a(z)}else{r=false}while(C.length){var u=C.pop(),y=u;if(!f.relative[u]){u=""}else{y=C.pop()}if(y==null){y=t}f.relative[u](H,y,x)}}else{H=C=[]}}if(!H){H=z}if(!H){throw"Syntax error, unrecognized expression: "+(u||E)}if(d.call(H)==="[object Array]"){if(!r){B.push.apply(B,H)}else{if(t&&t.nodeType===1){for(var F=0;H[F]!=null;F++){if(H[F]&&(H[F]===true||H[F].nodeType===1&&h(t,H[F]))){B.push(z[F])}}}else{for(var F=0;H[F]!=null;F++){if(H[F]&&H[F].nodeType===1){B.push(z[F])}}}}}else{a(H,B)}if(s){b(s,e,B,v);b.uniqueSort(B)}return B};b.uniqueSort=function(r){if(c){n=false;r.sort(c);if(n){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(y,e,z){var x,u;if(!y){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.match[v].exec(y))){var r=RegExp.leftContext;if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");x=f.find[v](u,e,z);if(x!=null){y=y.replace(f.match[v],"");break}}}}if(!x){x=e.getElementsByTagName("*")}return{set:x,expr:y}};b.filter=function(B,A,E,t){var s=B,G=[],y=A,v,e,x=A&&A[0]&&o(A[0]);while(B&&A.length){for(var z in f.filter){if((v=f.match[z].exec(B))!=null){var r=f.filter[z],F,D;e=false;if(y==G){G=[]}if(f.preFilter[z]){v=f.preFilter[z](v,y,E,G,t,x);if(!v){e=F=true}else{if(v===true){continue}}}if(v){for(var u=0;(D=y[u])!=null;u++){if(D){F=r(D,v,u,y);var C=t^!!F;if(E&&F!=null){if(C){e=true}else{y[u]=false}}else{if(C){G.push(D);e=true}}}}}if(F!==undefined){if(!E){y=G}B=B.replace(f.match[z],"");if(!e){return[]}break}}}if(B==s){if(e==null){throw"Syntax error, unrecognized expression: "+B}else{break}}s=B}return y};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(y,e,x){var u=typeof e==="string",z=u&&!/\W/.test(e),v=u&&!z;if(z&&!x){e=e.toUpperCase()}for(var t=0,s=y.length,r;t<s;t++){if((r=y[t])){while((r=r.previousSibling)&&r.nodeType!==1){}y[t]=v||r&&r.nodeName===e?r||false:r===e}}if(v){b.filter(e,y,true)}},">":function(x,r,y){var u=typeof r==="string";if(u&&!/\W/.test(r)){r=y?r:r.toUpperCase();for(var s=0,e=x.length;s<e;s++){var v=x[s];if(v){var t=v.parentNode;x[s]=t.nodeName===r?t:false}}}else{for(var s=0,e=x.length;s<e;s++){var v=x[s];if(v){x[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,x,true)}}},"":function(t,r,v){var s=i++,e=q;if(!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=i++,e=q;if(typeof r==="string"&&!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v,x){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,x,y){t=" "+t[1].replace(/\\/g,"")+" ";if(y){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(x^(v.className&&(" "+v.className+" ").indexOf(t)>=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){for(var s=0;e[s]===false;s++){}return e[s]&&o(e[s])?r[1]:r[1].toUpperCase()},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]=i++;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(u[3].match(p).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.toUpperCase()==="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 r<e[3]-0},gt:function(s,r,e){return r>e[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(x,s,t,y){var r=s[1],u=f.filters[r];if(u){return u(x,t,s,y)}else{if(r==="contains"){return(x.textContent||x.innerText||"").indexOf(s[3])>=0}else{if(r==="not"){var v=s[3];for(var t=0,e=v.length;t<e;t++){if(v[t]===x){return false}}return true}}}},CHILD:function(e,t){var x=t[1],r=e;switch(x){case"only":case"first":while(r=r.previousSibling){if(r.nodeType===1){return false}}if(x=="first"){return true}r=e;case"last":while(r=r.nextSibling){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],A=t[3];if(s==1&&A==0){return true}var v=t[0],z=e.parentNode;if(z&&(z.sizcache!==v||!e.nodeIndex)){var u=0;for(r=z.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}z.sizcache=v}var y=e.nodeIndex-A;if(s==0){return y==0}else{return(y%s==0&&y/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName===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 j=f.match.POS;for(var l in f.match){f.match[l]=new RegExp(f.match[l].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var a=function(r,e){r=Array.prototype.slice.call(r);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(k){a=function(u,t){var r=t||[];if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var s=0,e=u.length;s<e;s++){r.push(u[s])}}else{for(var s=0;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){n=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){var s=r.sourceIndex-e.sourceIndex;if(s===0){n=true}return s}}else{if(document.createRange){c=function(t,r){var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.setStart(t,0);s.setEnd(t,0);e.setStart(r,0);e.setEnd(r,0);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){n=true}return u}}}}(function(){var r=document.createElement("div"),s="script"+(new Date).getTime();r.innerHTML="<a name='"+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)})();(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="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(x,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!o(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]}})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(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])}}})()}function m(r,x,v,B,y,A){var z=r=="previousSibling"&&!A;for(var t=0,s=B.length;t<s;t++){var e=B[t];if(e){if(z&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=B[e.sizset];break}if(e.nodeType===1&&!A){e.sizcache=v;e.sizset=t}if(e.nodeName===x){u=e;break}e=e[r]}B[t]=u}}}function q(r,x,v,B,y,A){var z=r=="previousSibling"&&!A;for(var t=0,s=B.length;t<s;t++){var e=B[t];if(e){if(z&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=B[e.sizset];break}if(e.nodeType===1){if(!A){e.sizcache=v;e.sizset=t}if(typeof x!=="string"){if(e===x){u=true;break}}else{if(b.filter(x,[e]).length>0){u=e;break}}}e=e[r]}B[t]=u}}}var h=document.compareDocumentPosition?function(r,e){return r.compareDocumentPosition(e)&16}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};var o=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=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<r;x++){b(e,s[x],t)}return b.filter(u,t)};window.tinymce.dom.Sizzle=b})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=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<arguments.length;j++){h.push(arguments[j])}h=e[g].apply(e,h);b.update(g);return h}});a.extend(b,{on:function(i,h,g){return a.dom.Event.add(b.id,i,h,g)},getXY:function(){return{x:parseInt(b.getStyle("left")),y:parseInt(b.getStyle("top"))}},getSize:function(){var g=e.get(b.id);return{w:parseInt(b.getStyle("width")||g.clientWidth),h:parseInt(b.getStyle("height")||g.clientHeight)}},moveTo:function(g,h){b.setStyles({left:g,top:h})},moveBy:function(g,i){var h=b.getXY();b.moveTo(h.x+g,h.y+i)},resizeTo:function(g,i){b.setStyles({width:g,height:i})},resizeBy:function(g,j){var i=b.getSize();b.resizeTo(i.w+g,i.h+j)},update:function(h){var g;if(a.isIE6&&d.blocker){h=h||"";if(h.indexOf("get")===0||h.indexOf("has")===0||h.indexOf("is")===0){return}if(h=="remove"){e.remove(b.blocker);return}if(!b.blocker){b.blocker=e.uniqueId();g=e.add(d.container||e.getRoot(),"iframe",{id:b.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});e.setStyle(g,"opacity",0)}else{g=e.get(b.blocker)}e.setStyles(g,{left:b.getStyle("left",1),top:b.getStyle("top",1),width:b.getStyle("width",1),height:b.getStyle("height",1),display:b.getStyle("display",1),zIndex:parseInt(b.getStyle("zIndex",1)||0)-1})}}})}})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(i,g){var f=this,j=f.getRng(),l,k=f.win.document;g=g||{format:"html"};g.set=true;i=g.content=f.dom.processHTML(i);f.onBeforeSetContent.dispatch(f,g);i=g.content;if(j.insertNode){i+='<span id="__caret">_</span>';if(j.startContainer==k&&j.endContainer==k){k.body.innerHTML=i}else{j.deleteContents();j.insertNode(f.getRng().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 f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(1);h=g.parentElement();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(a){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(z,B){var F=[],D,H,A=z[B?"startContainer":"endContainer"],E=z[B?"startOffset":"endOffset"],C,G={};if(A.nodeType==1&&A.hasChildNodes()){H=A.childNodes.length-1;G.exclude=(B&&E>H)||(!B&&E==0);if(!B&&E){E--}A=A.childNodes[E>H?H:E];if(A.nodeType==3){E=B?0:A.nodeValue.length}}if(A.nodeType==3){if(r){for(D=A.previousSibling;D&&D.nodeType==3;D=D.previousSibling){E+=D.nodeValue.length}}G.offset=E}for(;A&&A!=t;A=A.parentNode){F.push(u.dom.nodeIndex(A,r))}G.indexes=F;return G}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('<span _mce_type="bookmark" id="'+i+'_start" style="'+s+'">'+l+"</span>");if(!n){j.collapse(false);j.pasteHTML('<span _mce_type="bookmark" id="'+i+'_end" style="'+s+'">'+l+"</span>")}}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(l){var n=this,k=n.dom,i,h,f,m;if(n.tridentSel){n.tridentSel.destroy()}if(l){if(l.start){f=k.createRng();m=k.getRoot();function g(s){var o=l[s?"start":"end"],p,q,r;if(o){for(q=m,p=o.indexes.length-1;p>=0;p--){q=q.childNodes[o.indexes[p]]||q}if(s){if(q.nodeType==3&&o.offset){f.setStart(q,o.offset)}else{if(o.exclude){f.setStartAfter(q)}else{f.setStartBefore(q)}}}else{if(q.nodeType==3&&o.offset){f.setEnd(q,o.offset)}else{if(o.exclude){f.setEndBefore(q)}else{f.setEndAfter(q)}}}}}g(true);g();n.setRng(f)}else{if(l.id){f=k.createRng();function j(u){var p=k.get(l.id+"_"+u),t,o,r,s,q=l.keep;if(p){t=p.parentNode;if(u=="start"){if(!q){o=k.nodeIndex(p)}else{t=p;o=1}f.setStart(t,o);f.setEnd(t,o)}else{if(!q){o=k.nodeIndex(p)}else{t=p;o=1}f.setEnd(t,o)}if(!q){s=p.previousSibling;r=p.nextSibling;d(c.grep(p.childNodes),function(v){if(v.nodeType==3){v.nodeValue=v.nodeValue.replace(/\uFEFF/g,"")}});while(p=k.get(l.id+"_"+u)){k.remove(p,1)}if(s&&r&&s.nodeType==r.nodeType&&s.nodeType==3){o=s.nodeValue.length;s.appendData(r.nodeValue);k.remove(r);if(u=="start"){f.setStart(s,o);f.setEnd(s,o)}else{f.setEnd(s,o)}}}}}j("start");j("end");n.setRng(f)}else{if(l.name){n.select(k.select(l.name)[l.index])}else{if(l.rng){n.setRng(l.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=a?g.win.document.body.createTextRange():g.win.document.createRange()}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){h.removeAllRanges();h.addRange(i)}}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(!a){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>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,"&gt;")}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("</"+b+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");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("<![CDATA["+b+"]]>");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("<!-- "+b+"-->");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case'"':return"&quot;"}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(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^<br \/>\s*<\//.test(n)){return"</"+o+">"}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<o.length;p++){if(r.nodeName==o[p]){return r}}}return null}for(z=0;z<y.length;z++){l=i.dom.select(y[z],s.node);for(u=0;u<l.length;u++){t=l[u];q=t.parentNode;if(k.test(q.nodeName)){A=m(t,"LI");if(!A){A=i.dom.create("li");A.innerHTML="&nbsp;";A.appendChild(t);q.insertBefore(A,q.firstChild)}else{A.appendChild(t)}}}}})}if(j.fix_table_elements){i.onPreProcess.add(function(k,l){if(!e.isOpera||opera.buildNumber()>=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;m<j.length;m+=2){k=j[m];if(k==34||k==38||k==60||k==62){continue}h[String.fromCharCode(j[m])]=j[m+1];k=parseInt(j[m]).toString(16)}n.entityLookup=h},setRules:function(i){var h=this;h._setup();h.rules={};h.wildRules=[];h.validElements={};return h.addRules(i)},addRules:function(i){var h=this,j;if(!i){return}h._setup();f(i.split(","),function(m){var q=m.split(/\[|\]/),l=q[0].split("/"),r,k,o,n=[];if(j){k=e.extend([],j.attribs)}if(q.length>1){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<k.length;t++){if(k[t].name==u[2]){k.splice(t,1);return}}}switch(u[3]){case"=":p.defaultVal=u[4]||"";break;case":":p.forcedVal=u[4];break;case"<":p.validVals=u[4].split("?");break}if(/[*.?]/.test(u[2])){o=o||[];p.nameRE=new RegExp("^"+c(u[2])+"$");o.push(p)}else{p.name=u[2];k.push(p)}n.push(u[2])})}f(l,function(v,u){var y=v.charAt(0),t=1,p={};if(j){if(j.noEmpty){p.noEmpty=j.noEmpty}if(j.fullEnd){p.fullEnd=j.fullEnd}if(j.padd){p.padd=j.padd}}switch(y){case"-":p.noEmpty=true;break;case"+":p.fullEnd=true;break;case"#":p.padd=true;break;default:t=0}l[u]=v=v.substring(t);h.validElements[v]=1;if(/[*.?]/.test(l[0])){p.nameRE=new RegExp("^"+c(l[0])+"$");h.wildRules=h.wildRules||{};h.wildRules.push(p)}else{p.name=l[0];if(l[0]=="@"){j=p}h.rules[v]=p}p.attribs=k;if(r){p.requiredAttribs=r}if(o){v="";f(n,function(s){if(v){v+="|"}v+="("+c(s)+")"});p.validAttribsRE=new RegExp("^"+v.toLowerCase()+"$");p.wildAttribs=o}})});i="";f(h.validElements,function(m,l){if(i){i+="|"}if(l!="@"){i+=l}});h.validElementsRE=new RegExp("^("+c(i.toLowerCase())+")$")},findRule:function(m){var j=this,l=j.rules,h,k;j._setup();k=l[m];if(k){return k}l=j.wildRules;for(h=0;h<l.length;h++){if(l[h].nameRE.test(m)){return l[h]}}return null},findAttribRule:function(h,l){var j,k=h.wildAttribs;for(j=0;j<k.length;j++){if(k[j].nameRE.test(l)){return k[j]}}return null},serialize:function(r,q){var m,k=this,p,i,j,l;k._setup();q=q||{};q.format=q.format||"html";k.processObj=q;if(d){l=[];f(r.getElementsByTagName("option"),function(o){var h=k.dom.getAttrib(o,"selected");l.push(h?h:null)})}r=r.cloneNode(true);if(d){f(r.getElementsByTagName("option"),function(o,h){k.dom.setAttrib(o,"selected",l[h])})}j=r.ownerDocument.implementation;if(j.createHTMLDocument&&(e.isOpera&&opera.buildNumber()>=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[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<noscript[^>]*>)(.*?)(<\/noscript>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?"<p$1>&#160;</p>":"<p$1>&nbsp;</p>");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,"</$1>")}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,"</$1>\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,"<![CDATA[$1]]>");if(k.entity_encoding=="raw"){j=j.replace(/<p>&nbsp;<\/p>|<p([^>]+)>&nbsp;<\/p>/g,"<p$1>\u00a0</p>")}j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return"<noscript"+p+">"+i.dom.decode(o.replace(/<!--|-->/g,""))+"</noscript>"})}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);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<E;F++){H=B[F];y=z._getAttrib(D,H);if(y!==null){x.writeAttribute(H.name,y)}}}if(r.validAttribsRE){B=z.dom.getAttribs(D);for(F=B.length-1;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+"<!--mce:"+(j.items.length-1)+"-->"+p}))});return j},_unprotect:function(i,j){i=i.replace(/\<!--mce:([0-9]+)--\>/g,function(k,h){return j.items[parseInt(h)]});j.items=[];return i},_encode:function(m){var j=this,k=j.settings,i;if(k.entity_encoding!=="raw"){if(k.entity_encoding.indexOf("named")!=-1){j.setEntities(k.entities);i=j.entityLookup;m=m.replace(/[\u007E-\uFFFF]/g,function(h){var l;if(l=i[h]){h="&"+l+";"}return h})}if(k.entity_encoding.indexOf("numeric")!=-1){m=m.replace(/[\u007E-\uFFFF]/g,function(h){return"&#"+h.charCodeAt(0)+";"})}}return m},_setup:function(){var h=this,i=this.settings;if(h.done){return}h.done=1;h.setRules(i.valid_elements);h.addRules(i.extended_valid_elements);if(i.invalid_elements){h.invalidElementsRE=new RegExp("^("+c(i.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(i.attrib_value_filter){h.attribValueFilter=i.attribValueFilter}},_getAttrib:function(m,j,h){var l,k;h=h||j.name;if(j.forcedVal&&(k=j.forcedVal)){if(k==="{$uid}"){return this.dom.uniqueId()}return k}k=this.dom.getAttrib(m,h);switch(h){case"rowspan":case"colspan":if(k=="1"){k=""}break}if(this.attribValueFilter){k=this.attribValueFilter(h,k,m)}if(j.validVals){for(l=j.validVals.length-1;l>=0;l--){if(k==j.validVals[l]){break}}if(l==-1){return null}}if(k===""&&typeof(j.defaultVal)!="undefined"){k=j.defaultVal;if(k==="{$uid}"){return this.dom.uniqueId()}return k}else{if(h=="class"&&this.processObj.get){k=k.replace(/\s?mceItem\w+\s?/g,"")}}if(k===""){return null}return k}})})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],f={},d=[],g=0,e;function b(m,u){var v=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}u()}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(x){var t=q.create("script",{type:"text/javascript"});t.text=x;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()}});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});s.onload=p;s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}};(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==e){j.push(m);l[m]=c}if(q){if(!f[m]){f[m]=[]}f[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(f[r],function(s){s.func.call(s.scope)});f[r]=e}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","lastSibling",e))}};(function(){var a={};function b(f,e){var d;function c(g){return g.replace(/[A-Z]+/g,function(h){return c(f[h])})}for(d in f){if(f.hasOwnProperty(d)){f[d]=c(f[d])}}c(e).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]/g,function(l,g,j){var h,k={};j=j.split(/\|/);for(h=j.length-1;h>=0;h--){k[j[h]]=1}a[g]=k})}b({Z:"#|H|K|N|O|P",Y:"#|X|form|R|Q",X:"p|T|div|U|W|isindex|fieldset|table",W:"pre|hr|blockquote|address|center|noframes",U:"ul|ol|dl|menu|dir",ZC:"#|p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"#|X|S|Q",S:"R|P",ZA:"#|a|G|J|M|O|P",R:"#|a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe"},"script[]style[]object[#|param|X|form|a|H|K|N|O|Q]param[]p[S]a[Z]br[]span[S]bdo[S]applet[#|param|X|form|a|H|K|N|O|Q]h1[S]img[]map[X|form|Q|area]h2[S]iframe[#|X|form|a|H|K|N|O|Q]h3[S]tt[S]i[S]b[S]u[S]s[S]strike[S]big[S]small[S]font[S]basefont[]em[S]strong[S]dfn[S]code[S]q[S]samp[S]kbd[S]var[S]cite[S]abbr[S]acronym[S]sub[S]sup[S]input[]select[optgroup|option]optgroup[option]option[]textarea[]label[S]button[#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[S]ins[#|X|form|a|H|K|N|O|Q]h5[S]del[#|X|form|a|H|K|N|O|Q]h6[S]div[#|X|form|a|H|K|N|O|Q]ul[li]li[#|X|form|a|H|K|N|O|Q]ol[li]dl[dt|dd]dt[S]dd[#|X|form|a|H|K|N|O|Q]menu[li]dir[li]pre[ZA]hr[]blockquote[#|X|form|a|H|K|N|O|Q]address[S|p]center[#|X|form|a|H|K|N|O|Q]noframes[#|X|form|a|H|K|N|O|Q]isindex[]fieldset[#|legend|X|form|a|H|K|N|O|Q]legend[S]table[caption|col|colgroup|thead|tfoot|tbody|tr]caption[S]col[]colgroup[col]thead[tr]tr[th|td]th[#|X|form|a|H|K|N|O|Q]form[#|X|a|H|K|N|O|Q]noscript[#|X|form|a|H|K|N|O|Q]td[#|X|form|a|H|K|N|O|Q]tfoot[tr]tbody[tr]area[]base[]body[#|X|form|a|H|K|N|O|Q]");tinymce.dom.Schema=function(){var c=this,d=a;c.isValid=function(f,e){var g=d[f];return !!(g&&(!e||g[e]))}}})();(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,r){var h=d.startContainer,k=d.startOffset,s=d.endContainer,l=d.endOffset,i,f,n,g,q,p,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(t){r([t])});return}function o(v,u,t){var x=[];for(;v&&v!=t;v=v[u]){x.push(v)}return x}function m(u,t){do{if(u.parentNode==t){return u}u=u.parentNode}while(u)}function j(v,u,x){var t=x?"nextSibling":"previousSibling";for(g=v,q=g.parentNode;g&&g!=u;g=q){q=g.parentNode;p=o(g==v?g:g[t],t);if(p.length){if(!x){p.reverse()}r(p)}}}if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[k]}if(s.nodeType==1&&s.hasChildNodes()){s=s.childNodes[Math.min(k==l?l:l-1,s.childNodes.length-1)]}i=c.findCommonAncestor(h,s);if(h==s){return r([h])}for(g=h;g;g=g.parentNode){if(g==s){return j(h,i,true)}if(g==i){break}}for(g=s;g;g=g.parentNode){if(g==h){return j(s,i)}if(g==i){break}}f=m(h,i)||h;n=m(s,i)||s;j(h,f,true);p=o(f==h?f:f.nextSibling,"nextSibling",n==s?n.nextSibling:n);if(p.length){r(p)}j(s,n)}}})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(e,d){this.id=e;this.settings=d=d||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=d.scope||this;this.disabled=0;this.active=0},setDisabled:function(d){var f;if(d!=this.disabled){f=b.get(this.id);if(f&&this.settings.unavailable_prefix){if(d){this.prevTitle=f.title;f.title=this.settings.unavailable_prefix+": "+f.title}else{f.title=this.prevTitle}}this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(b,a){this.parent(b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}z.onShowMenu.dispatch(z);if(A.keyboard_focus){a.add(o,"keydown",z._keyHandler,z);c.select("a","menu_"+z.id)[0].focus();z._focusIdx=0}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);a.remove(h,"mouseover",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000"});k=c.add(g,"div",{id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_keyHandler:function(j){var i=this,h=j.keyCode;function g(m){var k=i._focusIdx+m,l=c.select("a","menu_"+i.id)[k];if(l){i._focusIdx=k;l.focus()}}switch(h){case 38:g(-1);return;case 40:g(1);return;case 13:return;case 27:return this.hideMenu()}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,"td");i=p=c.add(i,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(d,c){this.parent(d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" />'+c+"</a>"}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")+"</a>"}return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(h,g){var f=this;f.parent(h,g);f.items=[];f.onChange=new a(f);f.onPostRender=new a(f);f.onAdd=new a(f);f.onRenderMenu=new d.util.Dispatcher(this);f.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.selectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle")}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<table id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("a",{id:f.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";i+="</tr></tbody></table>";return i},showMenu:function(){var g=this,j,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}j=c.getPos(this.settings.menu_container);i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(k){if(k.value===g.selectedValue){f.items[k.id].setSelected(1);g.oldID=k.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(f.menu&&f.menu.isMenuVisible){if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(g.hideMenu,g);f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){if(h.value===undefined){f.add({title:h.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}})}else{h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)}});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id+"_text","focus",function(h){if(!f._focused){f.keyDownHandler=b.add(f.id+"_text","keydown",function(l){var i=-1,j,k=l.keyCode;e(f.items,function(m,n){if(f.selectedValue==m.value){i=n}});if(k==38){j=f.items[i-1]}else{if(k==40){j=f.items[i+1]}else{if(k==13){j=f.selectedValue;f.selectedValue=null;f.settings.onselect(j);return b.cancel(l)}}}if(j){f.hideMenu();f.select(j.value)}})}f._focused=1});b.add(f.id+"_text","blur",function(){b.remove(f.id+"_text","keydown",f.keyDownHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return c.get(this.id).options.length-1},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox"},g);return g},postRender:function(){var g=this,h;g.rendered=true;function f(j){var i=g.items[j.target.selectedIndex-1];if(i&&(i=i.value)){g.onChange.dispatch(g,i);if(g.settings.onselect){g.settings.onselect(i)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(j){var i;b.remove(g.id,"change",h);i=b.add(g.id,"blur",function(){b.add(g.id,"change",f);b.remove(g.id,"blur",i)});if(j.keyCode==13||j.keyCode==32){f(j);return b.cancel(j)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,e){this.parent(f,e);this.onRenderMenu=new c.util.Dispatcher(this);e.menu_container=e.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(f.hideMenu,f);f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(f,e){this.parent(f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,"class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}i+="<td>"+b.createHTML("a",{id:f.id+"_action",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]});i+="<td>"+b.createHTML("a",{id:f.id+"_open",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";return b.createHTML("table",{id:f.id,"class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:g.title},i)},postRender:function(){var e=this,f=e.settings;if(f.onclick){a.add(e.id+"_action","click",function(){if(!e.isDisabled()){f.onclick(e.value)}})}a.add(e.id+"_open","click",e.showMenu,e);a.add(e.id+"_open","focus",function(){e._focused=1});a.add(e.id+"_open","blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(h,g){var f=this;f.parent(h,g);f.settings=g=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},f.settings);f.onShowMenu=new d.util.Dispatcher(f);f.onHideMenu=new d.util.Dispatcher(f);f.value=g.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.onHideMenu.dispatch(f);f.isMenuVisible=0},renderMenu:function(){var k=this,f,j=0,l=k.settings,p,h,o,g;g=c.add(l.menu_container,"div",{id:k.id+"_menu","class":l.menu_class+" "+l["class"],style:"position:absolute;left:0;top:-1000px;"});f=c.add(g,"div",{"class":l["class"]+" mceSplitButtonMenu"});c.add(f,"span",{"class":"mceMenuLine"});p=c.add(f,"table",{"class":"mceColorSplitMenu"});h=c.add(p,"tbody");j=0;e(b(l.colors,"array")?l.colors:l.colors.split(","),function(i){i=i.replace(/^#/,"");if(!j--){o=c.add(h,"tr");j=l.grid_width-1}p=c.add(o,"td");p=c.add(p,"a",{href:"javascript:;",style:{backgroundColor:"#"+i},_mce_color:"#"+i})});if(l.more_colors_func){p=c.add(h,"tr");p=c.add(p,"td",{colspan:l.grid_width,"class":"mceMoreColors"});p=c.add(p,"a",{id:k.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},l.more_colors_title);a.add(p,"click",function(i){l.more_colors_func.call(l.more_colors_scope||this);return a.cancel(i)})}c.addClass(f,"mceColorSplitMenu");a.add(k.id+"_menu","click",function(i){var m;i=i.target;if(i.nodeName=="A"&&(m=i.getAttribute("_mce_color"))){k.setColor(m)}return a.cancel(i)});return g},setColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g;f.hideMenu();f.settings.onselect(g)},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var l=this,e="",g,j,b=tinymce.DOM,m=l.settings,d,a,f,k;k=l.controls;for(d=0;d<k.length;d++){j=k[d];a=k[d-1];f=k[d+1];if(d===0){g="mceToolbarStart";if(j.Button){g+=" mceToolbarStartButton"}else{if(j.SplitButton){g+=" mceToolbarStartSplitButton"}else{if(j.ListBox){g+=" mceToolbarStartListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,"<!-- IE -->"))}}if(b.stdMode){e+='<td style="position: relative">'+j.renderHTML()+"</td>"}else{e+="<td>"+j.renderHTML()+"</td>"}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,"<!-- IE -->"))}}}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,"<!-- IE -->"));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},"<tbody><tr>"+e+"</tr></tbody>")}});(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<o.length;l++){if(o[l]==n){o.splice(l,1);break}}if(m.activeEditor==n){m._setActive(o[0])}n.destroy();m.onRemoveEditor.dispatch(m,n);return n},execCommand:function(r,p,o){var q=this,n=q.get(o),l;switch(r){case"mceFocus":n.focus();return true;case"mceAddEditor":case"mceAddControl":if(!q.get(o)){new j.Editor(o,q.settings).render()}return true;case"mceAddFrameControl":l=o.window;l.tinyMCE=tinyMCE;l.tinymce=j;j.DOM.doc=l.document;j.DOM.win=l;n=new j.Editor(o.element_id,o);n.render();if(j.isIE){function m(){n.destroy();l.detachEvent("onunload",m);l=l.tinyMCE=l.tinymce=null}l.attachEvent("onunload",m)}o.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(n){n.remove()}return true;case"mceToggleEditor":if(!n){q.execCommand("mceAddControl",0,o);return true}if(n.isHidden()){n.show()}else{n.hide()}return true}if(q.activeEditor){return q.activeEditor.execCommand(r,p,o)}return false},execInstanceCommand:function(p,o,n,m){var l=this.get(p);if(l){return l.execCommand(o,n,m)}return false},triggerSave:function(){g(this.editors,function(l){l.save()})},addI18n:function(n,q){var l,m=this.i18n;if(!j.is(n,"string")){g(n,function(r,p){g(r,function(t,s){g(t,function(v,u){if(s==="common"){m[p+"."+u]=v}else{m[p+"."+s+"."+u]=v}})})})}else{g(q,function(r,p){m[n+"."+p]=r})}},_setActive:function(l){this.selectedInstance=this.activeEditor=l}})})(tinymce);(function(m){var n=m.DOM,j=m.dom.Event,f=m.extend,k=m.util.Dispatcher,i=m.each,a=m.isGecko,b=m.isIE,e=m.isWebKit,d=m.is,h=m.ThemeManager,c=m.PluginManager,o=m.inArray,l=m.grep,g=m.explode;m.create("tinymce.Editor",{Editor:function(r,q){var p=this;p.id=p.editorId=r;p.execCommands={};p.queryStateCommands={};p.queryValueCommands={};p.isNotDirty=false;p.plugins={};i(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){p[s]=new k(p)});p.settings=q=f({id:r,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:m.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:m.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",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<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",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},q);p.documentBaseURI=new m.util.URI(q.document_base_url||m.documentBaseURL,{base_uri:tinyMCE.baseURI});p.baseURI=m.baseURI;p.execCallback("setup",p)},render:function(r){var u=this,v=u.settings,x=u.id,p=m.ScriptLoader;if(!j.domLoaded){j.add(document,"init",function(){u.render()});return}tinyMCE.settings=v;if(!u.getElement()){return}if(!/TEXTAREA|INPUT/i.test(u.getElement().nodeName)&&v.hidden_input&&n.getParent(x,"form")){n.insertAfter(n.create("input",{type:"hidden",name:x}),x)}if(m.WindowManager){u.windowManager=new m.WindowManager(u)}if(v.encoding=="xml"){u.onGetContent.add(function(s,t){if(t.save){t.content=n.encode(t.content)}})}if(v.add_form_submit_trigger){u.onSubmit.addToTop(function(){if(u.initialized){u.save();u.isNotDirty=1}})}if(v.add_unload_trigger){u._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(u.initialized&&!u.destroyed&&!u.isHidden()){u.save({format:"raw",no_events:true})}})}m.addUnload(u.destroy,u);if(v.submit_patch){u.onBeforeRenderUI.add(function(){var s=u.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){u.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){m.triggerSave();u.isNotDirty=1;return u.formElement._mceOldSubmit(u.formElement)}}s=null})}function q(){if(v.language){p.add(m.baseURL+"/langs/"+v.language+".js")}if(v.theme&&v.theme.charAt(0)!="-"&&!h.urls[v.theme]){h.load(v.theme,"themes/"+v.theme+"/editor_template"+m.suffix+".js")}i(g(v.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(s=="safari"){return}c.load(s,"plugins/"+s+"/editor_plugin"+m.suffix+".js")}});p.loadQueue(function(){if(!u.removed){u.init()}})}q()},init:function(){var r,E=this,F=E.settings,B,y,A=E.getElement(),q,p,C,x,z,D;m.add(E);if(F.theme){F.theme=F.theme.replace(/-/,"");q=h.get(F.theme);E.theme=new q();if(E.theme.init&&F.init_theme){E.theme.init(E,h.urls[F.theme]||m.documentBaseURL.replace(/\/$/,""))}}i(g(F.plugins.replace(/\-/g,"")),function(G){var H=c.get(G),t=c.urls[G]||m.documentBaseURL.replace(/\/$/,""),s;if(H){s=new H(E,t);E.plugins[G]=s;if(s.init){s.init(E,t)}}});if(F.popup_css!==false){if(F.popup_css){F.popup_css=E.documentBaseURI.toAbsolute(F.popup_css)}else{F.popup_css=E.baseURI.toAbsolute("themes/"+F.theme+"/skins/"+F.skin+"/dialog.css")}}if(F.popup_css_add){F.popup_css+=","+E.documentBaseURI.toAbsolute(F.popup_css_add)}E.controlManager=new m.ControlManager(E);if(F.custom_undo_redo){E.onBeforeExecCommand.add(function(t,G,u,H,s){if(G!="Undo"&&G!="Redo"&&G!="mceRepaint"&&(!s||!s.skip_undo)){if(!E.undoManager.hasUndo()){E.undoManager.add()}}});E.onExecCommand.add(function(t,G,u,H,s){if(G!="Undo"&&G!="Redo"&&G!="mceRepaint"&&(!s||!s.skip_undo)){E.undoManager.add()}})}E.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){E.nodeChanged()}});if(a){function v(s,t){if(!t||!t.initial){E.execCommand("mceRepaint")}}E.onUndo.add(v);E.onRedo.add(v);E.onSetContent.add(v)}E.onBeforeRenderUI.dispatch(E,E.controlManager);if(F.render_ui){B=F.width||A.style.width||A.offsetWidth;y=F.height||A.style.height||A.offsetHeight;E.orgDisplay=A.style.display;D=/^[0-9\.]+(|px)$/i;if(D.test(""+B)){B=Math.max(parseInt(B)+(q.deltaWidth||0),100)}if(D.test(""+y)){y=Math.max(parseInt(y)+(q.deltaHeight||0),100)}q=E.theme.renderUI({targetNode:A,width:B,height:y,deltaWidth:F.delta_width,deltaHeight:F.delta_height});E.editorContainer=q.editorContainer}if(document.domain&&location.hostname!=document.domain){m.relaxedDomain=document.domain}n.setStyles(q.sizeContainer||q.editorContainer,{width:B,height:y});y=(q.iframeHeight||y)+(typeof(y)=="number"?(q.deltaHeight||0):"");if(y<100){y=100}E.iframeHTML=F.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(F.document_base_url!=m.documentBaseURL){E.iframeHTML+='<base href="'+E.documentBaseURI.getURI()+'" />'}E.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(m.relaxedDomain){E.iframeHTML+='<script type="text/javascript">document.domain = "'+m.relaxedDomain+'";<\/script>'}x=F.body_id||"tinymce";if(x.indexOf("=")!=-1){x=E.getParam("body_id","","hash");x=x[E.id]||x}z=F.body_class||"";if(z.indexOf("=")!=-1){z=E.getParam("body_class","","hash");z=z[E.id]||""}E.iframeHTML+='</head><body id="'+x+'" class="mceContentBody '+z+'"></body></html>';if(m.relaxedDomain){if(b||(m.isOpera&&parseFloat(opera.version())>=9.5)){C='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+E.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(m.isOpera){C='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}r=n.add(q.iframeContainer,"iframe",{id:E.id+"_ifr",src:C||'javascript:""',frameBorder:"0",style:{width:"100%",height:y}});E.contentAreaContainer=q.iframeContainer;n.get(q.editorContainer).style.display=E.orgDisplay;n.get(E.id).style.display="none";if(!b||!m.relaxedDomain){E.setupIframe()}A=r=q=null},setupIframe:function(){var z=this,A=z.settings,r=n.get(z.id),u=z.getDoc(),q,x;if(!b||!m.relaxedDomain){u.open();u.write(z.iframeHTML);u.close()}if(!b){try{if(!A.readonly){u.designMode="On"}}catch(v){}}if(b){x=z.getBody();n.hide(x);if(!A.readonly){x.contentEditable=true}n.show(x)}z.dom=new m.dom.DOMUtils(z.getDoc(),{keep_values:true,url_converter:z.convertURL,url_converter_scope:z,hex_colors:A.force_hex_style_colors,class_filter:A.class_filter,update_styles:1,fix_ie_paragraphs:1,valid_styles:A.valid_styles});z.schema=new m.dom.Schema();z.serializer=new m.dom.Serializer(f(A,{valid_elements:A.verify_html===false?"*[*]":A.valid_elements,dom:z.dom,schema:z.schema}));z.selection=new m.dom.Selection(z.dom,z.getWin(),z.serializer);z.formatter=new m.Formatter(this);z.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"}}],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"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"}},{selector:"img,table",styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"}}],bold:[{inline:"strong"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b"}],italic:[{inline:"em"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"u"}],forecolor:{inline:"span",styles:{color:"%value"}},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"}},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},blockquote:{block:"blockquote",wrapper:1},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"],expand:false,deep:true}]});i("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(s){z.formatter.register(s,{block:s})});z.formatter.register(z.settings.formats);z.undoManager=new m.UndoManager(z);z.undoManager.onAdd.add(function(t,s){if(!s.initial){return z.onChange.dispatch(z,s,t)}});z.undoManager.onUndo.add(function(t,s){return z.onUndo.dispatch(z,s,t)});z.undoManager.onRedo.add(function(t,s){return z.onRedo.dispatch(z,s,t)});z.forceBlocks=new m.ForceBlocks(z,{forced_root_block:A.forced_root_block});z.editorCommands=new m.EditorCommands(z);z.serializer.onPreProcess.add(function(s,t){return z.onPreProcess.dispatch(z,t,s)});z.serializer.onPostProcess.add(function(s,t){return z.onPostProcess.dispatch(z,t,s)});z.onPreInit.dispatch(z);if(!A.gecko_spellcheck){z.getBody().spellcheck=0}if(!A.readonly){z._addEvents()}z.controlManager.onPostRender.dispatch(z,z.controlManager);z.onPostRender.dispatch(z);if(A.directionality){z.getBody().dir=A.directionality}if(A.nowrap){z.getBody().style.whiteSpace="nowrap"}if(A.custom_elements){function y(s,t){i(g(A.custom_elements),function(B){var C;if(B.indexOf("~")===0){B=B.substring(1);C="span"}else{C="div"}t.content=t.content.replace(new RegExp("<("+B+")([^>]*)>","g"),"<"+C+' _mce_name="$1"$2>');t.content=t.content.replace(new RegExp("</("+B+")>","g"),"</"+C+">")})}z.onBeforeSetContent.add(y);z.onPostProcess.add(function(s,t){if(t.set){y(s,t)}})}if(A.handle_node_change_callback){z.onNodeChange.add(function(t,s,B){z.execCallback("handle_node_change_callback",z.id,B,-1,-1,true,z.selection.isCollapsed())})}if(A.save_callback){z.onSaveContent.add(function(s,B){var t=z.execCallback("save_callback",z.id,B.content,z.getBody());if(t){B.content=t}})}if(A.onchange_callback){z.onChange.add(function(t,s){z.execCallback("onchange_callback",z,s)})}if(A.convert_newlines_to_brs){z.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(A.fix_nesting&&b){z.onBeforeSetContent.add(function(s,t){t.content=z._fixNesting(t.content)})}if(A.preformatted){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(A.verify_css_classes){z.serializer.attribValueFilter=function(D,B){var C,t;if(D=="class"){if(!z.classesRE){t=z.dom.getClasses();if(t.length>0){C="";i(t,function(s){C+=(C?"|":"")+s["class"]});z.classesRE=new RegExp("("+C+")","gi")}}return !z.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(B)||z.classesRE.test(B)?B:""}return B}}if(A.cleanup_callback){z.onBeforeSetContent.add(function(s,t){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)});z.onPreProcess.add(function(s,t){if(t.set){z.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){z.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});z.onPostProcess.add(function(s,t){if(t.set){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=z.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(A.save_callback){z.onGetContent.add(function(s,t){if(t.save){t.content=z.execCallback("save_callback",z.id,t.content,z.getBody())}})}if(A.handle_event_callback){z.onEvent.add(function(s,t,B){if(z.execCallback("handle_event_callback",t,s,B)===false){j.cancel(t)}})}z.onSetContent.add(function(){z.addVisual(z.getBody())});if(A.padd_empty_editor){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function p(s,t){i(s.dom.select("a"),function(C){var B=C.parentNode;if(s.dom.isBlock(B)&&B.lastChild===C){s.dom.add(B,"br",{_mce_bogus:1})}})}z.onExecCommand.add(function(s,t){if(t==="CreateLink"){p(s)}});z.onSetContent.add(z.selection.onSetContent.add(p));if(!A.readonly){try{u.designMode="Off";u.designMode="On"}catch(v){}}}setTimeout(function(){if(z.removed){return}z.load({initial:true,format:(A.cleanup_on_startup?"html":"raw")});z.startContent=z.getContent({format:"raw"});z.initialized=true;z.onInit.dispatch(z);z.execCallback("setupcontent_callback",z.id,z.getBody(),z.getDoc());z.execCallback("init_instance_callback",z);z.focus(true);z.nodeChanged({initial:1});if(A.content_css){m.each(g(A.content_css),function(s){z.dom.loadCSS(z.documentBaseURI.toAbsolute(s))})}if(A.auto_focus){setTimeout(function(){var s=m.get(A.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);r=null},focus:function(q){var s,p=this,r=p.settings.content_editable;if(!q){if(!r&&(!b||p.selection.getNode().ownerDocument!=p.getDoc())){p.getWin().focus()}}if(m.activeEditor!=p){if((s=m.activeEditor)!=null){s.onDeactivate.dispatch(s,p)}p.onActivate.dispatch(p,s)}m._setActive(p)},execCallback:function(u){var p=this,r=p.settings[u],q;if(!r){return}if(p.callbackLookup&&(q=p.callbackLookup[u])){r=q.func;q=q.scope}if(d(r,"string")){q=r.replace(/\.\w+$/,"");q=q?m.resolve(q):0;r=m.resolve(r);p.callbackLookup=p.callbackLookup||{};p.callbackLookup[u]={func:r,scope:q}}return r.apply(q||p,Array.prototype.slice.call(arguments,1))},translate:function(p){var r=this.settings.language||"en",q=m.i18n;if(!p){return""}return q[r+"."+p]||p.replace(/{\#([^}]+)\}/g,function(t,s){return q[r+"."+s]||"{#"+s+"}"})},getLang:function(q,p){return m.i18n[(this.settings.language||"en")+"."+q]||(d(p)?p:"{#"+q+"}")},getParam:function(u,r,p){var s=m.trim,q=d(this.settings[u])?this.settings[u]:r,t;if(p==="hash"){t={};if(d(q,"string")){i(q.indexOf("=")>0?q.split(/[;,](?![^=;,]*(?:[;,]|$))/):q.split(","),function(x){x=x.split("=");if(x.length>1){t[s(x[0])]=s(x[1])}else{t[s(x[0])]=s(x)}})}else{t=q}return t}return q},nodeChanged:function(r){var p=this,q=p.selection,u=q.getNode()||p.getBody();if(p.initialized){r=r||{};u=b&&u.ownerDocument!=p.getDoc()?p.getBody():u;r.parents=[];p.dom.getParent(u,function(s){if(s.nodeName=="BODY"){return true}r.parents.push(s)});p.onNodeChange.dispatch(p,r?r.controlManager||p.controlManager:p.controlManager,u,q.isCollapsed(),r)}},addButton:function(r,q){var p=this;p.buttons=p.buttons||{};p.buttons[r]=q},addCommand:function(r,q,p){this.execCommands[r]={func:q,scope:p||this}},addQueryStateHandler:function(r,q,p){this.queryStateCommands[r]={func:q,scope:p||this}},addQueryValueHandler:function(r,q,p){this.queryValueCommands[r]={func:q,scope:p||this}},addShortcut:function(r,u,p,s){var q=this,v;if(!q.settings.custom_shortcuts){return false}q.shortcuts=q.shortcuts||{};if(d(p,"string")){v=p;p=function(){q.execCommand(v,false,null)}}if(d(p,"object")){v=p;p=function(){q.execCommand(v[0],v[1],v[2])}}i(g(r),function(t){var x={func:p,scope:s||this,desc:u,alt:false,ctrl:false,shift:false};i(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});q.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,v,z,p){var r=this,u=0,y,q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!p||!p.skip_focus)){r.focus()}y={};r.onBeforeExecCommand.dispatch(r,x,v,z,y);if(y.terminate){return false}if(r.execCallback("execcommand_callback",r.id,r.selection.getNode(),x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(y=r.execCommands[x]){q=y.func.call(y.scope,v,z);if(q!==true){r.onExecCommand.dispatch(r,x,v,z,p);return q}}i(r.plugins,function(s){if(s.execCommand&&s.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);u=1;return false}});if(u){return true}if(r.theme&&r.theme.execCommand&&r.theme.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(m.GlobalCommands.execCommand(r,x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(r.editorCommands.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}r.getDoc().execCommand(x,v,z);r.onExecCommand.dispatch(r,x,v,z,p)},queryCommandState:function(u){var q=this,v,r;if(q._isHidden()){return}if(v=q.queryStateCommands[u]){r=v.func.call(v.scope);if(r!==true){return r}}v=q.editorCommands.queryCommandState(u);if(v!==-1){return v}try{return this.getDoc().queryCommandState(u)}catch(p){}},queryCommandValue:function(v){var q=this,u,r;if(q._isHidden()){return}if(u=q.queryValueCommands[v]){r=u.func.call(u.scope);if(r!==true){return r}}u=q.editorCommands.queryCommandValue(v);if(d(u)){return u}try{return this.getDoc().queryCommandValue(v)}catch(p){}},show:function(){var p=this;n.show(p.getContainer());n.hide(p.id);p.load()},hide:function(){var p=this,q=p.getDoc();if(b&&q){q.execCommand("SelectAll")}p.save();n.hide(p.getContainer());n.setStyle(p.id,"display",p.orgDisplay)},isHidden:function(){return !n.isHidden(this.id)},setProgressState:function(p,q,r){this.onSetProgressState.dispatch(this,p,q,r);return p},load:function(s){var p=this,r=p.getElement(),q;if(r){s=s||{};s.load=true;q=p.setContent(d(r.value)?r.value:r.innerHTML,s);s.element=r;if(!s.no_events){p.onLoadContent.dispatch(p,s)}s.element=r=null;return q}},save:function(u){var p=this,s=p.getElement(),q,r;if(!s||!p.initialized){return}u=u||{};u.save=true;if(!u.no_events){p.undoManager.typing=0;p.undoManager.add()}u.element=s;q=u.content=p.getContent(u);if(!u.no_events){p.onSaveContent.dispatch(p,u)}q=u.content;if(!/TEXTAREA|INPUT/i.test(s.nodeName)){s.innerHTML=q;if(r=n.getParent(p.id,"form")){i(r.elements,function(t){if(t.name==p.id){t.value=q;return false}})}}else{s.value=q}u.element=s=null;return q},setContent:function(q,r){var p=this;r=r||{};r.format=r.format||"html";r.set=true;r.content=q;if(!r.no_events){p.onBeforeSetContent.dispatch(p,r)}if(!m.isIE&&(q.length===0||/^\s+$/.test(q))){r.content=p.dom.setHTML(p.getBody(),'<br _mce_bogus="1" />');r.format="raw"}r.content=p.dom.setHTML(p.getBody(),m.trim(r.content));if(r.format!="raw"&&p.settings.cleanup){r.getInner=true;r.content=p.dom.setHTML(p.getBody(),p.serializer.serialize(p.getBody(),r))}if(!r.no_events){p.onSetContent.dispatch(p,r)}return r.content},getContent:function(r){var p=this,q;r=r||{};r.format=r.format||"html";r.get=true;if(!r.no_events){p.onBeforeGetContent.dispatch(p,r)}if(r.format!="raw"&&p.settings.cleanup){r.getInner=true;q=p.serializer.serialize(p.getBody(),r)}else{q=p.getBody().innerHTML}q=q.replace(/^\s*|\s*$/g,"");r.content=q;if(!r.no_events){p.onGetContent.dispatch(p,r)}return r.content},isDirty:function(){var p=this;return m.trim(p.startContent)!=m.trim(p.getContent({format:"raw",no_events:1}))&&!p.isNotDirty},getContainer:function(){var p=this;if(!p.container){p.container=n.get(p.editorContainer||p.id+"_parent")}return p.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return n.get(this.settings.content_element||this.id)},getWin:function(){var p=this,q;if(!p.contentWindow){q=n.get(p.id+"_ifr");if(q){p.contentWindow=q.contentWindow}}return p.contentWindow},getDoc:function(){var q=this,p;if(!q.contentDocument){p=q.getWin();if(p){q.contentDocument=p.document}}return q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(p,x,v){var q=this,r=q.settings;if(r.urlconverter_callback){return q.execCallback("urlconverter_callback",p,v,true,x)}if(!r.convert_urls||(v&&v.nodeName=="LINK")||p.indexOf("file:")===0){return p}if(r.relative_urls){return q.documentBaseURI.toRelative(p)}p=q.documentBaseURI.toAbsolute(p,r.remove_script_host);return p},addVisual:function(r){var p=this,q=p.settings;r=r||p.getBody();if(!d(p.hasVisual)){p.hasVisual=q.visual}i(p.dom.select("table,a",r),function(t){var s;switch(t.nodeName){case"TABLE":s=p.dom.getAttrib(t,"border");if(!s||s=="0"){if(p.hasVisual){p.dom.addClass(t,q.visual_table_class)}else{p.dom.removeClass(t,q.visual_table_class)}}return;case"A":s=p.dom.getAttrib(t,"name");if(s){if(p.hasVisual){p.dom.addClass(t,"mceItemAnchor")}else{p.dom.removeClass(t,"mceItemAnchor")}}return}});p.onVisualAid.dispatch(p,r,p.hasVisual)},remove:function(){var p=this,q=p.getContainer();p.removed=1;p.hide();p.execCallback("remove_instance_callback",p);p.onRemove.dispatch(p);p.onExecCommand.listeners=[];m.remove(p);n.remove(q)},destroy:function(q){var p=this;if(p.destroyed){return}if(!q){m.removeUnload(p.destroy);tinyMCE.onBeforeUnload.remove(p._beforeUnload);if(p.theme&&p.theme.destroy){p.theme.destroy()}p.controlManager.destroy();p.selection.destroy();p.dom.destroy();if(!p.settings.content_editable){j.clear(p.getWin());j.clear(p.getDoc())}j.clear(p.getBody());j.clear(p.formElement)}if(p.formElement){p.formElement.submit=p.formElement._mceOldSubmit;p.formElement._mceOldSubmit=null}p.contentAreaContainer=p.formElement=p.container=p.settings.content_element=p.bodyElement=p.contentDocument=p.contentWindow=null;if(p.selection){p.selection=p.selection.win=p.selection.dom=p.selection.dom.doc=null}p.destroyed=1},_addEvents:function(){var v=this,u,y=v.settings,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function r(t,A){var s=t.type;if(v.removed){return}if(v.onEvent.dispatch(v,t,A)!==false){v[x[t.fakeType||t.type]].dispatch(v,t,A)}}i(x,function(t,s){switch(s){case"contextmenu":if(m.isOpera){v.dom.bind(v.getBody(),"mousedown",function(A){if(A.ctrlKey){A.fakeType="contextmenu";r(A)}})}else{v.dom.bind(v.getBody(),s,r)}break;case"paste":v.dom.bind(v.getBody(),s,function(A){r(A)});break;case"submit":case"reset":v.dom.bind(v.getElement().form||n.getParent(v.id,"form"),s,r);break;default:v.dom.bind(y.content_editable?v.getBody():v.getDoc(),s,r)}});v.dom.bind(y.content_editable?v.getBody():(a?v.getDoc():v.getWin()),"focus",function(s){v.focus(true)});if(m.isGecko){v.dom.bind(v.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("_mce_src"))){t.src=v.documentBaseURI.toAbsolute(s)}})}if(a){function p(){var B=this,D=B.getDoc(),C=B.settings;if(a&&!C.readonly){if(B._isHidden()){try{if(!C.content_editable){D.designMode="On"}}catch(A){}}try{D.execCommand("styleWithCSS",0,false)}catch(A){if(!B._isHidden()){try{D.execCommand("useCSS",0,true)}catch(A){}}}if(!C.table_inline_editing){try{D.execCommand("enableInlineTableEditing",false,false)}catch(A){}}if(!C.object_resizing){try{D.execCommand("enableObjectResizing",false,false)}catch(A){}}}}v.onBeforeExecCommand.add(p);v.onMouseDown.add(p)}if(m.isWebKit){v.onClick.add(function(s,t){t=t.target;if(t.nodeName=="IMG"||(t.nodeName=="A"&&v.dom.hasClass(t,"mceItemAnchor"))){v.selection.getSel().setBaseAndExtent(t,0,t,1)}})}v.onMouseUp.add(v.nodeChanged);v.onClick.add(v.nodeChanged);v.onKeyUp.add(function(s,t){var A=t.keyCode;if((A>=33&&A<=36)||(A>=37&&A<=40)||A==13||A==45||A==46||A==8||(m.isMac&&(A==91||A==93))||t.ctrlKey){v.nodeChanged()}});v.onReset.add(function(){v.setContent(v.startContent,{format:"raw"})});if(y.custom_shortcuts){if(y.custom_undo_redo_keyboard_shortcuts){v.addShortcut("ctrl+z",v.getLang("undo_desc"),"Undo");v.addShortcut("ctrl+y",v.getLang("redo_desc"),"Redo")}if(a){v.addShortcut("ctrl+b",v.getLang("bold_desc"),"Bold");v.addShortcut("ctrl+i",v.getLang("italic_desc"),"Italic");v.addShortcut("ctrl+u",v.getLang("underline_desc"),"Underline")}for(u=1;u<=6;u++){v.addShortcut("ctrl+"+u,"",["FormatBlock",false,"h"+u])}v.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);v.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);v.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function z(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}i(v.shortcuts,function(A){if(m.isMac&&A.ctrl!=t.metaKey){return}else{if(!m.isMac&&A.ctrl!=t.ctrlKey){return}}if(A.alt!=t.altKey){return}if(A.shift!=t.shiftKey){return}if(t.keyCode==A.keyCode||(t.charCode&&t.charCode==A.charCode)){s=A;return false}});return s}v.onKeyUp.add(function(s,t){var A=z(t);if(A){return j.cancel(t)}});v.onKeyPress.add(function(s,t){var A=z(t);if(A){return j.cancel(t)}});v.onKeyDown.add(function(s,t){var A=z(t);if(A){A.func.call(A.scope);return j.cancel(t)}})}if(m.isIE){v.dom.bind(v.getDoc(),"controlselect",function(A){var t=v.resizeInfo,s;A=A.target;if(A.nodeName!=="IMG"){return}if(t){v.dom.unbind(t.node,t.ev,t.cb)}if(!v.dom.hasClass(A,"mceItemNoResize")){ev="resizeend";s=v.dom.bind(A,ev,function(C){var B;C=C.target;if(B=v.dom.getStyle(C,"width")){v.dom.setAttrib(C,"width",B.replace(/[^0-9%]+/g,""));v.dom.setStyle(C,"width","")}if(B=v.dom.getStyle(C,"height")){v.dom.setAttrib(C,"height",B.replace(/[^0-9%]+/g,""));v.dom.setStyle(C,"height","")}})}else{ev="resizestart";s=v.dom.bind(A,"resizestart",j.cancel,j)}t=v.resizeInfo={node:A,ev:ev,cb:s}});v.onKeyDown.add(function(s,t){switch(t.keyCode){case 8:if(v.selection.getRng().item){s.dom.remove(v.selection.getRng().item(0));return j.cancel(t)}}})}if(m.isOpera){v.onClick.add(function(s,t){j.prevent(t)})}if(y.custom_undo_redo){function q(){v.undoManager.typing=0;v.undoManager.add()}v.dom.bind(v.getDoc(),"focusout",function(s){if(!v.removed&&v.undoManager.typing){q()}});v.onKeyUp.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45||t.ctrlKey){q()}});v.onKeyDown.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45){if(v.undoManager.typing){q()}return}if(!v.undoManager.typing){v.undoManager.add();v.undoManager.typing=1}});v.onMouseDown.add(function(){if(v.undoManager.typing){q()}})}},_isHidden:function(){var p;if(!a){return 0}p=this.selection.getSel();return(!p||!p.rangeCount||p.rangeCount==0)},_fixNesting:function(q){var r=[],p;q=q.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(t,s,v){var u;if(s==="/"){if(!r.length){return""}if(v!==r[r.length-1].tag){for(p=r.length-1;p>=0;p--){if(r[p].tag===v){r[p].close=1;break}}return""}else{r.pop();if(r.length&&r[r.length-1].close){t=t+"</"+r[r.length-1].tag+">";r.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(v)){return t}if(/\/>$/.test(t)){return t}r.push({tag:v})}return t});for(p=r.length-1;p>=0;p--){q+="</"+r[p].tag+">"}return q}})})(tinymce);(function(c){var d=c.each,e,a=true,b=false;c.EditorCommands=function(n){var l=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,o;function q(y,x,v){var u;y=y.toLowerCase();if(u=j.exec[y]){u(y,x,v);return a}return b}function m(v){var u;v=v.toLowerCase();if(u=j.state[v]){return u(v)}return -1}function h(v){var u;v=v.toLowerCase();if(u=j.value[v]){return u(v)}return b}function t(u,v){v=v||"exec";d(u,function(y,x){d(x.toLowerCase().split(","),function(z){j[v][z]=y})})}c.extend(this,{execCommand:q,queryCommandState:m,queryCommandValue:h,addCommands:t});function f(x,v,u){if(v===e){v=b}if(u===e){u=null}return n.getDoc().execCommand(x,v,u)}function s(u){return n.formatter.match(u)}function r(u,v){n.formatter.toggle(u,v?{value:v}:e)}function i(u){o=p.getBookmark(u)}function g(){p.moveToBookmark(o)}t({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(y){var x=n.getDoc(),u;try{f(y)}catch(v){u=a}if(u||!x.queryCommandEnabled(y)){if(c.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(z){if(z){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(u){if(p.isCollapsed()){p.select(p.getNode())}f(u);p.collapse(b)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){var v=u.substring(7);d("left,center,right,full".split(","),function(x){if(v!=x){n.formatter.remove("align"+x)}});r("align"+v)},"InsertUnorderedList,InsertOrderedList":function(x){var u,v;f(x);u=l.getParent(p.getNode(),"ol,ul");if(u){v=u.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(v.nodeName)){i();l.split(v,u);g()}}},"Bold,Italic,Underline,Strikethrough":function(u){r(u)},"ForeColor,HiliteColor,FontName":function(x,v,u){r(x,u)},FontSize:function(y,x,v){var u,z;if(v>=1&&v<=7){z=c.explode(k.font_size_style_values);u=c.explode(k.font_size_classes);if(u){v=u[v-1]||v}else{v=z[v-1]||v}}r(y,v)},RemoveFormat:function(u){n.formatter.remove(u)},mceBlockQuote:function(u){r("blockquote")},FormatBlock:function(x,v,u){return r(u)},mceCleanup:function(){i();n.setContent(n.getContent({cleanup:a}),{cleanup:a});g()},mceRemoveNode:function(y,x,v){var u=v||p.getNode();if(u!=ed.getBody()){i();n.dom.remove(u,a);g()}},mceSelectNodeDepth:function(y,x,v){var u=0;l.getParent(p.getNode(),function(z){if(z.nodeType==1&&u++==v){p.select(z);return b}},n.getBody())},mceSelectNode:function(x,v,u){p.select(u)},mceInsertContent:function(x,v,u){p.setContent(u)},mceInsertRawHTML:function(x,v,u){p.setContent("tiny_mce_marker");n.setContent(n.getContent().replace(/tiny_mce_marker/g,u))},mceSetContent:function(x,v,u){n.setContent(u)},"Indent,Outdent":function(y){var v,u,x;v=k.indentation;u=/[a-z%]+$/i.exec(v);v=parseInt(v);if(!m("InsertUnorderedList")&&!m("InsertOrderedList")){d(p.getSelectedBlocks(),function(z){if(y=="outdent"){x=Math.max(0,parseInt(z.style.paddingLeft||0)-v);l.setStyle(z,"paddingLeft",x?x+u:"")}else{l.setStyle(z,"paddingLeft",(parseInt(z.style.paddingLeft||0)+v)+u)}})}else{f(y)}},mceRepaint:function(){var v;if(c.isGecko){try{i(a);if(p.getSel()){p.getSel().selectAllChildren(n.getBody())}p.collapse(a);g()}catch(u){}}},InsertHorizontalRule:function(){p.setContent("<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(x,v,u){p.setContent(u.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(y,x,v){var u=l.getParent(p.getNode(),"a");if(c.is(v,"string")){v={href:v}}if(!u){f("CreateLink",b,"javascript:mctmp(0);");d(l.select("a[href=javascript:mctmp(0);]"),function(z){l.setAttribs(z,v)})}else{if(v.href){l.setAttribs(u,v)}else{ed.dom.remove(u,a)}}}});t({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){return s("align"+u.substring(7))},"Bold,Italic,Underline,Strikethrough":function(u){return s(u)},mceBlockQuote:function(){return s("blockquote")},Outdent:function(){var u;if(k.inline_styles){if((u=l.getParent(p.getStart(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}if((u=l.getParent(p.getEnd(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}}return m("InsertUnorderedList")||m("InsertOrderedList")||(!k.inline_styles&&!!l.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(u){return l.getParent(p.getNode(),u=="insertunorderedlist"?"UL":"OL")}},"state");t({"FontSize,FontName":function(x){var v=0,u;if(u=l.getParent(p.getNode(),"span")){if(x=="fontsize"){v=u.style.fontSize}else{v=u.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return v}},"value");if(k.custom_undo_redo){t({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}})(tinymce);(function(a){a.create("tinymce.UndoManager",{index:0,data:null,typing:0,UndoManager:function(c){var d=this,b=a.util.Dispatcher;d.editor=c;d.data=[];d.onAdd=new b(this);d.onUndo=new b(this);d.onRedo=new b(this)},add:function(d){var g=this,f,e=g.editor,c,h=e.settings,j;d=d||{};d.content=d.content||e.getContent({format:"raw",no_events:1});d.content=d.content.replace(/^\s*|\s*$/g,"");j=g.data[g.index];if(j&&j.content==d.content){if(g.index>0||g.data.length==1){return null}}if(h.custom_undo_redo_levels){if(g.data.length>h.custom_undo_redo_levels){for(f=0;f<g.data.length-1;f++){g.data[f]=g.data[f+1]}g.data.length--;g.index=g.data.length}}if(h.custom_undo_redo_restore_selection){d.bookmark=c=d.bookmark||e.selection.getBookmark(2,true)}if(g.index<g.data.length-1){if(g.index==0){g.data=[]}else{g.data.length=g.index+1}}g.data.push(d);g.index=g.data.length-1;g.onAdd.dispatch(g,d);e.isNotDirty=0;return d},undo:function(){var e=this,c=e.editor,b=b,d;if(e.typing){e.add();e.typing=0}if(e.index>0){b=e.data[--e.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);e.onUndo.dispatch(e,b)}return b},redo:function(){var d=this,c=d.editor,b=null;if(d.index<d.data.length-1){b=d.data[++d.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);d.onRedo.dispatch(d,b)}return b},clear:function(){var b=this;b.data=[];b.index=0;b.typing=0},hasUndo:function(){return this.index>0||this.typing},hasRedo:function(){return this.index<this.data.length-1}})})(tinymce);(function(l){var k=l.dom.Event,c=l.isIE,a=l.isGecko,b=l.isOpera,j=l.each,i=l.extend,d=true,h=false;function g(n,o){var m=o.ownerDocument.createRange();m.setStart(n.endContainer,n.endOffset);m.setEndAfter(o);return m.cloneContents().textContent.length==0}function f(m){m=m.innerHTML;m=m.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi,"-");m=m.replace(/<[^>]+>/g,"");return m.replace(/[ \u00a0\t\r\n]+/g,"")==""}function e(o,q,m){var n,p;if(f(m)){n=q.getParent(m,"ul,ol");if(!q.getParent(n.parentNode,"ul,ol")){q.split(n,m);p=q.create("p",0,'<br _mce_bogus="1" />');q.replace(p,m);o.select(p,1)}return h}return d}l.create("tinymce.ForceBlocks",{ForceBlocks:function(n){var o=this,p=n.settings,q;o.editor=n;o.dom=n.dom;q=(p.forced_root_block||"p").toLowerCase();p.element=q.toUpperCase();n.onPreInit.add(o.setup,o);o.reOpera=new RegExp("(\\u00a0|&#160;|&nbsp;)</"+q+">","gi");o.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,q),"gi");o.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,q),"gi");o.reNbsp2BR2=new RegExp("<%p()([^>]+)>(&nbsp;|&#160;)<\\/%p>|<%p>(&nbsp;|&#160;)<\\/%p>".replace(/%p/g,q),"gi");o.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,q),"gi");function m(r,s){if(b){s.content=s.content.replace(o.reOpera,"</"+q+">")}s.content=s.content.replace(o.rePadd,"<"+q+"$1$2$3$4$5$6>\u00a0</"+q+">");if(!c&&!b&&s.set){s.content=s.content.replace(o.reNbsp2BR1,"<"+q+"$1$2><br /></"+q+">");s.content=s.content.replace(o.reNbsp2BR2,"<"+q+"$1$2><br /></"+q+">")}else{s.content=s.content.replace(o.reBR2Nbsp,"<"+q+"$1$2>\u00a0</"+q+">")}}n.onBeforeSetContent.add(m);n.onPostProcess.add(m);if(p.forced_root_block){n.onInit.add(o.forceRoots,o);n.onSetContent.add(o.forceRoots,o);n.onBeforeGetContent.add(o.forceRoots,o)}},setup:function(){var n=this,m=n.editor,p=m.settings,r=m.dom,o=m.selection;if(p.forced_root_block){m.onBeforeExecCommand.add(n.forceRoots,n);m.onKeyUp.add(n.forceRoots,n);m.onPreProcess.add(n.forceRoots,n)}if(p.force_br_newlines){if(c){m.onKeyPress.add(function(s,t){var u;if(t.keyCode==13&&o.getNode().nodeName!="LI"){o.setContent('<br id="__" /> ',{format:"raw"});u=r.get("__");u.removeAttribute("id");o.select(u);o.collapse();return k.cancel(t)}})}}if(!c&&p.force_p_newlines){m.onKeyPress.add(function(s,t){if(t.keyCode==13&&!t.shiftKey&&!n.insertPara(t)){k.cancel(t)}});if(a){m.onKeyDown.add(function(s,t){if((t.keyCode==8||t.keyCode==46)&&!t.shiftKey){n.backspaceDelete(t,t.keyCode==8)}})}}if(l.isWebKit){function q(t){var s=o.getRng(),u,y=r.create("div",null," "),x,v=r.getViewPort(t.getWin()).h;s.insertNode(u=r.create("br"));s.setStartAfter(u);s.setEndAfter(u);o.setRng(s);if(o.getSel().focusNode==u.previousSibling){o.select(r.insertAfter(r.doc.createTextNode("\u00a0"),u));o.collapse(d)}r.insertAfter(y,u);x=r.getPos(y).y;r.remove(y);if(x>v){t.getWin().scrollTo(0,x)}}m.onKeyPress.add(function(s,t){if(t.keyCode==13&&(t.shiftKey||p.force_br_newlines)){q(s);k.cancel(t)}})}m.onPreProcess.add(function(s,t){j(r.select("p,h1,h2,h3,h4,h5,h6,div",t.node),function(u){if(f(u)){j(r.select("span,em,strong,b,i",t.node),function(v){if(!v.hasChildNodes()){v.appendChild(s.getDoc().createTextNode("\u00a0"));return h}})}})});if(c){if(p.element!="P"){m.onKeyPress.add(function(s,t){n.lastElm=o.getNode().nodeName});m.onKeyUp.add(function(t,u){var x,v=o.getNode(),s=t.getBody();if(s.childNodes.length===1&&v.nodeName=="P"){v=r.rename(v,p.element);o.select(v);o.collapse();t.nodeChanged()}else{if(u.keyCode==13&&!u.shiftKey&&n.lastElm!="P"){x=r.getParent(v,"p");if(x){r.rename(x,p.element);t.nodeChanged()}}}})}}},find:function(u,p,q){var o=this.editor,m=o.getDoc().createTreeWalker(u,4,null,h),r=-1;while(u=m.nextNode()){r++;if(p==0&&u==q){return r}if(p==1&&r==q){return u}}return -1},forceRoots:function(v,H){var y=this,v=y.editor,L=v.getBody(),I=v.getDoc(),O=v.selection,z=O.getSel(),A=O.getRng(),M=-2,u,F,m,o,J=-16777215;var K,p,N,E,B,q=L.childNodes,D,C,x;for(D=q.length-1;D>=0;D--){K=q[D];if(K.nodeType===1&&K.getAttribute("_mce_type")){p=null;continue}if(K.nodeType===3||(!y.dom.isBlock(K)&&K.nodeType!==8&&!/^(script|mce:script|style|mce:style)$/i.test(K.nodeName))){if(!p){if(K.nodeType!=3||/[^\s]/g.test(K.nodeValue)){if(M==-2&&A){if(!c){if(A.startContainer.nodeType==1&&(C=A.startContainer.childNodes[A.startOffset])&&C.nodeType==1){x=C.getAttribute("id");C.setAttribute("id","__mce")}else{if(v.dom.getParent(A.startContainer,function(n){return n===L})){F=A.startOffset;m=A.endOffset;M=y.find(L,0,A.startContainer);u=y.find(L,0,A.endContainer)}}}else{o=I.body.createTextRange();o.moveToElementText(L);o.collapse(1);N=o.move("character",J)*-1;o=A.duplicate();o.collapse(1);E=o.move("character",J)*-1;o=A.duplicate();o.collapse(0);B=(o.move("character",J)*-1)-E;M=E-N;u=B}}p=v.dom.create(v.settings.forced_root_block);K.parentNode.replaceChild(p,K);p.appendChild(K)}}else{if(p.hasChildNodes()){p.insertBefore(K,p.firstChild)}else{p.appendChild(K)}}}else{p=null}}if(M!=-2){if(!c){p=L.getElementsByTagName(v.settings.element)[0];A=I.createRange();if(M!=-1){A.setStart(y.find(L,1,M),F)}else{A.setStart(p,0)}if(u!=-1){A.setEnd(y.find(L,1,u),m)}else{A.setEnd(p,0)}if(z){z.removeAllRanges();z.addRange(A)}}else{try{A=z.createRange();A.moveToElementText(L);A.collapse(1);A.moveStart("character",M);A.moveEnd("character",u);A.select()}catch(G){}}}else{if(!c&&(C=v.dom.get("__mce"))){if(x){C.setAttribute("id",x)}else{C.removeAttribute("id")}A=I.createRange();A.setStartBefore(C);A.setEndBefore(C);O.setRng(A)}}},getParentBlock:function(o){var m=this.dom;return m.getParent(o,m.isBlock)},insertPara:function(R){var F=this,v=F.editor,N=v.dom,S=v.getDoc(),W=v.settings,G=v.selection.getSel(),H=G.getRangeAt(0),V=S.body;var K,L,I,P,O,q,o,u,z,m,D,U,p,x,J,M=N.getViewPort(v.getWin()),C,E,B;K=S.createRange();K.setStart(G.anchorNode,G.anchorOffset);K.collapse(d);L=S.createRange();L.setStart(G.focusNode,G.focusOffset);L.collapse(d);I=K.compareBoundaryPoints(K.START_TO_END,L)<0;P=I?G.anchorNode:G.focusNode;O=I?G.anchorOffset:G.focusOffset;q=I?G.focusNode:G.anchorNode;o=I?G.focusOffset:G.anchorOffset;if(P===q&&/^(TD|TH)$/.test(P.nodeName)){if(P.firstChild.nodeName=="BR"){N.remove(P.firstChild)}if(P.childNodes.length==0){v.dom.add(P,W.element,null,"<br />");U=v.dom.add(P,W.element,null,"<br />")}else{J=P.innerHTML;P.innerHTML="";v.dom.add(P,W.element,null,J);U=v.dom.add(P,W.element,null,"<br />")}H=S.createRange();H.selectNodeContents(U);H.collapse(1);v.selection.setRng(H);return h}if(P==V&&q==V&&V.firstChild&&v.dom.isBlock(V.firstChild)){P=q=P.firstChild;O=o=0;K=S.createRange();K.setStart(P,0);L=S.createRange();L.setStart(q,0)}P=P.nodeName=="HTML"?S.body:P;P=P.nodeName=="BODY"?P.firstChild:P;q=q.nodeName=="HTML"?S.body:q;q=q.nodeName=="BODY"?q.firstChild:q;u=F.getParentBlock(P);z=F.getParentBlock(q);m=u?u.nodeName:W.element;if(J=F.dom.getParent(u,"li,pre")){if(J.nodeName=="LI"){return e(v.selection,F.dom,J)}return d}if(u&&(u.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(N.getStyle(u,"position",1)))){m=W.element;u=null}if(z&&(z.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(N.getStyle(u,"position",1)))){m=W.element;z=null}if(/(TD|TABLE|TH|CAPTION)/.test(m)||(u&&m=="DIV"&&/left|right/gi.test(N.getStyle(u,"float",1)))){m=W.element;u=z=null}D=(u&&u.nodeName==m)?u.cloneNode(0):v.dom.create(m);U=(z&&z.nodeName==m)?z.cloneNode(0):v.dom.create(m);U.removeAttribute("id");if(/^(H[1-6])$/.test(m)&&g(H,u)){U=v.dom.create(W.element)}J=p=P;do{if(J==V||J.nodeType==9||F.dom.isBlock(J)||/(TD|TABLE|TH|CAPTION)/.test(J.nodeName)){break}p=J}while((J=J.previousSibling?J.previousSibling:J.parentNode));J=x=q;do{if(J==V||J.nodeType==9||F.dom.isBlock(J)||/(TD|TABLE|TH|CAPTION)/.test(J.nodeName)){break}x=J}while((J=J.nextSibling?J.nextSibling:J.parentNode));if(p.nodeName==m){K.setStart(p,0)}else{K.setStartBefore(p)}K.setEnd(P,O);D.appendChild(K.cloneContents()||S.createTextNode(""));try{L.setEndAfter(x)}catch(Q){}L.setStart(q,o);U.appendChild(L.cloneContents()||S.createTextNode(""));H=S.createRange();if(!p.previousSibling&&p.parentNode.nodeName==m){H.setStartBefore(p.parentNode)}else{if(K.startContainer.nodeName==m&&K.startOffset==0){H.setStartBefore(K.startContainer)}else{H.setStart(K.startContainer,K.startOffset)}}if(!x.nextSibling&&x.parentNode.nodeName==m){H.setEndAfter(x.parentNode)}else{H.setEnd(L.endContainer,L.endOffset)}H.deleteContents();if(b){v.getWin().scrollTo(0,M.y)}if(D.firstChild&&D.firstChild.nodeName==m){D.innerHTML=D.firstChild.innerHTML}if(U.firstChild&&U.firstChild.nodeName==m){U.innerHTML=U.firstChild.innerHTML}if(f(D)){D.innerHTML="<br />"}function T(y,s){var r=[],Y,X,t;y.innerHTML="";if(W.keep_styles){X=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(X.nodeName)){Y=X.cloneNode(h);N.setAttrib(Y,"id","");r.push(Y)}}while(X=X.parentNode)}if(r.length>0){for(t=r.length-1,Y=y;t>=0;t--){Y=Y.appendChild(r[t])}r[0].innerHTML=b?"&nbsp;":"<br />";return r[0]}else{y.innerHTML=b?"&nbsp;":"<br />"}}if(f(U)){B=T(U,q)}if(b&&parseFloat(opera.version())<9.5){H.insertNode(D);H.insertNode(U)}else{H.insertNode(U);H.insertNode(D)}U.normalize();D.normalize();function A(r){return S.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,h).nextNode()||r}H=S.createRange();H.selectNodeContents(a?A(B||U):B||U);H.collapse(1);G.removeAllRanges();G.addRange(H);C=v.dom.getPos(U).y;E=U.clientHeight;if(C<M.y||C+E>M.y+M.h){v.getWin().scrollTo(0,C<M.y?C:C-M.h+25)}return h},backspaceDelete:function(s,A){var C=this,q=C.editor,x=q.getBody(),p=q.dom,o,u=q.selection,m=u.getRng(),v=m.startContainer,o,y,z;if(v&&q.dom.isBlock(v)&&!/^(TD|TH)$/.test(v.nodeName)&&A){if(v.childNodes.length==0||(v.childNodes.length==1&&v.firstChild.nodeName=="BR")){o=v;while((o=o.previousSibling)&&!q.dom.isBlock(o)){}if(o){if(v!=x.firstChild){y=q.dom.doc.createTreeWalker(o,NodeFilter.SHOW_TEXT,null,h);while(z=y.nextNode()){o=z}m=q.getDoc().createRange();m.setStart(o,o.nodeValue?o.nodeValue.length:0);m.setEnd(o,o.nodeValue?o.nodeValue.length:0);u.setRng(m);q.dom.remove(v)}return k.cancel(s)}}}function B(n){var r;n=n.target;if(n&&n.parentNode&&n.nodeName=="BR"&&(o=C.getParentBlock(n))){r=n.previousSibling;k.remove(x,"DOMNodeInserted",B);if(r&&r.nodeType==3&&/\s+$/.test(r.nodeValue)){return}if(n.previousSibling||n.nextSibling){q.dom.remove(n)}}}k._add(x,"DOMNodeInserted",B);window.setTimeout(function(){k._remove(x,"DOMNodeInserted",B)},1)}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;if(g.settings.use_native_selects){k=new c.ui.NativeListBox(m,i)}else{f=l||h._cls.listbox||c.ui.ListBox;k=new f(m,i)}h.controls[m]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark(1)});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(k.hideMenu){g.onMouseDown.add(k.hideMenu,k)}return h.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){function b(){var d={},c={},e={};function f(j,i,h,g){if(typeof(i)=="string"){i=[i]}a.each(i,function(k){j[k.toLowerCase()]={func:h,scope:g}})}a.extend(this,{add:function(i,h,g){f(d,i,h,g)},addQueryStateHandler:function(i,h,g){f(c,i,h,g)},addQueryValueHandler:function(i,h,g){f(e,i,h,g)},execCommand:function(h,k,j,i,g){if(k=d[k.toLowerCase()]){if(k.func.call(h||k.scope,j,i,g)!==false){return true}}},queryCommandValue:function(){if(cmd=e[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}},queryCommandState:function(){if(cmd=c[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}}})}a.GlobalCommands=new b()})(tinymce);(function(a){a.Formatter=function(R){var I={},K=a.each,b=R.dom,o=R.selection,r=a.dom.TreeWalker,G=new a.dom.RangeUtils(b),c=R.schema.isValid,B=b.isBlock,j=R.settings.forced_root_block,q=b.nodeIndex,A="\uFEFF",d=/^(src|href|style)$/,O=false,x=true,n,S,L;function k(U,T){return b.getParents(U,T,b.getRoot())}function D(){if(!L||L.apply.length||L.remove.length){L={apply:[],remove:[]}}}R.onMouseUp.add(D);D();function N(T){return T?I[T]:I}function i(T,U){if(T){if(typeof(T)!=="string"){K(T,function(W,V){i(V,W)})}else{U=U.length?U:[U];K(U,function(V){if(V.deep===n){V.deep=!V.selector}if(V.split===n){V.split=!V.selector}if(V.remove===n&&V.selector){V.remove="none"}if(typeof(V.classes)==="string"){V.classes=V.classes.split(/\s+/)}});I[T]=U}}}function P(V,ab,X){var Y=N(V),ac=Y[0],aa,U,Z;function W(af){var ae=af.startContainer,ai=af.startOffset,ah,ag;if(ae.nodeType==1||ae.nodeValue===""){ah=new r(ae.childNodes[ai]);for(ag=ah.current();ag;ag=ah.next()){if(ag.nodeType==3&&!B(ag.parentNode)&&!e(ag)){af.setStart(ag,0);break}}}return af}function T(af,ae){ae=ae||ac;if(af){K(ae.styles,function(ah,ag){b.setStyle(af,ag,p(ah,ab))});K(ae.attributes,function(ah,ag){b.setAttrib(af,ag,p(ah,ab))});K(ae.classes,function(ag){ag=p(ag,ab);if(!b.hasClass(af,ag)){b.addClass(af,ag)}})}}function ad(af){var ae=[],ah,ag;ah=ac.inline||ac.block;ag=b.create(ah);T(ag);G.walk(af,function(ai){var aj;function ak(al){var an=al.nodeName.toLowerCase(),am=al.parentNode.nodeName.toLowerCase();if(f(an,"br")){aj=0;if(ac.block){b.remove(al)}return}if(ac.wrapper&&t(al,V,ab)){aj=0;return}if(ac.block&&!ac.wrapper&&C(an)){al=b.rename(al,ah);T(al);ae.push(al);aj=0;return}if(ac.selector){K(Y,function(ao){if(b.is(al,ao.selector)){T(al,ao)}});return}if(c(ah,an)&&c(am,ah)){if(!aj){aj=ag.cloneNode(O);al.parentNode.insertBefore(aj,al);ae.push(aj)}aj.appendChild(al)}else{aj=0;K(a.grep(al.childNodes),ak);aj=0}}K(ai,ak)});K(ae,function(ak){var ai;function al(an){var am=0;K(an.childNodes,function(ao){if(!e(ao)&&!E(ao)){am++}});return am}function aj(am){var ao,an;K(am.childNodes,function(ap){if(ap.nodeType==1&&!E(ap)){ao=ap;return O}});if(ao&&g(ao,ac)){an=ao.cloneNode(O);T(an);b.replace(an,am,x);b.remove(ao,1)}return an||am}ai=al(ak);if(ai===0){b.remove(ak,1);return}if(ac.inline||ac.wrapper){if(!ac.exact&&ai===1){ak=aj(ak)}K(Y,function(am){K(b.select(am.inline,ak),function(an){Q(am,ab,an,am.exact?an:null)})});b.getParent(ak.parentNode,function(am){if(t(am,V,ab)){b.remove(ak,1);ak=0;return x}});if(ak){ak=s(y(ak),ak);ak=s(ak,y(ak,x))}}})}if(ac){if(X){U=b.createRng();U.setStartBefore(X);U.setEndAfter(X);ad(U)}else{if(!o.isCollapsed()||!ac.inline){aa=o.getBookmark();ad(m(o.getRng(x),Y));o.moveToBookmark(aa);o.setRng(W(o.getRng(x)));R.nodeChanged()}else{M("apply",V,ab)}}}}function v(V,ad,X){var Y=N(V),af=Y[0],ac,ab,U;function W(ak){var aj,ai,ah;aj=a.grep(ak.childNodes);for(ai=0,ah=Y.length;ai<ah;ai++){if(Q(Y[ai],ad,ak,ak)){break}}if(af.deep){for(ai=0,ah=aj.length;ai<ah;ai++){W(aj[ai])}}}function Z(ah){var ai;K(k(ah.parentNode).reverse(),function(aj){if(!ai&&aj.id!="_start"&&aj.id!="_end"){if(!B(aj)&&t(aj,V,ad)){ai=aj}}});return ai}function T(ak,ah,am,ap){var aq,ao,an,aj,al,ai;if(ak){ai=ak.parentNode;for(aq=ah.parentNode;aq&&aq!=ai;aq=aq.parentNode){ao=aq.cloneNode(O);for(al=0;al<Y.length;al++){if(Q(Y[al],ad,ao,ao)){ao=0;break}}if(ao){if(an){ao.appendChild(an)}if(!aj){aj=ao}an=ao}}if(ap){ah=b.split(ak,ah)}if(an){am.parentNode.insertBefore(an,am);aj.appendChild(am)}}return ah}function ae(ah){return T(Z(ah),ah,ah,true)}function aa(aj){var ai=b.get(aj?"_start":"_end"),ah=ai[aj?"firstChild":"lastChild"];b.remove(ai,1);return ah}function ag(ah){var ai,aj;ah=m(ah,Y,x);if(af.split){ai=F(ah,x);aj=F(ah);if(ai!=aj){ai=J(ai,"span",{id:"_start",_mce_type:"bookmark"});aj=J(aj,"span",{id:"_end",_mce_type:"bookmark"});ae(ai);ae(aj);ai=aa(x);aj=aa()}else{ai=aj=ae(ai)}ah.startContainer=ai.parentNode;ah.startOffset=q(ai);ah.endContainer=aj.parentNode;ah.endOffset=q(aj)+1}G.walk(ah,function(ak){K(ak,function(al){W(al)})})}if(X){U=b.createRng();U.setStartBefore(X);U.setEndAfter(X);ag(U);return}if(!o.isCollapsed()||!af.inline){ac=o.getBookmark();ag(o.getRng(x));o.moveToBookmark(ac);R.nodeChanged()}else{M("remove",V,ad)}}function z(T,V,U){if(h(T,V,U)){v(T,V,U)}else{P(T,V,U)}}function t(W,T,Y){var Z=N(T),X,V,U;function aa(ae,ag,ah){var ad,af,ab=ag[ah],ac;if(ab){if(ab.length===n){for(ad in ab){if(ab.hasOwnProperty(ad)){if(ah==="attributes"){af=b.getAttrib(ae,ad)}else{af=H(ae,ad)}if(!f(af,p(ab[ad],Y))){return}}}}else{for(ac=0;ac<ab.length;ac++){if(ah==="attributes"?b.getAttrib(ae,ab[ac]):H(ae,ab[ac])){return x}}}}return x}if(Z&&W){for(V=0;V<Z.length;V++){X=Z[V];if(g(W,X)&&aa(W,X,"attributes")&&aa(W,X,"styles")){if(U=X.classes){for(V=0;V<U.length;V++){if(!b.hasClass(W,U[V])){return}}}return x}}}}function h(V,Y,X){var U,W;function T(Z){Z=b.getParent(Z,function(aa){return !!t(aa,V,Y)});return t(Z,V,Y)}if(X){return T(X)}if(o.isCollapsed()){for(W=L.apply.length-1;W>=0;W--){if(L.apply[W].name==V){return true}}for(W=L.remove.length-1;W>=0;W--){if(L.remove[W].name==V){return false}}return T(o.getNode())}X=o.getNode();if(T(X)){return x}U=o.getStart();if(U!=X){if(T(U)){return x}}return O}function u(X){var Z=N(X),W,V,Y,U,T;if(Z){W=o.getStart();V=k(W);for(U=Z.length-1;U>=0;U--){T=Z[U].selector;if(!T){return x}for(Y=V.length-1;Y>=0;Y--){if(b.is(V[Y],T)){return x}}}}return O}a.extend(this,{get:N,register:i,apply:P,remove:v,toggle:z,match:h,matchNode:t,canApply:u});function g(T,U){if(f(T,U.inline)){return x}if(f(T,U.block)){return x}if(U.selector){return b.is(T,U.selector)}}function f(U,T){U=U||"";T=T||"";U=U.nodeName||U;T=T.nodeName||T;return U.toLowerCase()==T.toLowerCase()}function H(U,T){var V=b.getStyle(U,T);if(T=="color"||T=="backgroundColor"){V=b.toHex(V)}if(T=="fontWeight"&&V==700){V="bold"}return""+V}function p(T,U){if(typeof(T)!="string"){T=T(U)}else{if(U){T=T.replace(/%(\w+)/g,function(W,V){return U[V]||W})}}return T}function e(T){return T&&T.nodeType===3&&/^\s*$/.test(T.nodeValue)}function J(V,U,T){var W=b.create(U,T);V.parentNode.insertBefore(W,V);W.appendChild(V);return W}function m(T,ab,W){var V=T.startContainer,Y=T.startOffset,ae=T.endContainer,Z=T.endOffset,ad,aa;function ac(ah,ai,af,ag){var aj,ak;ag=ag||b.getRoot();for(;;){aj=ah.parentNode;if(aj==ag||(!ab[0].block_expand&&B(aj))){return ah}for(ad=aj[ai];ad&&ad!=ah;ad=ad[af]){if(ad.nodeType==1&&!E(ad)){return ah}if(ad.nodeType==3&&!e(ad)){return ah}}ah=ah.parentNode}return ah}if(V.nodeType==1&&V.hasChildNodes()){aa=V.childNodes.length-1;V=V.childNodes[Y>aa?aa:Y];if(V.nodeType==3){Y=0}}if(ae.nodeType==1&&ae.hasChildNodes()){aa=ae.childNodes.length-1;ae=ae.childNodes[Z>aa?aa:Z-1];if(ae.nodeType==3){Z=ae.nodeValue.length}}if(E(V.parentNode)){V=V.parentNode}if(E(V)){V=V.nextSibling||V}if(E(ae.parentNode)){ae=ae.parentNode}if(E(ae)){ae=ae.previousSibling||ae}if(ab[0].inline||ab[0].block_expand){V=ac(V,"firstChild","nextSibling");ae=ac(ae,"lastChild","previousSibling")}if(ab[0].selector&&ab[0].expand!==O){function X(ag,af){var ah,ai,aj;if(ag.nodeType==3&&ag.nodeValue.length==0&&ag[af]){ag=ag[af]}ah=k(ag);for(ai=0;ai<ah.length;ai++){for(aj=0;aj<ab.length;aj++){if(b.is(ah[ai],ab[aj].selector)){return ah[ai]}}}return ag}V=X(V,"previousSibling");ae=X(ae,"nextSibling")}if(ab[0].block||ab[0].selector){function U(ag,af,ai){var ah;if(!ab[0].wrapper){ah=b.getParent(ag,ab[0].block)}if(!ah){ah=b.getParent(ag.nodeType==3?ag.parentNode:ag,B)}if(ah&&ab[0].wrapper){ah=k(ah,"ul,ol").reverse()[0]||ah}if(!ah){ah=ag;while(ah[af]&&!B(ah[af])){ah=ah[af];if(f(ah,"br")){break}}}return ah||ag}V=U(V,"previousSibling");ae=U(ae,"nextSibling");if(ab[0].block){if(!B(V)){V=ac(V,"firstChild","nextSibling")}if(!B(ae)){ae=ac(ae,"lastChild","previousSibling")}}}if(V.nodeType==1){Y=q(V);V=V.parentNode}if(ae.nodeType==1){Z=q(ae)+1;ae=ae.parentNode}return{startContainer:V,startOffset:Y,endContainer:ae,endOffset:Z}}function Q(Z,Y,W,T){var V,U,X;if(!g(W,Z)){return O}if(Z.remove!="all"){K(Z.styles,function(ab,aa){ab=p(ab,Y);if(typeof(aa)==="number"){aa=ab;T=0}if(!T||f(H(T,aa),ab)){b.setStyle(W,aa,"")}X=1});if(X&&b.getAttrib(W,"style")==""){W.removeAttribute("style");W.removeAttribute("_mce_style")}K(Z.attributes,function(ac,aa){var ab;ac=p(ac,Y);if(typeof(aa)==="number"){aa=ac;T=0}if(!T||f(b.getAttrib(T,aa),ac)){if(aa=="class"){ac=b.getAttrib(W,aa);if(ac){ab="";K(ac.split(/\s+/),function(ad){if(/mce\w+/.test(ad)){ab+=(ab?" ":"")+ad}});if(ab){b.setAttrib(W,aa,ab);return}}}if(aa=="class"){W.removeAttribute("className")}if(d.test(aa)){W.removeAttribute("_mce_"+aa)}W.removeAttribute(aa)}});K(Z.classes,function(aa){aa=p(aa,Y);if(!T||b.hasClass(T,aa)){b.removeClass(W,aa)}});U=b.getAttribs(W);for(V=0;V<U.length;V++){if(U[V].nodeName.indexOf("_")!==0){return O}}}if(Z.remove!="none"){l(W,Z);return x}}function l(V,W){var T=V.parentNode,U;if(W.block){if(!j){function X(Z,Y,aa){Z=y(Z,Y,aa);return !Z||(Z.nodeName=="BR"||B(Z))}if(B(V)&&!B(T)){if(!X(V,O)&&!X(V.firstChild,x,1)){V.insertBefore(b.create("br"),V.firstChild)}if(!X(V,x)&&!X(V.lastChild,O,1)){V.appendChild(b.create("br"))}}}else{if(T==b.getRoot()){if(!W.list_block||!f(V,W.list_block)){K(a.grep(V.childNodes),function(Y){if(c(j,Y.nodeName.toLowerCase())){if(!U){U=J(Y,j)}else{U.appendChild(Y)}}else{U=0}})}}}}b.remove(V,1)}function y(U,T,V){if(U){T=T?"nextSibling":"previousSibling";for(U=V?U:U[T];U;U=U[T]){if(U.nodeType==1||!e(U)){return U}}}}function E(T){return T&&T.nodeType==1&&T.getAttribute("_mce_type")=="bookmark"}function s(X,W){var T,V,U;function Z(ac,ab){if(ac.nodeName!=ab.nodeName){return O}function aa(ae){var af={};K(b.getAttribs(ae),function(ag){var ah=ag.nodeName.toLowerCase();if(ah.indexOf("_")!==0&&ah!=="style"){af[ah]=b.getAttrib(ae,ah)}});return af}function ad(ah,ag){var af,ae;for(ae in ah){if(ah.hasOwnProperty(ae)){af=ag[ae];if(af===n){return O}if(ah[ae]!=af){return O}delete ag[ae]}}for(ae in ag){if(ag.hasOwnProperty(ae)){return O}}return x}if(!ad(aa(ac),aa(ab))){return O}if(!ad(b.parseStyle(b.getAttrib(ac,"style")),b.parseStyle(b.getAttrib(ab,"style")))){return O}return x}if(X&&W){function Y(ab,aa){for(V=ab;V;V=V[aa]){if(V.nodeType==3&&!e(V)){return ab}if(V.nodeType==1&&!E(V)){return V}}return ab}X=Y(X,"previousSibling");W=Y(W,"nextSibling");if(Z(X,W)){for(V=X.nextSibling;V&&V!=W;){U=V;V=V.nextSibling;X.appendChild(U)}b.remove(W);K(a.grep(W.childNodes),function(aa){X.appendChild(aa)});return X}}return W}function C(T){return/^(h[1-6]|p|div|pre|address)$/.test(T)}function F(U,X){var T,W,V;T=U[X?"startContainer":"endContainer"];W=U[X?"startOffset":"endOffset"];if(T.nodeType==1){V=T.childNodes.length-1;if(!X&&W){W--}T=T.childNodes[W>V?V:W]}return T}function M(ab,W,aa){var X,U,Z=o.getNode().parentNode,ad=R.getDoc(),Y="mceinline",ag=["onKeyDown","onKeyUp","onKeyPress"],V=L[ab],ac=L[ab=="apply"?"remove":"apply"];for(X=V.length-1;X>=0;X--){if(V[X].name==W){return}}V.push({name:W,vars:aa});for(X=ac.length-1;X>=0;X--){if(ac[X].name==W){ac.splice(X,1)}}function af(){if(S){K(ag,function(ah){R[ah].remove(S)});S=0}}function ae(ah){K(L.apply.reverse(),function(ai){P(ai.name,ai.vars,ah)});K(L.remove.reverse(),function(ai){v(ai.name,ai.vars,ah)});b.remove(ah,1);D()}function T(ah){return ah.face==Y||ah.style.fontFamily==Y}af();ad.execCommand("FontName",false,Y);K(b.select("font,span",Z),function(ai){var ah;if(T(ai)){ah=o.getBookmark();ae(ai);o.moveToBookmark(ah);R.nodeChanged();Z=0}});if(Z){S=function(ah,ai){K(b.select("font,span",Z),function(ak){var aj,al;if(ak.face==Y||ak.style.fontFamily==Y){al=ak.firstChild;ae(ak);U=b.createRng();U.setStart(al,al.nodeValue.length);U.setEnd(al,al.nodeValue.length);o.setRng(U);ah.nodeChanged();af()}});if(ai.type=="keyup"){af();D()}};K(ag,function(ah){R[ah].addToTop(S)})}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;if(c.inline_styles){h=e.explode(c.font_size_style_values);function b(j,i){g.replace(g.create("span",{style:i}),j,1)}d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}a.onPreProcess.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/tiny_mce_popup.js b/docs/include/jscripts/tiny_mce/tiny_mce_popup.js
new file mode 100644 (file)
index 0000000..3ef3acb
--- /dev/null
@@ -0,0 +1,5 @@
+
+// Uncomment and change this document.domain value if you are loading the script cross subdomains
+// document.domain = 'moxiecode.com';
+
+var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},0)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait();
\ No newline at end of file
diff --git a/docs/include/jscripts/tiny_mce/tiny_mce_src.js b/docs/include/jscripts/tiny_mce/tiny_mce_src.js
new file mode 100644 (file)
index 0000000..912ef16
--- /dev/null
@@ -0,0 +1,13821 @@
+(function(win) {\r
+       var whiteSpaceRe = /^\s*|\s*$/g,\r
+               undefined;\r
+\r
+       var tinymce = {\r
+               majorVersion : '3',\r
+\r
+               minorVersion : '3',\r
+\r
+               releaseDate : '2010-03-10',\r
+\r
+               _init : function() {\r
+                       var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;\r
+\r
+                       t.isOpera = win.opera && opera.buildNumber;\r
+\r
+                       t.isWebKit = /WebKit/.test(ua);\r
+\r
+                       t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName);\r
+\r
+                       t.isIE6 = t.isIE && /MSIE [56]/.test(ua);\r
+\r
+                       t.isGecko = !t.isWebKit && /Gecko/.test(ua);\r
+\r
+                       t.isMac = ua.indexOf('Mac') != -1;\r
+\r
+                       t.isAir = /adobeair/i.test(ua);\r
+\r
+                       // TinyMCE .NET webcontrol might be setting the values for TinyMCE\r
+                       if (win.tinyMCEPreInit) {\r
+                               t.suffix = tinyMCEPreInit.suffix;\r
+                               t.baseURL = tinyMCEPreInit.base;\r
+                               t.query = tinyMCEPreInit.query;\r
+                               return;\r
+                       }\r
+\r
+                       // Get suffix and base\r
+                       t.suffix = '';\r
+\r
+                       // If base element found, add that infront of baseURL\r
+                       nl = d.getElementsByTagName('base');\r
+                       for (i=0; i<nl.length; i++) {\r
+                               if (v = nl[i].href) {\r
+                                       // Host only value like http://site.com or http://site.com:8008\r
+                                       if (/^https?:\/\/[^\/]+$/.test(v))\r
+                                               v += '/';\r
+\r
+                                       base = v ? v.match(/.*\//)[0] : ''; // Get only directory\r
+                               }\r
+                       }\r
+\r
+                       function getBase(n) {\r
+                               if (n.src && /tiny_mce(|_gzip|_jquery|_prototype)(_dev|_src)?.js/.test(n.src)) {\r
+                                       if (/_(src|dev)\.js/g.test(n.src))\r
+                                               t.suffix = '_src';\r
+\r
+                                       if ((p = n.src.indexOf('?')) != -1)\r
+                                               t.query = n.src.substring(p + 1);\r
+\r
+                                       t.baseURL = n.src.substring(0, n.src.lastIndexOf('/'));\r
+\r
+                                       // If path to script is relative and a base href was found add that one infront\r
+                                       // the src property will always be an absolute one on non IE browsers and IE 8\r
+                                       // so this logic will basically only be executed on older IE versions\r
+                                       if (base && t.baseURL.indexOf('://') == -1 && t.baseURL.indexOf('/') !== 0)\r
+                                               t.baseURL = base + t.baseURL;\r
+\r
+                                       return t.baseURL;\r
+                               }\r
+\r
+                               return null;\r
+                       };\r
+\r
+                       // Check document\r
+                       nl = d.getElementsByTagName('script');\r
+                       for (i=0; i<nl.length; i++) {\r
+                               if (getBase(nl[i]))\r
+                                       return;\r
+                       }\r
+\r
+                       // Check head\r
+                       n = d.getElementsByTagName('head')[0];\r
+                       if (n) {\r
+                               nl = n.getElementsByTagName('script');\r
+                               for (i=0; i<nl.length; i++) {\r
+                                       if (getBase(nl[i]))\r
+                                               return;\r
+                               }\r
+                       }\r
+\r
+                       return;\r
+               },\r
+\r
+               is : function(o, t) {\r
+                       if (!t)\r
+                               return o !== undefined;\r
+\r
+                       if (t == 'array' && (o.hasOwnProperty && o instanceof Array))\r
+                               return true;\r
+\r
+                       return typeof(o) == t;\r
+               },\r
+\r
+               each : function(o, cb, s) {\r
+                       var n, l;\r
+\r
+                       if (!o)\r
+                               return 0;\r
+\r
+                       s = s || o;\r
+\r
+                       if (o.length !== undefined) {\r
+                               // Indexed arrays, needed for Safari\r
+                               for (n=0, l = o.length; n < l; n++) {\r
+                                       if (cb.call(s, o[n], n, o) === false)\r
+                                               return 0;\r
+                               }\r
+                       } else {\r
+                               // Hashtables\r
+                               for (n in o) {\r
+                                       if (o.hasOwnProperty(n)) {\r
+                                               if (cb.call(s, o[n], n, o) === false)\r
+                                                       return 0;\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+                       return 1;\r
+               },\r
+\r
+\r
+               map : function(a, f) {\r
+                       var o = [];\r
+\r
+                       tinymce.each(a, function(v) {\r
+                               o.push(f(v));\r
+                       });\r
+\r
+                       return o;\r
+               },\r
+\r
+               grep : function(a, f) {\r
+                       var o = [];\r
+\r
+                       tinymce.each(a, function(v) {\r
+                               if (!f || f(v))\r
+                                       o.push(v);\r
+                       });\r
+\r
+                       return o;\r
+               },\r
+\r
+               inArray : function(a, v) {\r
+                       var i, l;\r
+\r
+                       if (a) {\r
+                               for (i = 0, l = a.length; i < l; i++) {\r
+                                       if (a[i] === v)\r
+                                               return i;\r
+                               }\r
+                       }\r
+\r
+                       return -1;\r
+               },\r
+\r
+               extend : function(o, e) {\r
+                       var i, l, a = arguments;\r
+\r
+                       for (i = 1, l = a.length; i < l; i++) {\r
+                               e = a[i];\r
+\r
+                               tinymce.each(e, function(v, n) {\r
+                                       if (v !== undefined)\r
+                                               o[n] = v;\r
+                               });\r
+                       }\r
+\r
+                       return o;\r
+               },\r
+\r
+\r
+               trim : function(s) {\r
+                       return (s ? '' + s : '').replace(whiteSpaceRe, '');\r
+               },\r
+\r
+               create : function(s, p) {\r
+                       var t = this, sp, ns, cn, scn, c, de = 0;\r
+\r
+                       // Parse : <prefix> <class>:<super class>\r
+                       s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);\r
+                       cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name\r
+\r
+                       // Create namespace for new class\r
+                       ns = t.createNS(s[3].replace(/\.\w+$/, ''));\r
+\r
+                       // Class already exists\r
+                       if (ns[cn])\r
+                               return;\r
+\r
+                       // Make pure static class\r
+                       if (s[2] == 'static') {\r
+                               ns[cn] = p;\r
+\r
+                               if (this.onCreate)\r
+                                       this.onCreate(s[2], s[3], ns[cn]);\r
+\r
+                               return;\r
+                       }\r
+\r
+                       // Create default constructor\r
+                       if (!p[cn]) {\r
+                               p[cn] = function() {};\r
+                               de = 1;\r
+                       }\r
+\r
+                       // Add constructor and methods\r
+                       ns[cn] = p[cn];\r
+                       t.extend(ns[cn].prototype, p);\r
+\r
+                       // Extend\r
+                       if (s[5]) {\r
+                               sp = t.resolve(s[5]).prototype;\r
+                               scn = s[5].match(/\.(\w+)$/i)[1]; // Class name\r
+\r
+                               // Extend constructor\r
+                               c = ns[cn];\r
+                               if (de) {\r
+                                       // Add passthrough constructor\r
+                                       ns[cn] = function() {\r
+                                               return sp[scn].apply(this, arguments);\r
+                                       };\r
+                               } else {\r
+                                       // Add inherit constructor\r
+                                       ns[cn] = function() {\r
+                                               this.parent = sp[scn];\r
+                                               return c.apply(this, arguments);\r
+                                       };\r
+                               }\r
+                               ns[cn].prototype[cn] = ns[cn];\r
+\r
+                               // Add super methods\r
+                               t.each(sp, function(f, n) {\r
+                                       ns[cn].prototype[n] = sp[n];\r
+                               });\r
+\r
+                               // Add overridden methods\r
+                               t.each(p, function(f, n) {\r
+                                       // Extend methods if needed\r
+                                       if (sp[n]) {\r
+                                               ns[cn].prototype[n] = function() {\r
+                                                       this.parent = sp[n];\r
+                                                       return f.apply(this, arguments);\r
+                                               };\r
+                                       } else {\r
+                                               if (n != cn)\r
+                                                       ns[cn].prototype[n] = f;\r
+                                       }\r
+                               });\r
+                       }\r
+\r
+                       // Add static methods\r
+                       t.each(p['static'], function(f, n) {\r
+                               ns[cn][n] = f;\r
+                       });\r
+\r
+                       if (this.onCreate)\r
+                               this.onCreate(s[2], s[3], ns[cn].prototype);\r
+               },\r
+\r
+               walk : function(o, f, n, s) {\r
+                       s = s || this;\r
+\r
+                       if (o) {\r
+                               if (n)\r
+                                       o = o[n];\r
+\r
+                               tinymce.each(o, function(o, i) {\r
+                                       if (f.call(s, o, i, n) === false)\r
+                                               return false;\r
+\r
+                                       tinymce.walk(o, f, n, s);\r
+                               });\r
+                       }\r
+               },\r
+\r
+               createNS : function(n, o) {\r
+                       var i, v;\r
+\r
+                       o = o || win;\r
+\r
+                       n = n.split('.');\r
+                       for (i=0; i<n.length; i++) {\r
+                               v = n[i];\r
+\r
+                               if (!o[v])\r
+                                       o[v] = {};\r
+\r
+                               o = o[v];\r
+                       }\r
+\r
+                       return o;\r
+               },\r
+\r
+               resolve : function(n, o) {\r
+                       var i, l;\r
+\r
+                       o = o || win;\r
+\r
+                       n = n.split('.');\r
+                       for (i = 0, l = n.length; i < l; i++) {\r
+                               o = o[n[i]];\r
+\r
+                               if (!o)\r
+                                       break;\r
+                       }\r
+\r
+                       return o;\r
+               },\r
+\r
+               addUnload : function(f, s) {\r
+                       var t = this;\r
+\r
+                       f = {func : f, scope : s || this};\r
+\r
+                       if (!t.unloads) {\r
+                               function unload() {\r
+                                       var li = t.unloads, o, n;\r
+\r
+                                       if (li) {\r
+                                               // Call unload handlers\r
+                                               for (n in li) {\r
+                                                       o = li[n];\r
+\r
+                                                       if (o && o.func)\r
+                                                               o.func.call(o.scope, 1); // Send in one arg to distinct unload and user destroy\r
+                                               }\r
+\r
+                                               // Detach unload function\r
+                                               if (win.detachEvent) {\r
+                                                       win.detachEvent('onbeforeunload', fakeUnload);\r
+                                                       win.detachEvent('onunload', unload);\r
+                                               } else if (win.removeEventListener)\r
+                                                       win.removeEventListener('unload', unload, false);\r
+\r
+                                               // Destroy references\r
+                                               t.unloads = o = li = w = unload = 0;\r
+\r
+                                               // Run garbarge collector on IE\r
+                                               if (win.CollectGarbage)\r
+                                                       CollectGarbage();\r
+                                       }\r
+                               };\r
+\r
+                               function fakeUnload() {\r
+                                       var d = document;\r
+\r
+                                       // Is there things still loading, then do some magic\r
+                                       if (d.readyState == 'interactive') {\r
+                                               function stop() {\r
+                                                       // Prevent memory leak\r
+                                                       d.detachEvent('onstop', stop);\r
+\r
+                                                       // Call unload handler\r
+                                                       if (unload)\r
+                                                               unload();\r
+\r
+                                                       d = 0;\r
+                                               };\r
+\r
+                                               // Fire unload when the currently loading page is stopped\r
+                                               if (d)\r
+                                                       d.attachEvent('onstop', stop);\r
+\r
+                                               // Remove onstop listener after a while to prevent the unload function\r
+                                               // to execute if the user presses cancel in an onbeforeunload\r
+                                               // confirm dialog and then presses the browser stop button\r
+                                               win.setTimeout(function() {\r
+                                                       if (d)\r
+                                                               d.detachEvent('onstop', stop);\r
+                                               }, 0);\r
+                                       }\r
+                               };\r
+\r
+                               // Attach unload handler\r
+                               if (win.attachEvent) {\r
+                                       win.attachEvent('onunload', unload);\r
+                                       win.attachEvent('onbeforeunload', fakeUnload);\r
+                               } else if (win.addEventListener)\r
+                                       win.addEventListener('unload', unload, false);\r
+\r
+                               // Setup initial unload handler array\r
+                               t.unloads = [f];\r
+                       } else\r
+                               t.unloads.push(f);\r
+\r
+                       return f;\r
+               },\r
+\r
+               removeUnload : function(f) {\r
+                       var u = this.unloads, r = null;\r
+\r
+                       tinymce.each(u, function(o, i) {\r
+                               if (o && o.func == f) {\r
+                                       u.splice(i, 1);\r
+                                       r = f;\r
+                                       return false;\r
+                               }\r
+                       });\r
+\r
+                       return r;\r
+               },\r
+\r
+               explode : function(s, d) {\r
+                       return s ? tinymce.map(s.split(d || ','), tinymce.trim) : s;\r
+               },\r
+\r
+               _addVer : function(u) {\r
+                       var v;\r
+\r
+                       if (!this.query)\r
+                               return u;\r
+\r
+                       v = (u.indexOf('?') == -1 ? '?' : '&') + this.query;\r
+\r
+                       if (u.indexOf('#') == -1)\r
+                               return u + v;\r
+\r
+                       return u.replace('#', v + '#');\r
+               }\r
+\r
+               };\r
+\r
+       // Initialize the API\r
+       tinymce._init();\r
+\r
+       // Expose tinymce namespace to the global namespace (window)\r
+       win.tinymce = win.tinyMCE = tinymce;\r
+})(window);\r
+\r
+\r
+tinymce.create('tinymce.util.Dispatcher', {\r
+       scope : null,\r
+       listeners : null,\r
+\r
+       Dispatcher : function(s) {\r
+               this.scope = s || this;\r
+               this.listeners = [];\r
+       },\r
+\r
+       add : function(cb, s) {\r
+               this.listeners.push({cb : cb, scope : s || this.scope});\r
+\r
+               return cb;\r
+       },\r
+\r
+       addToTop : function(cb, s) {\r
+               this.listeners.unshift({cb : cb, scope : s || this.scope});\r
+\r
+               return cb;\r
+       },\r
+\r
+       remove : function(cb) {\r
+               var l = this.listeners, o = null;\r
+\r
+               tinymce.each(l, function(c, i) {\r
+                       if (cb == c.cb) {\r
+                               o = cb;\r
+                               l.splice(i, 1);\r
+                               return false;\r
+                       }\r
+               });\r
+\r
+               return o;\r
+       },\r
+\r
+       dispatch : function() {\r
+               var s, a = arguments, i, li = this.listeners, c;\r
+\r
+               // Needs to be a real loop since the listener count might change while looping\r
+               // And this is also more efficient\r
+               for (i = 0; i<li.length; i++) {\r
+                       c = li[i];\r
+                       s = c.cb.apply(c.scope, a);\r
+\r
+                       if (s === false)\r
+                               break;\r
+               }\r
+\r
+               return s;\r
+       }\r
+\r
+       });\r
+\r
+(function() {\r
+       var each = tinymce.each;\r
+\r
+       tinymce.create('tinymce.util.URI', {\r
+               URI : function(u, s) {\r
+                       var t = this, o, a, b;\r
+\r
+                       // Trim whitespace\r
+                       u = tinymce.trim(u);\r
+\r
+                       // Default settings\r
+                       s = t.settings = s || {};\r
+\r
+                       // Strange app protocol or local anchor\r
+                       if (/^(mailto|tel|news|javascript|about|data):/i.test(u) || /^\s*#/.test(u)) {\r
+                               t.source = u;\r
+                               return;\r
+                       }\r
+\r
+                       // Absolute path with no host, fake host and protocol\r
+                       if (u.indexOf('/') === 0 && u.indexOf('//') !== 0)\r
+                               u = (s.base_uri ? s.base_uri.protocol || 'http' : 'http') + '://mce_host' + u;\r
+\r
+                       // Relative path http:// or protocol relative //path\r
+                       if (!/^\w*:?\/\//.test(u))\r
+                               u = (s.base_uri.protocol || 'http') + '://mce_host' + t.toAbsPath(s.base_uri.path, u);\r
+\r
+                       // Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri)\r
+                       u = u.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something\r
+                       u = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u);\r
+                       each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], function(v, i) {\r
+                               var s = u[i];\r
+\r
+                               // Zope 3 workaround, they use @@something\r
+                               if (s)\r
+                                       s = s.replace(/\(mce_at\)/g, '@@');\r
+\r
+                               t[v] = s;\r
+                       });\r
+\r
+                       if (b = s.base_uri) {\r
+                               if (!t.protocol)\r
+                                       t.protocol = b.protocol;\r
+\r
+                               if (!t.userInfo)\r
+                                       t.userInfo = b.userInfo;\r
+\r
+                               if (!t.port && t.host == 'mce_host')\r
+                                       t.port = b.port;\r
+\r
+                               if (!t.host || t.host == 'mce_host')\r
+                                       t.host = b.host;\r
+\r
+                               t.source = '';\r
+                       }\r
+\r
+                       //t.path = t.path || '/';\r
+               },\r
+\r
+               setPath : function(p) {\r
+                       var t = this;\r
+\r
+                       p = /^(.*?)\/?(\w+)?$/.exec(p);\r
+\r
+                       // Update path parts\r
+                       t.path = p[0];\r
+                       t.directory = p[1];\r
+                       t.file = p[2];\r
+\r
+                       // Rebuild source\r
+                       t.source = '';\r
+                       t.getURI();\r
+               },\r
+\r
+               toRelative : function(u) {\r
+                       var t = this, o;\r
+\r
+                       if (u === "./")\r
+                               return u;\r
+\r
+                       u = new tinymce.util.URI(u, {base_uri : t});\r
+\r
+                       // Not on same domain/port or protocol\r
+                       if ((u.host != 'mce_host' && t.host != u.host && u.host) || t.port != u.port || t.protocol != u.protocol)\r
+                               return u.getURI();\r
+\r
+                       o = t.toRelPath(t.path, u.path);\r
+\r
+                       // Add query\r
+                       if (u.query)\r
+                               o += '?' + u.query;\r
+\r
+                       // Add anchor\r
+                       if (u.anchor)\r
+                               o += '#' + u.anchor;\r
+\r
+                       return o;\r
+               },\r
+       \r
+               toAbsolute : function(u, nh) {\r
+                       var u = new tinymce.util.URI(u, {base_uri : this});\r
+\r
+                       return u.getURI(this.host == u.host && this.protocol == u.protocol ? nh : 0);\r
+               },\r
+\r
+               toRelPath : function(base, path) {\r
+                       var items, bp = 0, out = '', i, l;\r
+\r
+                       // Split the paths\r
+                       base = base.substring(0, base.lastIndexOf('/'));\r
+                       base = base.split('/');\r
+                       items = path.split('/');\r
+\r
+                       if (base.length >= items.length) {\r
+                               for (i = 0, l = base.length; i < l; i++) {\r
+                                       if (i >= items.length || base[i] != items[i]) {\r
+                                               bp = i + 1;\r
+                                               break;\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+                       if (base.length < items.length) {\r
+                               for (i = 0, l = items.length; i < l; i++) {\r
+                                       if (i >= base.length || base[i] != items[i]) {\r
+                                               bp = i + 1;\r
+                                               break;\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+                       if (bp == 1)\r
+                               return path;\r
+\r
+                       for (i = 0, l = base.length - (bp - 1); i < l; i++)\r
+                               out += "../";\r
+\r
+                       for (i = bp - 1, l = items.length; i < l; i++) {\r
+                               if (i != bp - 1)\r
+                                       out += "/" + items[i];\r
+                               else\r
+                                       out += items[i];\r
+                       }\r
+\r
+                       return out;\r
+               },\r
+\r
+               toAbsPath : function(base, path) {\r
+                       var i, nb = 0, o = [], tr, outPath;\r
+\r
+                       // Split paths\r
+                       tr = /\/$/.test(path) ? '/' : '';\r
+                       base = base.split('/');\r
+                       path = path.split('/');\r
+\r
+                       // Remove empty chunks\r
+                       each(base, function(k) {\r
+                               if (k)\r
+                                       o.push(k);\r
+                       });\r
+\r
+                       base = o;\r
+\r
+                       // Merge relURLParts chunks\r
+                       for (i = path.length - 1, o = []; i >= 0; i--) {\r
+                               // Ignore empty or .\r
+                               if (path[i].length == 0 || path[i] == ".")\r
+                                       continue;\r
+\r
+                               // Is parent\r
+                               if (path[i] == '..') {\r
+                                       nb++;\r
+                                       continue;\r
+                               }\r
+\r
+                               // Move up\r
+                               if (nb > 0) {\r
+                                       nb--;\r
+                                       continue;\r
+                               }\r
+\r
+                               o.push(path[i]);\r
+                       }\r
+\r
+                       i = base.length - nb;\r
+\r
+                       // If /a/b/c or /\r
+                       if (i <= 0)\r
+                               outPath = o.reverse().join('/');\r
+                       else\r
+                               outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/');\r
+\r
+                       // Add front / if it's needed\r
+                       if (outPath.indexOf('/') !== 0)\r
+                               outPath = '/' + outPath;\r
+\r
+                       // Add traling / if it's needed\r
+                       if (tr && outPath.lastIndexOf('/') !== outPath.length - 1)\r
+                               outPath += tr;\r
+\r
+                       return outPath;\r
+               },\r
+\r
+               getURI : function(nh) {\r
+                       var s, t = this;\r
+\r
+                       // Rebuild source\r
+                       if (!t.source || nh) {\r
+                               s = '';\r
+\r
+                               if (!nh) {\r
+                                       if (t.protocol)\r
+                                               s += t.protocol + '://';\r
+\r
+                                       if (t.userInfo)\r
+                                               s += t.userInfo + '@';\r
+\r
+                                       if (t.host)\r
+                                               s += t.host;\r
+\r
+                                       if (t.port)\r
+                                               s += ':' + t.port;\r
+                               }\r
+\r
+                               if (t.path)\r
+                                       s += t.path;\r
+\r
+                               if (t.query)\r
+                                       s += '?' + t.query;\r
+\r
+                               if (t.anchor)\r
+                                       s += '#' + t.anchor;\r
+\r
+                               t.source = s;\r
+                       }\r
+\r
+                       return t.source;\r
+               }\r
+       });\r
+})();\r
+\r
+(function() {\r
+       var each = tinymce.each;\r
+\r
+       tinymce.create('static tinymce.util.Cookie', {\r
+               getHash : function(n) {\r
+                       var v = this.get(n), h;\r
+\r
+                       if (v) {\r
+                               each(v.split('&'), function(v) {\r
+                                       v = v.split('=');\r
+                                       h = h || {};\r
+                                       h[unescape(v[0])] = unescape(v[1]);\r
+                               });\r
+                       }\r
+\r
+                       return h;\r
+               },\r
+\r
+               setHash : function(n, v, e, p, d, s) {\r
+                       var o = '';\r
+\r
+                       each(v, function(v, k) {\r
+                               o += (!o ? '' : '&') + escape(k) + '=' + escape(v);\r
+                       });\r
+\r
+                       this.set(n, o, e, p, d, s);\r
+               },\r
+\r
+               get : function(n) {\r
+                       var c = document.cookie, e, p = n + "=", b;\r
+\r
+                       // Strict mode\r
+                       if (!c)\r
+                               return;\r
+\r
+                       b = c.indexOf("; " + p);\r
+\r
+                       if (b == -1) {\r
+                               b = c.indexOf(p);\r
+\r
+                               if (b != 0)\r
+                                       return null;\r
+                       } else\r
+                               b += 2;\r
+\r
+                       e = c.indexOf(";", b);\r
+\r
+                       if (e == -1)\r
+                               e = c.length;\r
+\r
+                       return unescape(c.substring(b + p.length, e));\r
+               },\r
+\r
+               set : function(n, v, e, p, d, s) {\r
+                       document.cookie = n + "=" + escape(v) +\r
+                               ((e) ? "; expires=" + e.toGMTString() : "") +\r
+                               ((p) ? "; path=" + escape(p) : "") +\r
+                               ((d) ? "; domain=" + d : "") +\r
+                               ((s) ? "; secure" : "");\r
+               },\r
+\r
+               remove : function(n, p) {\r
+                       var d = new Date();\r
+\r
+                       d.setTime(d.getTime() - 1000);\r
+\r
+                       this.set(n, '', d, p, d);\r
+               }\r
+       });\r
+})();\r
+\r
+tinymce.create('static tinymce.util.JSON', {\r
+       serialize : function(o) {\r
+               var i, v, s = tinymce.util.JSON.serialize, t;\r
+\r
+               if (o == null)\r
+                       return 'null';\r
+\r
+               t = typeof o;\r
+\r
+               if (t == 'string') {\r
+                       v = '\bb\tt\nn\ff\rr\""\'\'\\\\';\r
+\r
+                       return '"' + o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g, function(a, b) {\r
+                               i = v.indexOf(b);\r
+\r
+                               if (i + 1)\r
+                                       return '\\' + v.charAt(i + 1);\r
+\r
+                               a = b.charCodeAt().toString(16);\r
+\r
+                               return '\\u' + '0000'.substring(a.length) + a;\r
+                       }) + '"';\r
+               }\r
+\r
+               if (t == 'object') {\r
+                       if (o.hasOwnProperty && o instanceof Array) {\r
+                                       for (i=0, v = '['; i<o.length; i++)\r
+                                               v += (i > 0 ? ',' : '') + s(o[i]);\r
+\r
+                                       return v + ']';\r
+                               }\r
+\r
+                               v = '{';\r
+\r
+                               for (i in o)\r
+                                       v += typeof o[i] != 'function' ? (v.length > 1 ? ',"' : '"') + i + '":' + s(o[i]) : '';\r
+\r
+                               return v + '}';\r
+               }\r
+\r
+               return '' + o;\r
+       },\r
+\r
+       parse : function(s) {\r
+               try {\r
+                       return eval('(' + s + ')');\r
+               } catch (ex) {\r
+                       // Ignore\r
+               }\r
+       }\r
+\r
+       });\r
+\r
+tinymce.create('static tinymce.util.XHR', {\r
+       send : function(o) {\r
+               var x, t, w = window, c = 0;\r
+\r
+               // Default settings\r
+               o.scope = o.scope || this;\r
+               o.success_scope = o.success_scope || o.scope;\r
+               o.error_scope = o.error_scope || o.scope;\r
+               o.async = o.async === false ? false : true;\r
+               o.data = o.data || '';\r
+\r
+               function get(s) {\r
+                       x = 0;\r
+\r
+                       try {\r
+                               x = new ActiveXObject(s);\r
+                       } catch (ex) {\r
+                       }\r
+\r
+                       return x;\r
+               };\r
+\r
+               x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Microsoft.XMLHTTP') || get('Msxml2.XMLHTTP');\r
+\r
+               if (x) {\r
+                       if (x.overrideMimeType)\r
+                               x.overrideMimeType(o.content_type);\r
+\r
+                       x.open(o.type || (o.data ? 'POST' : 'GET'), o.url, o.async);\r
+\r
+                       if (o.content_type)\r
+                               x.setRequestHeader('Content-Type', o.content_type);\r
+\r
+                       x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\r
+\r
+                       x.send(o.data);\r
+\r
+                       function ready() {\r
+                               if (!o.async || x.readyState == 4 || c++ > 10000) {\r
+                                       if (o.success && c < 10000 && x.status == 200)\r
+                                               o.success.call(o.success_scope, '' + x.responseText, x, o);\r
+                                       else if (o.error)\r
+                                               o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o);\r
+\r
+                                       x = null;\r
+                               } else\r
+                                       w.setTimeout(ready, 10);\r
+                       };\r
+\r
+                       // Syncronous request\r
+                       if (!o.async)\r
+                               return ready();\r
+\r
+                       // Wait for response, onReadyStateChange can not be used since it leaks memory in IE\r
+                       t = w.setTimeout(ready, 10);\r
+               }\r
+       }\r
+});\r
+\r
+(function() {\r
+       var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR;\r
+\r
+       tinymce.create('tinymce.util.JSONRequest', {\r
+               JSONRequest : function(s) {\r
+                       this.settings = extend({\r
+                       }, s);\r
+                       this.count = 0;\r
+               },\r
+\r
+               send : function(o) {\r
+                       var ecb = o.error, scb = o.success;\r
+\r
+                       o = extend(this.settings, o);\r
+\r
+                       o.success = function(c, x) {\r
+                               c = JSON.parse(c);\r
+\r
+                               if (typeof(c) == 'undefined') {\r
+                                       c = {\r
+                                               error : 'JSON Parse error.'\r
+                                       };\r
+                               }\r
+\r
+                               if (c.error)\r
+                                       ecb.call(o.error_scope || o.scope, c.error, x);\r
+                               else\r
+                                       scb.call(o.success_scope || o.scope, c.result);\r
+                       };\r
+\r
+                       o.error = function(ty, x) {\r
+                               ecb.call(o.error_scope || o.scope, ty, x);\r
+                       };\r
+\r
+                       o.data = JSON.serialize({\r
+                               id : o.id || 'c' + (this.count++),\r
+                               method : o.method,\r
+                               params : o.params\r
+                       });\r
+\r
+                       // JSON content type for Ruby on rails. Bug: #1883287\r
+                       o.content_type = 'application/json';\r
+\r
+                       XHR.send(o);\r
+               },\r
+\r
+               'static' : {\r
+                       sendRPC : function(o) {\r
+                               return new tinymce.util.JSONRequest().send(o);\r
+                       }\r
+               }\r
+       });\r
+}());\r
+(function(tinymce) {\r
+       // Shorten names\r
+       var each = tinymce.each,\r
+               is = tinymce.is,\r
+               isWebKit = tinymce.isWebKit,\r
+               isIE = tinymce.isIE,\r
+               blockRe = /^(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)$/,\r
+               boolAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'),\r
+               mceAttribs = makeMap('src,href,style,coords,shape'),\r
+               encodedChars = {'&' : '&amp;', '"' : '&quot;', '<' : '&lt;', '>' : '&gt;'},\r
+               encodeCharsRe = /[<>&\"]/g,\r
+               simpleSelectorRe = /^([a-z0-9],?)+$/i,\r
+               tagRegExp = /<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)(\s*\/?)>/g,\r
+               attrRegExp = /(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;\r
+\r
+       function makeMap(str) {\r
+               var map = {}, i;\r
+\r
+               str = str.split(',');\r
+               for (i = str.length; i >= 0; i--)\r
+                       map[str[i]] = 1;\r
+\r
+               return map;\r
+       };\r
+\r
+       tinymce.create('tinymce.dom.DOMUtils', {\r
+               doc : null,\r
+               root : null,\r
+               files : null,\r
+               pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/,\r
+               props : {\r
+                       "for" : "htmlFor",\r
+                       "class" : "className",\r
+                       className : "className",\r
+                       checked : "checked",\r
+                       disabled : "disabled",\r
+                       maxlength : "maxLength",\r
+                       readonly : "readOnly",\r
+                       selected : "selected",\r
+                       value : "value",\r
+                       id : "id",\r
+                       name : "name",\r
+                       type : "type"\r
+               },\r
+\r
+               DOMUtils : function(d, s) {\r
+                       var t = this, globalStyle;\r
+\r
+                       t.doc = d;\r
+                       t.win = window;\r
+                       t.files = {};\r
+                       t.cssFlicker = false;\r
+                       t.counter = 0;\r
+                       t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat"; \r
+                       t.stdMode = d.documentMode === 8;\r
+\r
+                       t.settings = s = tinymce.extend({\r
+                               keep_values : false,\r
+                               hex_colors : 1,\r
+                               process_html : 1\r
+                       }, s);\r
+\r
+                       // Fix IE6SP2 flicker and check it failed for pre SP2\r
+                       if (tinymce.isIE6) {\r
+                               try {\r
+                                       d.execCommand('BackgroundImageCache', false, true);\r
+                               } catch (e) {\r
+                                       t.cssFlicker = true;\r
+                               }\r
+                       }\r
+\r
+                       // Build styles list\r
+                       if (s.valid_styles) {\r
+                               t._styles = {};\r
+\r
+                               // Convert styles into a rule list\r
+                               each(s.valid_styles, function(value, key) {\r
+                                       t._styles[key] = tinymce.explode(value);\r
+                               });\r
+                       }\r
+\r
+                       tinymce.addUnload(t.destroy, t);\r
+               },\r
+\r
+               getRoot : function() {\r
+                       var t = this, s = t.settings;\r
+\r
+                       return (s && t.get(s.root_element)) || t.doc.body;\r
+               },\r
+\r
+               getViewPort : function(w) {\r
+                       var d, b;\r
+\r
+                       w = !w ? this.win : w;\r
+                       d = w.document;\r
+                       b = this.boxModel ? d.documentElement : d.body;\r
+\r
+                       // Returns viewport size excluding scrollbars\r
+                       return {\r
+                               x : w.pageXOffset || b.scrollLeft,\r
+                               y : w.pageYOffset || b.scrollTop,\r
+                               w : w.innerWidth || b.clientWidth,\r
+                               h : w.innerHeight || b.clientHeight\r
+                       };\r
+               },\r
+\r
+               getRect : function(e) {\r
+                       var p, t = this, sr;\r
+\r
+                       e = t.get(e);\r
+                       p = t.getPos(e);\r
+                       sr = t.getSize(e);\r
+\r
+                       return {\r
+                               x : p.x,\r
+                               y : p.y,\r
+                               w : sr.w,\r
+                               h : sr.h\r
+                       };\r
+               },\r
+\r
+               getSize : function(e) {\r
+                       var t = this, w, h;\r
+\r
+                       e = t.get(e);\r
+                       w = t.getStyle(e, 'width');\r
+                       h = t.getStyle(e, 'height');\r
+\r
+                       // Non pixel value, then force offset/clientWidth\r
+                       if (w.indexOf('px') === -1)\r
+                               w = 0;\r
+\r
+                       // Non pixel value, then force offset/clientWidth\r
+                       if (h.indexOf('px') === -1)\r
+                               h = 0;\r
+\r
+                       return {\r
+                               w : parseInt(w) || e.offsetWidth || e.clientWidth,\r
+                               h : parseInt(h) || e.offsetHeight || e.clientHeight\r
+                       };\r
+               },\r
+\r
+               getParent : function(n, f, r) {\r
+                       return this.getParents(n, f, r, false);\r
+               },\r
+\r
+               getParents : function(n, f, r, c) {\r
+                       var t = this, na, se = t.settings, o = [];\r
+\r
+                       n = t.get(n);\r
+                       c = c === undefined;\r
+\r
+                       if (se.strict_root)\r
+                               r = r || t.getRoot();\r
+\r
+                       // Wrap node name as func\r
+                       if (is(f, 'string')) {\r
+                               na = f;\r
+\r
+                               if (f === '*') {\r
+                                       f = function(n) {return n.nodeType == 1;};\r
+                               } else {\r
+                                       f = function(n) {\r
+                                               return t.is(n, na);\r
+                                       };\r
+                               }\r
+                       }\r
+\r
+                       while (n) {\r
+                               if (n == r || !n.nodeType || n.nodeType === 9)\r
+                                       break;\r
+\r
+                               if (!f || f(n)) {\r
+                                       if (c)\r
+                                               o.push(n);\r
+                                       else\r
+                                               return n;\r
+                               }\r
+\r
+                               n = n.parentNode;\r
+                       }\r
+\r
+                       return c ? o : null;\r
+               },\r
+\r
+               get : function(e) {\r
+                       var n;\r
+\r
+                       if (e && this.doc && typeof(e) == 'string') {\r
+                               n = e;\r
+                               e = this.doc.getElementById(e);\r
+\r
+                               // IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick\r
+                               if (e && e.id !== n)\r
+                                       return this.doc.getElementsByName(n)[1];\r
+                       }\r
+\r
+                       return e;\r
+               },\r
+\r
+               getNext : function(node, selector) {\r
+                       return this._findSib(node, selector, 'nextSibling');\r
+               },\r
+\r
+               getPrev : function(node, selector) {\r
+                       return this._findSib(node, selector, 'previousSibling');\r
+               },\r
+\r
+\r
+               select : function(pa, s) {\r
+                       var t = this;\r
+\r
+                       return tinymce.dom.Sizzle(pa, t.get(s) || t.get(t.settings.root_element) || t.doc, []);\r
+               },\r
+\r
+               is : function(n, selector) {\r
+                       var i;\r
+\r
+                       // If it isn't an array then try to do some simple selectors instead of Sizzle for to boost performance\r
+                       if (n.length === undefined) {\r
+                               // Simple all selector\r
+                               if (selector === '*')\r
+                                       return n.nodeType == 1;\r
+\r
+                               // Simple selector just elements\r
+                               if (simpleSelectorRe.test(selector)) {\r
+                                       selector = selector.toLowerCase().split(/,/);\r
+                                       n = n.nodeName.toLowerCase();\r
+\r
+                                       for (i = selector.length - 1; i >= 0; i--) {\r
+                                               if (selector[i] == n)\r
+                                                       return true;\r
+                                       }\r
+\r
+                                       return false;\r
+                               }\r
+                       }\r
+\r
+                       return tinymce.dom.Sizzle.matches(selector, n.nodeType ? [n] : n).length > 0;\r
+               },\r
+\r
+\r
+               add : function(p, n, a, h, c) {\r
+                       var t = this;\r
+\r
+                       return this.run(p, function(p) {\r
+                               var e, k;\r
+\r
+                               e = is(n, 'string') ? t.doc.createElement(n) : n;\r
+                               t.setAttribs(e, a);\r
+\r
+                               if (h) {\r
+                                       if (h.nodeType)\r
+                                               e.appendChild(h);\r
+                                       else\r
+                                               t.setHTML(e, h);\r
+                               }\r
+\r
+                               return !c ? p.appendChild(e) : e;\r
+                       });\r
+               },\r
+\r
+               create : function(n, a, h) {\r
+                       return this.add(this.doc.createElement(n), n, a, h, 1);\r
+               },\r
+\r
+               createHTML : function(n, a, h) {\r
+                       var o = '', t = this, k;\r
+\r
+                       o += '<' + n;\r
+\r
+                       for (k in a) {\r
+                               if (a.hasOwnProperty(k))\r
+                                       o += ' ' + k + '="' + t.encode(a[k]) + '"';\r
+                       }\r
+\r
+                       if (tinymce.is(h))\r
+                               return o + '>' + h + '</' + n + '>';\r
+\r
+                       return o + ' />';\r
+               },\r
+\r
+               remove : function(node, keep_children) {\r
+                       return this.run(node, function(node) {\r
+                               var parent, child;\r
+\r
+                               parent = node.parentNode;\r
+\r
+                               if (!parent)\r
+                                       return null;\r
+\r
+                               if (keep_children) {\r
+                                       while (child = node.firstChild) {\r
+                                               // IE 8 will crash if you don't remove completely empty text nodes\r
+                                               if (child.nodeType !== 3 || child.nodeValue)\r
+                                                       parent.insertBefore(child, node);\r
+                                               else\r
+                                                       node.removeChild(child);\r
+                                       }\r
+                               }\r
+\r
+                               return parent.removeChild(node);\r
+                       });\r
+               },\r
+\r
+               setStyle : function(n, na, v) {\r
+                       var t = this;\r
+\r
+                       return t.run(n, function(e) {\r
+                               var s, i;\r
+\r
+                               s = e.style;\r
+\r
+                               // Camelcase it, if needed\r
+                               na = na.replace(/-(\D)/g, function(a, b){\r
+                                       return b.toUpperCase();\r
+                               });\r
+\r
+                               // Default px suffix on these\r
+                               if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v)))\r
+                                       v += 'px';\r
+\r
+                               switch (na) {\r
+                                       case 'opacity':\r
+                                               // IE specific opacity\r
+                                               if (isIE) {\r
+                                                       s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")";\r
+\r
+                                                       if (!n.currentStyle || !n.currentStyle.hasLayout)\r
+                                                               s.display = 'inline-block';\r
+                                               }\r
+\r
+                                               // Fix for older browsers\r
+                                               s[na] = s['-moz-opacity'] = s['-khtml-opacity'] = v || '';\r
+                                               break;\r
+\r
+                                       case 'float':\r
+                                               isIE ? s.styleFloat = v : s.cssFloat = v;\r
+                                               break;\r
+                                       \r
+                                       default:\r
+                                               s[na] = v || '';\r
+                               }\r
+\r
+                               // Force update of the style data\r
+                               if (t.settings.update_styles)\r
+                                       t.setAttrib(e, '_mce_style');\r
+                       });\r
+               },\r
+\r
+               getStyle : function(n, na, c) {\r
+                       n = this.get(n);\r
+\r
+                       if (!n)\r
+                               return false;\r
+\r
+                       // Gecko\r
+                       if (this.doc.defaultView && c) {\r
+                               // Remove camelcase\r
+                               na = na.replace(/[A-Z]/g, function(a){\r
+                                       return '-' + a;\r
+                               });\r
+\r
+                               try {\r
+                                       return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na);\r
+                               } catch (ex) {\r
+                                       // Old safari might fail\r
+                                       return null;\r
+                               }\r
+                       }\r
+\r
+                       // Camelcase it, if needed\r
+                       na = na.replace(/-(\D)/g, function(a, b){\r
+                               return b.toUpperCase();\r
+                       });\r
+\r
+                       if (na == 'float')\r
+                               na = isIE ? 'styleFloat' : 'cssFloat';\r
+\r
+                       // IE & Opera\r
+                       if (n.currentStyle && c)\r
+                               return n.currentStyle[na];\r
+\r
+                       return n.style[na];\r
+               },\r
+\r
+               setStyles : function(e, o) {\r
+                       var t = this, s = t.settings, ol;\r
+\r
+                       ol = s.update_styles;\r
+                       s.update_styles = 0;\r
+\r
+                       each(o, function(v, n) {\r
+                               t.setStyle(e, n, v);\r
+                       });\r
+\r
+                       // Update style info\r
+                       s.update_styles = ol;\r
+                       if (s.update_styles)\r
+                               t.setAttrib(e, s.cssText);\r
+               },\r
+\r
+               setAttrib : function(e, n, v) {\r
+                       var t = this;\r
+\r
+                       // Whats the point\r
+                       if (!e || !n)\r
+                               return;\r
+\r
+                       // Strict XML mode\r
+                       if (t.settings.strict)\r
+                               n = n.toLowerCase();\r
+\r
+                       return this.run(e, function(e) {\r
+                               var s = t.settings;\r
+\r
+                               switch (n) {\r
+                                       case "style":\r
+                                               if (!is(v, 'string')) {\r
+                                                       each(v, function(v, n) {\r
+                                                               t.setStyle(e, n, v);\r
+                                                       });\r
+\r
+                                                       return;\r
+                                               }\r
+\r
+                                               // No mce_style for elements with these since they might get resized by the user\r
+                                               if (s.keep_values) {\r
+                                                       if (v && !t._isRes(v))\r
+                                                               e.setAttribute('_mce_style', v, 2);\r
+                                                       else\r
+                                                               e.removeAttribute('_mce_style', 2);\r
+                                               }\r
+\r
+                                               e.style.cssText = v;\r
+                                               break;\r
+\r
+                                       case "class":\r
+                                               e.className = v || ''; // Fix IE null bug\r
+                                               break;\r
+\r
+                                       case "src":\r
+                                       case "href":\r
+                                               if (s.keep_values) {\r
+                                                       if (s.url_converter)\r
+                                                               v = s.url_converter.call(s.url_converter_scope || t, v, n, e);\r
+\r
+                                                       t.setAttrib(e, '_mce_' + n, v, 2);\r
+                                               }\r
+\r
+                                               break;\r
+                                       \r
+                                       case "shape":\r
+                                               e.setAttribute('_mce_style', v);\r
+                                               break;\r
+                               }\r
+\r
+                               if (is(v) && v !== null && v.length !== 0)\r
+                                       e.setAttribute(n, '' + v, 2);\r
+                               else\r
+                                       e.removeAttribute(n, 2);\r
+                       });\r
+               },\r
+\r
+               setAttribs : function(e, o) {\r
+                       var t = this;\r
+\r
+                       return this.run(e, function(e) {\r
+                               each(o, function(v, n) {\r
+                                       t.setAttrib(e, n, v);\r
+                               });\r
+                       });\r
+               },\r
+\r
+               getAttrib : function(e, n, dv) {\r
+                       var v, t = this;\r
+\r
+                       e = t.get(e);\r
+\r
+                       if (!e || e.nodeType !== 1)\r
+                               return false;\r
+\r
+                       if (!is(dv))\r
+                               dv = '';\r
+\r
+                       // Try the mce variant for these\r
+                       if (/^(src|href|style|coords|shape)$/.test(n)) {\r
+                               v = e.getAttribute("_mce_" + n);\r
+\r
+                               if (v)\r
+                                       return v;\r
+                       }\r
+\r
+                       if (isIE && t.props[n]) {\r
+                               v = e[t.props[n]];\r
+                               v = v && v.nodeValue ? v.nodeValue : v;\r
+                       }\r
+\r
+                       if (!v)\r
+                               v = e.getAttribute(n, 2);\r
+\r
+                       // Check boolean attribs\r
+                       if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(n)) {\r
+                               if (e[t.props[n]] === true && v === '')\r
+                                       return n;\r
+\r
+                               return v ? n : '';\r
+                       }\r
+\r
+                       // Inner input elements will override attributes on form elements\r
+                       if (e.nodeName === "FORM" && e.getAttributeNode(n))\r
+                               return e.getAttributeNode(n).nodeValue;\r
+\r
+                       if (n === 'style') {\r
+                               v = v || e.style.cssText;\r
+\r
+                               if (v) {\r
+                                       v = t.serializeStyle(t.parseStyle(v), e.nodeName);\r
+\r
+                                       if (t.settings.keep_values && !t._isRes(v))\r
+                                               e.setAttribute('_mce_style', v);\r
+                               }\r
+                       }\r
+\r
+                       // Remove Apple and WebKit stuff\r
+                       if (isWebKit && n === "class" && v)\r
+                               v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, '');\r
+\r
+                       // Handle IE issues\r
+                       if (isIE) {\r
+                               switch (n) {\r
+                                       case 'rowspan':\r
+                                       case 'colspan':\r
+                                               // IE returns 1 as default value\r
+                                               if (v === 1)\r
+                                                       v = '';\r
+\r
+                                               break;\r
+\r
+                                       case 'size':\r
+                                               // IE returns +0 as default value for size\r
+                                               if (v === '+0' || v === 20 || v === 0)\r
+                                                       v = '';\r
+\r
+                                               break;\r
+\r
+                                       case 'width':\r
+                                       case 'height':\r
+                                       case 'vspace':\r
+                                       case 'checked':\r
+                                       case 'disabled':\r
+                                       case 'readonly':\r
+                                               if (v === 0)\r
+                                                       v = '';\r
+\r
+                                               break;\r
+\r
+                                       case 'hspace':\r
+                                               // IE returns -1 as default value\r
+                                               if (v === -1)\r
+                                                       v = '';\r
+\r
+                                               break;\r
+\r
+                                       case 'maxlength':\r
+                                       case 'tabindex':\r
+                                               // IE returns default value\r
+                                               if (v === 32768 || v === 2147483647 || v === '32768')\r
+                                                       v = '';\r
+\r
+                                               break;\r
+\r
+                                       case 'multiple':\r
+                                       case 'compact':\r
+                                       case 'noshade':\r
+                                       case 'nowrap':\r
+                                               if (v === 65535)\r
+                                                       return n;\r
+\r
+                                               return dv;\r
+\r
+                                       case 'shape':\r
+                                               v = v.toLowerCase();\r
+                                               break;\r
+\r
+                                       default:\r
+                                               // IE has odd anonymous function for event attributes\r
+                                               if (n.indexOf('on') === 0 && v)\r
+                                                       v = ('' + v).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, '$1');\r
+                               }\r
+                       }\r
+\r
+                       return (v !== undefined && v !== null && v !== '') ? '' + v : dv;\r
+               },\r
+\r
+               getPos : function(n, ro) {\r
+                       var t = this, x = 0, y = 0, e, d = t.doc, r;\r
+\r
+                       n = t.get(n);\r
+                       ro = ro || d.body;\r
+\r
+                       if (n) {\r
+                               // Use getBoundingClientRect on IE, Opera has it but it's not perfect\r
+                               if (isIE && !t.stdMode) {\r
+                                       n = n.getBoundingClientRect();\r
+                                       e = t.boxModel ? d.documentElement : d.body;\r
+                                       x = t.getStyle(t.select('html')[0], 'borderWidth'); // Remove border\r
+                                       x = (x == 'medium' || t.boxModel && !t.isIE6) && 2 || x;\r
+                                       n.top += t.win.self != t.win.top ? 2 : 0; // IE adds some strange extra cord if used in a frameset\r
+\r
+                                       return {x : n.left + e.scrollLeft - x, y : n.top + e.scrollTop - x};\r
+                               }\r
+\r
+                               r = n;\r
+                               while (r && r != ro && r.nodeType) {\r
+                                       x += r.offsetLeft || 0;\r
+                                       y += r.offsetTop || 0;\r
+                                       r = r.offsetParent;\r
+                               }\r
+\r
+                               r = n.parentNode;\r
+                               while (r && r != ro && r.nodeType) {\r
+                                       x -= r.scrollLeft || 0;\r
+                                       y -= r.scrollTop || 0;\r
+                                       r = r.parentNode;\r
+                               }\r
+                       }\r
+\r
+                       return {x : x, y : y};\r
+               },\r
+\r
+               parseStyle : function(st) {\r
+                       var t = this, s = t.settings, o = {};\r
+\r
+                       if (!st)\r
+                               return o;\r
+\r
+                       function compress(p, s, ot) {\r
+                               var t, r, b, l;\r
+\r
+                               // Get values and check it it needs compressing\r
+                               t = o[p + '-top' + s];\r
+                               if (!t)\r
+                                       return;\r
+\r
+                               r = o[p + '-right' + s];\r
+                               if (t != r)\r
+                                       return;\r
+\r
+                               b = o[p + '-bottom' + s];\r
+                               if (r != b)\r
+                                       return;\r
+\r
+                               l = o[p + '-left' + s];\r
+                               if (b != l)\r
+                                       return;\r
+\r
+                               // Compress\r
+                               o[ot] = l;\r
+                               delete o[p + '-top' + s];\r
+                               delete o[p + '-right' + s];\r
+                               delete o[p + '-bottom' + s];\r
+                               delete o[p + '-left' + s];\r
+                       };\r
+\r
+                       function compress2(ta, a, b, c) {\r
+                               var t;\r
+\r
+                               t = o[a];\r
+                               if (!t)\r
+                                       return;\r
+\r
+                               t = o[b];\r
+                               if (!t)\r
+                                       return;\r
+\r
+                               t = o[c];\r
+                               if (!t)\r
+                                       return;\r
+\r
+                               // Compress\r
+                               o[ta] = o[a] + ' ' + o[b] + ' ' + o[c];\r
+                               delete o[a];\r
+                               delete o[b];\r
+                               delete o[c];\r
+                       };\r
+\r
+                       st = st.replace(/&(#?[a-z0-9]+);/g, '&$1_MCE_SEMI_'); // Protect entities\r
+\r
+                       each(st.split(';'), function(v) {\r
+                               var sv, ur = [];\r
+\r
+                               if (v) {\r
+                                       v = v.replace(/_MCE_SEMI_/g, ';'); // Restore entities\r
+                                       v = v.replace(/url\([^\)]+\)/g, function(v) {ur.push(v);return 'url(' + ur.length + ')';});\r
+                                       v = v.split(':');\r
+                                       sv = tinymce.trim(v[1]);\r
+                                       sv = sv.replace(/url\(([^\)]+)\)/g, function(a, b) {return ur[parseInt(b) - 1];});\r
+\r
+                                       sv = sv.replace(/rgb\([^\)]+\)/g, function(v) {\r
+                                               return t.toHex(v);\r
+                                       });\r
+\r
+                                       if (s.url_converter) {\r
+                                               sv = sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g, function(x, c) {\r
+                                                       return 'url(' + s.url_converter.call(s.url_converter_scope || t, t.decode(c), 'style', null) + ')';\r
+                                               });\r
+                                       }\r
+\r
+                                       o[tinymce.trim(v[0]).toLowerCase()] = sv;\r
+                               }\r
+                       });\r
+\r
+                       compress("border", "", "border");\r
+                       compress("border", "-width", "border-width");\r
+                       compress("border", "-color", "border-color");\r
+                       compress("border", "-style", "border-style");\r
+                       compress("padding", "", "padding");\r
+                       compress("margin", "", "margin");\r
+                       compress2('border', 'border-width', 'border-style', 'border-color');\r
+\r
+                       if (isIE) {\r
+                               // Remove pointless border\r
+                               if (o.border == 'medium none')\r
+                                       o.border = '';\r
+                       }\r
+\r
+                       return o;\r
+               },\r
+\r
+               serializeStyle : function(o, name) {\r
+                       var t = this, s = '';\r
+\r
+                       function add(v, k) {\r
+                               if (k && v) {\r
+                                       // Remove browser specific styles like -moz- or -webkit-\r
+                                       if (k.indexOf('-') === 0)\r
+                                               return;\r
+\r
+                                       switch (k) {\r
+                                               case 'font-weight':\r
+                                                       // Opera will output bold as 700\r
+                                                       if (v == 700)\r
+                                                               v = 'bold';\r
+\r
+                                                       break;\r
+\r
+                                               case 'color':\r
+                                               case 'background-color':\r
+                                                       v = v.toLowerCase();\r
+                                                       break;\r
+                                       }\r
+\r
+                                       s += (s ? ' ' : '') + k + ': ' + v + ';';\r
+                               }\r
+                       };\r
+\r
+                       // Validate style output\r
+                       if (name && t._styles) {\r
+                               each(t._styles['*'], function(name) {\r
+                                       add(o[name], name);\r
+                               });\r
+\r
+                               each(t._styles[name.toLowerCase()], function(name) {\r
+                                       add(o[name], name);\r
+                               });\r
+                       } else\r
+                               each(o, add);\r
+\r
+                       return s;\r
+               },\r
+\r
+               loadCSS : function(u) {\r
+                       var t = this, d = t.doc, head;\r
+\r
+                       if (!u)\r
+                               u = '';\r
+\r
+                       head = t.select('head')[0];\r
+\r
+                       each(u.split(','), function(u) {\r
+                               var link;\r
+\r
+                               if (t.files[u])\r
+                                       return;\r
+\r
+                               t.files[u] = true;\r
+                               link = t.create('link', {rel : 'stylesheet', href : tinymce._addVer(u)});\r
+\r
+                               // IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug\r
+                               // This fix seems to resolve that issue by realcing the document ones a stylesheet finishes loading\r
+                               // It's ugly but it seems to work fine.\r
+                               if (isIE && d.documentMode) {\r
+                                       link.onload = function() {\r
+                                               d.recalc();\r
+                                               link.onload = null;\r
+                                       };\r
+                               }\r
+\r
+                               head.appendChild(link);\r
+                       });\r
+               },\r
+\r
+               addClass : function(e, c) {\r
+                       return this.run(e, function(e) {\r
+                               var o;\r
+\r
+                               if (!c)\r
+                                       return 0;\r
+\r
+                               if (this.hasClass(e, c))\r
+                                       return e.className;\r
+\r
+                               o = this.removeClass(e, c);\r
+\r
+                               return e.className = (o != '' ? (o + ' ') : '') + c;\r
+                       });\r
+               },\r
+\r
+               removeClass : function(e, c) {\r
+                       var t = this, re;\r
+\r
+                       return t.run(e, function(e) {\r
+                               var v;\r
+\r
+                               if (t.hasClass(e, c)) {\r
+                                       if (!re)\r
+                                               re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g");\r
+\r
+                                       v = e.className.replace(re, ' ');\r
+                                       v = tinymce.trim(v != ' ' ? v : '');\r
+\r
+                                       e.className = v;\r
+\r
+                                       // Empty class attr\r
+                                       if (!v)\r
+                                               e.removeAttribute('class');\r
+\r
+                                       return v;\r
+                               }\r
+\r
+                               return e.className;\r
+                       });\r
+               },\r
+\r
+               hasClass : function(n, c) {\r
+                       n = this.get(n);\r
+\r
+                       if (!n || !c)\r
+                               return false;\r
+\r
+                       return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1;\r
+               },\r
+\r
+               show : function(e) {\r
+                       return this.setStyle(e, 'display', 'block');\r
+               },\r
+\r
+               hide : function(e) {\r
+                       return this.setStyle(e, 'display', 'none');\r
+               },\r
+\r
+               isHidden : function(e) {\r
+                       e = this.get(e);\r
+\r
+                       return !e || e.style.display == 'none' || this.getStyle(e, 'display') == 'none';\r
+               },\r
+\r
+               uniqueId : function(p) {\r
+                       return (!p ? 'mce_' : p) + (this.counter++);\r
+               },\r
+\r
+               setHTML : function(e, h) {\r
+                       var t = this;\r
+\r
+                       return this.run(e, function(e) {\r
+                               var x, i, nl, n, p, x;\r
+\r
+                               h = t.processHTML(h);\r
+\r
+                               if (isIE) {\r
+                                       function set() {\r
+                                               // Remove all child nodes\r
+                                               while (e.firstChild)\r
+                                                       e.firstChild.removeNode();\r
+\r
+                                               try {\r
+                                                       // IE will remove comments from the beginning\r
+                                                       // unless you padd the contents with something\r
+                                                       e.innerHTML = '<br />' + h;\r
+                                                       e.removeChild(e.firstChild);\r
+                                               } catch (ex) {\r
+                                                       // IE sometimes produces an unknown runtime error on innerHTML if it's an block element within a block element for example a div inside a p\r
+                                                       // This seems to fix this problem\r
+\r
+                                                       // Create new div with HTML contents and a BR infront to keep comments\r
+                                                       x = t.create('div');\r
+                                                       x.innerHTML = '<br />' + h;\r
+\r
+                                                       // Add all children from div to target\r
+                                                       each (x.childNodes, function(n, i) {\r
+                                                               // Skip br element\r
+                                                               if (i)\r
+                                                                       e.appendChild(n);\r
+                                                       });\r
+                                               }\r
+                                       };\r
+\r
+                                       // IE has a serious bug when it comes to paragraphs it can produce an invalid\r
+                                       // DOM tree if contents like this <p><ul><li>Item 1</li></ul></p> is inserted\r
+                                       // It seems to be that IE doesn't like a root block element placed inside another root block element\r
+                                       if (t.settings.fix_ie_paragraphs)\r
+                                               h = h.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi, '<p$1 _mce_keep="true">&nbsp;</p>');\r
+\r
+                                       set();\r
+\r
+                                       if (t.settings.fix_ie_paragraphs) {\r
+                                               // Check for odd paragraphs this is a sign of a broken DOM\r
+                                               nl = e.getElementsByTagName("p");\r
+                                               for (i = nl.length - 1, x = 0; i >= 0; i--) {\r
+                                                       n = nl[i];\r
+\r
+                                                       if (!n.hasChildNodes()) {\r
+                                                               if (!n._mce_keep) {\r
+                                                                       x = 1; // Is broken\r
+                                                                       break;\r
+                                                               }\r
+\r
+                                                               n.removeAttribute('_mce_keep');\r
+                                                       }\r
+                                               }\r
+                                       }\r
+\r
+                                       // Time to fix the madness IE left us\r
+                                       if (x) {\r
+                                               // So if we replace the p elements with divs and mark them and then replace them back to paragraphs\r
+                                               // after we use innerHTML we can fix the DOM tree\r
+                                               h = h.replace(/<p ([^>]+)>|<p>/ig, '<div $1 _mce_tmp="1">');\r
+                                               h = h.replace(/<\/p>/g, '</div>');\r
+\r
+                                               // Set the new HTML with DIVs\r
+                                               set();\r
+\r
+                                               // Replace all DIV elements with the _mce_tmp attibute back to paragraphs\r
+                                               // This is needed since IE has a annoying bug see above for details\r
+                                               // This is a slow process but it has to be done. :(\r
+                                               if (t.settings.fix_ie_paragraphs) {\r
+                                                       nl = e.getElementsByTagName("DIV");\r
+                                                       for (i = nl.length - 1; i >= 0; i--) {\r
+                                                               n = nl[i];\r
+\r
+                                                               // Is it a temp div\r
+                                                               if (n._mce_tmp) {\r
+                                                                       // Create new paragraph\r
+                                                                       p = t.doc.createElement('p');\r
+\r
+                                                                       // Copy all attributes\r
+                                                                       n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi, function(a, b) {\r
+                                                                               var v;\r
+\r
+                                                                               if (b !== '_mce_tmp') {\r
+                                                                                       v = n.getAttribute(b);\r
+\r
+                                                                                       if (!v && b === 'class')\r
+                                                                                               v = n.className;\r
+\r
+                                                                                       p.setAttribute(b, v);\r
+                                                                               }\r
+                                                                       });\r
+\r
+                                                                       // Append all children to new paragraph\r
+                                                                       for (x = 0; x<n.childNodes.length; x++)\r
+                                                                               p.appendChild(n.childNodes[x].cloneNode(true));\r
+\r
+                                                                       // Replace div with new paragraph\r
+                                                                       n.swapNode(p);\r
+                                                               }\r
+                                                       }\r
+                                               }\r
+                                       }\r
+                               } else\r
+                                       e.innerHTML = h;\r
+\r
+                               return h;\r
+                       });\r
+               },\r
+\r
+               processHTML : function(h) {\r
+                       var t = this, s = t.settings, codeBlocks = [];\r
+\r
+                       if (!s.process_html)\r
+                               return h;\r
+\r
+                       if (isIE) {\r
+                               h = h.replace(/&apos;/g, '&#39;'); // IE can't handle apos\r
+                               h = h.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi, ''); // IE doesn't handle default values correct\r
+                       }\r
+\r
+                       // Fix some issues\r
+                       h = h.replace(/<a( )([^>]+)\/>|<a\/>/gi, '<a$1$2></a>'); // Force open\r
+\r
+                       // Store away src and href in _mce_src and mce_href since browsers mess them up\r
+                       if (s.keep_values) {\r
+                               // Wrap scripts and styles in comments for serialization purposes\r
+                               if (/<script|noscript|style/i.test(h)) {\r
+                                       function trim(s) {\r
+                                               // Remove prefix and suffix code for element\r
+                                               s = s.replace(/(<!--\[CDATA\[|\]\]-->)/g, '\n');\r
+                                               s = s.replace(/^[\r\n]*|[\r\n]*$/g, '');\r
+                                               s = s.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g, '');\r
+                                               s = s.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g, '');\r
+\r
+                                               return s;\r
+                                       };\r
+\r
+                                       // Wrap the script contents in CDATA and keep them from executing\r
+                                       h = h.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/gi, function(v, attribs, text) {\r
+                                               // Force type attribute\r
+                                               if (!attribs)\r
+                                                       attribs = ' type="text/javascript"';\r
+\r
+                                               // Convert the src attribute of the scripts\r
+                                               attribs = attribs.replace(/src=\"([^\"]+)\"?/i, function(a, url) {\r
+                                                       if (s.url_converter)\r
+                                                               url = t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(url), 'src', 'script'));\r
+\r
+                                                       return '_mce_src="' + url + '"';\r
+                                               });\r
+\r
+                                               // Wrap text contents\r
+                                               if (tinymce.trim(text)) {\r
+                                                       codeBlocks.push(trim(text));\r
+                                                       text = '<!--\nMCE_SCRIPT:' + (codeBlocks.length - 1) + '\n// -->';\r
+                                               }\r
+\r
+                                               return '<mce:script' + attribs + '>' + text + '</mce:script>';\r
+                                       });\r
+\r
+                                       // Wrap style elements\r
+                                       h = h.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi, function(v, attribs, text) {\r
+                                               // Wrap text contents\r
+                                               if (text) {\r
+                                                       codeBlocks.push(trim(text));\r
+                                                       text = '<!--\nMCE_SCRIPT:' + (codeBlocks.length - 1) + '\n-->';\r
+                                               }\r
+\r
+                                               return '<mce:style' + attribs + '>' + text + '</mce:style><style ' + attribs + ' _mce_bogus="1">' + text + '</style>';\r
+                                       });\r
+\r
+                                       // Wrap noscript elements\r
+                                       h = h.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g, function(v, attribs, text) {\r
+                                               return '<mce:noscript' + attribs + '><!--' + t.encode(text).replace(/--/g, '&#45;&#45;') + '--></mce:noscript>';\r
+                                       });\r
+                               }\r
+\r
+                               h = h.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g, '<!--[CDATA[$1]]-->');\r
+\r
+                               // This function processes the attributes in the HTML string to force boolean\r
+                               // attributes to the attr="attr" format and convert style, src and href to _mce_ versions\r
+                               function processTags(html) {\r
+                                       return html.replace(tagRegExp, function(match, elm_name, attrs, end) {\r
+                                               return '<' + elm_name + attrs.replace(attrRegExp, function(match, name, value, val2, val3) {\r
+                                                       var mceValue;\r
+\r
+                                                       name = name.toLowerCase();\r
+                                                       value = value || val2 || val3 || "";\r
+\r
+                                                       // Treat boolean attributes\r
+                                                       if (boolAttrs[name]) {\r
+                                                               // false or 0 is treated as a missing attribute\r
+                                                               if (value === 'false' || value === '0')\r
+                                                                       return;\r
+\r
+                                                               return name + '="' + name + '"';\r
+                                                       }\r
+\r
+                                                       // Is attribute one that needs special treatment\r
+                                                       if (mceAttribs[name] && attrs.indexOf('_mce_' + name) == -1) {\r
+                                                               mceValue = t.decode(value);\r
+\r
+                                                               // Convert URLs to relative/absolute ones\r
+                                                               if (s.url_converter && (name == "src" || name == "href"))\r
+                                                                       mceValue = s.url_converter.call(s.url_converter_scope || t, mceValue, name, elm_name);\r
+\r
+                                                               // Process styles lowercases them and compresses them\r
+                                                               if (name == 'style')\r
+                                                                       mceValue = t.serializeStyle(t.parseStyle(mceValue), name);\r
+\r
+                                                               return name + '="' + value + '"' + ' _mce_' + name + '="' + t.encode(mceValue) + '"';\r
+                                                       }\r
+\r
+                                                       return match;\r
+                                               }) + end + '>';\r
+                                       });\r
+                               };\r
+\r
+                               h = processTags(h);\r
+\r
+                               // Restore script blocks\r
+                               h = h.replace(/MCE_SCRIPT:([0-9]+)/g, function(val, idx) {\r
+                                       return codeBlocks[idx];\r
+                               });\r
+                       }\r
+\r
+                       return h;\r
+               },\r
+\r
+               getOuterHTML : function(e) {\r
+                       var d;\r
+\r
+                       e = this.get(e);\r
+\r
+                       if (!e)\r
+                               return null;\r
+\r
+                       if (e.outerHTML !== undefined)\r
+                               return e.outerHTML;\r
+\r
+                       d = (e.ownerDocument || this.doc).createElement("body");\r
+                       d.appendChild(e.cloneNode(true));\r
+\r
+                       return d.innerHTML;\r
+               },\r
+\r
+               setOuterHTML : function(e, h, d) {\r
+                       var t = this;\r
+\r
+                       function setHTML(e, h, d) {\r
+                               var n, tp;\r
+\r
+                               tp = d.createElement("body");\r
+                               tp.innerHTML = h;\r
+\r
+                               n = tp.lastChild;\r
+                               while (n) {\r
+                                       t.insertAfter(n.cloneNode(true), e);\r
+                                       n = n.previousSibling;\r
+                               }\r
+\r
+                               t.remove(e);\r
+                       };\r
+\r
+                       return this.run(e, function(e) {\r
+                               e = t.get(e);\r
+\r
+                               // Only set HTML on elements\r
+                               if (e.nodeType == 1) {\r
+                                       d = d || e.ownerDocument || t.doc;\r
+\r
+                                       if (isIE) {\r
+                                               try {\r
+                                                       // Try outerHTML for IE it sometimes produces an unknown runtime error\r
+                                                       if (isIE && e.nodeType == 1)\r
+                                                               e.outerHTML = h;\r
+                                                       else\r
+                                                               setHTML(e, h, d);\r
+                                               } catch (ex) {\r
+                                                       // Fix for unknown runtime error\r
+                                                       setHTML(e, h, d);\r
+                                               }\r
+                                       } else\r
+                                               setHTML(e, h, d);\r
+                               }\r
+                       });\r
+               },\r
+\r
+               decode : function(s) {\r
+                       var e, n, v;\r
+\r
+                       // Look for entities to decode\r
+                       if (/&[\w#]+;/.test(s)) {\r
+                               // Decode the entities using a div element not super efficient but less code\r
+                               e = this.doc.createElement("div");\r
+                               e.innerHTML = s;\r
+                               n = e.firstChild;\r
+                               v = '';\r
+\r
+                               if (n) {\r
+                                       do {\r
+                                               v += n.nodeValue;\r
+                                       } while (n = n.nextSibling);\r
+                               }\r
+\r
+                               return v || s;\r
+                       }\r
+\r
+                       return s;\r
+               },\r
+\r
+               encode : function(str) {\r
+                       return ('' + str).replace(encodeCharsRe, function(chr) {\r
+                               return encodedChars[chr];\r
+                       });\r
+               },\r
+\r
+               insertAfter : function(node, reference_node) {\r
+                       reference_node = this.get(reference_node);\r
+\r
+                       return this.run(node, function(node) {\r
+                               var parent, nextSibling;\r
+\r
+                               parent = reference_node.parentNode;\r
+                               nextSibling = reference_node.nextSibling;\r
+\r
+                               if (nextSibling)\r
+                                       parent.insertBefore(node, nextSibling);\r
+                               else\r
+                                       parent.appendChild(node);\r
+\r
+                               return node;\r
+                       });\r
+               },\r
+\r
+               isBlock : function(n) {\r
+                       if (n.nodeType && n.nodeType !== 1)\r
+                               return false;\r
+\r
+                       n = n.nodeName || n;\r
+\r
+                       return blockRe.test(n);\r
+               },\r
+\r
+               replace : function(n, o, k) {\r
+                       var t = this;\r
+\r
+                       if (is(o, 'array'))\r
+                               n = n.cloneNode(true);\r
+\r
+                       return t.run(o, function(o) {\r
+                               if (k) {\r
+                                       each(tinymce.grep(o.childNodes), function(c) {\r
+                                               n.appendChild(c);\r
+                                       });\r
+                               }\r
+\r
+                               return o.parentNode.replaceChild(n, o);\r
+                       });\r
+               },\r
+\r
+               rename : function(elm, name) {\r
+                       var t = this, newElm;\r
+\r
+                       if (elm.nodeName != name.toUpperCase()) {\r
+                               // Rename block element\r
+                               newElm = t.create(name);\r
+\r
+                               // Copy attribs to new block\r
+                               each(t.getAttribs(elm), function(attr_node) {\r
+                                       t.setAttrib(newElm, attr_node.nodeName, t.getAttrib(elm, attr_node.nodeName));\r
+                               });\r
+\r
+                               // Replace block\r
+                               t.replace(newElm, elm, 1);\r
+                       }\r
+\r
+                       return newElm || elm;\r
+               },\r
+\r
+               findCommonAncestor : function(a, b) {\r
+                       var ps = a, pe;\r
+\r
+                       while (ps) {\r
+                               pe = b;\r
+\r
+                               while (pe && ps != pe)\r
+                                       pe = pe.parentNode;\r
+\r
+                               if (ps == pe)\r
+                                       break;\r
+\r
+                               ps = ps.parentNode;\r
+                       }\r
+\r
+                       if (!ps && a.ownerDocument)\r
+                               return a.ownerDocument.documentElement;\r
+\r
+                       return ps;\r
+               },\r
+\r
+               toHex : function(s) {\r
+                       var c = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);\r
+\r
+                       function hex(s) {\r
+                               s = parseInt(s).toString(16);\r
+\r
+                               return s.length > 1 ? s : '0' + s; // 0 -> 00\r
+                       };\r
+\r
+                       if (c) {\r
+                               s = '#' + hex(c[1]) + hex(c[2]) + hex(c[3]);\r
+\r
+                               return s;\r
+                       }\r
+\r
+                       return s;\r
+               },\r
+\r
+               getClasses : function() {\r
+                       var t = this, cl = [], i, lo = {}, f = t.settings.class_filter, ov;\r
+\r
+                       if (t.classes)\r
+                               return t.classes;\r
+\r
+                       function addClasses(s) {\r
+                               // IE style imports\r
+                               each(s.imports, function(r) {\r
+                                       addClasses(r);\r
+                               });\r
+\r
+                               each(s.cssRules || s.rules, function(r) {\r
+                                       // Real type or fake it on IE\r
+                                       switch (r.type || 1) {\r
+                                               // Rule\r
+                                               case 1:\r
+                                                       if (r.selectorText) {\r
+                                                               each(r.selectorText.split(','), function(v) {\r
+                                                                       v = v.replace(/^\s*|\s*$|^\s\./g, "");\r
+\r
+                                                                       // Is internal or it doesn't contain a class\r
+                                                                       if (/\.mce/.test(v) || !/\.[\w\-]+$/.test(v))\r
+                                                                               return;\r
+\r
+                                                                       // Remove everything but class name\r
+                                                                       ov = v;\r
+                                                                       v = v.replace(/.*\.([a-z0-9_\-]+).*/i, '$1');\r
+\r
+                                                                       // Filter classes\r
+                                                                       if (f && !(v = f(v, ov)))\r
+                                                                               return;\r
+\r
+                                                                       if (!lo[v]) {\r
+                                                                               cl.push({'class' : v});\r
+                                                                               lo[v] = 1;\r
+                                                                       }\r
+                                                               });\r
+                                                       }\r
+                                                       break;\r
+\r
+                                               // Import\r
+                                               case 3:\r
+                                                       addClasses(r.styleSheet);\r
+                                                       break;\r
+                                       }\r
+                               });\r
+                       };\r
+\r
+                       try {\r
+                               each(t.doc.styleSheets, addClasses);\r
+                       } catch (ex) {\r
+                               // Ignore\r
+                       }\r
+\r
+                       if (cl.length > 0)\r
+                               t.classes = cl;\r
+\r
+                       return cl;\r
+               },\r
+\r
+               run : function(e, f, s) {\r
+                       var t = this, o;\r
+\r
+                       if (t.doc && typeof(e) === 'string')\r
+                               e = t.get(e);\r
+\r
+                       if (!e)\r
+                               return false;\r
+\r
+                       s = s || this;\r
+                       if (!e.nodeType && (e.length || e.length === 0)) {\r
+                               o = [];\r
+\r
+                               each(e, function(e, i) {\r
+                                       if (e) {\r
+                                               if (typeof(e) == 'string')\r
+                                                       e = t.doc.getElementById(e);\r
+\r
+                                               o.push(f.call(s, e, i));\r
+                                       }\r
+                               });\r
+\r
+                               return o;\r
+                       }\r
+\r
+                       return f.call(s, e);\r
+               },\r
+\r
+               getAttribs : function(n) {\r
+                       var o;\r
+\r
+                       n = this.get(n);\r
+\r
+                       if (!n)\r
+                               return [];\r
+\r
+                       if (isIE) {\r
+                               o = [];\r
+\r
+                               // Object will throw exception in IE\r
+                               if (n.nodeName == 'OBJECT')\r
+                                       return n.attributes;\r
+\r
+                               // IE doesn't keep the selected attribute if you clone option elements\r
+                               if (n.nodeName === 'OPTION' && this.getAttrib(n, 'selected'))\r
+                                       o.push({specified : 1, nodeName : 'selected'});\r
+\r
+                               // It's crazy that this is faster in IE but it's because it returns all attributes all the time\r
+                               n.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi, '').replace(/[\w:\-]+/gi, function(a) {\r
+                                       o.push({specified : 1, nodeName : a});\r
+                               });\r
+\r
+                               return o;\r
+                       }\r
+\r
+                       return n.attributes;\r
+               },\r
+\r
+               destroy : function(s) {\r
+                       var t = this;\r
+\r
+                       if (t.events)\r
+                               t.events.destroy();\r
+\r
+                       t.win = t.doc = t.root = t.events = null;\r
+\r
+                       // Manual destroy then remove unload handler\r
+                       if (!s)\r
+                               tinymce.removeUnload(t.destroy);\r
+               },\r
+\r
+               createRng : function() {\r
+                       var d = this.doc;\r
+\r
+                       return d.createRange ? d.createRange() : new tinymce.dom.Range(this);\r
+               },\r
+\r
+               nodeIndex : function(node, normalized) {\r
+                       var idx = 0, lastNode, nodeType;\r
+\r
+                       if (node) {\r
+                               for (node = node.previousSibling, lastNode = node; node; node = node.previousSibling) {\r
+                                       nodeType = node.nodeType;\r
+\r
+                                       // Text nodes needs special treatment if the normalized argument is specified\r
+                                       if (normalized && nodeType == 3) {\r
+                                               // Checks if the current node has contents and that the last node is a non text node or empty\r
+                                               if (node.nodeValue.length > 0 && (lastNode.nodeType != nodeType || lastNode.nodeValue.length === 0))\r
+                                                       idx++;\r
+                                       } else\r
+                                               idx++;\r
+\r
+                                       lastNode = node;\r
+                               }\r
+                       }\r
+\r
+                       return idx;\r
+               },\r
+\r
+               split : function(pe, e, re) {\r
+                       var t = this, r = t.createRng(), bef, aft, pa;\r
+\r
+                       // W3C valid browsers tend to leave empty nodes to the left/right side of the contents, this makes sense\r
+                       // but we don't want that in our code since it serves no purpose for the end user\r
+                       // For example if this is chopped:\r
+                       //   <p>text 1<span><b>CHOP</b></span>text 2</p>\r
+                       // would produce:\r
+                       //   <p>text 1<span></span></p><b>CHOP</b><p><span></span>text 2</p>\r
+                       // this function will then trim of empty edges and produce:\r
+                       //   <p>text 1</p><b>CHOP</b><p>text 2</p>\r
+                       function trim(node) {\r
+                               var i, children = node.childNodes;\r
+\r
+                               if (node.nodeType == 1 && node.getAttribute('_mce_type') == 'bookmark')\r
+                                       return;\r
+\r
+                               for (i = children.length - 1; i >= 0; i--)\r
+                                       trim(children[i]);\r
+\r
+                               if (node.nodeType != 9) {\r
+                                       // Keep non whitespace text nodes\r
+                                       if (node.nodeType == 3 && node.nodeValue.length > 0)\r
+                                               return;\r
+\r
+                                       if (node.nodeType == 1) {\r
+                                               // If the only child is a bookmark then move it up\r
+                                               children = node.childNodes;\r
+                                               if (children.length == 1 && children[0] && children[0].nodeType == 1 && children[0].getAttribute('_mce_type') == 'bookmark')\r
+                                                       node.parentNode.insertBefore(children[0], node);\r
+\r
+                                               // Keep non empty elements or img, hr etc\r
+                                               if (children.length || /^(br|hr|input|img)$/i.test(node.nodeName))\r
+                                                       return;\r
+                                       }\r
+\r
+                                       t.remove(node);\r
+                               }\r
+\r
+                               return node;\r
+                       };\r
+\r
+                       if (pe && e) {\r
+                               // Get before chunk\r
+                               r.setStart(pe.parentNode, t.nodeIndex(pe));\r
+                               r.setEnd(e.parentNode, t.nodeIndex(e));\r
+                               bef = r.extractContents();\r
+\r
+                               // Get after chunk\r
+                               r = t.createRng();\r
+                               r.setStart(e.parentNode, t.nodeIndex(e) + 1);\r
+                               r.setEnd(pe.parentNode, t.nodeIndex(pe) + 1);\r
+                               aft = r.extractContents();\r
+\r
+                               // Insert before chunk\r
+                               pa = pe.parentNode;\r
+                               pa.insertBefore(trim(bef), pe);\r
+\r
+                               // Insert middle chunk\r
+                               if (re)\r
+                                       pa.replaceChild(re, e);\r
+                               else\r
+                                       pa.insertBefore(e, pe);\r
+\r
+                               // Insert after chunk\r
+                               pa.insertBefore(trim(aft), pe);\r
+                               t.remove(pe);\r
+\r
+                               return re || e;\r
+                       }\r
+               },\r
+\r
+               bind : function(target, name, func, scope) {\r
+                       var t = this;\r
+\r
+                       if (!t.events)\r
+                               t.events = new tinymce.dom.EventUtils();\r
+\r
+                       return t.events.add(target, name, func, scope || this);\r
+               },\r
+\r
+               unbind : function(target, name, func) {\r
+                       var t = this;\r
+\r
+                       if (!t.events)\r
+                               t.events = new tinymce.dom.EventUtils();\r
+\r
+                       return t.events.remove(target, name, func);\r
+               },\r
+\r
+\r
+               _findSib : function(node, selector, name) {\r
+                       var t = this, f = selector;\r
+\r
+                       if (node) {\r
+                               // If expression make a function of it using is\r
+                               if (is(f, 'string')) {\r
+                                       f = function(node) {\r
+                                               return t.is(node, selector);\r
+                                       };\r
+                               }\r
+\r
+                               // Loop all siblings\r
+                               for (node = node[name]; node; node = node[name]) {\r
+                                       if (f(node))\r
+                                               return node;\r
+                               }\r
+                       }\r
+\r
+                       return null;\r
+               },\r
+\r
+               _isRes : function(c) {\r
+                       // Is live resizble element\r
+                       return /^(top|left|bottom|right|width|height)/i.test(c) || /;\s*(top|left|bottom|right|width|height)/i.test(c);\r
+               }\r
+\r
+               /*\r
+               walk : function(n, f, s) {\r
+                       var d = this.doc, w;\r
+\r
+                       if (d.createTreeWalker) {\r
+                               w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);\r
+\r
+                               while ((n = w.nextNode()) != null)\r
+                                       f.call(s || this, n);\r
+                       } else\r
+                               tinymce.walk(n, f, 'childNodes', s);\r
+               }\r
+               */\r
+\r
+               /*\r
+               toRGB : function(s) {\r
+                       var c = /^\s*?#([0-9A-F]{2})([0-9A-F]{1,2})([0-9A-F]{2})?\s*?$/.exec(s);\r
+\r
+                       if (c) {\r
+                               // #FFF -> #FFFFFF\r
+                               if (!is(c[3]))\r
+                                       c[3] = c[2] = c[1];\r
+\r
+                               return "rgb(" + parseInt(c[1], 16) + "," + parseInt(c[2], 16) + "," + parseInt(c[3], 16) + ")";\r
+                       }\r
+\r
+                       return s;\r
+               }\r
+               */\r
+       });\r
+\r
+       tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0});\r
+})(tinymce);\r
+\r
+(function(ns) {\r
+       // Range constructor\r
+       function Range(dom) {\r
+               var t = this,\r
+                       doc = dom.doc,\r
+                       EXTRACT = 0,\r
+                       CLONE = 1,\r
+                       DELETE = 2,\r
+                       TRUE = true,\r
+                       FALSE = false,\r
+                       START_OFFSET = 'startOffset',\r
+                       START_CONTAINER = 'startContainer',\r
+                       END_CONTAINER = 'endContainer',\r
+                       END_OFFSET = 'endOffset',\r
+                       extend = tinymce.extend,\r
+                       nodeIndex = dom.nodeIndex;\r
+\r
+               extend(t, {\r
+                       // Inital states\r
+                       startContainer : doc,\r
+                       startOffset : 0,\r
+                       endContainer : doc,\r
+                       endOffset : 0,\r
+                       collapsed : TRUE,\r
+                       commonAncestorContainer : doc,\r
+\r
+                       // Range constants\r
+                       START_TO_START : 0,\r
+                       START_TO_END : 1,\r
+                       END_TO_END : 2,\r
+                       END_TO_START : 3,\r
+\r
+                       // Public methods\r
+                       setStart : setStart,\r
+                       setEnd : setEnd,\r
+                       setStartBefore : setStartBefore,\r
+                       setStartAfter : setStartAfter,\r
+                       setEndBefore : setEndBefore,\r
+                       setEndAfter : setEndAfter,\r
+                       collapse : collapse,\r
+                       selectNode : selectNode,\r
+                       selectNodeContents : selectNodeContents,\r
+                       compareBoundaryPoints : compareBoundaryPoints,\r
+                       deleteContents : deleteContents,\r
+                       extractContents : extractContents,\r
+                       cloneContents : cloneContents,\r
+                       insertNode : insertNode,\r
+                       surroundContents : surroundContents,\r
+                       cloneRange : cloneRange\r
+               });\r
+\r
+               function setStart(n, o) {\r
+                       _setEndPoint(TRUE, n, o);\r
+               };\r
+\r
+               function setEnd(n, o) {\r
+                       _setEndPoint(FALSE, n, o);\r
+               };\r
+\r
+               function setStartBefore(n) {\r
+                       setStart(n.parentNode, nodeIndex(n));\r
+               };\r
+\r
+               function setStartAfter(n) {\r
+                       setStart(n.parentNode, nodeIndex(n) + 1);\r
+               };\r
+\r
+               function setEndBefore(n) {\r
+                       setEnd(n.parentNode, nodeIndex(n));\r
+               };\r
+\r
+               function setEndAfter(n) {\r
+                       setEnd(n.parentNode, nodeIndex(n) + 1);\r
+               };\r
+\r
+               function collapse(ts) {\r
+                       if (ts) {\r
+                               t[END_CONTAINER] = t[START_CONTAINER];\r
+                               t[END_OFFSET] = t[START_OFFSET];\r
+                       } else {\r
+                               t[START_CONTAINER] = t[END_CONTAINER];\r
+                               t[START_OFFSET] = t[END_OFFSET];\r
+                       }\r
+\r
+                       t.collapsed = TRUE;\r
+               };\r
+\r
+               function selectNode(n) {\r
+                       setStartBefore(n);\r
+                       setEndAfter(n);\r
+               };\r
+\r
+               function selectNodeContents(n) {\r
+                       setStart(n, 0);\r
+                       setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length);\r
+               };\r
+\r
+               function compareBoundaryPoints(h, r) {\r
+                       var sc = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[END_OFFSET];\r
+\r
+                       // Check START_TO_START\r
+                       if (h === 0)\r
+                               return _compareBoundaryPoints(sc, so, sc, so);\r
+\r
+                       // Check START_TO_END\r
+                       if (h === 1)\r
+                               return _compareBoundaryPoints(sc, so, ec, eo);\r
+\r
+                       // Check END_TO_END\r
+                       if (h === 2)\r
+                               return _compareBoundaryPoints(ec, eo, ec, eo);\r
+\r
+                       // Check END_TO_START\r
+                       if (h === 3)\r
+                               return _compareBoundaryPoints(ec, eo, sc, so);\r
+               };\r
+\r
+               function deleteContents() {\r
+                       _traverse(DELETE);\r
+               };\r
+\r
+               function extractContents() {\r
+                       return _traverse(EXTRACT);\r
+               };\r
+\r
+               function cloneContents() {\r
+                       return _traverse(CLONE);\r
+               };\r
+\r
+               function insertNode(n) {\r
+                       var startContainer = this[START_CONTAINER],\r
+                               startOffset = this[START_OFFSET], nn, o;\r
+\r
+                       // Node is TEXT_NODE or CDATA\r
+                       if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) {\r
+                               if (!startOffset) {\r
+                                       // At the start of text\r
+                                       startContainer.parentNode.insertBefore(n, startContainer);\r
+                               } else if (startOffset >= startContainer.nodeValue.length) {\r
+                                       // At the end of text\r
+                                       dom.insertAfter(n, startContainer);\r
+                               } else {\r
+                                       // Middle, need to split\r
+                                       nn = startContainer.splitText(startOffset);\r
+                                       startContainer.parentNode.insertBefore(n, nn);\r
+                               }\r
+                       } else {\r
+                               // Insert element node\r
+                               if (startContainer.childNodes.length > 0)\r
+                                       o = startContainer.childNodes[startOffset];\r
+\r
+                               if (o)\r
+                                       startContainer.insertBefore(n, o);\r
+                               else\r
+                                       startContainer.appendChild(n);\r
+                       }\r
+               };\r
+\r
+               function surroundContents(n) {\r
+                       var f = t.extractContents();\r
+\r
+                       t.insertNode(n);\r
+                       n.appendChild(f);\r
+                       t.selectNode(n);\r
+               };\r
+\r
+               function cloneRange() {\r
+                       return extend(new Range(dom), {\r
+                               startContainer : t[START_CONTAINER],\r
+                               startOffset : t[START_OFFSET],\r
+                               endContainer : t[END_CONTAINER],\r
+                               endOffset : t[END_OFFSET],\r
+                               collapsed : t.collapsed,\r
+                               commonAncestorContainer : t.commonAncestorContainer\r
+                       });\r
+               };\r
+\r
+               // Private methods\r
+\r
+               function _getSelectedNode(container, offset) {\r
+                       var child;\r
+\r
+                       if (container.nodeType == 3 /* TEXT_NODE */)\r
+                               return container;\r
+\r
+                       if (offset < 0)\r
+                               return container;\r
+\r
+                       child = container.firstChild;\r
+                       while (child && offset > 0) {\r
+                               --offset;\r
+                               child = child.nextSibling;\r
+                       }\r
+\r
+                       if (child)\r
+                               return child;\r
+\r
+                       return container;\r
+               };\r
+\r
+               function _isCollapsed() {\r
+                       return (t[START_CONTAINER] == t[END_CONTAINER] && t[START_OFFSET] == t[END_OFFSET]);\r
+               };\r
+\r
+               function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) {\r
+                       var c, offsetC, n, cmnRoot, childA, childB;\r
+\r
+                       // In the first case the boundary-points have the same container. A is before B\r
+                       // if its offset is less than the offset of B, A is equal to B if its offset is\r
+                       // equal to the offset of B, and A is after B if its offset is greater than the\r
+                       // offset of B.\r
+                       if (containerA == containerB) {\r
+                               if (offsetA == offsetB)\r
+                                       return 0; // equal\r
+\r
+                               if (offsetA < offsetB)\r
+                                       return -1; // before\r
+\r
+                               return 1; // after\r
+                       }\r
+\r
+                       // In the second case a child node C of the container of A is an ancestor\r
+                       // container of B. In this case, A is before B if the offset of A is less than or\r
+                       // equal to the index of the child node C and A is after B otherwise.\r
+                       c = containerB;\r
+                       while (c && c.parentNode != containerA)\r
+                               c = c.parentNode;\r
+\r
+                       if (c) {\r
+                               offsetC = 0;\r
+                               n = containerA.firstChild;\r
+\r
+                               while (n != c && offsetC < offsetA) {\r
+                                       offsetC++;\r
+                                       n = n.nextSibling;\r
+                               }\r
+\r
+                               if (offsetA <= offsetC)\r
+                                       return -1; // before\r
+\r
+                               return 1; // after\r
+                       }\r
+\r
+                       // In the third case a child node C of the container of B is an ancestor container\r
+                       // of A. In this case, A is before B if the index of the child node C is less than\r
+                       // the offset of B and A is after B otherwise.\r
+                       c = containerA;\r
+                       while (c && c.parentNode != containerB) {\r
+                               c = c.parentNode;\r
+                       }\r
+\r
+                       if (c) {\r
+                               offsetC = 0;\r
+                               n = containerB.firstChild;\r
+\r
+                               while (n != c && offsetC < offsetB) {\r
+                                       offsetC++;\r
+                                       n = n.nextSibling;\r
+                               }\r
+\r
+                               if (offsetC < offsetB)\r
+                                       return -1; // before\r
+\r
+                               return 1; // after\r
+                       }\r
+\r
+                       // In the fourth case, none of three other cases hold: the containers of A and B\r
+                       // are siblings or descendants of sibling nodes. In this case, A is before B if\r
+                       // the container of A is before the container of B in a pre-order traversal of the\r
+                       // Ranges' context tree and A is after B otherwise.\r
+                       cmnRoot = dom.findCommonAncestor(containerA, containerB);\r
+                       childA = containerA;\r
+\r
+                       while (childA && childA.parentNode != cmnRoot)\r
+                               childA = childA.parentNode;\r
+\r
+                       if (!childA)\r
+                               childA = cmnRoot;\r
+\r
+                       childB = containerB;\r
+                       while (childB && childB.parentNode != cmnRoot)\r
+                               childB = childB.parentNode;\r
+\r
+                       if (!childB)\r
+                               childB = cmnRoot;\r
+\r
+                       if (childA == childB)\r
+                               return 0; // equal\r
+\r
+                       n = cmnRoot.firstChild;\r
+                       while (n) {\r
+                               if (n == childA)\r
+                                       return -1; // before\r
+\r
+                               if (n == childB)\r
+                                       return 1; // after\r
+\r
+                               n = n.nextSibling;\r
+                       }\r
+               };\r
+\r
+               function _setEndPoint(st, n, o) {\r
+                       var ec, sc;\r
+\r
+                       if (st) {\r
+                               t[START_CONTAINER] = n;\r
+                               t[START_OFFSET] = o;\r
+                       } else {\r
+                               t[END_CONTAINER] = n;\r
+                               t[END_OFFSET] = o;\r
+                       }\r
+\r
+                       // If one boundary-point of a Range is set to have a root container\r
+                       // other than the current one for the Range, the Range is collapsed to\r
+                       // the new position. This enforces the restriction that both boundary-\r
+                       // points of a Range must have the same root container.\r
+                       ec = t[END_CONTAINER];\r
+                       while (ec.parentNode)\r
+                               ec = ec.parentNode;\r
+\r
+                       sc = t[START_CONTAINER];\r
+                       while (sc.parentNode)\r
+                               sc = sc.parentNode;\r
+\r
+                       if (sc == ec) {\r
+                               // The start position of a Range is guaranteed to never be after the\r
+                               // end position. To enforce this restriction, if the start is set to\r
+                               // be at a position after the end, the Range is collapsed to that\r
+                               // position.\r
+                               if (_compareBoundaryPoints(t[START_CONTAINER], t[START_OFFSET], t[END_CONTAINER], t[END_OFFSET]) > 0)\r
+                                       t.collapse(st);\r
+                       } else\r
+                               t.collapse(st);\r
+\r
+                       t.collapsed = _isCollapsed();\r
+                       t.commonAncestorContainer = dom.findCommonAncestor(t[START_CONTAINER], t[END_CONTAINER]);\r
+               };\r
+\r
+               function _traverse(how) {\r
+                       var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep;\r
+\r
+                       if (t[START_CONTAINER] == t[END_CONTAINER])\r
+                               return _traverseSameContainer(how);\r
+\r
+                       for (c = t[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {\r
+                               if (p == t[START_CONTAINER])\r
+                                       return _traverseCommonStartContainer(c, how);\r
+\r
+                               ++endContainerDepth;\r
+                       }\r
+\r
+                       for (c = t[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {\r
+                               if (p == t[END_CONTAINER])\r
+                                       return _traverseCommonEndContainer(c, how);\r
+\r
+                               ++startContainerDepth;\r
+                       }\r
+\r
+                       depthDiff = startContainerDepth - endContainerDepth;\r
+\r
+                       startNode = t[START_CONTAINER];\r
+                       while (depthDiff > 0) {\r
+                               startNode = startNode.parentNode;\r
+                               depthDiff--;\r
+                       }\r
+\r
+                       endNode = t[END_CONTAINER];\r
+                       while (depthDiff < 0) {\r
+                               endNode = endNode.parentNode;\r
+                               depthDiff++;\r
+                       }\r
+\r
+                       // ascend the ancestor hierarchy until we have a common parent.\r
+                       for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) {\r
+                               startNode = sp;\r
+                               endNode = ep;\r
+                       }\r
+\r
+                       return _traverseCommonAncestors(startNode, endNode, how);\r
+               };\r
+\r
+                function _traverseSameContainer(how) {\r
+                       var frag, s, sub, n, cnt, sibling, xferNode;\r
+\r
+                       if (how != DELETE)\r
+                               frag = doc.createDocumentFragment();\r
+\r
+                       // If selection is empty, just return the fragment\r
+                       if (t[START_OFFSET] == t[END_OFFSET])\r
+                               return frag;\r
+\r
+                       // Text node needs special case handling\r
+                       if (t[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) {\r
+                               // get the substring\r
+                               s = t[START_CONTAINER].nodeValue;\r
+                               sub = s.substring(t[START_OFFSET], t[END_OFFSET]);\r
+\r
+                               // set the original text node to its new value\r
+                               if (how != CLONE) {\r
+                                       t[START_CONTAINER].deleteData(t[START_OFFSET], t[END_OFFSET] - t[START_OFFSET]);\r
+\r
+                                       // Nothing is partially selected, so collapse to start point\r
+                                       t.collapse(TRUE);\r
+                               }\r
+\r
+                               if (how == DELETE)\r
+                                       return;\r
+\r
+                               frag.appendChild(doc.createTextNode(sub));\r
+                               return frag;\r
+                       }\r
+\r
+                       // Copy nodes between the start/end offsets.\r
+                       n = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]);\r
+                       cnt = t[END_OFFSET] - t[START_OFFSET];\r
+\r
+                       while (cnt > 0) {\r
+                               sibling = n.nextSibling;\r
+                               xferNode = _traverseFullySelected(n, how);\r
+\r
+                               if (frag)\r
+                                       frag.appendChild( xferNode );\r
+\r
+                               --cnt;\r
+                               n = sibling;\r
+                       }\r
+\r
+                       // Nothing is partially selected, so collapse to start point\r
+                       if (how != CLONE)\r
+                               t.collapse(TRUE);\r
+\r
+                       return frag;\r
+               };\r
+\r
+               function _traverseCommonStartContainer(endAncestor, how) {\r
+                       var frag, n, endIdx, cnt, sibling, xferNode;\r
+\r
+                       if (how != DELETE)\r
+                               frag = doc.createDocumentFragment();\r
+\r
+                       n = _traverseRightBoundary(endAncestor, how);\r
+\r
+                       if (frag)\r
+                               frag.appendChild(n);\r
+\r
+                       endIdx = nodeIndex(endAncestor);\r
+                       cnt = endIdx - t[START_OFFSET];\r
+\r
+                       if (cnt <= 0) {\r
+                               // Collapse to just before the endAncestor, which\r
+                               // is partially selected.\r
+                               if (how != CLONE) {\r
+                                       t.setEndBefore(endAncestor);\r
+                                       t.collapse(FALSE);\r
+                               }\r
+\r
+                               return frag;\r
+                       }\r
+\r
+                       n = endAncestor.previousSibling;\r
+                       while (cnt > 0) {\r
+                               sibling = n.previousSibling;\r
+                               xferNode = _traverseFullySelected(n, how);\r
+\r
+                               if (frag)\r
+                                       frag.insertBefore(xferNode, frag.firstChild);\r
+\r
+                               --cnt;\r
+                               n = sibling;\r
+                       }\r
+\r
+                       // Collapse to just before the endAncestor, which\r
+                       // is partially selected.\r
+                       if (how != CLONE) {\r
+                               t.setEndBefore(endAncestor);\r
+                               t.collapse(FALSE);\r
+                       }\r
+\r
+                       return frag;\r
+               };\r
+\r
+               function _traverseCommonEndContainer(startAncestor, how) {\r
+                       var frag, startIdx, n, cnt, sibling, xferNode;\r
+\r
+                       if (how != DELETE)\r
+                               frag = doc.createDocumentFragment();\r
+\r
+                       n = _traverseLeftBoundary(startAncestor, how);\r
+                       if (frag)\r
+                               frag.appendChild(n);\r
+\r
+                       startIdx = nodeIndex(startAncestor);\r
+                       ++startIdx;  // Because we already traversed it....\r
+\r
+                       cnt = t[END_OFFSET] - startIdx;\r
+                       n = startAncestor.nextSibling;\r
+                       while (cnt > 0) {\r
+                               sibling = n.nextSibling;\r
+                               xferNode = _traverseFullySelected(n, how);\r
+\r
+                               if (frag)\r
+                                       frag.appendChild(xferNode);\r
+\r
+                               --cnt;\r
+                               n = sibling;\r
+                       }\r
+\r
+                       if (how != CLONE) {\r
+                               t.setStartAfter(startAncestor);\r
+                               t.collapse(TRUE);\r
+                       }\r
+\r
+                       return frag;\r
+               };\r
+\r
+               function _traverseCommonAncestors(startAncestor, endAncestor, how) {\r
+                       var n, frag, commonParent, startOffset, endOffset, cnt, sibling, nextSibling;\r
+\r
+                       if (how != DELETE)\r
+                               frag = doc.createDocumentFragment();\r
+\r
+                       n = _traverseLeftBoundary(startAncestor, how);\r
+                       if (frag)\r
+                               frag.appendChild(n);\r
+\r
+                       commonParent = startAncestor.parentNode;\r
+                       startOffset = nodeIndex(startAncestor);\r
+                       endOffset = nodeIndex(endAncestor);\r
+                       ++startOffset;\r
+\r
+                       cnt = endOffset - startOffset;\r
+                       sibling = startAncestor.nextSibling;\r
+\r
+                       while (cnt > 0) {\r
+                               nextSibling = sibling.nextSibling;\r
+                               n = _traverseFullySelected(sibling, how);\r
+\r
+                               if (frag)\r
+                                       frag.appendChild(n);\r
+\r
+                               sibling = nextSibling;\r
+                               --cnt;\r
+                       }\r
+\r
+                       n = _traverseRightBoundary(endAncestor, how);\r
+\r
+                       if (frag)\r
+                               frag.appendChild(n);\r
+\r
+                       if (how != CLONE) {\r
+                               t.setStartAfter(startAncestor);\r
+                               t.collapse(TRUE);\r
+                       }\r
+\r
+                       return frag;\r
+               };\r
+\r
+               function _traverseRightBoundary(root, how) {\r
+                       var next = _getSelectedNode(t[END_CONTAINER], t[END_OFFSET] - 1), parent, clonedParent, prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != t[END_CONTAINER];\r
+\r
+                       if (next == root)\r
+                               return _traverseNode(next, isFullySelected, FALSE, how);\r
+\r
+                       parent = next.parentNode;\r
+                       clonedParent = _traverseNode(parent, FALSE, FALSE, how);\r
+\r
+                       while (parent) {\r
+                               while (next) {\r
+                                       prevSibling = next.previousSibling;\r
+                                       clonedChild = _traverseNode(next, isFullySelected, FALSE, how);\r
+\r
+                                       if (how != DELETE)\r
+                                               clonedParent.insertBefore(clonedChild, clonedParent.firstChild);\r
+\r
+                                       isFullySelected = TRUE;\r
+                                       next = prevSibling;\r
+                               }\r
+\r
+                               if (parent == root)\r
+                                       return clonedParent;\r
+\r
+                               next = parent.previousSibling;\r
+                               parent = parent.parentNode;\r
+\r
+                               clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how);\r
+\r
+                               if (how != DELETE)\r
+                                       clonedGrandParent.appendChild(clonedParent);\r
+\r
+                               clonedParent = clonedGrandParent;\r
+                       }\r
+               };\r
+\r
+               function _traverseLeftBoundary(root, how) {\r
+                       var next = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]), isFullySelected = next != t[START_CONTAINER], parent, clonedParent, nextSibling, clonedChild, clonedGrandParent;\r
+\r
+                       if (next == root)\r
+                               return _traverseNode(next, isFullySelected, TRUE, how);\r
+\r
+                       parent = next.parentNode;\r
+                       clonedParent = _traverseNode(parent, FALSE, TRUE, how);\r
+\r
+                       while (parent) {\r
+                               while (next) {\r
+                                       nextSibling = next.nextSibling;\r
+                                       clonedChild = _traverseNode(next, isFullySelected, TRUE, how);\r
+\r
+                                       if (how != DELETE)\r
+                                               clonedParent.appendChild(clonedChild);\r
+\r
+                                       isFullySelected = TRUE;\r
+                                       next = nextSibling;\r
+                               }\r
+\r
+                               if (parent == root)\r
+                                       return clonedParent;\r
+\r
+                               next = parent.nextSibling;\r
+                               parent = parent.parentNode;\r
+\r
+                               clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how);\r
+\r
+                               if (how != DELETE)\r
+                                       clonedGrandParent.appendChild(clonedParent);\r
+\r
+                               clonedParent = clonedGrandParent;\r
+                       }\r
+               };\r
+\r
+               function _traverseNode(n, isFullySelected, isLeft, how) {\r
+                       var txtValue, newNodeValue, oldNodeValue, offset, newNode;\r
+\r
+                       if (isFullySelected)\r
+                               return _traverseFullySelected(n, how);\r
+\r
+                       if (n.nodeType == 3 /* TEXT_NODE */) {\r
+                               txtValue = n.nodeValue;\r
+\r
+                               if (isLeft) {\r
+                                       offset = t[START_OFFSET];\r
+                                       newNodeValue = txtValue.substring(offset);\r
+                                       oldNodeValue = txtValue.substring(0, offset);\r
+                               } else {\r
+                                       offset = t[END_OFFSET];\r
+                                       newNodeValue = txtValue.substring(0, offset);\r
+                                       oldNodeValue = txtValue.substring(offset);\r
+                               }\r
+\r
+                               if (how != CLONE)\r
+                                       n.nodeValue = oldNodeValue;\r
+\r
+                               if (how == DELETE)\r
+                                       return;\r
+\r
+                               newNode = n.cloneNode(FALSE);\r
+                               newNode.nodeValue = newNodeValue;\r
+\r
+                               return newNode;\r
+                       }\r
+\r
+                       if (how == DELETE)\r
+                               return;\r
+\r
+                       return n.cloneNode(FALSE);\r
+               };\r
+\r
+               function _traverseFullySelected(n, how) {\r
+                       if (how != DELETE)\r
+                               return how == CLONE ? n.cloneNode(TRUE) : n;\r
+\r
+                       n.parentNode.removeChild(n);\r
+               };\r
+       };\r
+\r
+       ns.Range = Range;\r
+})(tinymce.dom);\r
+\r
+(function() {\r
+       function Selection(selection) {\r
+               var t = this, invisibleChar = '\uFEFF', range, lastIERng, dom = selection.dom, TRUE = true, FALSE = false;\r
+\r
+               // Compares two IE specific ranges to see if they are different\r
+               // this method is useful when invalidating the cached selection range\r
+               function compareRanges(rng1, rng2) {\r
+                       if (rng1 && rng2) {\r
+                               // Both are control ranges and the selected element matches\r
+                               if (rng1.item && rng2.item && rng1.item(0) === rng2.item(0))\r
+                                       return TRUE;\r
+\r
+                               // Both are text ranges and the range matches\r
+                               if (rng1.isEqual && rng2.isEqual && rng2.isEqual(rng1)) {\r
+                                       // IE will say that the range is equal then produce an invalid argument exception\r
+                                       // if you perform specific operations in a keyup event. For example Ctrl+Del.\r
+                                       // This hack will invalidate the range cache if the exception occurs\r
+                                       try {\r
+                                               // Try accessing nextSibling will producer an invalid argument some times\r
+                                               range.startContainer.nextSibling;\r
+                                               return TRUE;\r
+                                       } catch (ex) {\r
+                                               // Ignore\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+                       return FALSE;\r
+               };\r
+\r
+               // Returns a W3C DOM compatible range object by using the IE Range API\r
+               function getRange() {\r
+                       var ieRange = selection.getRng(), domRange = dom.createRng(), ieRange2, element, collapsed, isMerged;\r
+\r
+                       // If selection is outside the current document just return an empty range\r
+                       element = ieRange.item ? ieRange.item(0) : ieRange.parentElement();\r
+                       if (element.ownerDocument != dom.doc)\r
+                               return domRange;\r
+\r
+                       // Handle control selection or text selection of a image\r
+                       if (ieRange.item || !element.hasChildNodes()) {\r
+                               domRange.setStart(element.parentNode, dom.nodeIndex(element));\r
+                               domRange.setEnd(domRange.startContainer, domRange.startOffset + 1);\r
+\r
+                               return domRange;\r
+                       }\r
+\r
+                       // Duplicare IE selection range and check if the range is collapsed\r
+                       ieRange2 = ieRange.duplicate();\r
+                       collapsed = selection.isCollapsed();\r
+\r
+                       // Insert invisible start marker\r
+                       ieRange.collapse();\r
+                       ieRange.pasteHTML('<span id="_mce_start" style="display:none;line-height:0">' + invisibleChar + '</span>');\r
+\r
+                       // Insert invisible end marker\r
+                       if (!collapsed) {\r
+                               ieRange2.collapse(FALSE);\r
+                               ieRange2.pasteHTML('<span id="_mce_end" style="display:none;line-height:0">' + invisibleChar + '</span>');\r
+                       }\r
+\r
+                       // Sets the end point of the range by looking for the marker\r
+                       // This method also merges the text nodes it splits so that\r
+                       // the DOM doesn't get fragmented.\r
+                       function setEndPoint(start) {\r
+                               var container, offset, marker, sibling;\r
+\r
+                               // Look for endpoint marker\r
+                               marker = dom.get('_mce_' + (start ? 'start' : 'end'));\r
+                               sibling = marker.previousSibling;\r
+\r
+                               // Is marker after a text node\r
+                               if (sibling && sibling.nodeType == 3) {\r
+                                       // Get container node and calc offset\r
+                                       container = sibling;\r
+                                       offset = container.nodeValue.length;\r
+                                       dom.remove(marker);\r
+\r
+                                       // Merge text nodes to reduce DOM fragmentation\r
+                                       sibling = container.nextSibling;\r
+                                       if (sibling && sibling.nodeType == 3) {\r
+                                               isMerged = TRUE;\r
+                                               container.appendData(sibling.nodeValue);\r
+                                               dom.remove(sibling);\r
+                                       }\r
+                               } else {\r
+                                       sibling = marker.nextSibling;\r
+\r
+                                       // Is marker before a text node\r
+                                       if (sibling && sibling.nodeType == 3) {\r
+                                               container = sibling;\r
+                                               offset = 0;\r
+                                       } else {\r
+                                               // Is marker before an element\r
+                                               if (sibling)\r
+                                                       offset = dom.nodeIndex(sibling) - 1;\r
+                                               else\r
+                                                       offset = dom.nodeIndex(marker);\r
+\r
+                                               container = marker.parentNode;\r
+                                       }\r
+\r
+                                       dom.remove(marker);\r
+                               }\r
+\r
+                               // Set start of range\r
+                               if (start)\r
+                                       domRange.setStart(container, offset);\r
+\r
+                               // Set end of range or automatically if it's collapsed to increase performance\r
+                               if (!start || collapsed)\r
+                                       domRange.setEnd(container, offset);\r
+                       };\r
+\r
+                       // Set start of range\r
+                       setEndPoint(TRUE);\r
+\r
+                       // Set end of range if needed\r
+                       if (!collapsed)\r
+                               setEndPoint(FALSE);\r
+\r
+                       // Restore selection if the range contents was merged\r
+                       // since the selection was then moved since the text nodes got changed\r
+                       if (isMerged)\r
+                               t.addRange(domRange);\r
+\r
+                       return domRange;\r
+               };\r
+\r
+               this.addRange = function(rng) {\r
+                       var ieRng, ieRng2, doc = selection.dom.doc, body = doc.body, startPos, endPos, sc, so, ec, eo, marker, lastIndex, skipStart, skipEnd;\r
+\r
+                       this.destroy();\r
+\r
+                       // Setup some shorter versions\r
+                       sc = rng.startContainer;\r
+                       so = rng.startOffset;\r
+                       ec = rng.endContainer;\r
+                       eo = rng.endOffset;\r
+                       ieRng = body.createTextRange();\r
+\r
+                       // If document selection move caret to first node in document\r
+                       if (sc == doc || ec == doc) {\r
+                               ieRng = body.createTextRange();\r
+                               ieRng.collapse();\r
+                               ieRng.select();\r
+                               return;\r
+                       }\r
+\r
+                       // If child index resolve it\r
+                       if (sc.nodeType == 1 && sc.hasChildNodes()) {\r
+                               lastIndex = sc.childNodes.length - 1;\r
+\r
+                               // Index is higher that the child count then we need to jump over the start container\r
+                               if (so > lastIndex) {\r
+                                       skipStart = 1;\r
+                                       sc = sc.childNodes[lastIndex];\r
+                               } else\r
+                                       sc = sc.childNodes[so];\r
+\r
+                               // Child was text node then move offset to start of it\r
+                               if (sc.nodeType == 3)\r
+                                       so = 0;\r
+                       }\r
+\r
+                       // If child index resolve it\r
+                       if (ec.nodeType == 1 && ec.hasChildNodes()) {\r
+                               lastIndex = ec.childNodes.length - 1;\r
+\r
+                               if (eo == 0) {\r
+                                       skipEnd = 1;\r
+                                       ec = ec.childNodes[0];\r
+                               } else {\r
+                                       ec = ec.childNodes[Math.min(lastIndex, eo - 1)];\r
+\r
+                                       // Child was text node then move offset to end of text node\r
+                                       if (ec.nodeType == 3)\r
+                                               eo = ec.nodeValue.length;\r
+                               }\r
+                       }\r
+\r
+                       // Single element selection\r
+                       if (sc == ec && sc.nodeType == 1) {\r
+                               // Make control selection for some elements\r
+                               if (/^(IMG|TABLE)$/.test(sc.nodeName) && so != eo) {\r
+                                       ieRng = body.createControlRange();\r
+                                       ieRng.addElement(sc);\r
+                               } else {\r
+                                       ieRng = body.createTextRange();\r
+\r
+                                       // Padd empty elements with invisible character\r
+                                       if (!sc.hasChildNodes() && sc.canHaveHTML)\r
+                                               sc.innerHTML = invisibleChar;\r
+\r
+                                       // Select element contents\r
+                                       ieRng.moveToElementText(sc);\r
+\r
+                                       // If it's only containing a padding remove it so the caret remains\r
+                                       if (sc.innerHTML == invisibleChar) {\r
+                                               ieRng.collapse(TRUE);\r
+                                               sc.removeChild(sc.firstChild);\r
+                                       }\r
+                               }\r
+\r
+                               if (so == eo)\r
+                                       ieRng.collapse(eo <= rng.endContainer.childNodes.length - 1);\r
+\r
+                               ieRng.select();\r
+                               ieRng.scrollIntoView();\r
+                               return;\r
+                       }\r
+\r
+                       // Create range and marker\r
+                       ieRng = body.createTextRange();\r
+                       marker = doc.createElement('span');\r
+                       marker.innerHTML = ' ';\r
+\r
+                       // Set start of range to startContainer/startOffset\r
+                       if (sc.nodeType == 3) {\r
+                               // Insert marker after/before startContainer\r
+                               if (skipStart)\r
+                                       dom.insertAfter(marker, sc);\r
+                               else\r
+                                       sc.parentNode.insertBefore(marker, sc);\r
+\r
+                               // Select marker the caret to offset position\r
+                               ieRng.moveToElementText(marker);\r
+                               marker.parentNode.removeChild(marker);\r
+                               ieRng.move('character', so);\r
+                       } else {\r
+                               ieRng.moveToElementText(sc);\r
+\r
+                               if (skipStart)\r
+                                       ieRng.collapse(FALSE);\r
+                       }\r
+\r
+                       // If same text container then we can do a more simple move\r
+                       if (sc == ec && sc.nodeType == 3) {\r
+                               ieRng.moveEnd('character', eo - so);\r
+                               ieRng.select();\r
+                               ieRng.scrollIntoView();\r
+                               return;\r
+                       }\r
+\r
+                       // Set end of range to endContainer/endOffset\r
+                       ieRng2 = body.createTextRange();\r
+                       if (ec.nodeType == 3) {\r
+                               // Insert marker after/before startContainer\r
+                               ec.parentNode.insertBefore(marker, ec);\r
+\r
+                               // Move selection to end marker and move caret to end offset\r
+                               ieRng2.moveToElementText(marker);\r
+                               marker.parentNode.removeChild(marker);\r
+                               ieRng2.move('character', eo);\r
+                               ieRng.setEndPoint('EndToStart', ieRng2);\r
+                       } else {\r
+                               ieRng2.moveToElementText(ec);\r
+                               ieRng2.collapse(!!skipEnd);\r
+                               ieRng.setEndPoint('EndToEnd', ieRng2);\r
+                       }\r
+\r
+                       ieRng.select();\r
+                       ieRng.scrollIntoView();\r
+               };\r
+\r
+               this.getRangeAt = function() {\r
+                       // Setup new range if the cache is empty\r
+                       if (!range || !compareRanges(lastIERng, selection.getRng())) {\r
+                               range = getRange();\r
+\r
+                               // Store away text range for next call\r
+                               lastIERng = selection.getRng();\r
+                       }\r
+\r
+                       // Return cached range\r
+                       return range;\r
+               };\r
+\r
+               this.destroy = function() {\r
+                       // Destroy cached range and last IE range to avoid memory leaks\r
+                       lastIERng = range = null;\r
+               };\r
+\r
+               // IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode\r
+               if (selection.dom.boxModel) {\r
+                       (function() {\r
+                               var doc = dom.doc, body = doc.body, started, startRng;\r
+\r
+                               // Make HTML element unselectable since we are going to handle selection by hand\r
+                               doc.documentElement.unselectable = TRUE;\r
+\r
+                               // Return range from point or null if it failed\r
+                               function rngFromPoint(x, y) {\r
+                                       var rng = body.createTextRange();\r
+\r
+                                       try {\r
+                                               rng.moveToPoint(x, y);\r
+                                       } catch (ex) {\r
+                                               // IE sometimes throws and exception, so lets just ignore it\r
+                                               rng = null;\r
+                                       }\r
+\r
+                                       return rng;\r
+                               };\r
+\r
+                               // Fires while the selection is changing\r
+                               function selectionChange(e) {\r
+                                       var pointRng;\r
+\r
+                                       // Check if the button is down or not\r
+                                       if (e.button) {\r
+                                               // Create range from mouse position\r
+                                               pointRng = rngFromPoint(e.x, e.y);\r
+\r
+                                               if (pointRng) {\r
+                                                       // Check if pointRange is before/after selection then change the endPoint\r
+                                                       if (pointRng.compareEndPoints('StartToStart', startRng) > 0)\r
+                                                               pointRng.setEndPoint('StartToStart', startRng);\r
+                                                       else\r
+                                                               pointRng.setEndPoint('EndToEnd', startRng);\r
+\r
+                                                       pointRng.select();\r
+                                               }\r
+                                       } else\r
+                                               endSelection();\r
+                               }\r
+\r
+                               // Removes listeners\r
+                               function endSelection() {\r
+                                       dom.unbind(doc, 'mouseup', endSelection);\r
+                                       dom.unbind(doc, 'mousemove', selectionChange);\r
+                                       started = 0;\r
+                               };\r
+\r
+                               // Detect when user selects outside BODY\r
+                               dom.bind(doc, 'mousedown', function(e) {\r
+                                       if (e.target.nodeName === 'HTML') {\r
+                                               if (started)\r
+                                                       endSelection();\r
+\r
+                                               started = 1;\r
+\r
+                                               // Setup start position\r
+                                               startRng = rngFromPoint(e.x, e.y);\r
+                                               if (startRng) {\r
+                                                       // Listen for selection change events\r
+                                                       dom.bind(doc, 'mouseup', endSelection);\r
+                                                       dom.bind(doc, 'mousemove', selectionChange);\r
+\r
+                                                       startRng.select();\r
+                                               }\r
+                                       }\r
+                               });\r
+                       })();\r
+               }\r
+       };\r
+\r
+       // Expose the selection object\r
+       tinymce.dom.TridentSelection = Selection;\r
+})();\r
+\r
+\r
+/*\r
+ * Sizzle CSS Selector Engine - v1.0\r
+ *  Copyright 2009, The Dojo Foundation\r
+ *  Released under the MIT, BSD, and GPL Licenses.\r
+ *  More information: http://sizzlejs.com/\r
+ */\r
+(function(){\r
+\r
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,\r
+       done = 0,\r
+       toString = Object.prototype.toString,\r
+       hasDuplicate = false;\r
+\r
+var Sizzle = function(selector, context, results, seed) {\r
+       results = results || [];\r
+       var origContext = context = context || document;\r
+\r
+       if ( context.nodeType !== 1 && context.nodeType !== 9 ) {\r
+               return [];\r
+       }\r
+       \r
+       if ( !selector || typeof selector !== "string" ) {\r
+               return results;\r
+       }\r
+\r
+       var parts = [], m, set, checkSet, check, mode, extra, prune = true, contextXML = isXML(context);\r
+       \r
+       // Reset the position of the chunker regexp (start from head)\r
+       chunker.lastIndex = 0;\r
+       \r
+       while ( (m = chunker.exec(selector)) !== null ) {\r
+               parts.push( m[1] );\r
+               \r
+               if ( m[2] ) {\r
+                       extra = RegExp.rightContext;\r
+                       break;\r
+               }\r
+       }\r
+\r
+       if ( parts.length > 1 && origPOS.exec( selector ) ) {\r
+               if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {\r
+                       set = posProcess( parts[0] + parts[1], context );\r
+               } else {\r
+                       set = Expr.relative[ parts[0] ] ?\r
+                               [ context ] :\r
+                               Sizzle( parts.shift(), context );\r
+\r
+                       while ( parts.length ) {\r
+                               selector = parts.shift();\r
+\r
+                               if ( Expr.relative[ selector ] )\r
+                                       selector += parts.shift();\r
+\r
+                               set = posProcess( selector, set );\r
+                       }\r
+               }\r
+       } else {\r
+               // Take a shortcut and set the context if the root selector is an ID\r
+               // (but not if it'll be faster if the inner selector is an ID)\r
+               if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&\r
+                               Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {\r
+                       var ret = Sizzle.find( parts.shift(), context, contextXML );\r
+                       context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];\r
+               }\r
+\r
+               if ( context ) {\r
+                       var ret = seed ?\r
+                               { expr: parts.pop(), set: makeArray(seed) } :\r
+                               Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );\r
+                       set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;\r
+\r
+                       if ( parts.length > 0 ) {\r
+                               checkSet = makeArray(set);\r
+                       } else {\r
+                               prune = false;\r
+                       }\r
+\r
+                       while ( parts.length ) {\r
+                               var cur = parts.pop(), pop = cur;\r
+\r
+                               if ( !Expr.relative[ cur ] ) {\r
+                                       cur = "";\r
+                               } else {\r
+                                       pop = parts.pop();\r
+                               }\r
+\r
+                               if ( pop == null ) {\r
+                                       pop = context;\r
+                               }\r
+\r
+                               Expr.relative[ cur ]( checkSet, pop, contextXML );\r
+                       }\r
+               } else {\r
+                       checkSet = parts = [];\r
+               }\r
+       }\r
+\r
+       if ( !checkSet ) {\r
+               checkSet = set;\r
+       }\r
+\r
+       if ( !checkSet ) {\r
+               throw "Syntax error, unrecognized expression: " + (cur || selector);\r
+       }\r
+\r
+       if ( toString.call(checkSet) === "[object Array]" ) {\r
+               if ( !prune ) {\r
+                       results.push.apply( results, checkSet );\r
+               } else if ( context && context.nodeType === 1 ) {\r
+                       for ( var i = 0; checkSet[i] != null; i++ ) {\r
+                               if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {\r
+                                       results.push( set[i] );\r
+                               }\r
+                       }\r
+               } else {\r
+                       for ( var i = 0; checkSet[i] != null; i++ ) {\r
+                               if ( checkSet[i] && checkSet[i].nodeType === 1 ) {\r
+                                       results.push( set[i] );\r
+                               }\r
+                       }\r
+               }\r
+       } else {\r
+               makeArray( checkSet, results );\r
+       }\r
+\r
+       if ( extra ) {\r
+               Sizzle( extra, origContext, results, seed );\r
+               Sizzle.uniqueSort( results );\r
+       }\r
+\r
+       return results;\r
+};\r
+\r
+Sizzle.uniqueSort = function(results){\r
+       if ( sortOrder ) {\r
+               hasDuplicate = false;\r
+               results.sort(sortOrder);\r
+\r
+               if ( hasDuplicate ) {\r
+                       for ( var i = 1; i < results.length; i++ ) {\r
+                               if ( results[i] === results[i-1] ) {\r
+                                       results.splice(i--, 1);\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+};\r
+\r
+Sizzle.matches = function(expr, set){\r
+       return Sizzle(expr, null, null, set);\r
+};\r
+\r
+Sizzle.find = function(expr, context, isXML){\r
+       var set, match;\r
+\r
+       if ( !expr ) {\r
+               return [];\r
+       }\r
+\r
+       for ( var i = 0, l = Expr.order.length; i < l; i++ ) {\r
+               var type = Expr.order[i], match;\r
+               \r
+               if ( (match = Expr.match[ type ].exec( expr )) ) {\r
+                       var left = RegExp.leftContext;\r
+\r
+                       if ( left.substr( left.length - 1 ) !== "\\" ) {\r
+                               match[1] = (match[1] || "").replace(/\\/g, "");\r
+                               set = Expr.find[ type ]( match, context, isXML );\r
+                               if ( set != null ) {\r
+                                       expr = expr.replace( Expr.match[ type ], "" );\r
+                                       break;\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+\r
+       if ( !set ) {\r
+               set = context.getElementsByTagName("*");\r
+       }\r
+\r
+       return {set: set, expr: expr};\r
+};\r
+\r
+Sizzle.filter = function(expr, set, inplace, not){\r
+       var old = expr, result = [], curLoop = set, match, anyFound,\r
+               isXMLFilter = set && set[0] && isXML(set[0]);\r
+\r
+       while ( expr && set.length ) {\r
+               for ( var type in Expr.filter ) {\r
+                       if ( (match = Expr.match[ type ].exec( expr )) != null ) {\r
+                               var filter = Expr.filter[ type ], found, item;\r
+                               anyFound = false;\r
+\r
+                               if ( curLoop == result ) {\r
+                                       result = [];\r
+                               }\r
+\r
+                               if ( Expr.preFilter[ type ] ) {\r
+                                       match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );\r
+\r
+                                       if ( !match ) {\r
+                                               anyFound = found = true;\r
+                                       } else if ( match === true ) {\r
+                                               continue;\r
+                                       }\r
+                               }\r
+\r
+                               if ( match ) {\r
+                                       for ( var i = 0; (item = curLoop[i]) != null; i++ ) {\r
+                                               if ( item ) {\r
+                                                       found = filter( item, match, i, curLoop );\r
+                                                       var pass = not ^ !!found;\r
+\r
+                                                       if ( inplace && found != null ) {\r
+                                                               if ( pass ) {\r
+                                                                       anyFound = true;\r
+                                                               } else {\r
+                                                                       curLoop[i] = false;\r
+                                                               }\r
+                                                       } else if ( pass ) {\r
+                                                               result.push( item );\r
+                                                               anyFound = true;\r
+                                                       }\r
+                                               }\r
+                                       }\r
+                               }\r
+\r
+                               if ( found !== undefined ) {\r
+                                       if ( !inplace ) {\r
+                                               curLoop = result;\r
+                                       }\r
+\r
+                                       expr = expr.replace( Expr.match[ type ], "" );\r
+\r
+                                       if ( !anyFound ) {\r
+                                               return [];\r
+                                       }\r
+\r
+                                       break;\r
+                               }\r
+                       }\r
+               }\r
+\r
+               // Improper expression\r
+               if ( expr == old ) {\r
+                       if ( anyFound == null ) {\r
+                               throw "Syntax error, unrecognized expression: " + expr;\r
+                       } else {\r
+                               break;\r
+                       }\r
+               }\r
+\r
+               old = expr;\r
+       }\r
+\r
+       return curLoop;\r
+};\r
+\r
+var Expr = Sizzle.selectors = {\r
+       order: [ "ID", "NAME", "TAG" ],\r
+       match: {\r
+               ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,\r
+               CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,\r
+               NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,\r
+               ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,\r
+               TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,\r
+               CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,\r
+               POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,\r
+               PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/\r
+       },\r
+       attrMap: {\r
+               "class": "className",\r
+               "for": "htmlFor"\r
+       },\r
+       attrHandle: {\r
+               href: function(elem){\r
+                       return elem.getAttribute("href");\r
+               }\r
+       },\r
+       relative: {\r
+               "+": function(checkSet, part, isXML){\r
+                       var isPartStr = typeof part === "string",\r
+                               isTag = isPartStr && !/\W/.test(part),\r
+                               isPartStrNotTag = isPartStr && !isTag;\r
+\r
+                       if ( isTag && !isXML ) {\r
+                               part = part.toUpperCase();\r
+                       }\r
+\r
+                       for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {\r
+                               if ( (elem = checkSet[i]) ) {\r
+                                       while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}\r
+\r
+                                       checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ?\r
+                                               elem || false :\r
+                                               elem === part;\r
+                               }\r
+                       }\r
+\r
+                       if ( isPartStrNotTag ) {\r
+                               Sizzle.filter( part, checkSet, true );\r
+                       }\r
+               },\r
+               ">": function(checkSet, part, isXML){\r
+                       var isPartStr = typeof part === "string";\r
+\r
+                       if ( isPartStr && !/\W/.test(part) ) {\r
+                               part = isXML ? part : part.toUpperCase();\r
+\r
+                               for ( var i = 0, l = checkSet.length; i < l; i++ ) {\r
+                                       var elem = checkSet[i];\r
+                                       if ( elem ) {\r
+                                               var parent = elem.parentNode;\r
+                                               checkSet[i] = parent.nodeName === part ? parent : false;\r
+                                       }\r
+                               }\r
+                       } else {\r
+                               for ( var i = 0, l = checkSet.length; i < l; i++ ) {\r
+                                       var elem = checkSet[i];\r
+                                       if ( elem ) {\r
+                                               checkSet[i] = isPartStr ?\r
+                                                       elem.parentNode :\r
+                                                       elem.parentNode === part;\r
+                                       }\r
+                               }\r
+\r
+                               if ( isPartStr ) {\r
+                                       Sizzle.filter( part, checkSet, true );\r
+                               }\r
+                       }\r
+               },\r
+               "": function(checkSet, part, isXML){\r
+                       var doneName = done++, checkFn = dirCheck;\r
+\r
+                       if ( !part.match(/\W/) ) {\r
+                               var nodeCheck = part = isXML ? part : part.toUpperCase();\r
+                               checkFn = dirNodeCheck;\r
+                       }\r
+\r
+                       checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);\r
+               },\r
+               "~": function(checkSet, part, isXML){\r
+                       var doneName = done++, checkFn = dirCheck;\r
+\r
+                       if ( typeof part === "string" && !part.match(/\W/) ) {\r
+                               var nodeCheck = part = isXML ? part : part.toUpperCase();\r
+                               checkFn = dirNodeCheck;\r
+                       }\r
+\r
+                       checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);\r
+               }\r
+       },\r
+       find: {\r
+               ID: function(match, context, isXML){\r
+                       if ( typeof context.getElementById !== "undefined" && !isXML ) {\r
+                               var m = context.getElementById(match[1]);\r
+                               return m ? [m] : [];\r
+                       }\r
+               },\r
+               NAME: function(match, context, isXML){\r
+                       if ( typeof context.getElementsByName !== "undefined" ) {\r
+                               var ret = [], results = context.getElementsByName(match[1]);\r
+\r
+                               for ( var i = 0, l = results.length; i < l; i++ ) {\r
+                                       if ( results[i].getAttribute("name") === match[1] ) {\r
+                                               ret.push( results[i] );\r
+                                       }\r
+                               }\r
+\r
+                               return ret.length === 0 ? null : ret;\r
+                       }\r
+               },\r
+               TAG: function(match, context){\r
+                       return context.getElementsByTagName(match[1]);\r
+               }\r
+       },\r
+       preFilter: {\r
+               CLASS: function(match, curLoop, inplace, result, not, isXML){\r
+                       match = " " + match[1].replace(/\\/g, "") + " ";\r
+\r
+                       if ( isXML ) {\r
+                               return match;\r
+                       }\r
+\r
+                       for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {\r
+                               if ( elem ) {\r
+                                       if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) {\r
+                                               if ( !inplace )\r
+                                                       result.push( elem );\r
+                                       } else if ( inplace ) {\r
+                                               curLoop[i] = false;\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+                       return false;\r
+               },\r
+               ID: function(match){\r
+                       return match[1].replace(/\\/g, "");\r
+               },\r
+               TAG: function(match, curLoop){\r
+                       for ( var i = 0; curLoop[i] === false; i++ ){}\r
+                       return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();\r
+               },\r
+               CHILD: function(match){\r
+                       if ( match[1] == "nth" ) {\r
+                               // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'\r
+                               var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(\r
+                                       match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||\r
+                                       !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);\r
+\r
+                               // calculate the numbers (first)n+(last) including if they are negative\r
+                               match[2] = (test[1] + (test[2] || 1)) - 0;\r
+                               match[3] = test[3] - 0;\r
+                       }\r
+\r
+                       // TODO: Move to normal caching system\r
+                       match[0] = done++;\r
+\r
+                       return match;\r
+               },\r
+               ATTR: function(match, curLoop, inplace, result, not, isXML){\r
+                       var name = match[1].replace(/\\/g, "");\r
+                       \r
+                       if ( !isXML && Expr.attrMap[name] ) {\r
+                               match[1] = Expr.attrMap[name];\r
+                       }\r
+\r
+                       if ( match[2] === "~=" ) {\r
+                               match[4] = " " + match[4] + " ";\r
+                       }\r
+\r
+                       return match;\r
+               },\r
+               PSEUDO: function(match, curLoop, inplace, result, not){\r
+                       if ( match[1] === "not" ) {\r
+                               // If we're dealing with a complex expression, or a simple one\r
+                               if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) {\r
+                                       match[3] = Sizzle(match[3], null, null, curLoop);\r
+                               } else {\r
+                                       var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);\r
+                                       if ( !inplace ) {\r
+                                               result.push.apply( result, ret );\r
+                                       }\r
+                                       return false;\r
+                               }\r
+                       } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {\r
+                               return true;\r
+                       }\r
+                       \r
+                       return match;\r
+               },\r
+               POS: function(match){\r
+                       match.unshift( true );\r
+                       return match;\r
+               }\r
+       },\r
+       filters: {\r
+               enabled: function(elem){\r
+                       return elem.disabled === false && elem.type !== "hidden";\r
+               },\r
+               disabled: function(elem){\r
+                       return elem.disabled === true;\r
+               },\r
+               checked: function(elem){\r
+                       return elem.checked === true;\r
+               },\r
+               selected: function(elem){\r
+                       // Accessing this property makes selected-by-default\r
+                       // options in Safari work properly\r
+                       elem.parentNode.selectedIndex;\r
+                       return elem.selected === true;\r
+               },\r
+               parent: function(elem){\r
+                       return !!elem.firstChild;\r
+               },\r
+               empty: function(elem){\r
+                       return !elem.firstChild;\r
+               },\r
+               has: function(elem, i, match){\r
+                       return !!Sizzle( match[3], elem ).length;\r
+               },\r
+               header: function(elem){\r
+                       return /h\d/i.test( elem.nodeName );\r
+               },\r
+               text: function(elem){\r
+                       return "text" === elem.type;\r
+               },\r
+               radio: function(elem){\r
+                       return "radio" === elem.type;\r
+               },\r
+               checkbox: function(elem){\r
+                       return "checkbox" === elem.type;\r
+               },\r
+               file: function(elem){\r
+                       return "file" === elem.type;\r
+               },\r
+               password: function(elem){\r
+                       return "password" === elem.type;\r
+               },\r
+               submit: function(elem){\r
+                       return "submit" === elem.type;\r
+               },\r
+               image: function(elem){\r
+                       return "image" === elem.type;\r
+               },\r
+               reset: function(elem){\r
+                       return "reset" === elem.type;\r
+               },\r
+               button: function(elem){\r
+                       return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";\r
+               },\r
+               input: function(elem){\r
+                       return /input|select|textarea|button/i.test(elem.nodeName);\r
+               }\r
+       },\r
+       setFilters: {\r
+               first: function(elem, i){\r
+                       return i === 0;\r
+               },\r
+               last: function(elem, i, match, array){\r
+                       return i === array.length - 1;\r
+               },\r
+               even: function(elem, i){\r
+                       return i % 2 === 0;\r
+               },\r
+               odd: function(elem, i){\r
+                       return i % 2 === 1;\r
+               },\r
+               lt: function(elem, i, match){\r
+                       return i < match[3] - 0;\r
+               },\r
+               gt: function(elem, i, match){\r
+                       return i > match[3] - 0;\r
+               },\r
+               nth: function(elem, i, match){\r
+                       return match[3] - 0 == i;\r
+               },\r
+               eq: function(elem, i, match){\r
+                       return match[3] - 0 == i;\r
+               }\r
+       },\r
+       filter: {\r
+               PSEUDO: function(elem, match, i, array){\r
+                       var name = match[1], filter = Expr.filters[ name ];\r
+\r
+                       if ( filter ) {\r
+                               return filter( elem, i, match, array );\r
+                       } else if ( name === "contains" ) {\r
+                               return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;\r
+                       } else if ( name === "not" ) {\r
+                               var not = match[3];\r
+\r
+                               for ( var i = 0, l = not.length; i < l; i++ ) {\r
+                                       if ( not[i] === elem ) {\r
+                                               return false;\r
+                                       }\r
+                               }\r
+\r
+                               return true;\r
+                       }\r
+               },\r
+               CHILD: function(elem, match){\r
+                       var type = match[1], node = elem;\r
+                       switch (type) {\r
+                               case 'only':\r
+                               case 'first':\r
+                                       while (node = node.previousSibling)  {\r
+                                               if ( node.nodeType === 1 ) return false;\r
+                                       }\r
+                                       if ( type == 'first') return true;\r
+                                       node = elem;\r
+                               case 'last':\r
+                                       while (node = node.nextSibling)  {\r
+                                               if ( node.nodeType === 1 ) return false;\r
+                                       }\r
+                                       return true;\r
+                               case 'nth':\r
+                                       var first = match[2], last = match[3];\r
+\r
+                                       if ( first == 1 && last == 0 ) {\r
+                                               return true;\r
+                                       }\r
+                                       \r
+                                       var doneName = match[0],\r
+                                               parent = elem.parentNode;\r
+       \r
+                                       if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {\r
+                                               var count = 0;\r
+                                               for ( node = parent.firstChild; node; node = node.nextSibling ) {\r
+                                                       if ( node.nodeType === 1 ) {\r
+                                                               node.nodeIndex = ++count;\r
+                                                       }\r
+                                               } \r
+                                               parent.sizcache = doneName;\r
+                                       }\r
+                                       \r
+                                       var diff = elem.nodeIndex - last;\r
+                                       if ( first == 0 ) {\r
+                                               return diff == 0;\r
+                                       } else {\r
+                                               return ( diff % first == 0 && diff / first >= 0 );\r
+                                       }\r
+                       }\r
+               },\r
+               ID: function(elem, match){\r
+                       return elem.nodeType === 1 && elem.getAttribute("id") === match;\r
+               },\r
+               TAG: function(elem, match){\r
+                       return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;\r
+               },\r
+               CLASS: function(elem, match){\r
+                       return (" " + (elem.className || elem.getAttribute("class")) + " ")\r
+                               .indexOf( match ) > -1;\r
+               },\r
+               ATTR: function(elem, match){\r
+                       var name = match[1],\r
+                               result = Expr.attrHandle[ name ] ?\r
+                                       Expr.attrHandle[ name ]( elem ) :\r
+                                       elem[ name ] != null ?\r
+                                               elem[ name ] :\r
+                                               elem.getAttribute( name ),\r
+                               value = result + "",\r
+                               type = match[2],\r
+                               check = match[4];\r
+\r
+                       return result == null ?\r
+                               type === "!=" :\r
+                               type === "=" ?\r
+                               value === check :\r
+                               type === "*=" ?\r
+                               value.indexOf(check) >= 0 :\r
+                               type === "~=" ?\r
+                               (" " + value + " ").indexOf(check) >= 0 :\r
+                               !check ?\r
+                               value && result !== false :\r
+                               type === "!=" ?\r
+                               value != check :\r
+                               type === "^=" ?\r
+                               value.indexOf(check) === 0 :\r
+                               type === "$=" ?\r
+                               value.substr(value.length - check.length) === check :\r
+                               type === "|=" ?\r
+                               value === check || value.substr(0, check.length + 1) === check + "-" :\r
+                               false;\r
+               },\r
+               POS: function(elem, match, i, array){\r
+                       var name = match[2], filter = Expr.setFilters[ name ];\r
+\r
+                       if ( filter ) {\r
+                               return filter( elem, i, match, array );\r
+                       }\r
+               }\r
+       }\r
+};\r
+\r
+var origPOS = Expr.match.POS;\r
+\r
+for ( var type in Expr.match ) {\r
+       Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );\r
+}\r
+\r
+var makeArray = function(array, results) {\r
+       array = Array.prototype.slice.call( array );\r
+\r
+       if ( results ) {\r
+               results.push.apply( results, array );\r
+               return results;\r
+       }\r
+       \r
+       return array;\r
+};\r
+\r
+// Perform a simple check to determine if the browser is capable of\r
+// converting a NodeList to an array using builtin methods.\r
+try {\r
+       Array.prototype.slice.call( document.documentElement.childNodes );\r
+\r
+// Provide a fallback method if it does not work\r
+} catch(e){\r
+       makeArray = function(array, results) {\r
+               var ret = results || [];\r
+\r
+               if ( toString.call(array) === "[object Array]" ) {\r
+                       Array.prototype.push.apply( ret, array );\r
+               } else {\r
+                       if ( typeof array.length === "number" ) {\r
+                               for ( var i = 0, l = array.length; i < l; i++ ) {\r
+                                       ret.push( array[i] );\r
+                               }\r
+                       } else {\r
+                               for ( var i = 0; array[i]; i++ ) {\r
+                                       ret.push( array[i] );\r
+                               }\r
+                       }\r
+               }\r
+\r
+               return ret;\r
+       };\r
+}\r
+\r
+var sortOrder;\r
+\r
+if ( document.documentElement.compareDocumentPosition ) {\r
+       sortOrder = function( a, b ) {\r
+               var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;\r
+               if ( ret === 0 ) {\r
+                       hasDuplicate = true;\r
+               }\r
+               return ret;\r
+       };\r
+} else if ( "sourceIndex" in document.documentElement ) {\r
+       sortOrder = function( a, b ) {\r
+               var ret = a.sourceIndex - b.sourceIndex;\r
+               if ( ret === 0 ) {\r
+                       hasDuplicate = true;\r
+               }\r
+               return ret;\r
+       };\r
+} else if ( document.createRange ) {\r
+       sortOrder = function( a, b ) {\r
+               var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();\r
+               aRange.setStart(a, 0);\r
+               aRange.setEnd(a, 0);\r
+               bRange.setStart(b, 0);\r
+               bRange.setEnd(b, 0);\r
+               var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);\r
+               if ( ret === 0 ) {\r
+                       hasDuplicate = true;\r
+               }\r
+               return ret;\r
+       };\r
+}\r
+\r
+// Check to see if the browser returns elements by name when\r
+// querying by getElementById (and provide a workaround)\r
+(function(){\r
+       // We're going to inject a fake input element with a specified name\r
+       var form = document.createElement("div"),\r
+               id = "script" + (new Date).getTime();\r
+       form.innerHTML = "<a name='" + id + "'/>";\r
+\r
+       // Inject it into the root element, check its status, and remove it quickly\r
+       var root = document.documentElement;\r
+       root.insertBefore( form, root.firstChild );\r
+\r
+       // The workaround has to do additional checks after a getElementById\r
+       // Which slows things down for other browsers (hence the branching)\r
+       if ( !!document.getElementById( id ) ) {\r
+               Expr.find.ID = function(match, context, isXML){\r
+                       if ( typeof context.getElementById !== "undefined" && !isXML ) {\r
+                               var m = context.getElementById(match[1]);\r
+                               return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];\r
+                       }\r
+               };\r
+\r
+               Expr.filter.ID = function(elem, match){\r
+                       var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");\r
+                       return elem.nodeType === 1 && node && node.nodeValue === match;\r
+               };\r
+       }\r
+\r
+       root.removeChild( form );\r
+})();\r
+\r
+(function(){\r
+       // Check to see if the browser returns only elements\r
+       // when doing getElementsByTagName("*")\r
+\r
+       // Create a fake element\r
+       var div = document.createElement("div");\r
+       div.appendChild( document.createComment("") );\r
+\r
+       // Make sure no comments are found\r
+       if ( div.getElementsByTagName("*").length > 0 ) {\r
+               Expr.find.TAG = function(match, context){\r
+                       var results = context.getElementsByTagName(match[1]);\r
+\r
+                       // Filter out possible comments\r
+                       if ( match[1] === "*" ) {\r
+                               var tmp = [];\r
+\r
+                               for ( var i = 0; results[i]; i++ ) {\r
+                                       if ( results[i].nodeType === 1 ) {\r
+                                               tmp.push( results[i] );\r
+                                       }\r
+                               }\r
+\r
+                               results = tmp;\r
+                       }\r
+\r
+                       return results;\r
+               };\r
+       }\r
+\r
+       // Check to see if an attribute returns normalized href attributes\r
+       div.innerHTML = "<a href='#'></a>";\r
+       if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&\r
+                       div.firstChild.getAttribute("href") !== "#" ) {\r
+               Expr.attrHandle.href = function(elem){\r
+                       return elem.getAttribute("href", 2);\r
+               };\r
+       }\r
+})();\r
+\r
+if ( document.querySelectorAll ) (function(){\r
+       var oldSizzle = Sizzle, div = document.createElement("div");\r
+       div.innerHTML = "<p class='TEST'></p>";\r
+\r
+       // Safari can't handle uppercase or unicode characters when\r
+       // in quirks mode.\r
+       if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {\r
+               return;\r
+       }\r
+       \r
+       Sizzle = function(query, context, extra, seed){\r
+               context = context || document;\r
+\r
+               // Only use querySelectorAll on non-XML documents\r
+               // (ID selectors don't work in non-HTML documents)\r
+               if ( !seed && context.nodeType === 9 && !isXML(context) ) {\r
+                       try {\r
+                               return makeArray( context.querySelectorAll(query), extra );\r
+                       } catch(e){}\r
+               }\r
+               \r
+               return oldSizzle(query, context, extra, seed);\r
+       };\r
+\r
+       for ( var prop in oldSizzle ) {\r
+               Sizzle[ prop ] = oldSizzle[ prop ];\r
+       }\r
+})();\r
+\r
+if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){\r
+       var div = document.createElement("div");\r
+       div.innerHTML = "<div class='test e'></div><div class='test'></div>";\r
+\r
+       // Opera can't find a second classname (in 9.6)\r
+       if ( div.getElementsByClassName("e").length === 0 )\r
+               return;\r
+\r
+       // Safari caches class attributes, doesn't catch changes (in 3.2)\r
+       div.lastChild.className = "e";\r
+\r
+       if ( div.getElementsByClassName("e").length === 1 )\r
+               return;\r
+\r
+       Expr.order.splice(1, 0, "CLASS");\r
+       Expr.find.CLASS = function(match, context, isXML) {\r
+               if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {\r
+                       return context.getElementsByClassName(match[1]);\r
+               }\r
+       };\r
+})();\r
+\r
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {\r
+       var sibDir = dir == "previousSibling" && !isXML;\r
+       for ( var i = 0, l = checkSet.length; i < l; i++ ) {\r
+               var elem = checkSet[i];\r
+               if ( elem ) {\r
+                       if ( sibDir && elem.nodeType === 1 ){\r
+                               elem.sizcache = doneName;\r
+                               elem.sizset = i;\r
+                       }\r
+                       elem = elem[dir];\r
+                       var match = false;\r
+\r
+                       while ( elem ) {\r
+                               if ( elem.sizcache === doneName ) {\r
+                                       match = checkSet[elem.sizset];\r
+                                       break;\r
+                               }\r
+\r
+                               if ( elem.nodeType === 1 && !isXML ){\r
+                                       elem.sizcache = doneName;\r
+                                       elem.sizset = i;\r
+                               }\r
+\r
+                               if ( elem.nodeName === cur ) {\r
+                                       match = elem;\r
+                                       break;\r
+                               }\r
+\r
+                               elem = elem[dir];\r
+                       }\r
+\r
+                       checkSet[i] = match;\r
+               }\r
+       }\r
+}\r
+\r
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {\r
+       var sibDir = dir == "previousSibling" && !isXML;\r
+       for ( var i = 0, l = checkSet.length; i < l; i++ ) {\r
+               var elem = checkSet[i];\r
+               if ( elem ) {\r
+                       if ( sibDir && elem.nodeType === 1 ) {\r
+                               elem.sizcache = doneName;\r
+                               elem.sizset = i;\r
+                       }\r
+                       elem = elem[dir];\r
+                       var match = false;\r
+\r
+                       while ( elem ) {\r
+                               if ( elem.sizcache === doneName ) {\r
+                                       match = checkSet[elem.sizset];\r
+                                       break;\r
+                               }\r
+\r
+                               if ( elem.nodeType === 1 ) {\r
+                                       if ( !isXML ) {\r
+                                               elem.sizcache = doneName;\r
+                                               elem.sizset = i;\r
+                                       }\r
+                                       if ( typeof cur !== "string" ) {\r
+                                               if ( elem === cur ) {\r
+                                                       match = true;\r
+                                                       break;\r
+                                               }\r
+\r
+                                       } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {\r
+                                               match = elem;\r
+                                               break;\r
+                                       }\r
+                               }\r
+\r
+                               elem = elem[dir];\r
+                       }\r
+\r
+                       checkSet[i] = match;\r
+               }\r
+       }\r
+}\r
+\r
+var contains = document.compareDocumentPosition ?  function(a, b){\r
+       return a.compareDocumentPosition(b) & 16;\r
+} : function(a, b){\r
+       return a !== b && (a.contains ? a.contains(b) : true);\r
+};\r
+\r
+var isXML = function(elem){\r
+       return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||\r
+               !!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML";\r
+};\r
+\r
+var posProcess = function(selector, context){\r
+       var tmpSet = [], later = "", match,\r
+               root = context.nodeType ? [context] : context;\r
+\r
+       // Position selectors must be done after the filter\r
+       // And so must :not(positional) so we move all PSEUDOs to the end\r
+       while ( (match = Expr.match.PSEUDO.exec( selector )) ) {\r
+               later += match[0];\r
+               selector = selector.replace( Expr.match.PSEUDO, "" );\r
+       }\r
+\r
+       selector = Expr.relative[selector] ? selector + "*" : selector;\r
+\r
+       for ( var i = 0, l = root.length; i < l; i++ ) {\r
+               Sizzle( selector, root[i], tmpSet );\r
+       }\r
+\r
+       return Sizzle.filter( later, tmpSet );\r
+};\r
+\r
+// EXPOSE\r
+\r
+window.tinymce.dom.Sizzle = Sizzle;\r
+\r
+})();\r
+\r
+\r
+(function(tinymce) {\r
+       // Shorten names\r
+       var each = tinymce.each, DOM = tinymce.DOM, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, Event;\r
+\r
+       tinymce.create('tinymce.dom.EventUtils', {\r
+               EventUtils : function() {\r
+                       this.inits = [];\r
+                       this.events = [];\r
+               },\r
+\r
+               add : function(o, n, f, s) {\r
+                       var cb, t = this, el = t.events, r;\r
+\r
+                       if (n instanceof Array) {\r
+                               r = [];\r
+\r
+                               each(n, function(n) {\r
+                                       r.push(t.add(o, n, f, s));\r
+                               });\r
+\r
+                               return r;\r
+                       }\r
+\r
+                       // Handle array\r
+                       if (o && o.hasOwnProperty && o instanceof Array) {\r
+                               r = [];\r
+\r
+                               each(o, function(o) {\r
+                                       o = DOM.get(o);\r
+                                       r.push(t.add(o, n, f, s));\r
+                               });\r
+\r
+                               return r;\r
+                       }\r
+\r
+                       o = DOM.get(o);\r
+\r
+                       if (!o)\r
+                               return;\r
+\r
+                       // Setup event callback\r
+                       cb = function(e) {\r
+                               // Is all events disabled\r
+                               if (t.disabled)\r
+                                       return;\r
+\r
+                               e = e || window.event;\r
+\r
+                               // Patch in target, preventDefault and stopPropagation in IE it's W3C valid\r
+                               if (e && isIE) {\r
+                                       if (!e.target)\r
+                                               e.target = e.srcElement;\r
+\r
+                                       // Patch in preventDefault, stopPropagation methods for W3C compatibility\r
+                                       tinymce.extend(e, t._stoppers);\r
+                               }\r
+\r
+                               if (!s)\r
+                                       return f(e);\r
+\r
+                               return f.call(s, e);\r
+                       };\r
+\r
+                       if (n == 'unload') {\r
+                               tinymce.unloads.unshift({func : cb});\r
+                               return cb;\r
+                       }\r
+\r
+                       if (n == 'init') {\r
+                               if (t.domLoaded)\r
+                                       cb();\r
+                               else\r
+                                       t.inits.push(cb);\r
+\r
+                               return cb;\r
+                       }\r
+\r
+                       // Store away listener reference\r
+                       el.push({\r
+                               obj : o,\r
+                               name : n,\r
+                               func : f,\r
+                               cfunc : cb,\r
+                               scope : s\r
+                       });\r
+\r
+                       t._add(o, n, cb);\r
+\r
+                       return f;\r
+               },\r
+\r
+               remove : function(o, n, f) {\r
+                       var t = this, a = t.events, s = false, r;\r
+\r
+                       // Handle array\r
+                       if (o && o.hasOwnProperty && o instanceof Array) {\r
+                               r = [];\r
+\r
+                               each(o, function(o) {\r
+                                       o = DOM.get(o);\r
+                                       r.push(t.remove(o, n, f));\r
+                               });\r
+\r
+                               return r;\r
+                       }\r
+\r
+                       o = DOM.get(o);\r
+\r
+                       each(a, function(e, i) {\r
+                               if (e.obj == o && e.name == n && (!f || (e.func == f || e.cfunc == f))) {\r
+                                       a.splice(i, 1);\r
+                                       t._remove(o, n, e.cfunc);\r
+                                       s = true;\r
+                                       return false;\r
+                               }\r
+                       });\r
+\r
+                       return s;\r
+               },\r
+\r
+               clear : function(o) {\r
+                       var t = this, a = t.events, i, e;\r
+\r
+                       if (o) {\r
+                               o = DOM.get(o);\r
+\r
+                               for (i = a.length - 1; i >= 0; i--) {\r
+                                       e = a[i];\r
+\r
+                                       if (e.obj === o) {\r
+                                               t._remove(e.obj, e.name, e.cfunc);\r
+                                               e.obj = e.cfunc = null;\r
+                                               a.splice(i, 1);\r
+                                       }\r
+                               }\r
+                       }\r
+               },\r
+\r
+               cancel : function(e) {\r
+                       if (!e)\r
+                               return false;\r
+\r
+                       this.stop(e);\r
+\r
+                       return this.prevent(e);\r
+               },\r
+\r
+               stop : function(e) {\r
+                       if (e.stopPropagation)\r
+                               e.stopPropagation();\r
+                       else\r
+                               e.cancelBubble = true;\r
+\r
+                       return false;\r
+               },\r
+\r
+               prevent : function(e) {\r
+                       if (e.preventDefault)\r
+                               e.preventDefault();\r
+                       else\r
+                               e.returnValue = false;\r
+\r
+                       return false;\r
+               },\r
+\r
+               destroy : function() {\r
+                       var t = this;\r
+\r
+                       each(t.events, function(e, i) {\r
+                               t._remove(e.obj, e.name, e.cfunc);\r
+                               e.obj = e.cfunc = null;\r
+                       });\r
+\r
+                       t.events = [];\r
+                       t = null;\r
+               },\r
+\r
+               _add : function(o, n, f) {\r
+                       if (o.attachEvent)\r
+                               o.attachEvent('on' + n, f);\r
+                       else if (o.addEventListener)\r
+                               o.addEventListener(n, f, false);\r
+                       else\r
+                               o['on' + n] = f;\r
+               },\r
+\r
+               _remove : function(o, n, f) {\r
+                       if (o) {\r
+                               try {\r
+                                       if (o.detachEvent)\r
+                                               o.detachEvent('on' + n, f);\r
+                                       else if (o.removeEventListener)\r
+                                               o.removeEventListener(n, f, false);\r
+                                       else\r
+                                               o['on' + n] = null;\r
+                               } catch (ex) {\r
+                                       // Might fail with permission denined on IE so we just ignore that\r
+                               }\r
+                       }\r
+               },\r
+\r
+               _pageInit : function(win) {\r
+                       var t = this;\r
+\r
+                       // Keep it from running more than once\r
+                       if (t.domLoaded)\r
+                               return;\r
+\r
+                       t.domLoaded = true;\r
+\r
+                       each(t.inits, function(c) {\r
+                               c();\r
+                       });\r
+\r
+                       t.inits = [];\r
+               },\r
+\r
+               _wait : function(win) {\r
+                       var t = this, doc = win.document;\r
+\r
+                       // No need since the document is already loaded\r
+                       if (win.tinyMCE_GZ && tinyMCE_GZ.loaded) {\r
+                               t.domLoaded = 1;\r
+                               return;\r
+                       }\r
+\r
+                       // Use IE method\r
+                       if (doc.attachEvent) {\r
+                               doc.attachEvent("onreadystatechange", function() {\r
+                                       if (doc.readyState === "complete") {\r
+                                               doc.detachEvent("onreadystatechange", arguments.callee);\r
+                                               t._pageInit(win);\r
+                                       }\r
+                               });\r
+\r
+                               if (doc.documentElement.doScroll && win == win.top) {\r
+                                       (function() {\r
+                                               if (t.domLoaded)\r
+                                                       return;\r
+\r
+                                               try {\r
+                                                       // If IE is used, use the trick by Diego Perini\r
+                                                       // http://javascript.nwbox.com/IEContentLoaded/\r
+                                                       doc.documentElement.doScroll("left");\r
+                                               } catch (ex) {\r
+                                                       setTimeout(arguments.callee, 0);\r
+                                                       return;\r
+                                               }\r
+\r
+                                               t._pageInit(win);\r
+                                       })();\r
+                               }\r
+                       } else if (doc.addEventListener) {\r
+                               t._add(win, 'DOMContentLoaded', function() {\r
+                                       t._pageInit(win);\r
+                               });\r
+                       }\r
+\r
+                       t._add(win, 'load', function() {\r
+                               t._pageInit(win);\r
+                       });\r
+               },\r
+\r
+               _stoppers : {\r
+                       preventDefault :  function() {\r
+                               this.returnValue = false;\r
+                       },\r
+\r
+                       stopPropagation : function() {\r
+                               this.cancelBubble = true;\r
+                       }\r
+               }\r
+       });\r
+\r
+       Event = tinymce.dom.Event = new tinymce.dom.EventUtils();\r
+\r
+       // Dispatch DOM content loaded event for IE and Safari\r
+       Event._wait(window);\r
+\r
+       tinymce.addUnload(function() {\r
+               Event.destroy();\r
+       });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+       tinymce.dom.Element = function(id, settings) {\r
+               var t = this, dom, el;\r
+\r
+               t.settings = settings = settings || {};\r
+               t.id = id;\r
+               t.dom = dom = settings.dom || tinymce.DOM;\r
+\r
+               // Only IE leaks DOM references, this is a lot faster\r
+               if (!tinymce.isIE)\r
+                       el = dom.get(t.id);\r
+\r
+               tinymce.each(\r
+                               ('getPos,getRect,getParent,add,setStyle,getStyle,setStyles,' + \r
+                               'setAttrib,setAttribs,getAttrib,addClass,removeClass,' + \r
+                               'hasClass,getOuterHTML,setOuterHTML,remove,show,hide,' + \r
+                               'isHidden,setHTML,get').split(/,/)\r
+                       , function(k) {\r
+                               t[k] = function() {\r
+                                       var a = [id], i;\r
+\r
+                                       for (i = 0; i < arguments.length; i++)\r
+                                               a.push(arguments[i]);\r
+\r
+                                       a = dom[k].apply(dom, a);\r
+                                       t.update(k);\r
+\r
+                                       return a;\r
+                               };\r
+               });\r
+\r
+               tinymce.extend(t, {\r
+                       on : function(n, f, s) {\r
+                               return tinymce.dom.Event.add(t.id, n, f, s);\r
+                       },\r
+\r
+                       getXY : function() {\r
+                               return {\r
+                                       x : parseInt(t.getStyle('left')),\r
+                                       y : parseInt(t.getStyle('top'))\r
+                               };\r
+                       },\r
+\r
+                       getSize : function() {\r
+                               var n = dom.get(t.id);\r
+\r
+                               return {\r
+                                       w : parseInt(t.getStyle('width') || n.clientWidth),\r
+                                       h : parseInt(t.getStyle('height') || n.clientHeight)\r
+                               };\r
+                       },\r
+\r
+                       moveTo : function(x, y) {\r
+                               t.setStyles({left : x, top : y});\r
+                       },\r
+\r
+                       moveBy : function(x, y) {\r
+                               var p = t.getXY();\r
+\r
+                               t.moveTo(p.x + x, p.y + y);\r
+                       },\r
+\r
+                       resizeTo : function(w, h) {\r
+                               t.setStyles({width : w, height : h});\r
+                       },\r
+\r
+                       resizeBy : function(w, h) {\r
+                               var s = t.getSize();\r
+\r
+                               t.resizeTo(s.w + w, s.h + h);\r
+                       },\r
+\r
+                       update : function(k) {\r
+                               var b;\r
+\r
+                               if (tinymce.isIE6 && settings.blocker) {\r
+                                       k = k || '';\r
+\r
+                                       // Ignore getters\r
+                                       if (k.indexOf('get') === 0 || k.indexOf('has') === 0 || k.indexOf('is') === 0)\r
+                                               return;\r
+\r
+                                       // Remove blocker on remove\r
+                                       if (k == 'remove') {\r
+                                               dom.remove(t.blocker);\r
+                                               return;\r
+                                       }\r
+\r
+                                       if (!t.blocker) {\r
+                                               t.blocker = dom.uniqueId();\r
+                                               b = dom.add(settings.container || dom.getRoot(), 'iframe', {id : t.blocker, style : 'position:absolute;', frameBorder : 0, src : 'javascript:""'});\r
+                                               dom.setStyle(b, 'opacity', 0);\r
+                                       } else\r
+                                               b = dom.get(t.blocker);\r
+\r
+                                       dom.setStyles(b, {\r
+                                               left : t.getStyle('left', 1),\r
+                                               top : t.getStyle('top', 1),\r
+                                               width : t.getStyle('width', 1),\r
+                                               height : t.getStyle('height', 1),\r
+                                               display : t.getStyle('display', 1),\r
+                                               zIndex : parseInt(t.getStyle('zIndex', 1) || 0) - 1\r
+                                       });\r
+                               }\r
+                       }\r
+               });\r
+       };\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+       function trimNl(s) {\r
+               return s.replace(/[\n\r]+/g, '');\r
+       };\r
+\r
+       // Shorten names\r
+       var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each;\r
+\r
+       tinymce.create('tinymce.dom.Selection', {\r
+               Selection : function(dom, win, serializer) {\r
+                       var t = this;\r
+\r
+                       t.dom = dom;\r
+                       t.win = win;\r
+                       t.serializer = serializer;\r
+\r
+                       // Add events\r
+                       each([\r
+                               'onBeforeSetContent',\r
+                               'onBeforeGetContent',\r
+                               'onSetContent',\r
+                               'onGetContent'\r
+                       ], function(e) {\r
+                               t[e] = new tinymce.util.Dispatcher(t);\r
+                       });\r
+\r
+                       // No W3C Range support\r
+                       if (!t.win.getSelection)\r
+                               t.tridentSel = new tinymce.dom.TridentSelection(t);\r
+\r
+                       // Prevent leaks\r
+                       tinymce.addUnload(t.destroy, t);\r
+               },\r
+\r
+               getContent : function(s) {\r
+                       var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n;\r
+\r
+                       s = s || {};\r
+                       wb = wa = '';\r
+                       s.get = true;\r
+                       s.format = s.format || 'html';\r
+                       t.onBeforeGetContent.dispatch(t, s);\r
+\r
+                       if (s.format == 'text')\r
+                               return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : ''));\r
+\r
+                       if (r.cloneContents) {\r
+                               n = r.cloneContents();\r
+\r
+                               if (n)\r
+                                       e.appendChild(n);\r
+                       } else if (is(r.item) || is(r.htmlText))\r
+                               e.innerHTML = r.item ? r.item(0).outerHTML : r.htmlText;\r
+                       else\r
+                               e.innerHTML = r.toString();\r
+\r
+                       // Keep whitespace before and after\r
+                       if (/^\s/.test(e.innerHTML))\r
+                               wb = ' ';\r
+\r
+                       if (/\s+$/.test(e.innerHTML))\r
+                               wa = ' ';\r
+\r
+                       s.getInner = true;\r
+\r
+                       s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa;\r
+                       t.onGetContent.dispatch(t, s);\r
+\r
+                       return s.content;\r
+               },\r
+\r
+               setContent : function(h, s) {\r
+                       var t = this, r = t.getRng(), c, d = t.win.document;\r
+\r
+                       s = s || {format : 'html'};\r
+                       s.set = true;\r
+                       h = s.content = t.dom.processHTML(h);\r
+\r
+                       // Dispatch before set content event\r
+                       t.onBeforeSetContent.dispatch(t, s);\r
+                       h = s.content;\r
+\r
+                       if (r.insertNode) {\r
+                               // Make caret marker since insertNode places the caret in the beginning of text after insert\r
+                               h += '<span id="__caret">_</span>';\r
+\r
+                               // Delete and insert new node\r
+                               if (r.startContainer == d && r.endContainer == d) {\r
+                                       // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents\r
+                                       d.body.innerHTML = h;\r
+                               } else {\r
+                                       r.deleteContents();\r
+                                       r.insertNode(t.getRng().createContextualFragment(h));\r
+                               }\r
+\r
+                               // Move to caret marker\r
+                               c = t.dom.get('__caret');\r
+\r
+                               // Make sure we wrap it compleatly, Opera fails with a simple select call\r
+                               r = d.createRange();\r
+                               r.setStartBefore(c);\r
+                               r.setEndBefore(c);\r
+                               t.setRng(r);\r
+\r
+                               // Remove the caret position\r
+                               t.dom.remove('__caret');\r
+                       } else {\r
+                               if (r.item) {\r
+                                       // Delete content and get caret text selection\r
+                                       d.execCommand('Delete', false, null);\r
+                                       r = t.getRng();\r
+                               }\r
+\r
+                               r.pasteHTML(h);\r
+                       }\r
+\r
+                       // Dispatch set content event\r
+                       t.onSetContent.dispatch(t, s);\r
+               },\r
+\r
+               getStart : function() {\r
+                       var t = this, r = t.getRng(), e;\r
+\r
+                       if (isIE) {\r
+                               if (r.item)\r
+                                       return r.item(0);\r
+\r
+                               r = r.duplicate();\r
+                               r.collapse(1);\r
+                               e = r.parentElement();\r
+\r
+                               if (e && e.nodeName == 'BODY')\r
+                                       return e.firstChild || e;\r
+\r
+                               return e;\r
+                       } else {\r
+                               e = r.startContainer;\r
+\r
+                               if (e.nodeType == 1 && e.hasChildNodes())\r
+                                       e = e.childNodes[Math.min(e.childNodes.length - 1, r.startOffset)];\r
+\r
+                               if (e && e.nodeType == 3)\r
+                                       return e.parentNode;\r
+\r
+                               return e;\r
+                       }\r
+               },\r
+\r
+               getEnd : function() {\r
+                       var t = this, r = t.getRng(), e, eo;\r
+\r
+                       if (isIE) {\r
+                               if (r.item)\r
+                                       return r.item(0);\r
+\r
+                               r = r.duplicate();\r
+                               r.collapse(0);\r
+                               e = r.parentElement();\r
+\r
+                               if (e && e.nodeName == 'BODY')\r
+                                       return e.lastChild || e;\r
+\r
+                               return e;\r
+                       } else {\r
+                               e = r.endContainer;\r
+                               eo = r.endOffset;\r
+\r
+                               if (e.nodeType == 1 && e.hasChildNodes())\r
+                                       e = e.childNodes[eo > 0 ? eo - 1 : eo];\r
+\r
+                               if (e && e.nodeType == 3)\r
+                                       return e.parentNode;\r
+\r
+                               return e;\r
+                       }\r
+               },\r
+\r
+               getBookmark : function(type, normalized) {\r
+                       var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, index, chr = '\uFEFF', styles;\r
+\r
+                       function findIndex(name, element) {\r
+                               var index = 0;\r
+\r
+                               each(dom.select(name), function(node, i) {\r
+                                       if (node == element)\r
+                                               index = i;\r
+                               });\r
+\r
+                               return index;\r
+                       };\r
+\r
+                       if (type == 2) {\r
+                               function getLocation() {\r
+                                       var rng = t.getRng(true), root = dom.getRoot(), bookmark = {};\r
+\r
+                                       function getPoint(rng, start) {\r
+                                               var indexes = [], node, lastIdx,\r
+                                                       container = rng[start ? 'startContainer' : 'endContainer'],\r
+                                                       offset = rng[start ? 'startOffset' : 'endOffset'], exclude, point = {};\r
+\r
+                                               // Resolve element index\r
+                                               if (container.nodeType == 1 && container.hasChildNodes()) {\r
+                                                       lastIdx = container.childNodes.length - 1;\r
+                                                       point.exclude = (start && offset > lastIdx) || (!start && offset == 0);\r
+\r
+                                                       if (!start && offset)\r
+                                                               offset--;\r
+\r
+                                                       container = container.childNodes[offset > lastIdx ? lastIdx : offset];\r
+\r
+                                                       if (container.nodeType == 3)\r
+                                                               offset = start ? 0 : container.nodeValue.length;\r
+                                               }\r
+\r
+                                               if (container.nodeType == 3) {\r
+                                                       if (normalized) {\r
+                                                               for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling)\r
+                                                                       offset += node.nodeValue.length;\r
+                                                       }\r
+\r
+                                                       point.offset = offset;\r
+                                               }\r
+\r
+                                               for (; container && container != root; container = container.parentNode)\r
+                                                       indexes.push(t.dom.nodeIndex(container, normalized));\r
+\r
+                                               point.indexes = indexes;\r
+\r
+                                               return point;\r
+                                       };\r
+\r
+                                       bookmark.start = getPoint(rng, true);\r
+\r
+                                       if (!t.isCollapsed())\r
+                                               bookmark.end = getPoint(rng);\r
+\r
+                                       return bookmark;\r
+                               };\r
+\r
+                               return getLocation();\r
+                       }\r
+\r
+                       // Handle simple range\r
+                       if (type)\r
+                               return {rng : t.getRng()};\r
+\r
+                       rng = t.getRng();\r
+                       id = dom.uniqueId();\r
+                       collapsed = tinyMCE.activeEditor.selection.isCollapsed();\r
+                       styles = 'overflow:hidden;line-height:0px';\r
+\r
+                       // Explorer method\r
+                       if (rng.duplicate || rng.item) {\r
+                               // Text selection\r
+                               if (!rng.item) {\r
+                                       rng2 = rng.duplicate();\r
+\r
+                                       // Insert start marker\r
+                                       rng.collapse();\r
+                                       rng.pasteHTML('<span _mce_type="bookmark" id="' + id + '_start" style="' + styles + '">' + chr + '</span>');\r
+\r
+                                       // Insert end marker\r
+                                       if (!collapsed) {\r
+                                               rng2.collapse(false);\r
+                                               rng2.pasteHTML('<span _mce_type="bookmark" id="' + id + '_end" style="' + styles + '">' + chr + '</span>');\r
+                                       }\r
+                               } else {\r
+                                       // Control selection\r
+                                       element = rng.item(0);\r
+                                       name = element.nodeName;\r
+\r
+                                       return {name : name, index : findIndex(name, element)};\r
+                               }\r
+                       } else {\r
+                               element = t.getNode();\r
+                               name = element.nodeName;\r
+                               if (name == 'IMG')\r
+                                       return {name : name, index : findIndex(name, element)};\r
+\r
+                               // W3C method\r
+                               rng2 = rng.cloneRange();\r
+\r
+                               // Insert end marker\r
+                               if (!collapsed) {\r
+                                       rng2.collapse(false);\r
+                                       rng2.insertNode(dom.create('span', {_mce_type : "bookmark", id : id + '_end', style : styles}, chr));\r
+                               }\r
+\r
+                               rng.collapse(true);\r
+                               rng.insertNode(dom.create('span', {_mce_type : "bookmark", id : id + '_start', style : styles}, chr));\r
+                       }\r
+\r
+                       t.moveToBookmark({id : id, keep : 1});\r
+\r
+                       return {id : id};\r
+               },\r
+\r
+               moveToBookmark : function(bookmark) {\r
+                       var t = this, dom = t.dom, marker1, marker2, rng, root;\r
+\r
+                       // Clear selection cache\r
+                       if (t.tridentSel)\r
+                               t.tridentSel.destroy();\r
+\r
+                       if (bookmark) {\r
+                               if (bookmark.start) {\r
+                                       rng = dom.createRng();\r
+                                       root = dom.getRoot();\r
+\r
+                                       function setEndPoint(start) {\r
+                                               var point = bookmark[start ? 'start' : 'end'], i, node, offset;\r
+\r
+                                               if (point) {\r
+                                                       for (node = root, i = point.indexes.length - 1; i >= 0; i--)\r
+                                                               node = node.childNodes[point.indexes[i]] || node;\r
+\r
+                                                       if (start) {\r
+                                                               if (node.nodeType == 3 && point.offset)\r
+                                                                       rng.setStart(node, point.offset);\r
+                                                               else {\r
+                                                                       if (point.exclude)\r
+                                                                               rng.setStartAfter(node);\r
+                                                                       else\r
+                                                                               rng.setStartBefore(node);\r
+                                                               }\r
+                                                       } else {\r
+                                                               if (node.nodeType == 3 && point.offset)\r
+                                                                       rng.setEnd(node, point.offset);\r
+                                                               else {\r
+                                                                       if (point.exclude)\r
+                                                                               rng.setEndBefore(node);\r
+                                                                       else\r
+                                                                               rng.setEndAfter(node);\r
+                                                               }\r
+                                                       }\r
+                                               }\r
+                                       };\r
+\r
+                                       setEndPoint(true);\r
+                                       setEndPoint();\r
+\r
+                                       t.setRng(rng);\r
+                               } else if (bookmark.id) {\r
+                                       rng = dom.createRng();\r
+\r
+                                       function restoreEndPoint(suffix) {\r
+                                               var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep;\r
+\r
+                                               if (marker) {\r
+                                                       node = marker.parentNode;\r
+\r
+                                                       if (suffix == 'start') {\r
+                                                               if (!keep) {\r
+                                                                       idx = dom.nodeIndex(marker);\r
+                                                               } else {\r
+                                                                       node = marker;\r
+                                                                       idx = 1;\r
+                                                               }\r
+\r
+                                                               rng.setStart(node, idx);\r
+                                                               rng.setEnd(node, idx);\r
+                                                       } else {\r
+                                                               if (!keep) {\r
+                                                                       idx = dom.nodeIndex(marker);\r
+                                                               } else {\r
+                                                                       node = marker;\r
+                                                                       idx = 1;\r
+                                                               }\r
+\r
+                                                               rng.setEnd(node, idx);\r
+                                                       }\r
+\r
+                                                       if (!keep) {\r
+                                                               prev = marker.previousSibling;\r
+                                                               next = marker.nextSibling;\r
+\r
+                                                               // Remove all marker text nodes\r
+                                                               each(tinymce.grep(marker.childNodes), function(node) {\r
+                                                                       if (node.nodeType == 3)\r
+                                                                               node.nodeValue = node.nodeValue.replace(/\uFEFF/g, '');\r
+                                                               });\r
+\r
+                                                               // Remove marker but keep children if for example contents where inserted into the marker\r
+                                                               // Also remove duplicated instances of the marker for example by a split operation or by WebKit auto split on paste feature\r
+                                                               while (marker = dom.get(bookmark.id + '_' + suffix))\r
+                                                                       dom.remove(marker, 1);\r
+\r
+                                                               // If siblings are text nodes then merge them\r
+                                                               if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3) {\r
+                                                                       idx = prev.nodeValue.length;\r
+                                                                       prev.appendData(next.nodeValue);\r
+                                                                       dom.remove(next);\r
+\r
+                                                                       if (suffix == 'start') {\r
+                                                                               rng.setStart(prev, idx);\r
+                                                                               rng.setEnd(prev, idx);\r
+                                                                       } else\r
+                                                                               rng.setEnd(prev, idx);\r
+                                                               }\r
+                                                       }\r
+                                               }\r
+                                       };\r
+\r
+                                       // Restore start/end points\r
+                                       restoreEndPoint('start');\r
+                                       restoreEndPoint('end');\r
+\r
+                                       t.setRng(rng);\r
+                               } else if (bookmark.name) {\r
+                                       t.select(dom.select(bookmark.name)[bookmark.index]);\r
+                               } else if (bookmark.rng)\r
+                                       t.setRng(bookmark.rng);\r
+                       }\r
+               },\r
+\r
+               select : function(node, content) {\r
+                       var t = this, dom = t.dom, rng = dom.createRng(), idx;\r
+\r
+                       idx = dom.nodeIndex(node);\r
+                       rng.setStart(node.parentNode, idx);\r
+                       rng.setEnd(node.parentNode, idx + 1);\r
+\r
+                       // Find first/last text node or BR element\r
+                       if (content) {\r
+                               function setPoint(node, start) {\r
+                                       var walker = new tinymce.dom.TreeWalker(node, node);\r
+\r
+                                       do {\r
+                                               // Text node\r
+                                               if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) {\r
+                                                       if (start)\r
+                                                               rng.setStart(node, 0);\r
+                                                       else\r
+                                                               rng.setEnd(node, node.nodeValue.length);\r
+\r
+                                                       return;\r
+                                               }\r
+\r
+                                               // BR element\r
+                                               if (node.nodeName == 'BR') {\r
+                                                       if (start)\r
+                                                               rng.setStartBefore(node);\r
+                                                       else\r
+                                                               rng.setEndBefore(node);\r
+\r
+                                                       return;\r
+                                               }\r
+                                       } while (node = (start ? walker.next() : walker.prev()));\r
+                               };\r
+\r
+                               setPoint(node, 1);\r
+                               setPoint(node);\r
+                       }\r
+\r
+                       t.setRng(rng);\r
+\r
+                       return node;\r
+               },\r
+\r
+               isCollapsed : function() {\r
+                       var t = this, r = t.getRng(), s = t.getSel();\r
+\r
+                       if (!r || r.item)\r
+                               return false;\r
+\r
+                       if (r.compareEndPoints)\r
+                               return r.compareEndPoints('StartToEnd', r) === 0;\r
+\r
+                       return !s || r.collapsed;\r
+               },\r
+\r
+               collapse : function(b) {\r
+                       var t = this, r = t.getRng(), n;\r
+\r
+                       // Control range on IE\r
+                       if (r.item) {\r
+                               n = r.item(0);\r
+                               r = this.win.document.body.createTextRange();\r
+                               r.moveToElementText(n);\r
+                       }\r
+\r
+                       r.collapse(!!b);\r
+                       t.setRng(r);\r
+               },\r
+\r
+               getSel : function() {\r
+                       var t = this, w = this.win;\r
+\r
+                       return w.getSelection ? w.getSelection() : w.document.selection;\r
+               },\r
+\r
+               getRng : function(w3c) {\r
+                       var t = this, s, r;\r
+\r
+                       // Found tridentSel object then we need to use that one\r
+                       if (w3c && t.tridentSel)\r
+                               return t.tridentSel.getRangeAt(0);\r
+\r
+                       try {\r
+                               if (s = t.getSel())\r
+                                       r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : t.win.document.createRange());\r
+                       } catch (ex) {\r
+                               // IE throws unspecified error here if TinyMCE is placed in a frame/iframe\r
+                       }\r
+\r
+                       // No range found then create an empty one\r
+                       // This can occur when the editor is placed in a hidden container element on Gecko\r
+                       // Or on IE when there was an exception\r
+                       if (!r)\r
+                               r = isIE ? t.win.document.body.createTextRange() : t.win.document.createRange();\r
+\r
+                       return r;\r
+               },\r
+\r
+               setRng : function(r) {\r
+                       var s, t = this;\r
+\r
+                       if (!t.tridentSel) {\r
+                               s = t.getSel();\r
+\r
+                               if (s) {\r
+                                       s.removeAllRanges();\r
+                                       s.addRange(r);\r
+                               }\r
+                       } else {\r
+                               // Is W3C Range\r
+                               if (r.cloneRange) {\r
+                                       t.tridentSel.addRange(r);\r
+                                       return;\r
+                               }\r
+\r
+                               // Is IE specific range\r
+                               try {\r
+                                       r.select();\r
+                               } catch (ex) {\r
+                                       // Needed for some odd IE bug #1843306\r
+                               }\r
+                       }\r
+               },\r
+\r
+               setNode : function(n) {\r
+                       var t = this;\r
+\r
+                       t.setContent(t.dom.getOuterHTML(n));\r
+\r
+                       return n;\r
+               },\r
+\r
+               getNode : function() {\r
+                       var t = this, rng = t.getRng(), sel = t.getSel(), elm;\r
+\r
+                       if (!isIE) {\r
+                               // Range maybe lost after the editor is made visible again\r
+                               if (!rng)\r
+                                       return t.dom.getRoot();\r
+\r
+                               elm = rng.commonAncestorContainer;\r
+\r
+                               // Handle selection a image or other control like element such as anchors\r
+                               if (!rng.collapsed) {\r
+                                       if (rng.startContainer == rng.endContainer) {\r
+                                               if (rng.startOffset - rng.endOffset < 2) {\r
+                                                       if (rng.startContainer.hasChildNodes())\r
+                                                               elm = rng.startContainer.childNodes[rng.startOffset];\r
+                                               }\r
+                                       }\r
+\r
+                                       // If the anchor node is a element instead of a text node then return this element\r
+                                       if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1) \r
+                                               return sel.anchorNode.childNodes[sel.anchorOffset]; \r
+                               }\r
+\r
+                               if (elm && elm.nodeType == 3)\r
+                                       return elm.parentNode;\r
+\r
+                               return elm;\r
+                       }\r
+\r
+                       return rng.item ? rng.item(0) : rng.parentElement();\r
+               },\r
+\r
+               getSelectedBlocks : function(st, en) {\r
+                       var t = this, dom = t.dom, sb, eb, n, bl = [];\r
+\r
+                       sb = dom.getParent(st || t.getStart(), dom.isBlock);\r
+                       eb = dom.getParent(en || t.getEnd(), dom.isBlock);\r
+\r
+                       if (sb)\r
+                               bl.push(sb);\r
+\r
+                       if (sb && eb && sb != eb) {\r
+                               n = sb;\r
+\r
+                               while ((n = n.nextSibling) && n != eb) {\r
+                                       if (dom.isBlock(n))\r
+                                               bl.push(n);\r
+                               }\r
+                       }\r
+\r
+                       if (eb && sb != eb)\r
+                               bl.push(eb);\r
+\r
+                       return bl;\r
+               },\r
+\r
+               destroy : function(s) {\r
+                       var t = this;\r
+\r
+                       t.win = null;\r
+\r
+                       if (t.tridentSel)\r
+                               t.tridentSel.destroy();\r
+\r
+                       // Manual destroy then remove unload handler\r
+                       if (!s)\r
+                               tinymce.removeUnload(t.destroy);\r
+               }\r
+       });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+       tinymce.create('tinymce.dom.XMLWriter', {\r
+               node : null,\r
+\r
+               XMLWriter : function(s) {\r
+                       // Get XML document\r
+                       function getXML() {\r
+                               var i = document.implementation;\r
+\r
+                               if (!i || !i.createDocument) {\r
+                                       // Try IE objects\r
+                                       try {return new ActiveXObject('MSXML2.DOMDocument');} catch (ex) {}\r
+                                       try {return new ActiveXObject('Microsoft.XmlDom');} catch (ex) {}\r
+                               } else\r
+                                       return i.createDocument('', '', null);\r
+                       };\r
+\r
+                       this.doc = getXML();\r
+                       \r
+                       // Since Opera and WebKit doesn't escape > into &gt; we need to do it our self to normalize the output for all browsers\r
+                       this.valid = tinymce.isOpera || tinymce.isWebKit;\r
+\r
+                       this.reset();\r
+               },\r
+\r
+               reset : function() {\r
+                       var t = this, d = t.doc;\r
+\r
+                       if (d.firstChild)\r
+                               d.removeChild(d.firstChild);\r
+\r
+                       t.node = d.appendChild(d.createElement("html"));\r
+               },\r
+\r
+               writeStartElement : function(n) {\r
+                       var t = this;\r
+\r
+                       t.node = t.node.appendChild(t.doc.createElement(n));\r
+               },\r
+\r
+               writeAttribute : function(n, v) {\r
+                       if (this.valid)\r
+                               v = v.replace(/>/g, '%MCGT%');\r
+\r
+                       this.node.setAttribute(n, v);\r
+               },\r
+\r
+               writeEndElement : function() {\r
+                       this.node = this.node.parentNode;\r
+               },\r
+\r
+               writeFullEndElement : function() {\r
+                       var t = this, n = t.node;\r
+\r
+                       n.appendChild(t.doc.createTextNode(""));\r
+                       t.node = n.parentNode;\r
+               },\r
+\r
+               writeText : function(v) {\r
+                       if (this.valid)\r
+                               v = v.replace(/>/g, '%MCGT%');\r
+\r
+                       this.node.appendChild(this.doc.createTextNode(v));\r
+               },\r
+\r
+               writeCDATA : function(v) {\r
+                       this.node.appendChild(this.doc.createCDATASection(v));\r
+               },\r
+\r
+               writeComment : function(v) {\r
+                       // Fix for bug #2035694\r
+                       if (tinymce.isIE)\r
+                               v = v.replace(/^\-|\-$/g, ' ');\r
+\r
+                       this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g, ' ')));\r
+               },\r
+\r
+               getContent : function() {\r
+                       var h;\r
+\r
+                       h = this.doc.xml || new XMLSerializer().serializeToString(this.doc);\r
+                       h = h.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g, '');\r
+                       h = h.replace(/ ?\/>/g, ' />');\r
+\r
+                       if (this.valid)\r
+                               h = h.replace(/\%MCGT%/g, '&gt;');\r
+\r
+                       return h;\r
+               }\r
+       });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+       tinymce.create('tinymce.dom.StringWriter', {\r
+               str : null,\r
+               tags : null,\r
+               count : 0,\r
+               settings : null,\r
+               indent : null,\r
+\r
+               StringWriter : function(s) {\r
+                       this.settings = tinymce.extend({\r
+                               indent_char : ' ',\r
+                               indentation : 0\r
+                       }, s);\r
+\r
+                       this.reset();\r
+               },\r
+\r
+               reset : function() {\r
+                       this.indent = '';\r
+                       this.str = "";\r
+                       this.tags = [];\r
+                       this.count = 0;\r
+               },\r
+\r
+               writeStartElement : function(n) {\r
+                       this._writeAttributesEnd();\r
+                       this.writeRaw('<' + n);\r
+                       this.tags.push(n);\r
+                       this.inAttr = true;\r
+                       this.count++;\r
+                       this.elementCount = this.count;\r
+               },\r
+\r
+               writeAttribute : function(n, v) {\r
+                       var t = this;\r
+\r
+                       t.writeRaw(" " + t.encode(n) + '="' + t.encode(v) + '"');\r
+               },\r
+\r
+               writeEndElement : function() {\r
+                       var n;\r
+\r
+                       if (this.tags.length > 0) {\r
+                               n = this.tags.pop();\r
+\r
+                               if (this._writeAttributesEnd(1))\r
+                                       this.writeRaw('</' + n + '>');\r
+\r
+                               if (this.settings.indentation > 0)\r
+                                       this.writeRaw('\n');\r
+                       }\r
+               },\r
+\r
+               writeFullEndElement : function() {\r
+                       if (this.tags.length > 0) {\r
+                               this._writeAttributesEnd();\r
+                               this.writeRaw('</' + this.tags.pop() + '>');\r
+\r
+                               if (this.settings.indentation > 0)\r
+                                       this.writeRaw('\n');\r
+                       }\r
+               },\r
+\r
+               writeText : function(v) {\r
+                       this._writeAttributesEnd();\r
+                       this.writeRaw(this.encode(v));\r
+                       this.count++;\r
+               },\r
+\r
+               writeCDATA : function(v) {\r
+                       this._writeAttributesEnd();\r
+                       this.writeRaw('<![CDATA[' + v + ']]>');\r
+                       this.count++;\r
+               },\r
+\r
+               writeComment : function(v) {\r
+                       this._writeAttributesEnd();\r
+                       this.writeRaw('<!-- ' + v + '-->');\r
+                       this.count++;\r
+               },\r
+\r
+               writeRaw : function(v) {\r
+                       this.str += v;\r
+               },\r
+\r
+               encode : function(s) {\r
+                       return s.replace(/[<>&"]/g, function(v) {\r
+                               switch (v) {\r
+                                       case '<':\r
+                                               return '&lt;';\r
+\r
+                                       case '>':\r
+                                               return '&gt;';\r
+\r
+                                       case '&':\r
+                                               return '&amp;';\r
+\r
+                                       case '"':\r
+                                               return '&quot;';\r
+                               }\r
+\r
+                               return v;\r
+                       });\r
+               },\r
+\r
+               getContent : function() {\r
+                       return this.str;\r
+               },\r
+\r
+               _writeAttributesEnd : function(s) {\r
+                       if (!this.inAttr)\r
+                               return;\r
+\r
+                       this.inAttr = false;\r
+\r
+                       if (s && this.elementCount == this.count) {\r
+                               this.writeRaw(' />');\r
+                               return false;\r
+                       }\r
+\r
+                       this.writeRaw('>');\r
+\r
+                       return true;\r
+               }\r
+       });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+       // Shorten names\r
+       var extend = tinymce.extend, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, isIE = tinymce.isIE, isGecko = tinymce.isGecko;\r
+\r
+       function wildcardToRE(s) {\r
+               return s.replace(/([?+*])/g, '.$1');\r
+       };\r
+\r
+       tinymce.create('tinymce.dom.Serializer', {\r
+               Serializer : function(s) {\r
+                       var t = this;\r
+\r
+                       t.key = 0;\r
+                       t.onPreProcess = new Dispatcher(t);\r
+                       t.onPostProcess = new Dispatcher(t);\r
+\r
+                       try {\r
+                               t.writer = new tinymce.dom.XMLWriter();\r
+                       } catch (ex) {\r
+                               // IE might throw exception if ActiveX is disabled so we then switch to the slightly slower StringWriter\r
+                               t.writer = new tinymce.dom.StringWriter();\r
+                       }\r
+\r
+                       // Default settings\r
+                       t.settings = s = extend({\r
+                               dom : tinymce.DOM,\r
+                               valid_nodes : 0,\r
+                               node_filter : 0,\r
+                               attr_filter : 0,\r
+                               invalid_attrs : /^(_mce_|_moz_|sizset|sizcache)/,\r
+                               closed : /^(br|hr|input|meta|img|link|param|area)$/,\r
+                               entity_encoding : 'named',\r
+                               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',\r
+                               valid_elements : '*[*]',\r
+                               extended_valid_elements : 0,\r
+                               invalid_elements : 0,\r
+                               fix_table_elements : 1,\r
+                               fix_list_elements : true,\r
+                               fix_content_duplication : true,\r
+                               convert_fonts_to_spans : false,\r
+                               font_size_classes : 0,\r
+                               apply_source_formatting : 0,\r
+                               indent_mode : 'simple',\r
+                               indent_char : '\t',\r
+                               indent_levels : 1,\r
+                               remove_linebreaks : 1,\r
+                               remove_redundant_brs : 1,\r
+                               element_format : 'xhtml'\r
+                       }, s);\r
+\r
+                       t.dom = s.dom;\r
+                       t.schema = s.schema;\r
+\r
+                       // Use raw entities if no entities are defined\r
+                       if (s.entity_encoding == 'named' && !s.entities)\r
+                               s.entity_encoding = 'raw';\r
+\r
+                       if (s.remove_redundant_brs) {\r
+                               t.onPostProcess.add(function(se, o) {\r
+                                       // Remove single BR at end of block elements since they get rendered\r
+                                       o.content = o.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi, function(a, b, c) {\r
+                                               // Check if it's a single element\r
+                                               if (/^<br \/>\s*<\//.test(a))\r
+                                                       return '</' + c + '>';\r
+\r
+                                               return a;\r
+                                       });\r
+                               });\r
+                       }\r
+\r
+                       // Remove XHTML element endings i.e. produce crap :) XHTML is better\r
+                       if (s.element_format == 'html') {\r
+                               t.onPostProcess.add(function(se, o) {\r
+                                       o.content = o.content.replace(/<([^>]+) \/>/g, '<$1>');\r
+                               });\r
+                       }\r
+\r
+                       if (s.fix_list_elements) {\r
+                               t.onPreProcess.add(function(se, o) {\r
+                                       var nl, x, a = ['ol', 'ul'], i, n, p, r = /^(OL|UL)$/, np;\r
+\r
+                                       function prevNode(e, n) {\r
+                                               var a = n.split(','), i;\r
+\r
+                                               while ((e = e.previousSibling) != null) {\r
+                                                       for (i=0; i<a.length; i++) {\r
+                                                               if (e.nodeName == a[i])\r
+                                                                       return e;\r
+                                                       }\r
+                                               }\r
+\r
+                                               return null;\r
+                                       };\r
+\r
+                                       for (x=0; x<a.length; x++) {\r
+                                               nl = t.dom.select(a[x], o.node);\r
+\r
+                                               for (i=0; i<nl.length; i++) {\r
+                                                       n = nl[i];\r
+                                                       p = n.parentNode;\r
+\r
+                                                       if (r.test(p.nodeName)) {\r
+                                                               np = prevNode(n, 'LI');\r
+\r
+                                                               if (!np) {\r
+                                                                       np = t.dom.create('li');\r
+                                                                       np.innerHTML = '&nbsp;';\r
+                                                                       np.appendChild(n);\r
+                                                                       p.insertBefore(np, p.firstChild);\r
+                                                               } else\r
+                                                                       np.appendChild(n);\r
+                                                       }\r
+                                               }\r
+                                       }\r
+                               });\r
+                       }\r
+\r
+                       if (s.fix_table_elements) {\r
+                               t.onPreProcess.add(function(se, o) {\r
+                                       // Since Opera will crash if you attach the node to a dynamic document we need to brrowser sniff a specific build\r
+                                       // so Opera users with an older version will have to live with less compaible output not much we can do here\r
+                                       if (!tinymce.isOpera || opera.buildNumber() >= 1767) {\r
+                                               each(t.dom.select('p table', o.node).reverse(), function(n) {\r
+                                                       var parent = t.dom.getParent(n.parentNode, 'table,p');\r
+\r
+                                                       if (parent.nodeName != 'TABLE') {\r
+                                                               try {\r
+                                                                       t.dom.split(parent, n);\r
+                                                               } catch (ex) {\r
+                                                                       // IE can sometimes fire an unknown runtime error so we just ignore it\r
+                                                               }\r
+                                                       }\r
+                                               });\r
+                                       }\r
+                               });\r
+                       }\r
+               },\r
+\r
+               setEntities : function(s) {\r
+                       var t = this, a, i, l = {}, v;\r
+\r
+                       // No need to setup more than once\r
+                       if (t.entityLookup)\r
+                               return;\r
+\r
+                       // Build regex and lookup array\r
+                       a = s.split(',');\r
+                       for (i = 0; i < a.length; i += 2) {\r
+                               v = a[i];\r
+\r
+                               // Don't add default &amp; &quot; etc.\r
+                               if (v == 34 || v == 38 || v == 60 || v == 62)\r
+                                       continue;\r
+\r
+                               l[String.fromCharCode(a[i])] = a[i + 1];\r
+\r
+                               v = parseInt(a[i]).toString(16);\r
+                       }\r
+\r
+                       t.entityLookup = l;\r
+               },\r
+\r
+               setRules : function(s) {\r
+                       var t = this;\r
+\r
+                       t._setup();\r
+                       t.rules = {};\r
+                       t.wildRules = [];\r
+                       t.validElements = {};\r
+\r
+                       return t.addRules(s);\r
+               },\r
+\r
+               addRules : function(s) {\r
+                       var t = this, dr;\r
+\r
+                       if (!s)\r
+                               return;\r
+\r
+                       t._setup();\r
+\r
+                       each(s.split(','), function(s) {\r
+                               var p = s.split(/\[|\]/), tn = p[0].split('/'), ra, at, wat, va = [];\r
+\r
+                               // Extend with default rules\r
+                               if (dr)\r
+                                       at = tinymce.extend([], dr.attribs);\r
+\r
+                               // Parse attributes\r
+                               if (p.length > 1) {\r
+                                       each(p[1].split('|'), function(s) {\r
+                                               var ar = {}, i;\r
+\r
+                                               at = at || [];\r
+\r
+                                               // Parse attribute rule\r
+                                               s = s.replace(/::/g, '~');\r
+                                               s = /^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(s);\r
+                                               s[2] = s[2].replace(/~/g, ':');\r
+\r
+                                               // Add required attributes\r
+                                               if (s[1] == '!') {\r
+                                                       ra = ra || [];\r
+                                                       ra.push(s[2]);\r
+                                               }\r
+\r
+                                               // Remove inherited attributes\r
+                                               if (s[1] == '-') {\r
+                                                       for (i = 0; i <at.length; i++) {\r
+                                                               if (at[i].name == s[2]) {\r
+                                                                       at.splice(i, 1);\r
+                                                                       return;\r
+                                                               }\r
+                                                       }\r
+                                               }\r
+\r
+                                               switch (s[3]) {\r
+                                                       // Add default attrib values\r
+                                                       case '=':\r
+                                                               ar.defaultVal = s[4] || '';\r
+                                                               break;\r
+\r
+                                                       // Add forced attrib values\r
+                                                       case ':':\r
+                                                               ar.forcedVal = s[4];\r
+                                                               break;\r
+\r
+                                                       // Add validation values\r
+                                                       case '<':\r
+                                                               ar.validVals = s[4].split('?');\r
+                                                               break;\r
+                                               }\r
+\r
+                                               if (/[*.?]/.test(s[2])) {\r
+                                                       wat = wat || [];\r
+                                                       ar.nameRE = new RegExp('^' + wildcardToRE(s[2]) + '$');\r
+                                                       wat.push(ar);\r
+                                               } else {\r
+                                                       ar.name = s[2];\r
+                                                       at.push(ar);\r
+                                               }\r
+\r
+                                               va.push(s[2]);\r
+                                       });\r
+                               }\r
+\r
+                               // Handle element names\r
+                               each(tn, function(s, i) {\r
+                                       var pr = s.charAt(0), x = 1, ru = {};\r
+\r
+                                       // Extend with default rule data\r
+                                       if (dr) {\r
+                                               if (dr.noEmpty)\r
+                                                       ru.noEmpty = dr.noEmpty;\r
+\r
+                                               if (dr.fullEnd)\r
+                                                       ru.fullEnd = dr.fullEnd;\r
+\r
+                                               if (dr.padd)\r
+                                                       ru.padd = dr.padd;\r
+                                       }\r
+\r
+                                       // Handle prefixes\r
+                                       switch (pr) {\r
+                                               case '-':\r
+                                                       ru.noEmpty = true;\r
+                                                       break;\r
+\r
+                                               case '+':\r
+                                                       ru.fullEnd = true;\r
+                                                       break;\r
+\r
+                                               case '#':\r
+                                                       ru.padd = true;\r
+                                                       break;\r
+\r
+                                               default:\r
+                                                       x = 0;\r
+                                       }\r
+\r
+                                       tn[i] = s = s.substring(x);\r
+                                       t.validElements[s] = 1;\r
+\r
+                                       // Add element name or element regex\r
+                                       if (/[*.?]/.test(tn[0])) {\r
+                                               ru.nameRE = new RegExp('^' + wildcardToRE(tn[0]) + '$');\r
+                                               t.wildRules = t.wildRules || {};\r
+                                               t.wildRules.push(ru);\r
+                                       } else {\r
+                                               ru.name = tn[0];\r
+\r
+                                               // Store away default rule\r
+                                               if (tn[0] == '@')\r
+                                                       dr = ru;\r
+\r
+                                               t.rules[s] = ru;\r
+                                       }\r
+\r
+                                       ru.attribs = at;\r
+\r
+                                       if (ra)\r
+                                               ru.requiredAttribs = ra;\r
+\r
+                                       if (wat) {\r
+                                               // Build valid attributes regexp\r
+                                               s = '';\r
+                                               each(va, function(v) {\r
+                                                       if (s)\r
+                                                               s += '|';\r
+\r
+                                                       s += '(' + wildcardToRE(v) + ')';\r
+                                               });\r
+                                               ru.validAttribsRE = new RegExp('^' + s.toLowerCase() + '$');\r
+                                               ru.wildAttribs = wat;\r
+                                       }\r
+                               });\r
+                       });\r
+\r
+                       // Build valid elements regexp\r
+                       s = '';\r
+                       each(t.validElements, function(v, k) {\r
+                               if (s)\r
+                                       s += '|';\r
+\r
+                               if (k != '@')\r
+                                       s += k;\r
+                       });\r
+                       t.validElementsRE = new RegExp('^(' + wildcardToRE(s.toLowerCase()) + ')$');\r
+\r
+                       //console.debug(t.validElementsRE.toString());\r
+                       //console.dir(t.rules);\r
+                       //console.dir(t.wildRules);\r
+               },\r
+\r
+               findRule : function(n) {\r
+                       var t = this, rl = t.rules, i, r;\r
+\r
+                       t._setup();\r
+\r
+                       // Exact match\r
+                       r = rl[n];\r
+                       if (r)\r
+                               return r;\r
+\r
+                       // Try wildcards\r
+                       rl = t.wildRules;\r
+                       for (i = 0; i < rl.length; i++) {\r
+                               if (rl[i].nameRE.test(n))\r
+                                       return rl[i];\r
+                       }\r
+\r
+                       return null;\r
+               },\r
+\r
+               findAttribRule : function(ru, n) {\r
+                       var i, wa = ru.wildAttribs;\r
+\r
+                       for (i = 0; i < wa.length; i++) {\r
+                               if (wa[i].nameRE.test(n))\r
+                                       return wa[i];\r
+                       }\r
+\r
+                       return null;\r
+               },\r
+\r
+               serialize : function(n, o) {\r
+                       var h, t = this, doc, oldDoc, impl, selected;\r
+\r
+                       t._setup();\r
+                       o = o || {};\r
+                       o.format = o.format || 'html';\r
+                       t.processObj = o;\r
+\r
+                       // IE looses the selected attribute on option elements so we need to store it\r
+                       // See: http://support.microsoft.com/kb/829907\r
+                       if (isIE) {\r
+                               selected = [];\r
+                               each(n.getElementsByTagName('option'), function(n) {\r
+                                       var v = t.dom.getAttrib(n, 'selected');\r
+\r
+                                       selected.push(v ? v : null);\r
+                               });\r
+                       }\r
+\r
+                       n = n.cloneNode(true);\r
+\r
+                       // IE looses the selected attribute on option elements so we need to restore it\r
+                       if (isIE) {\r
+                               each(n.getElementsByTagName('option'), function(n, i) {\r
+                                       t.dom.setAttrib(n, 'selected', selected[i]);\r
+                               });\r
+                       }\r
+\r
+                       // Nodes needs to be attached to something in WebKit/Opera\r
+                       // Older builds of Opera crashes if you attach the node to an document created dynamically\r
+                       // and since we can't feature detect a crash we need to sniff the acutal build number\r
+                       // This fix will make DOM ranges and make Sizzle happy!\r
+                       impl = n.ownerDocument.implementation;\r
+                       if (impl.createHTMLDocument && (tinymce.isOpera && opera.buildNumber() >= 1767)) {\r
+                               // Create an empty HTML document\r
+                               doc = impl.createHTMLDocument("");\r
+\r
+                               // Add the element or it's children if it's a body element to the new document\r
+                               each(n.nodeName == 'BODY' ? n.childNodes : [n], function(node) {\r
+                                       doc.body.appendChild(doc.importNode(node, true));\r
+                               });\r
+\r
+                               // Grab first child or body element for serialization\r
+                               if (n.nodeName != 'BODY')\r
+                                       n = doc.body.firstChild;\r
+                               else\r
+                                       n = doc.body;\r
+\r
+                               // set the new document in DOMUtils so createElement etc works\r
+                               oldDoc = t.dom.doc;\r
+                               t.dom.doc = doc;\r
+                       }\r
+\r
+                       t.key = '' + (parseInt(t.key) + 1);\r
+\r
+                       // Pre process\r
+                       if (!o.no_events) {\r
+                               o.node = n;\r
+                               t.onPreProcess.dispatch(t, o);\r
+                       }\r
+\r
+                       // Serialize HTML DOM into a string\r
+                       t.writer.reset();\r
+                       t._info = o;\r
+                       t._serializeNode(n, o.getInner);\r
+\r
+                       // Post process\r
+                       o.content = t.writer.getContent();\r
+\r
+                       // Restore the old document if it was changed\r
+                       if (oldDoc)\r
+                               t.dom.doc = oldDoc;\r
+\r
+                       if (!o.no_events)\r
+                               t.onPostProcess.dispatch(t, o);\r
+\r
+                       t._postProcess(o);\r
+                       o.node = null;\r
+\r
+                       return tinymce.trim(o.content);\r
+               },\r
+\r
+               // Internal functions\r
+\r
+               _postProcess : function(o) {\r
+                       var t = this, s = t.settings, h = o.content, sc = [], p;\r
+\r
+                       if (o.format == 'html') {\r
+                               // Protect some elements\r
+                               p = t._protect({\r
+                                       content : h,\r
+                                       patterns : [\r
+                                               {pattern : /(<script[^>]*>)(.*?)(<\/script>)/g},\r
+                                               {pattern : /(<noscript[^>]*>)(.*?)(<\/noscript>)/g},\r
+                                               {pattern : /(<style[^>]*>)(.*?)(<\/style>)/g},\r
+                                               {pattern : /(<pre[^>]*>)(.*?)(<\/pre>)/g, encode : 1},\r
+                                               {pattern : /(<!--\[CDATA\[)(.*?)(\]\]-->)/g}\r
+                                       ]\r
+                               });\r
+\r
+                               h = p.content;\r
+\r
+                               // Entity encode\r
+                               if (s.entity_encoding !== 'raw')\r
+                                       h = t._encode(h);\r
+\r
+                               // Use BR instead of &nbsp; padded P elements inside editor and use <p>&nbsp;</p> outside editor\r
+/*                             if (o.set)\r
+                                       h = h.replace(/<p>\s+(&nbsp;|&#160;|\u00a0|<br \/>)\s+<\/p>/g, '<p><br /></p>');\r
+                               else\r
+                                       h = h.replace(/<p>\s+(&nbsp;|&#160;|\u00a0|<br \/>)\s+<\/p>/g, '<p>$1</p>');*/\r
+\r
+                               // Since Gecko and Safari keeps whitespace in the DOM we need to\r
+                               // remove it inorder to match other browsers. But I think Gecko and Safari is right.\r
+                               // This process is only done when getting contents out from the editor.\r
+                               if (!o.set) {\r
+                                       // We need to replace paragraph whitespace with an nbsp before indentation to keep the \u00a0 char\r
+                                       h = h.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g, s.entity_encoding == 'numeric' ? '<p$1>&#160;</p>' : '<p$1>&nbsp;</p>');\r
+\r
+                                       if (s.remove_linebreaks) {\r
+                                               h = h.replace(/\r?\n|\r/g, ' ');\r
+                                               h = h.replace(/(<[^>]+>)\s+/g, '$1 ');\r
+                                               h = h.replace(/\s+(<\/[^>]+>)/g, ' $1');\r
+                                               h = h.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>'); // Trim block start\r
+                                               h = h.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>'); // Trim block start\r
+                                               h = h.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g, '</$1>'); // Trim block end\r
+                                       }\r
+\r
+                                       // Simple indentation\r
+                                       if (s.apply_source_formatting && s.indent_mode == 'simple') {\r
+                                               // Add line breaks before and after block elements\r
+                                               h = h.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g, '\n<$1$2$3>\n');\r
+                                               h = h.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g, '\n<$1$2>');\r
+                                               h = h.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g, '</$1>\n');\r
+                                               h = h.replace(/\n\n/g, '\n');\r
+                                       }\r
+                               }\r
+\r
+                               h = t._unprotect(h, p);\r
+\r
+                               // Restore CDATA sections\r
+                               h = h.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g, '<![CDATA[$1]]>');\r
+\r
+                               // Restore the \u00a0 character if raw mode is enabled\r
+                               if (s.entity_encoding == 'raw')\r
+                                       h = h.replace(/<p>&nbsp;<\/p>|<p([^>]+)>&nbsp;<\/p>/g, '<p$1>\u00a0</p>');\r
+\r
+                               // Restore noscript elements\r
+                               h = h.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g, function(v, attribs, text) {\r
+                                       return '<noscript' + attribs + '>' + t.dom.decode(text.replace(/<!--|-->/g, '')) + '</noscript>';\r
+                               });\r
+                       }\r
+\r
+                       o.content = h;\r
+               },\r
+\r
+               _serializeNode : function(n, inner) {\r
+                       var t = this, s = t.settings, w = t.writer, hc, el, cn, i, l, a, at, no, v, nn, ru, ar, iv, closed, keep, type;\r
+\r
+                       if (!s.node_filter || s.node_filter(n)) {\r
+                               switch (n.nodeType) {\r
+                                       case 1: // Element\r
+                                               if (n.hasAttribute ? n.hasAttribute('_mce_bogus') : n.getAttribute('_mce_bogus'))\r
+                                                       return;\r
+\r
+                                               iv = keep = false;\r
+                                               hc = n.hasChildNodes();\r
+                                               nn = n.getAttribute('_mce_name') || n.nodeName.toLowerCase();\r
+\r
+                                               // Get internal type\r
+                                               type = n.getAttribute('_mce_type');\r
+                                               if (type) {\r
+                                                       if (!t._info.cleanup) {\r
+                                                               iv = true;\r
+                                                               return;\r
+                                                       } else\r
+                                                               keep = 1;\r
+                                               }\r
+\r
+                                               // Add correct prefix on IE\r
+                                               if (isIE) {\r
+                                                       if (n.scopeName !== 'HTML' && n.scopeName !== 'html')\r
+                                                               nn = n.scopeName + ':' + nn;\r
+                                               }\r
+\r
+                                               // Remove mce prefix on IE needed for the abbr element\r
+                                               if (nn.indexOf('mce:') === 0)\r
+                                                       nn = nn.substring(4);\r
+\r
+                                               // Check if valid\r
+                                               if (!keep) {\r
+                                                       if (!t.validElementsRE || !t.validElementsRE.test(nn) || (t.invalidElementsRE && t.invalidElementsRE.test(nn)) || inner) {\r
+                                                               iv = true;\r
+                                                               break;\r
+                                                       }\r
+                                               }\r
+\r
+                                               if (isIE) {\r
+                                                       // Fix IE content duplication (DOM can have multiple copies of the same node)\r
+                                                       if (s.fix_content_duplication) {\r
+                                                               if (n._mce_serialized == t.key)\r
+                                                                       return;\r
+\r
+                                                               n._mce_serialized = t.key;\r
+                                                       }\r
+\r
+                                                       // IE sometimes adds a / infront of the node name\r
+                                                       if (nn.charAt(0) == '/')\r
+                                                               nn = nn.substring(1);\r
+                                               } else if (isGecko) {\r
+                                                       // Ignore br elements\r
+                                                       if (n.nodeName === 'BR' && n.getAttribute('type') == '_moz')\r
+                                                               return;\r
+                                               }\r
+\r
+                                               // Check if valid child\r
+                                               if (s.validate_children) {\r
+                                                       if (t.elementName && !t.schema.isValid(t.elementName, nn)) {\r
+                                                               iv = true;\r
+                                                               break;\r
+                                                       }\r
+\r
+                                                       t.elementName = nn;\r
+                                               }\r
+\r
+                                               ru = t.findRule(nn);\r
+                                               nn = ru.name || nn;\r
+                                               closed = s.closed.test(nn);\r
+\r
+                                               // Skip empty nodes or empty node name in IE\r
+                                               if ((!hc && ru.noEmpty) || (isIE && !nn)) {\r
+                                                       iv = true;\r
+                                                       break;\r
+                                               }\r
+\r
+                                               // Check required\r
+                                               if (ru.requiredAttribs) {\r
+                                                       a = ru.requiredAttribs;\r
+\r
+                                                       for (i = a.length - 1; i >= 0; i--) {\r
+                                                               if (this.dom.getAttrib(n, a[i]) !== '')\r
+                                                                       break;\r
+                                                       }\r
+\r
+                                                       // None of the required was there\r
+                                                       if (i == -1) {\r
+                                                               iv = true;\r
+                                                               break;\r
+                                                       }\r
+                                               }\r
+\r
+                                               w.writeStartElement(nn);\r
+\r
+                                               // Add ordered attributes\r
+                                               if (ru.attribs) {\r
+                                                       for (i=0, at = ru.attribs, l = at.length; i<l; i++) {\r
+                                                               a = at[i];\r
+                                                               v = t._getAttrib(n, a);\r
+\r
+                                                               if (v !== null)\r
+                                                                       w.writeAttribute(a.name, v);\r
+                                                       }\r
+                                               }\r
+\r
+                                               // Add wild attributes\r
+                                               if (ru.validAttribsRE) {\r
+                                                       at = t.dom.getAttribs(n);\r
+                                                       for (i=at.length-1; i>-1; i--) {\r
+                                                               no = at[i];\r
+\r
+                                                               if (no.specified) {\r
+                                                                       a = no.nodeName.toLowerCase();\r
+\r
+                                                                       if (s.invalid_attrs.test(a) || !ru.validAttribsRE.test(a))\r
+                                                                               continue;\r
+\r
+                                                                       ar = t.findAttribRule(ru, a);\r
+                                                                       v = t._getAttrib(n, ar, a);\r
+\r
+                                                                       if (v !== null)\r
+                                                                               w.writeAttribute(a, v);\r
+                                                               }\r
+                                                       }\r
+                                               }\r
+\r
+                                               // Keep type attribute\r
+                                               if (type && keep)\r
+                                                       w.writeAttribute('_mce_type', type);\r
+\r
+                                               // Write text from script\r
+                                               if (nn === 'script' && tinymce.trim(n.innerHTML)) {\r
+                                                       w.writeText('// '); // Padd it with a comment so it will parse on older browsers\r
+                                                       w.writeCDATA(n.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g, '')); // Remove comments and cdata stuctures\r
+                                                       hc = false;\r
+                                                       break;\r
+                                               }\r
+\r
+                                               // Padd empty nodes with a &nbsp;\r
+                                               if (ru.padd) {\r
+                                                       // If it has only one bogus child, padd it anyway workaround for <td><br /></td> bug\r
+                                                       if (hc && (cn = n.firstChild) && cn.nodeType === 1 && n.childNodes.length === 1) {\r
+                                                               if (cn.hasAttribute ? cn.hasAttribute('_mce_bogus') : cn.getAttribute('_mce_bogus'))\r
+                                                                       w.writeText('\u00a0');\r
+                                                       } else if (!hc)\r
+                                                               w.writeText('\u00a0'); // No children then padd it\r
+                                               }\r
+\r
+                                               break;\r
+\r
+                                       case 3: // Text\r
+                                               // Check if valid child\r
+                                               if (s.validate_children && t.elementName && !t.schema.isValid(t.elementName, '#text'))\r
+                                                       return;\r
+\r
+                                               return w.writeText(n.nodeValue);\r
+\r
+                                       case 4: // CDATA\r
+                                               return w.writeCDATA(n.nodeValue);\r
+\r
+                                       case 8: // Comment\r
+                                               return w.writeComment(n.nodeValue);\r
+                               }\r
+                       } else if (n.nodeType == 1)\r
+                               hc = n.hasChildNodes();\r
+\r
+                       if (hc && !closed) {\r
+                               cn = n.firstChild;\r
+\r
+                               while (cn) {\r
+                                       t._serializeNode(cn);\r
+                                       t.elementName = nn;\r
+                                       cn = cn.nextSibling;\r
+                               }\r
+                       }\r
+\r
+                       // Write element end\r
+                       if (!iv) {\r
+                               if (!closed)\r
+                                       w.writeFullEndElement();\r
+                               else\r
+                                       w.writeEndElement();\r
+                       }\r
+               },\r
+\r
+               _protect : function(o) {\r
+                       var t = this;\r
+\r
+                       o.items = o.items || [];\r
+\r
+                       function enc(s) {\r
+                               return s.replace(/[\r\n\\]/g, function(c) {\r
+                                       if (c === '\n')\r
+                                               return '\\n';\r
+                                       else if (c === '\\')\r
+                                               return '\\\\';\r
+\r
+                                       return '\\r';\r
+                               });\r
+                       };\r
+\r
+                       function dec(s) {\r
+                               return s.replace(/\\[\\rn]/g, function(c) {\r
+                                       if (c === '\\n')\r
+                                               return '\n';\r
+                                       else if (c === '\\\\')\r
+                                               return '\\';\r
+\r
+                                       return '\r';\r
+                               });\r
+                       };\r
+\r
+                       each(o.patterns, function(p) {\r
+                               o.content = dec(enc(o.content).replace(p.pattern, function(x, a, b, c) {\r
+                                       b = dec(b);\r
+\r
+                                       if (p.encode)\r
+                                               b = t._encode(b);\r
+\r
+                                       o.items.push(b);\r
+                                       return a + '<!--mce:' + (o.items.length - 1) + '-->' + c;\r
+                               }));\r
+                       });\r
+\r
+                       return o;\r
+               },\r
+\r
+               _unprotect : function(h, o) {\r
+                       h = h.replace(/\<!--mce:([0-9]+)--\>/g, function(a, b) {\r
+                               return o.items[parseInt(b)];\r
+                       });\r
+\r
+                       o.items = [];\r
+\r
+                       return h;\r
+               },\r
+\r
+               _encode : function(h) {\r
+                       var t = this, s = t.settings, l;\r
+\r
+                       // Entity encode\r
+                       if (s.entity_encoding !== 'raw') {\r
+                               if (s.entity_encoding.indexOf('named') != -1) {\r
+                                       t.setEntities(s.entities);\r
+                                       l = t.entityLookup;\r
+\r
+                                       h = h.replace(/[\u007E-\uFFFF]/g, function(a) {\r
+                                               var v;\r
+\r
+                                               if (v = l[a])\r
+                                                       a = '&' + v + ';';\r
+\r
+                                               return a;\r
+                                       });\r
+                               }\r
+\r
+                               if (s.entity_encoding.indexOf('numeric') != -1) {\r
+                                       h = h.replace(/[\u007E-\uFFFF]/g, function(a) {\r
+                                               return '&#' + a.charCodeAt(0) + ';';\r
+                                       });\r
+                               }\r
+                       }\r
+\r
+                       return h;\r
+               },\r
+\r
+               _setup : function() {\r
+                       var t = this, s = this.settings;\r
+\r
+                       if (t.done)\r
+                               return;\r
+\r
+                       t.done = 1;\r
+\r
+                       t.setRules(s.valid_elements);\r
+                       t.addRules(s.extended_valid_elements);\r
+\r
+                       if (s.invalid_elements)\r
+                               t.invalidElementsRE = new RegExp('^(' + wildcardToRE(s.invalid_elements.replace(/,/g, '|').toLowerCase()) + ')$');\r
+\r
+                       if (s.attrib_value_filter)\r
+                               t.attribValueFilter = s.attribValueFilter;\r
+               },\r
+\r
+               _getAttrib : function(n, a, na) {\r
+                       var i, v;\r
+\r
+                       na = na || a.name;\r
+\r
+                       if (a.forcedVal && (v = a.forcedVal)) {\r
+                               if (v === '{$uid}')\r
+                                       return this.dom.uniqueId();\r
+\r
+                               return v;\r
+                       }\r
+\r
+                       v = this.dom.getAttrib(n, na);\r
+\r
+                       switch (na) {\r
+                               case 'rowspan':\r
+                               case 'colspan':\r
+                                       // Whats the point? Remove usless attribute value\r
+                                       if (v == '1')\r
+                                               v = '';\r
+\r
+                                       break;\r
+                       }\r
+\r
+                       if (this.attribValueFilter)\r
+                               v = this.attribValueFilter(na, v, n);\r
+\r
+                       if (a.validVals) {\r
+                               for (i = a.validVals.length - 1; i >= 0; i--) {\r
+                                       if (v == a.validVals[i])\r
+                                               break;\r
+                               }\r
+\r
+                               if (i == -1)\r
+                                       return null;\r
+                       }\r
+\r
+                       if (v === '' && typeof(a.defaultVal) != 'undefined') {\r
+                               v = a.defaultVal;\r
+\r
+                               if (v === '{$uid}')\r
+                                       return this.dom.uniqueId();\r
+\r
+                               return v;\r
+                       } else {\r
+                               // Remove internal mceItemXX classes when content is extracted from editor\r
+                               if (na == 'class' && this.processObj.get)\r
+                                       v = v.replace(/\s?mceItem\w+\s?/g, '');\r
+                       }\r
+\r
+                       if (v === '')\r
+                               return null;\r
+\r
+\r
+                       return v;\r
+               }\r
+       });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+       tinymce.dom.ScriptLoader = function(settings) {\r
+               var QUEUED = 0,\r
+                       LOADING = 1,\r
+                       LOADED = 2,\r
+                       states = {},\r
+                       queue = [],\r
+                       scriptLoadedCallbacks = {},\r
+                       queueLoadedCallbacks = [],\r
+                       loading = 0,\r
+                       undefined;\r
+\r
+               function loadScript(url, callback) {\r
+                       var t = this, dom = tinymce.DOM, elm, uri, loc, id;\r
+\r
+                       // Execute callback when script is loaded\r
+                       function done() {\r
+                               dom.remove(id);\r
+\r
+                               if (elm)\r
+                                       elm.onreadystatechange = elm.onload = elm = null;\r
+\r
+                               callback();\r
+                       };\r
+\r
+                       id = dom.uniqueId();\r
+\r
+                       if (tinymce.isIE6) {\r
+                               uri = new tinymce.util.URI(url);\r
+                               loc = location;\r
+\r
+                               // If script is from same domain and we\r
+                               // use IE 6 then use XHR since it's more reliable\r
+                               if (uri.host == loc.hostname && uri.port == loc.port && (uri.protocol + ':') == loc.protocol) {\r
+                                       tinymce.util.XHR.send({\r
+                                               url : tinymce._addVer(uri.getURI()),\r
+                                               success : function(content) {\r
+                                                       // Create new temp script element\r
+                                                       var script = dom.create('script', {\r
+                                                               type : 'text/javascript'\r
+                                                       });\r
+\r
+                                                       // Evaluate script in global scope\r
+                                                       script.text = content;\r
+                                                       document.getElementsByTagName('head')[0].appendChild(script);\r
+                                                       dom.remove(script);\r
+\r
+                                                       done();\r
+                                               }\r
+                                       });\r
+\r
+                                       return;\r
+                               }\r
+                       }\r
+\r
+                       // Create new script element\r
+                       elm = dom.create('script', {\r
+                               id : id,\r
+                               type : 'text/javascript',\r
+                               src : tinymce._addVer(url)\r
+                       });\r
+\r
+                       // Add onload and readystate listeners\r
+                       elm.onload = done;\r
+                       elm.onreadystatechange = function() {\r
+                               var state = elm.readyState;\r
+\r
+                               // Loaded state is passed on IE 6 however there\r
+                               // are known issues with this method but we can't use\r
+                               // XHR in a cross domain loading\r
+                               if (state == 'complete' || state == 'loaded')\r
+                                       done();\r
+                       };\r
+\r
+                       // Most browsers support this feature so we report errors\r
+                       // for those at least to help users track their missing plugins etc\r
+                       // todo: Removed since it produced error if the document is unloaded by navigating away, re-add it as an option\r
+                       /*elm.onerror = function() {\r
+                               alert('Failed to load: ' + url);\r
+                       };*/\r
+\r
+                       // Add script to document\r
+                       (document.getElementsByTagName('head')[0] || document.body).appendChild(elm);\r
+               };\r
+\r
+               this.isDone = function(url) {\r
+                       return states[url] == LOADED;\r
+               };\r
+\r
+               this.markDone = function(url) {\r
+                       states[url] = LOADED;\r
+               };\r
+\r
+               this.add = this.load = function(url, callback, scope) {\r
+                       var item, state = states[url];\r
+\r
+                       // Add url to load queue\r
+                       if (state == undefined) {\r
+                               queue.push(url);\r
+                               states[url] = QUEUED;\r
+                       }\r
+\r
+                       if (callback) {\r
+                               // Store away callback for later execution\r
+                               if (!scriptLoadedCallbacks[url])\r
+                                       scriptLoadedCallbacks[url] = [];\r
+\r
+                               scriptLoadedCallbacks[url].push({\r
+                                       func : callback,\r
+                                       scope : scope || this\r
+                               });\r
+                       }\r
+               };\r
+\r
+               this.loadQueue = function(callback, scope) {\r
+                       this.loadScripts(queue, callback, scope);\r
+               };\r
+\r
+               this.loadScripts = function(scripts, callback, scope) {\r
+                       var loadScripts;\r
+\r
+                       function execScriptLoadedCallbacks(url) {\r
+                               // Execute URL callback functions\r
+                               tinymce.each(scriptLoadedCallbacks[url], function(callback) {\r
+                                       callback.func.call(callback.scope);\r
+                               });\r
+\r
+                               scriptLoadedCallbacks[url] = undefined;\r
+                       };\r
+\r
+                       queueLoadedCallbacks.push({\r
+                               func : callback,\r
+                               scope : scope || this\r
+                       });\r
+\r
+                       loadScripts = function() {\r
+                               var loadingScripts = tinymce.grep(scripts);\r
+\r
+                               // Current scripts has been handled\r
+                               scripts.length = 0;\r
+\r
+                               // Load scripts that needs to be loaded\r
+                               tinymce.each(loadingScripts, function(url) {\r
+                                       // Script is already loaded then execute script callbacks directly\r
+                                       if (states[url] == LOADED) {\r
+                                               execScriptLoadedCallbacks(url);\r
+                                               return;\r
+                                       }\r
+\r
+                                       // Is script not loading then start loading it\r
+                                       if (states[url] != LOADING) {\r
+                                               states[url] = LOADING;\r
+                                               loading++;\r
+\r
+                                               loadScript(url, function() {\r
+                                                       states[url] = LOADED;\r
+                                                       loading--;\r
+\r
+                                                       execScriptLoadedCallbacks(url);\r
+\r
+                                                       // Load more scripts if they where added by the recently loaded script\r
+                                                       loadScripts();\r
+                                               });\r
+                                       }\r
+                               });\r
+\r
+                               // No scripts are currently loading then execute all pending queue loaded callbacks\r
+                               if (!loading) {\r
+                                       tinymce.each(queueLoadedCallbacks, function(callback) {\r
+                                               callback.func.call(callback.scope);\r
+                                       });\r
+\r
+                                       queueLoadedCallbacks.length = 0;\r
+                               }\r
+                       };\r
+\r
+                       loadScripts();\r
+               };\r
+       };\r
+\r
+       // Global script loader\r
+       tinymce.ScriptLoader = new tinymce.dom.ScriptLoader();\r
+})(tinymce);\r
+\r
+tinymce.dom.TreeWalker = function(start_node, root_node) {\r
+       var node = start_node;\r
+\r
+       function findSibling(node, start_name, sibling_name, shallow) {\r
+               var sibling, parent;\r
+\r
+               if (node) {\r
+                       // Walk into nodes if it has a start\r
+                       if (!shallow && node[start_name])\r
+                               return node[start_name];\r
+\r
+                       // Return the sibling if it has one\r
+                       if (node != root_node) {\r
+                               sibling = node[sibling_name];\r
+                               if (sibling)\r
+                                       return sibling;\r
+\r
+                               // Walk up the parents to look for siblings\r
+                               for (parent = node.parentNode; parent && parent != root_node; parent = parent.parentNode) {\r
+                                       sibling = parent[sibling_name];\r
+                                       if (sibling)\r
+                                               return sibling;\r
+                               }\r
+                       }\r
+               }\r
+       };\r
+\r
+       this.current = function() {\r
+               return node;\r
+       };\r
+\r
+       this.next = function(shallow) {\r
+               return (node = findSibling(node, 'firstChild', 'nextSibling', shallow));\r
+       };\r
+\r
+       this.prev = function(shallow) {\r
+               return (node = findSibling(node, 'lastChild', 'lastSibling', shallow));\r
+       };\r
+};\r
+\r
+(function() {\r
+       var transitional = {};\r
+\r
+       function unpack(lookup, data) {\r
+               var key;\r
+\r
+               function replace(value) {\r
+                       return value.replace(/[A-Z]+/g, function(key) {\r
+                               return replace(lookup[key]);\r
+                       });\r
+               };\r
+\r
+               // Unpack lookup\r
+               for (key in lookup) {\r
+                       if (lookup.hasOwnProperty(key))\r
+                               lookup[key] = replace(lookup[key]);\r
+               }\r
+\r
+               // Unpack and parse data into object map\r
+               replace(data).replace(/#/g, '#text').replace(/(\w+)\[([^\]]+)\]/g, function(str, name, children) {\r
+                       var i, map = {};\r
+\r
+                       children = children.split(/\|/);\r
+\r
+                       for (i = children.length - 1; i >= 0; i--)\r
+                               map[children[i]] = 1;\r
+\r
+                       transitional[name] = map;\r
+               });\r
+       };\r
+\r
+       // This is the XHTML 1.0 transitional elements with it's children packed to reduce it's size\r
+       // we will later include the attributes here and use it as a default for valid elements but it\r
+       // requires us to rewrite the serializer engine\r
+       unpack({\r
+               Z : '#|H|K|N|O|P',\r
+               Y : '#|X|form|R|Q',\r
+               X : 'p|T|div|U|W|isindex|fieldset|table',\r
+               W : 'pre|hr|blockquote|address|center|noframes',\r
+               U : 'ul|ol|dl|menu|dir',\r
+               ZC : '#|p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q',\r
+               T : 'h1|h2|h3|h4|h5|h6',\r
+               ZB : '#|X|S|Q',\r
+               S : 'R|P',\r
+               ZA : '#|a|G|J|M|O|P',\r
+               R : '#|a|H|K|N|O',\r
+               Q : 'noscript|P',\r
+               P : 'ins|del|script',\r
+               O : 'input|select|textarea|label|button',\r
+               N : 'M|L',\r
+               M : 'em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym',\r
+               L : 'sub|sup',\r
+               K : 'J|I',\r
+               J : 'tt|i|b|u|s|strike',\r
+               I : 'big|small|font|basefont',\r
+               H : 'G|F',\r
+               G : 'br|span|bdo',\r
+               F : 'object|applet|img|map|iframe'\r
+       }, 'script[]' + \r
+               'style[]' + \r
+               'object[#|param|X|form|a|H|K|N|O|Q]' + \r
+               'param[]' + \r
+               'p[S]' + \r
+               'a[Z]' + \r
+               'br[]' + \r
+               'span[S]' + \r
+               'bdo[S]' + \r
+               'applet[#|param|X|form|a|H|K|N|O|Q]' + \r
+               'h1[S]' + \r
+               'img[]' + \r
+               'map[X|form|Q|area]' + \r
+               'h2[S]' + \r
+               'iframe[#|X|form|a|H|K|N|O|Q]' + \r
+               'h3[S]' + \r
+               'tt[S]' + \r
+               'i[S]' + \r
+               'b[S]' + \r
+               'u[S]' + \r
+               's[S]' + \r
+               'strike[S]' + \r
+               'big[S]' + \r
+               'small[S]' + \r
+               'font[S]' + \r
+               'basefont[]' + \r
+               'em[S]' + \r
+               'strong[S]' + \r
+               'dfn[S]' + \r
+               'code[S]' + \r
+               'q[S]' + \r
+               'samp[S]' + \r
+               'kbd[S]' + \r
+               'var[S]' + \r
+               'cite[S]' + \r
+               'abbr[S]' + \r
+               'acronym[S]' + \r
+               'sub[S]' + \r
+               'sup[S]' + \r
+               'input[]' + \r
+               'select[optgroup|option]' + \r
+               'optgroup[option]' + \r
+               'option[]' + \r
+               'textarea[]' + \r
+               'label[S]' + \r
+               'button[#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]' + \r
+               'h4[S]' + \r
+               'ins[#|X|form|a|H|K|N|O|Q]' + \r
+               'h5[S]' + \r
+               'del[#|X|form|a|H|K|N|O|Q]' + \r
+               'h6[S]' + \r
+               'div[#|X|form|a|H|K|N|O|Q]' + \r
+               'ul[li]' + \r
+               'li[#|X|form|a|H|K|N|O|Q]' + \r
+               'ol[li]' + \r
+               'dl[dt|dd]' + \r
+               'dt[S]' + \r
+               'dd[#|X|form|a|H|K|N|O|Q]' + \r
+               'menu[li]' + \r
+               'dir[li]' + \r
+               'pre[ZA]' + \r
+               'hr[]' + \r
+               'blockquote[#|X|form|a|H|K|N|O|Q]' + \r
+               'address[S|p]' + \r
+               'center[#|X|form|a|H|K|N|O|Q]' + \r
+               'noframes[#|X|form|a|H|K|N|O|Q]' + \r
+               'isindex[]' + \r
+               'fieldset[#|legend|X|form|a|H|K|N|O|Q]' + \r
+               'legend[S]' + \r
+               'table[caption|col|colgroup|thead|tfoot|tbody|tr]' + \r
+               'caption[S]' + \r
+               'col[]' + \r
+               'colgroup[col]' + \r
+               'thead[tr]' + \r
+               'tr[th|td]' + \r
+               'th[#|X|form|a|H|K|N|O|Q]' + \r
+               'form[#|X|a|H|K|N|O|Q]' + \r
+               'noscript[#|X|form|a|H|K|N|O|Q]' + \r
+               'td[#|X|form|a|H|K|N|O|Q]' + \r
+               'tfoot[tr]' + \r
+               'tbody[tr]' + \r
+               'area[]' + \r
+               'base[]' + \r
+               'body[#|X|form|a|H|K|N|O|Q]'\r
+       );\r
+\r
+       tinymce.dom.Schema = function() {\r
+               var t = this, elements = transitional;\r
+\r
+               t.isValid = function(name, child_name) {\r
+                       var element = elements[name];\r
+\r
+                       return !!(element && (!child_name || element[child_name]));\r
+               };\r
+       };\r
+})();\r
+(function(tinymce) {\r
+       tinymce.dom.RangeUtils = function(dom) {\r
+               var INVISIBLE_CHAR = '\uFEFF';\r
+\r
+               this.walk = function(rng, callback) {\r
+                       var startContainer = rng.startContainer,\r
+                               startOffset = rng.startOffset,\r
+                               endContainer = rng.endContainer,\r
+                               endOffset = rng.endOffset,\r
+                               ancestor, startPoint,\r
+                               endPoint, node, parent, siblings, nodes;\r
+\r
+                       // Handle table cell selection the table plugin enables\r
+                       // you to fake select table cells and perform formatting actions on them\r
+                       nodes = dom.select('td.mceSelected,th.mceSelected');\r
+                       if (nodes.length > 0) {\r
+                               tinymce.each(nodes, function(node) {\r
+                                       callback([node]);\r
+                               });\r
+\r
+                               return;\r
+                       }\r
+\r
+                       function collectSiblings(node, name, end_node) {\r
+                               var siblings = [];\r
+\r
+                               for (; node && node != end_node; node = node[name])\r
+                                       siblings.push(node);\r
+\r
+                               return siblings;\r
+                       };\r
+\r
+                       function findEndPoint(node, root) {\r
+                               do {\r
+                                       if (node.parentNode == root)\r
+                                               return node;\r
+\r
+                                       node = node.parentNode;\r
+                               } while(node);\r
+                       };\r
+\r
+                       function walkBoundary(start_node, end_node, next) {\r
+                               var siblingName = next ? 'nextSibling' : 'previousSibling';\r
+\r
+                               for (node = start_node, parent = node.parentNode; node && node != end_node; node = parent) {\r
+                                       parent = node.parentNode;\r
+                                       siblings = collectSiblings(node == start_node ? node : node[siblingName], siblingName);\r
+\r
+                                       if (siblings.length) {\r
+                                               if (!next)\r
+                                                       siblings.reverse();\r
+\r
+                                               callback(siblings);\r
+                                       }\r
+                               }\r
+                       };\r
+\r
+                       // If index based start position then resolve it\r
+                       if (startContainer.nodeType == 1 && startContainer.hasChildNodes())\r
+                               startContainer = startContainer.childNodes[startOffset];\r
+\r
+                       // If index based end position then resolve it\r
+                       if (endContainer.nodeType == 1 && endContainer.hasChildNodes())\r
+                               endContainer = endContainer.childNodes[Math.min(startOffset == endOffset ? endOffset : endOffset - 1, endContainer.childNodes.length - 1)];\r
+\r
+                       // Find common ancestor and end points\r
+                       ancestor = dom.findCommonAncestor(startContainer, endContainer);\r
+\r
+                       // Same container\r
+                       if (startContainer == endContainer)\r
+                               return callback([startContainer]);\r
+\r
+                       // Process left side\r
+                       for (node = startContainer; node; node = node.parentNode) {\r
+                               if (node == endContainer)\r
+                                       return walkBoundary(startContainer, ancestor, true);\r
+\r
+                               if (node == ancestor)\r
+                                       break;\r
+                       }\r
+\r
+                       // Process right side\r
+                       for (node = endContainer; node; node = node.parentNode) {\r
+                               if (node == startContainer)\r
+                                       return walkBoundary(endContainer, ancestor);\r
+\r
+                               if (node == ancestor)\r
+                                       break;\r
+                       }\r
+\r
+                       // Find start/end point\r
+                       startPoint = findEndPoint(startContainer, ancestor) || startContainer;\r
+                       endPoint = findEndPoint(endContainer, ancestor) || endContainer;\r
+\r
+                       // Walk left leaf\r
+                       walkBoundary(startContainer, startPoint, true);\r
+\r
+                       // Walk the middle from start to end point\r
+                       siblings = collectSiblings(\r
+                               startPoint == startContainer ? startPoint : startPoint.nextSibling,\r
+                               'nextSibling',\r
+                               endPoint == endContainer ? endPoint.nextSibling : endPoint\r
+                       );\r
+\r
+                       if (siblings.length)\r
+                               callback(siblings);\r
+\r
+                       // Walk right leaf\r
+                       walkBoundary(endContainer, endPoint);\r
+               };\r
+\r
+               /*              this.split = function(rng) {\r
+                       var startContainer = rng.startContainer,\r
+                               startOffset = rng.startOffset,\r
+                               endContainer = rng.endContainer,\r
+                               endOffset = rng.endOffset;\r
+\r
+                       function splitText(node, offset) {\r
+                               if (offset == node.nodeValue.length)\r
+                                       node.appendData(INVISIBLE_CHAR);\r
+\r
+                               node = node.splitText(offset);\r
+\r
+                               if (node.nodeValue === INVISIBLE_CHAR)\r
+                                       node.nodeValue = '';\r
+\r
+                               return node;\r
+                       };\r
+\r
+                       // Handle single text node\r
+                       if (startContainer == endContainer) {\r
+                               if (startContainer.nodeType == 3) {\r
+                                       if (startOffset != 0)\r
+                                               startContainer = endContainer = splitText(startContainer, startOffset);\r
+\r
+                                       if (endOffset - startOffset != startContainer.nodeValue.length)\r
+                                               splitText(startContainer, endOffset - startOffset);\r
+                               }\r
+                       } else {\r
+                               // Split startContainer text node if needed\r
+                               if (startContainer.nodeType == 3 && startOffset != 0) {\r
+                                       startContainer = splitText(startContainer, startOffset);\r
+                                       startOffset = 0;\r
+                               }\r
+\r
+                               // Split endContainer text node if needed\r
+                               if (endContainer.nodeType == 3 && endOffset != endContainer.nodeValue.length) {\r
+                                       endContainer = splitText(endContainer, endOffset).previousSibling;\r
+                                       endOffset = endContainer.nodeValue.length;\r
+                               }\r
+                       }\r
+\r
+                       return {\r
+                               startContainer : startContainer,\r
+                               startOffset : startOffset,\r
+                               endContainer : endContainer,\r
+                               endOffset : endOffset\r
+                       };\r
+               };\r
+*/\r
+       };\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+       // Shorten class names\r
+       var DOM = tinymce.DOM, is = tinymce.is;\r
+\r
+       tinymce.create('tinymce.ui.Control', {\r
+               Control : function(id, s) {\r
+                       this.id = id;\r
+                       this.settings = s = s || {};\r
+                       this.rendered = false;\r
+                       this.onRender = new tinymce.util.Dispatcher(this);\r
+                       this.classPrefix = '';\r
+                       this.scope = s.scope || this;\r
+                       this.disabled = 0;\r
+                       this.active = 0;\r
+               },\r
+\r
+               setDisabled : function(s) {\r
+                       var e;\r
+\r
+                       if (s != this.disabled) {\r
+                               e = DOM.get(this.id);\r
+\r
+                               // Add accessibility title for unavailable actions\r
+                               if (e && this.settings.unavailable_prefix) {\r
+                                       if (s) {\r
+                                               this.prevTitle = e.title;\r
+                                               e.title = this.settings.unavailable_prefix + ": " + e.title;\r
+                                       } else\r
+                                               e.title = this.prevTitle;\r
+                               }\r
+\r
+                               this.setState('Disabled', s);\r
+                               this.setState('Enabled', !s);\r
+                               this.disabled = s;\r
+                       }\r
+               },\r
+\r
+               isDisabled : function() {\r
+                       return this.disabled;\r
+               },\r
+\r
+               setActive : function(s) {\r
+                       if (s != this.active) {\r
+                               this.setState('Active', s);\r
+                               this.active = s;\r
+                       }\r
+               },\r
+\r
+               isActive : function() {\r
+                       return this.active;\r
+               },\r
+\r
+               setState : function(c, s) {\r
+                       var n = DOM.get(this.id);\r
+\r
+                       c = this.classPrefix + c;\r
+\r
+                       if (s)\r
+                               DOM.addClass(n, c);\r
+                       else\r
+                               DOM.removeClass(n, c);\r
+               },\r
+\r
+               isRendered : function() {\r
+                       return this.rendered;\r
+               },\r
+\r
+               renderHTML : function() {\r
+               },\r
+\r
+               renderTo : function(n) {\r
+                       DOM.setHTML(n, this.renderHTML());\r
+               },\r
+\r
+               postRender : function() {\r
+                       var t = this, b;\r
+\r
+                       // Set pending states\r
+                       if (is(t.disabled)) {\r
+                               b = t.disabled;\r
+                               t.disabled = -1;\r
+                               t.setDisabled(b);\r
+                       }\r
+\r
+                       if (is(t.active)) {\r
+                               b = t.active;\r
+                               t.active = -1;\r
+                               t.setActive(b);\r
+                       }\r
+               },\r
+\r
+               remove : function() {\r
+                       DOM.remove(this.id);\r
+                       this.destroy();\r
+               },\r
+\r
+               destroy : function() {\r
+                       tinymce.dom.Event.clear(this.id);\r
+               }\r
+       });\r
+})(tinymce);\r
+tinymce.create('tinymce.ui.Container:tinymce.ui.Control', {\r
+       Container : function(id, s) {\r
+               this.parent(id, s);\r
+\r
+               this.controls = [];\r
+\r
+               this.lookup = {};\r
+       },\r
+\r
+       add : function(c) {\r
+               this.lookup[c.id] = c;\r
+               this.controls.push(c);\r
+\r
+               return c;\r
+       },\r
+\r
+       get : function(n) {\r
+               return this.lookup[n];\r
+       }\r
+});\r
+\r
+\r
+tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {\r
+       Separator : function(id, s) {\r
+               this.parent(id, s);\r
+               this.classPrefix = 'mceSeparator';\r
+       },\r
+\r
+       renderHTML : function() {\r
+               return tinymce.DOM.createHTML('span', {'class' : this.classPrefix});\r
+       }\r
+});\r
+\r
+(function(tinymce) {\r
+       var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;\r
+\r
+       tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control', {\r
+               MenuItem : function(id, s) {\r
+                       this.parent(id, s);\r
+                       this.classPrefix = 'mceMenuItem';\r
+               },\r
+\r
+               setSelected : function(s) {\r
+                       this.setState('Selected', s);\r
+                       this.selected = s;\r
+               },\r
+\r
+               isSelected : function() {\r
+                       return this.selected;\r
+               },\r
+\r
+               postRender : function() {\r
+                       var t = this;\r
+                       \r
+                       t.parent();\r
+\r
+                       // Set pending state\r
+                       if (is(t.selected))\r
+                               t.setSelected(t.selected);\r
+               }\r
+       });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+       var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;\r
+\r
+       tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem', {\r
+               Menu : function(id, s) {\r
+                       var t = this;\r
+\r
+                       t.parent(id, s);\r
+                       t.items = {};\r
+                       t.collapsed = false;\r
+                       t.menuCount = 0;\r
+                       t.onAddItem = new tinymce.util.Dispatcher(this);\r
+               },\r
+\r
+               expand : function(d) {\r
+                       var t = this;\r
+\r
+                       if (d) {\r
+                               walk(t, function(o) {\r
+                                       if (o.expand)\r
+                                               o.expand();\r
+                               }, 'items', t);\r
+                       }\r
+\r
+                       t.collapsed = false;\r
+               },\r
+\r
+               collapse : function(d) {\r
+                       var t = this;\r
+\r
+                       if (d) {\r
+                               walk(t, function(o) {\r
+                                       if (o.collapse)\r
+                                               o.collapse();\r
+                               }, 'items', t);\r
+                       }\r
+\r
+                       t.collapsed = true;\r
+               },\r
+\r
+               isCollapsed : function() {\r
+                       return this.collapsed;\r
+               },\r
+\r
+               add : function(o) {\r
+                       if (!o.settings)\r
+                               o = new tinymce.ui.MenuItem(o.id || DOM.uniqueId(), o);\r
+\r
+                       this.onAddItem.dispatch(this, o);\r
+\r
+                       return this.items[o.id] = o;\r
+               },\r
+\r
+               addSeparator : function() {\r
+                       return this.add({separator : true});\r
+               },\r
+\r
+               addMenu : function(o) {\r
+                       if (!o.collapse)\r
+                               o = this.createMenu(o);\r
+\r
+                       this.menuCount++;\r
+\r
+                       return this.add(o);\r
+               },\r
+\r
+               hasMenus : function() {\r
+                       return this.menuCount !== 0;\r
+               },\r
+\r
+               remove : function(o) {\r
+                       delete this.items[o.id];\r
+               },\r
+\r
+               removeAll : function() {\r
+                       var t = this;\r
+\r
+                       walk(t, function(o) {\r
+                               if (o.removeAll)\r
+                                       o.removeAll();\r
+                               else\r
+                                       o.remove();\r
+\r
+                               o.destroy();\r
+                       }, 'items', t);\r
+\r
+                       t.items = {};\r
+               },\r
+\r
+               createMenu : function(o) {\r
+                       var m = new tinymce.ui.Menu(o.id || DOM.uniqueId(), o);\r
+\r
+                       m.onAddItem.add(this.onAddItem.dispatch, this.onAddItem);\r
+\r
+                       return m;\r
+               }\r
+       });\r
+})(tinymce);\r
+(function(tinymce) {\r
+       var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event, Element = tinymce.dom.Element;\r
+\r
+       tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu', {\r
+               DropMenu : function(id, s) {\r
+                       s = s || {};\r
+                       s.container = s.container || DOM.doc.body;\r
+                       s.offset_x = s.offset_x || 0;\r
+                       s.offset_y = s.offset_y || 0;\r
+                       s.vp_offset_x = s.vp_offset_x || 0;\r
+                       s.vp_offset_y = s.vp_offset_y || 0;\r
+\r
+                       if (is(s.icons) && !s.icons)\r
+                               s['class'] += ' mceNoIcons';\r
+\r
+                       this.parent(id, s);\r
+                       this.onShowMenu = new tinymce.util.Dispatcher(this);\r
+                       this.onHideMenu = new tinymce.util.Dispatcher(this);\r
+                       this.classPrefix = 'mceMenu';\r
+               },\r
+\r
+               createMenu : function(s) {\r
+                       var t = this, cs = t.settings, m;\r
+\r
+                       s.container = s.container || cs.container;\r
+                       s.parent = t;\r
+                       s.constrain = s.constrain || cs.constrain;\r
+                       s['class'] = s['class'] || cs['class'];\r
+                       s.vp_offset_x = s.vp_offset_x || cs.vp_offset_x;\r
+                       s.vp_offset_y = s.vp_offset_y || cs.vp_offset_y;\r
+                       m = new tinymce.ui.DropMenu(s.id || DOM.uniqueId(), s);\r
+\r
+                       m.onAddItem.add(t.onAddItem.dispatch, t.onAddItem);\r
+\r
+                       return m;\r
+               },\r
+\r
+               update : function() {\r
+                       var t = this, s = t.settings, tb = DOM.get('menu_' + t.id + '_tbl'), co = DOM.get('menu_' + t.id + '_co'), tw, th;\r
+\r
+                       tw = s.max_width ? Math.min(tb.clientWidth, s.max_width) : tb.clientWidth;\r
+                       th = s.max_height ? Math.min(tb.clientHeight, s.max_height) : tb.clientHeight;\r
+\r
+                       if (!DOM.boxModel)\r
+                               t.element.setStyles({width : tw + 2, height : th + 2});\r
+                       else\r
+                               t.element.setStyles({width : tw, height : th});\r
+\r
+                       if (s.max_width)\r
+                               DOM.setStyle(co, 'width', tw);\r
+\r
+                       if (s.max_height) {\r
+                               DOM.setStyle(co, 'height', th);\r
+\r
+                               if (tb.clientHeight < s.max_height)\r
+                                       DOM.setStyle(co, 'overflow', 'hidden');\r
+                       }\r
+               },\r
+\r
+               showMenu : function(x, y, px) {\r
+                       var t = this, s = t.settings, co, vp = DOM.getViewPort(), w, h, mx, my, ot = 2, dm, tb, cp = t.classPrefix;\r
+\r
+                       t.collapse(1);\r
+\r
+                       if (t.isMenuVisible)\r
+                               return;\r
+\r
+                       if (!t.rendered) {\r
+                               co = DOM.add(t.settings.container, t.renderNode());\r
+\r
+                               each(t.items, function(o) {\r
+                                       o.postRender();\r
+                               });\r
+\r
+                               t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container});\r
+                       } else\r
+                               co = DOM.get('menu_' + t.id);\r
+\r
+                       // Move layer out of sight unless it's Opera since it scrolls to top of page due to an bug\r
+                       if (!tinymce.isOpera)\r
+                               DOM.setStyles(co, {left : -0xFFFF , top : -0xFFFF});\r
+\r
+                       DOM.show(co);\r
+                       t.update();\r
+\r
+                       x += s.offset_x || 0;\r
+                       y += s.offset_y || 0;\r
+                       vp.w -= 4;\r
+                       vp.h -= 4;\r
+\r
+                       // Move inside viewport if not submenu\r
+                       if (s.constrain) {\r
+                               w = co.clientWidth - ot;\r
+                               h = co.clientHeight - ot;\r
+                               mx = vp.x + vp.w;\r
+                               my = vp.y + vp.h;\r
+\r
+                               if ((x + s.vp_offset_x + w) > mx)\r
+                                       x = px ? px - w : Math.max(0, (mx - s.vp_offset_x) - w);\r
+\r
+                               if ((y + s.vp_offset_y + h) > my)\r
+                                       y = Math.max(0, (my - s.vp_offset_y) - h);\r
+                       }\r
+\r
+                       DOM.setStyles(co, {left : x , top : y});\r
+                       t.element.update();\r
+\r
+                       t.isMenuVisible = 1;\r
+                       t.mouseClickFunc = Event.add(co, 'click', function(e) {\r
+                               var m;\r
+\r
+                               e = e.target;\r
+\r
+                               if (e && (e = DOM.getParent(e, 'tr')) && !DOM.hasClass(e, cp + 'ItemSub')) {\r
+                                       m = t.items[e.id];\r
+\r
+                                       if (m.isDisabled())\r
+                                               return;\r
+\r
+                                       dm = t;\r
+\r
+                                       while (dm) {\r
+                                               if (dm.hideMenu)\r
+                                                       dm.hideMenu();\r
+\r
+                                               dm = dm.settings.parent;\r
+                                       }\r
+\r
+                                       if (m.settings.onclick)\r
+                                               m.settings.onclick(e);\r
+\r
+                                       return Event.cancel(e); // Cancel to fix onbeforeunload problem\r
+                               }\r
+                       });\r
+\r
+                       if (t.hasMenus()) {\r
+                               t.mouseOverFunc = Event.add(co, 'mouseover', function(e) {\r
+                                       var m, r, mi;\r
+\r
+                                       e = e.target;\r
+                                       if (e && (e = DOM.getParent(e, 'tr'))) {\r
+                                               m = t.items[e.id];\r
+\r
+                                               if (t.lastMenu)\r
+                                                       t.lastMenu.collapse(1);\r
+\r
+                                               if (m.isDisabled())\r
+                                                       return;\r
+\r
+                                               if (e && DOM.hasClass(e, cp + 'ItemSub')) {\r
+                                                       //p = DOM.getPos(s.container);\r
+                                                       r = DOM.getRect(e);\r
+                                                       m.showMenu((r.x + r.w - ot), r.y - ot, r.x);\r
+                                                       t.lastMenu = m;\r
+                                                       DOM.addClass(DOM.get(m.id).firstChild, cp + 'ItemActive');\r
+                                               }\r
+                                       }\r
+                               });\r
+                       }\r
+\r
+                       t.onShowMenu.dispatch(t);\r
+\r
+                       if (s.keyboard_focus) {\r
+                               Event.add(co, 'keydown', t._keyHandler, t);\r
+                               DOM.select('a', 'menu_' + t.id)[0].focus(); // Select first link\r
+                               t._focusIdx = 0;\r
+                       }\r
+               },\r
+\r
+               hideMenu : function(c) {\r
+                       var t = this, co = DOM.get('menu_' + t.id), e;\r
+\r
+                       if (!t.isMenuVisible)\r
+                               return;\r
+\r
+                       Event.remove(co, 'mouseover', t.mouseOverFunc);\r
+                       Event.remove(co, 'click', t.mouseClickFunc);\r
+                       Event.remove(co, 'keydown', t._keyHandler);\r
+                       DOM.hide(co);\r
+                       t.isMenuVisible = 0;\r
+\r
+                       if (!c)\r
+                               t.collapse(1);\r
+\r
+                       if (t.element)\r
+                               t.element.hide();\r
+\r
+                       if (e = DOM.get(t.id))\r
+                               DOM.removeClass(e.firstChild, t.classPrefix + 'ItemActive');\r
+\r
+                       t.onHideMenu.dispatch(t);\r
+               },\r
+\r
+               add : function(o) {\r
+                       var t = this, co;\r
+\r
+                       o = t.parent(o);\r
+\r
+                       if (t.isRendered && (co = DOM.get('menu_' + t.id)))\r
+                               t._add(DOM.select('tbody', co)[0], o);\r
+\r
+                       return o;\r
+               },\r
+\r
+               collapse : function(d) {\r
+                       this.parent(d);\r
+                       this.hideMenu(1);\r
+               },\r
+\r
+               remove : function(o) {\r
+                       DOM.remove(o.id);\r
+                       this.destroy();\r
+\r
+                       return this.parent(o);\r
+               },\r
+\r
+               destroy : function() {\r
+                       var t = this, co = DOM.get('menu_' + t.id);\r
+\r
+                       Event.remove(co, 'mouseover', t.mouseOverFunc);\r
+                       Event.remove(co, 'click', t.mouseClickFunc);\r
+\r
+                       if (t.element)\r
+                               t.element.remove();\r
+\r
+                       DOM.remove(co);\r
+               },\r
+\r
+               renderNode : function() {\r
+                       var t = this, s = t.settings, n, tb, co, w;\r
+\r
+                       w = DOM.create('div', {id : 'menu_' + t.id, 'class' : s['class'], 'style' : 'position:absolute;left:0;top:0;z-index:200000'});\r
+                       co = DOM.add(w, 'div', {id : 'menu_' + t.id + '_co', 'class' : t.classPrefix + (s['class'] ? ' ' + s['class'] : '')});\r
+                       t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container});\r
+\r
+                       if (s.menu_line)\r
+                               DOM.add(co, 'span', {'class' : t.classPrefix + 'Line'});\r
+\r
+//                     n = DOM.add(co, 'div', {id : 'menu_' + t.id + '_co', 'class' : 'mceMenuContainer'});\r
+                       n = DOM.add(co, 'table', {id : 'menu_' + t.id + '_tbl', border : 0, cellPadding : 0, cellSpacing : 0});\r
+                       tb = DOM.add(n, 'tbody');\r
+\r
+                       each(t.items, function(o) {\r
+                               t._add(tb, o);\r
+                       });\r
+\r
+                       t.rendered = true;\r
+\r
+                       return w;\r
+               },\r
+\r
+               // Internal functions\r
+\r
+               _keyHandler : function(e) {\r
+                       var t = this, kc = e.keyCode;\r
+\r
+                       function focus(d) {\r
+                               var i = t._focusIdx + d, e = DOM.select('a', 'menu_' + t.id)[i];\r
+\r
+                               if (e) {\r
+                                       t._focusIdx = i;\r
+                                       e.focus();\r
+                               }\r
+                       };\r
+\r
+                       switch (kc) {\r
+                               case 38:\r
+                                       focus(-1); // Select first link\r
+                                       return;\r
+\r
+                               case 40:\r
+                                       focus(1);\r
+                                       return;\r
+\r
+                               case 13:\r
+                                       return;\r
+\r
+                               case 27:\r
+                                       return this.hideMenu();\r
+                       }\r
+               },\r
+\r
+               _add : function(tb, o) {\r
+                       var n, s = o.settings, a, ro, it, cp = this.classPrefix, ic;\r
+\r
+                       if (s.separator) {\r
+                               ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'ItemSeparator'});\r
+                               DOM.add(ro, 'td', {'class' : cp + 'ItemSeparator'});\r
+\r
+                               if (n = ro.previousSibling)\r
+                                       DOM.addClass(n, 'mceLast');\r
+\r
+                               return;\r
+                       }\r
+\r
+                       n = ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'Item ' + cp + 'ItemEnabled'});\r
+                       n = it = DOM.add(n, 'td');\r
+                       n = a = DOM.add(n, 'a', {href : 'javascript:;', onclick : "return false;", onmousedown : 'return false;'});\r
+\r
+                       DOM.addClass(it, s['class']);\r
+//                     n = DOM.add(n, 'span', {'class' : 'item'});\r
+\r
+                       ic = DOM.add(n, 'span', {'class' : 'mceIcon' + (s.icon ? ' mce_' + s.icon : '')});\r
+\r
+                       if (s.icon_src)\r
+                               DOM.add(ic, 'img', {src : s.icon_src});\r
+\r
+                       n = DOM.add(n, s.element || 'span', {'class' : 'mceText', title : o.settings.title}, o.settings.title);\r
+\r
+                       if (o.settings.style)\r
+                               DOM.setAttrib(n, 'style', o.settings.style);\r
+\r
+                       if (tb.childNodes.length == 1)\r
+                               DOM.addClass(ro, 'mceFirst');\r
+\r
+                       if ((n = ro.previousSibling) && DOM.hasClass(n, cp + 'ItemSeparator'))\r
+                               DOM.addClass(ro, 'mceFirst');\r
+\r
+                       if (o.collapse)\r
+                               DOM.addClass(ro, cp + 'ItemSub');\r
+\r
+                       if (n = ro.previousSibling)\r
+                               DOM.removeClass(n, 'mceLast');\r
+\r
+                       DOM.addClass(ro, 'mceLast');\r
+               }\r
+       });\r
+})(tinymce);\r
+(function(tinymce) {\r
+       var DOM = tinymce.DOM;\r
+\r
+       tinymce.create('tinymce.ui.Button:tinymce.ui.Control', {\r
+               Button : function(id, s) {\r
+                       this.parent(id, s);\r
+                       this.classPrefix = 'mceButton';\r
+               },\r
+\r
+               renderHTML : function() {\r
+                       var cp = this.classPrefix, s = this.settings, h, l;\r
+\r
+                       l = DOM.encode(s.label || '');\r
+                       h = '<a id="' + this.id + '" href="javascript:;" class="' + cp + ' ' + cp + 'Enabled ' + s['class'] + (l ? ' ' + cp + 'Labeled' : '') +'" onmousedown="return false;" onclick="return false;" title="' + DOM.encode(s.title) + '">';\r
+\r
+                       if (s.image)\r
+                               h += '<img class="mceIcon" src="' + s.image + '" />' + l + '</a>';\r
+                       else\r
+                               h += '<span class="mceIcon ' + s['class'] + '"></span>' + (l ? '<span class="' + cp + 'Label">' + l + '</span>' : '') + '</a>';\r
+\r
+                       return h;\r
+               },\r
+\r
+               postRender : function() {\r
+                       var t = this, s = t.settings;\r
+\r
+                       tinymce.dom.Event.add(t.id, 'click', function(e) {\r
+                               if (!t.isDisabled())\r
+                                       return s.onclick.call(s.scope, e);\r
+                       });\r
+               }\r
+       });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+       var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher;\r
+\r
+       tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control', {\r
+               ListBox : function(id, s) {\r
+                       var t = this;\r
+\r
+                       t.parent(id, s);\r
+\r
+                       t.items = [];\r
+\r
+                       t.onChange = new Dispatcher(t);\r
+\r
+                       t.onPostRender = new Dispatcher(t);\r
+\r
+                       t.onAdd = new Dispatcher(t);\r
+\r
+                       t.onRenderMenu = new tinymce.util.Dispatcher(this);\r
+\r
+                       t.classPrefix = 'mceListBox';\r
+               },\r
+\r
+               select : function(va) {\r
+                       var t = this, fv, f;\r
+\r
+                       if (va == undefined)\r
+                               return t.selectByIndex(-1);\r
+\r
+                       // Is string or number make function selector\r
+                       if (va && va.call)\r
+                               f = va;\r
+                       else {\r
+                               f = function(v) {\r
+                                       return v == va;\r
+                               };\r
+                       }\r
+\r
+                       // Do we need to do something?\r
+                       if (va != t.selectedValue) {\r
+                               // Find item\r
+                               each(t.items, function(o, i) {\r
+                                       if (f(o.value)) {\r
+                                               fv = 1;\r
+                                               t.selectByIndex(i);\r
+                                               return false;\r
+                                       }\r
+                               });\r
+\r
+                               if (!fv)\r
+                                       t.selectByIndex(-1);\r
+                       }\r
+               },\r
+\r
+               selectByIndex : function(idx) {\r
+                       var t = this, e, o;\r
+\r
+                       if (idx != t.selectedIndex) {\r
+                               e = DOM.get(t.id + '_text');\r
+                               o = t.items[idx];\r
+\r
+                               if (o) {\r
+                                       t.selectedValue = o.value;\r
+                                       t.selectedIndex = idx;\r
+                                       DOM.setHTML(e, DOM.encode(o.title));\r
+                                       DOM.removeClass(e, 'mceTitle');\r
+                               } else {\r
+                                       DOM.setHTML(e, DOM.encode(t.settings.title));\r
+                                       DOM.addClass(e, 'mceTitle');\r
+                                       t.selectedValue = t.selectedIndex = null;\r
+                               }\r
+\r
+                               e = 0;\r
+                       }\r
+               },\r
+\r
+               add : function(n, v, o) {\r
+                       var t = this;\r
+\r
+                       o = o || {};\r
+                       o = tinymce.extend(o, {\r
+                               title : n,\r
+                               value : v\r
+                       });\r
+\r
+                       t.items.push(o);\r
+                       t.onAdd.dispatch(t, o);\r
+               },\r
+\r
+               getLength : function() {\r
+                       return this.items.length;\r
+               },\r
+\r
+               renderHTML : function() {\r
+                       var h = '', t = this, s = t.settings, cp = t.classPrefix;\r
+\r
+                       h = '<table id="' + t.id + '" cellpadding="0" cellspacing="0" class="' + cp + ' ' + cp + 'Enabled' + (s['class'] ? (' ' + s['class']) : '') + '"><tbody><tr>';\r
+                       h += '<td>' + DOM.createHTML('a', {id : t.id + '_text', href : 'javascript:;', 'class' : 'mceText', onclick : "return false;", onmousedown : 'return false;'}, DOM.encode(t.settings.title)) + '</td>';\r
+                       h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', tabindex : -1, href : 'javascript:;', 'class' : 'mceOpen', onclick : "return false;", onmousedown : 'return false;'}, '<span></span>') + '</td>';\r
+                       h += '</tr></tbody></table>';\r
+\r
+                       return h;\r
+               },\r
+\r
+               showMenu : function() {\r
+                       var t = this, p1, p2, e = DOM.get(this.id), m;\r
+\r
+                       if (t.isDisabled() || t.items.length == 0)\r
+                               return;\r
+\r
+                       if (t.menu && t.menu.isMenuVisible)\r
+                               return t.hideMenu();\r
+\r
+                       if (!t.isMenuRendered) {\r
+                               t.renderMenu();\r
+                               t.isMenuRendered = true;\r
+                       }\r
+\r
+                       p1 = DOM.getPos(this.settings.menu_container);\r
+                       p2 = DOM.getPos(e);\r
+\r
+                       m = t.menu;\r
+                       m.settings.offset_x = p2.x;\r
+                       m.settings.offset_y = p2.y;\r
+                       m.settings.keyboard_focus = !tinymce.isOpera; // Opera is buggy when it comes to auto focus\r
+\r
+                       // Select in menu\r
+                       if (t.oldID)\r
+                               m.items[t.oldID].setSelected(0);\r
+\r
+                       each(t.items, function(o) {\r
+                               if (o.value === t.selectedValue) {\r
+                                       m.items[o.id].setSelected(1);\r
+                                       t.oldID = o.id;\r
+                               }\r
+                       });\r
+\r
+                       m.showMenu(0, e.clientHeight);\r
+\r
+                       Event.add(DOM.doc, 'mousedown', t.hideMenu, t);\r
+                       DOM.addClass(t.id, t.classPrefix + 'Selected');\r
+\r
+                       //DOM.get(t.id + '_text').focus();\r
+               },\r
+\r
+               hideMenu : function(e) {\r
+                       var t = this;\r
+\r
+                       if (t.menu && t.menu.isMenuVisible) {\r
+                               // Prevent double toogles by canceling the mouse click event to the button\r
+                               if (e && e.type == "mousedown" && (e.target.id == t.id + '_text' || e.target.id == t.id + '_open'))\r
+                                       return;\r
+\r
+                               if (!e || !DOM.getParent(e.target, '.mceMenu')) {\r
+                                       DOM.removeClass(t.id, t.classPrefix + 'Selected');\r
+                                       Event.remove(DOM.doc, 'mousedown', t.hideMenu, t);\r
+                                       t.menu.hideMenu();\r
+                               }\r
+                       }\r
+               },\r
+\r
+               renderMenu : function() {\r
+                       var t = this, m;\r
+\r
+                       m = t.settings.control_manager.createDropMenu(t.id + '_menu', {\r
+                               menu_line : 1,\r
+                               'class' : t.classPrefix + 'Menu mceNoIcons',\r
+                               max_width : 150,\r
+                               max_height : 150\r
+                       });\r
+\r
+                       m.onHideMenu.add(t.hideMenu, t);\r
+\r
+                       m.add({\r
+                               title : t.settings.title,\r
+                               'class' : 'mceMenuItemTitle',\r
+                               onclick : function() {\r
+                                       if (t.settings.onselect('') !== false)\r
+                                               t.select(''); // Must be runned after\r
+                               }\r
+                       });\r
+\r
+                       each(t.items, function(o) {\r
+                               // No value then treat it as a title\r
+                               if (o.value === undefined) {\r
+                                       m.add({\r
+                                               title : o.title,\r
+                                               'class' : 'mceMenuItemTitle',\r
+                                               onclick : function() {\r
+                                                       if (t.settings.onselect('') !== false)\r
+                                                               t.select(''); // Must be runned after\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       o.id = DOM.uniqueId();\r
+                                       o.onclick = function() {\r
+                                               if (t.settings.onselect(o.value) !== false)\r
+                                                       t.select(o.value); // Must be runned after\r
+                                       };\r
+\r
+                                       m.add(o);\r
+                               }\r
+                       });\r
+\r
+                       t.onRenderMenu.dispatch(t, m);\r
+                       t.menu = m;\r
+               },\r
+\r
+               postRender : function() {\r
+                       var t = this, cp = t.classPrefix;\r
+\r
+                       Event.add(t.id, 'click', t.showMenu, t);\r
+                       Event.add(t.id + '_text', 'focus', function(e) {\r
+                               if (!t._focused) {\r
+                                       t.keyDownHandler = Event.add(t.id + '_text', 'keydown', function(e) {\r
+                                               var idx = -1, v, kc = e.keyCode;\r
+\r
+                                               // Find current index\r
+                                               each(t.items, function(v, i) {\r
+                                                       if (t.selectedValue == v.value)\r
+                                                               idx = i;\r
+                                               });\r
+\r
+                                               // Move up/down\r
+                                               if (kc == 38)\r
+                                                       v = t.items[idx - 1];\r
+                                               else if (kc == 40)\r
+                                                       v = t.items[idx + 1];\r
+                                               else if (kc == 13) {\r
+                                                       // Fake select on enter\r
+                                                       v = t.selectedValue;\r
+                                                       t.selectedValue = null; // Needs to be null to fake change\r
+                                                       t.settings.onselect(v);\r
+                                                       return Event.cancel(e);\r
+                                               }\r
+\r
+                                               if (v) {\r
+                                                       t.hideMenu();\r
+                                                       t.select(v.value);\r
+                                               }\r
+                                       });\r
+                               }\r
+\r
+                               t._focused = 1;\r
+                       });\r
+                       Event.add(t.id + '_text', 'blur', function() {Event.remove(t.id + '_text', 'keydown', t.keyDownHandler); t._focused = 0;});\r
+\r
+                       // Old IE doesn't have hover on all elements\r
+                       if (tinymce.isIE6 || !DOM.boxModel) {\r
+                               Event.add(t.id, 'mouseover', function() {\r
+                                       if (!DOM.hasClass(t.id, cp + 'Disabled'))\r
+                                               DOM.addClass(t.id, cp + 'Hover');\r
+                               });\r
+\r
+                               Event.add(t.id, 'mouseout', function() {\r
+                                       if (!DOM.hasClass(t.id, cp + 'Disabled'))\r
+                                               DOM.removeClass(t.id, cp + 'Hover');\r
+                               });\r
+                       }\r
+\r
+                       t.onPostRender.dispatch(t, DOM.get(t.id));\r
+               },\r
+\r
+               destroy : function() {\r
+                       this.parent();\r
+\r
+                       Event.clear(this.id + '_text');\r
+                       Event.clear(this.id + '_open');\r
+               }\r
+       });\r
+})(tinymce);\r
+(function(tinymce) {\r
+       var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher;\r
+\r
+       tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox', {\r
+               NativeListBox : function(id, s) {\r
+                       this.parent(id, s);\r
+                       this.classPrefix = 'mceNativeListBox';\r
+               },\r
+\r
+               setDisabled : function(s) {\r
+                       DOM.get(this.id).disabled = s;\r
+               },\r
+\r
+               isDisabled : function() {\r
+                       return DOM.get(this.id).disabled;\r
+               },\r
+\r
+               select : function(va) {\r
+                       var t = this, fv, f;\r
+\r
+                       if (va == undefined)\r
+                               return t.selectByIndex(-1);\r
+\r
+                       // Is string or number make function selector\r
+                       if (va && va.call)\r
+                               f = va;\r
+                       else {\r
+                               f = function(v) {\r
+                                       return v == va;\r
+                               };\r
+                       }\r
+\r
+                       // Do we need to do something?\r
+                       if (va != t.selectedValue) {\r
+                               // Find item\r
+                               each(t.items, function(o, i) {\r
+                                       if (f(o.value)) {\r
+                                               fv = 1;\r
+                                               t.selectByIndex(i);\r
+                                               return false;\r
+                                       }\r
+                               });\r
+\r
+                               if (!fv)\r
+                                       t.selectByIndex(-1);\r
+                       }\r
+               },\r
+\r
+               selectByIndex : function(idx) {\r
+                       DOM.get(this.id).selectedIndex = idx + 1;\r
+                       this.selectedValue = this.items[idx] ? this.items[idx].value : null;\r
+               },\r
+\r
+               add : function(n, v, a) {\r
+                       var o, t = this;\r
+\r
+                       a = a || {};\r
+                       a.value = v;\r
+\r
+                       if (t.isRendered())\r
+                               DOM.add(DOM.get(this.id), 'option', a, n);\r
+\r
+                       o = {\r
+                               title : n,\r
+                               value : v,\r
+                               attribs : a\r
+                       };\r
+\r
+                       t.items.push(o);\r
+                       t.onAdd.dispatch(t, o);\r
+               },\r
+\r
+               getLength : function() {\r
+                       return DOM.get(this.id).options.length - 1;\r
+               },\r
+\r
+               renderHTML : function() {\r
+                       var h, t = this;\r
+\r
+                       h = DOM.createHTML('option', {value : ''}, '-- ' + t.settings.title + ' --');\r
+\r
+                       each(t.items, function(it) {\r
+                               h += DOM.createHTML('option', {value : it.value}, it.title);\r
+                       });\r
+\r
+                       h = DOM.createHTML('select', {id : t.id, 'class' : 'mceNativeListBox'}, h);\r
+\r
+                       return h;\r
+               },\r
+\r
+               postRender : function() {\r
+                       var t = this, ch;\r
+\r
+                       t.rendered = true;\r
+\r
+                       function onChange(e) {\r
+                               var v = t.items[e.target.selectedIndex - 1];\r
+\r
+                               if (v && (v = v.value)) {\r
+                                       t.onChange.dispatch(t, v);\r
+\r
+                                       if (t.settings.onselect)\r
+                                               t.settings.onselect(v);\r
+                               }\r
+                       };\r
+\r
+                       Event.add(t.id, 'change', onChange);\r
+\r
+                       // Accessibility keyhandler\r
+                       Event.add(t.id, 'keydown', function(e) {\r
+                               var bf;\r
+\r
+                               Event.remove(t.id, 'change', ch);\r
+\r
+                               bf = Event.add(t.id, 'blur', function() {\r
+                                       Event.add(t.id, 'change', onChange);\r
+                                       Event.remove(t.id, 'blur', bf);\r
+                               });\r
+\r
+                               if (e.keyCode == 13 || e.keyCode == 32) {\r
+                                       onChange(e);\r
+                                       return Event.cancel(e);\r
+                               }\r
+                       });\r
+\r
+                       t.onPostRender.dispatch(t, DOM.get(t.id));\r
+               }\r
+       });\r
+})(tinymce);\r
+(function(tinymce) {\r
+       var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;\r
+\r
+       tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button', {\r
+               MenuButton : function(id, s) {\r
+                       this.parent(id, s);\r
+\r
+                       this.onRenderMenu = new tinymce.util.Dispatcher(this);\r
+\r
+                       s.menu_container = s.menu_container || DOM.doc.body;\r
+               },\r
+\r
+               showMenu : function() {\r
+                       var t = this, p1, p2, e = DOM.get(t.id), m;\r
+\r
+                       if (t.isDisabled())\r
+                               return;\r
+\r
+                       if (!t.isMenuRendered) {\r
+                               t.renderMenu();\r
+                               t.isMenuRendered = true;\r
+                       }\r
+\r
+                       if (t.isMenuVisible)\r
+                               return t.hideMenu();\r
+\r
+                       p1 = DOM.getPos(t.settings.menu_container);\r
+                       p2 = DOM.getPos(e);\r
+\r
+                       m = t.menu;\r
+                       m.settings.offset_x = p2.x;\r
+                       m.settings.offset_y = p2.y;\r
+                       m.settings.vp_offset_x = p2.x;\r
+                       m.settings.vp_offset_y = p2.y;\r
+                       m.settings.keyboard_focus = t._focused;\r
+                       m.showMenu(0, e.clientHeight);\r
+\r
+                       Event.add(DOM.doc, 'mousedown', t.hideMenu, t);\r
+                       t.setState('Selected', 1);\r
+\r
+                       t.isMenuVisible = 1;\r
+               },\r
+\r
+               renderMenu : function() {\r
+                       var t = this, m;\r
+\r
+                       m = t.settings.control_manager.createDropMenu(t.id + '_menu', {\r
+                               menu_line : 1,\r
+                               'class' : this.classPrefix + 'Menu',\r
+                               icons : t.settings.icons\r
+                       });\r
+\r
+                       m.onHideMenu.add(t.hideMenu, t);\r
+\r
+                       t.onRenderMenu.dispatch(t, m);\r
+                       t.menu = m;\r
+               },\r
+\r
+               hideMenu : function(e) {\r
+                       var t = this;\r
+\r
+                       // Prevent double toogles by canceling the mouse click event to the button\r
+                       if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id || e.id === t.id + '_open';}))\r
+                               return;\r
+\r
+                       if (!e || !DOM.getParent(e.target, '.mceMenu')) {\r
+                               t.setState('Selected', 0);\r
+                               Event.remove(DOM.doc, 'mousedown', t.hideMenu, t);\r
+                               if (t.menu)\r
+                                       t.menu.hideMenu();\r
+                       }\r
+\r
+                       t.isMenuVisible = 0;\r
+               },\r
+\r
+               postRender : function() {\r
+                       var t = this, s = t.settings;\r
+\r
+                       Event.add(t.id, 'click', function() {\r
+                               if (!t.isDisabled()) {\r
+                                       if (s.onclick)\r
+                                               s.onclick(t.value);\r
+\r
+                                       t.showMenu();\r
+                               }\r
+                       });\r
+               }\r
+       });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+       var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;\r
+\r
+       tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton', {\r
+               SplitButton : function(id, s) {\r
+                       this.parent(id, s);\r
+                       this.classPrefix = 'mceSplitButton';\r
+               },\r
+\r
+               renderHTML : function() {\r
+                       var h, t = this, s = t.settings, h1;\r
+\r
+                       h = '<tbody><tr>';\r
+\r
+                       if (s.image)\r
+                               h1 = DOM.createHTML('img ', {src : s.image, 'class' : 'mceAction ' + s['class']});\r
+                       else\r
+                               h1 = DOM.createHTML('span', {'class' : 'mceAction ' + s['class']}, '');\r
+\r
+                       h += '<td>' + DOM.createHTML('a', {id : t.id + '_action', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>';\r
+       \r
+                       h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']});\r
+                       h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>';\r
+\r
+                       h += '</tr></tbody>';\r
+\r
+                       return DOM.createHTML('table', {id : t.id, 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', onmousedown : 'return false;', title : s.title}, h);\r
+               },\r
+\r
+               postRender : function() {\r
+                       var t = this, s = t.settings;\r
+\r
+                       if (s.onclick) {\r
+                               Event.add(t.id + '_action', 'click', function() {\r
+                                       if (!t.isDisabled())\r
+                                               s.onclick(t.value);\r
+                               });\r
+                       }\r
+\r
+                       Event.add(t.id + '_open', 'click', t.showMenu, t);\r
+                       Event.add(t.id + '_open', 'focus', function() {t._focused = 1;});\r
+                       Event.add(t.id + '_open', 'blur', function() {t._focused = 0;});\r
+\r
+                       // Old IE doesn't have hover on all elements\r
+                       if (tinymce.isIE6 || !DOM.boxModel) {\r
+                               Event.add(t.id, 'mouseover', function() {\r
+                                       if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled'))\r
+                                               DOM.addClass(t.id, 'mceSplitButtonHover');\r
+                               });\r
+\r
+                               Event.add(t.id, 'mouseout', function() {\r
+                                       if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled'))\r
+                                               DOM.removeClass(t.id, 'mceSplitButtonHover');\r
+                               });\r
+                       }\r
+               },\r
+\r
+               destroy : function() {\r
+                       this.parent();\r
+\r
+                       Event.clear(this.id + '_action');\r
+                       Event.clear(this.id + '_open');\r
+               }\r
+       });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+       var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each;\r
+\r
+       tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton', {\r
+               ColorSplitButton : function(id, s) {\r
+                       var t = this;\r
+\r
+                       t.parent(id, s);\r
+\r
+                       t.settings = s = tinymce.extend({\r
+                               colors : '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF',\r
+                               grid_width : 8,\r
+                               default_color : '#888888'\r
+                       }, t.settings);\r
+\r
+                       t.onShowMenu = new tinymce.util.Dispatcher(t);\r
+\r
+                       t.onHideMenu = new tinymce.util.Dispatcher(t);\r
+\r
+                       t.value = s.default_color;\r
+               },\r
+\r
+               showMenu : function() {\r
+                       var t = this, r, p, e, p2;\r
+\r
+                       if (t.isDisabled())\r
+                               return;\r
+\r
+                       if (!t.isMenuRendered) {\r
+                               t.renderMenu();\r
+                               t.isMenuRendered = true;\r
+                       }\r
+\r
+                       if (t.isMenuVisible)\r
+                               return t.hideMenu();\r
+\r
+                       e = DOM.get(t.id);\r
+                       DOM.show(t.id + '_menu');\r
+                       DOM.addClass(e, 'mceSplitButtonSelected');\r
+                       p2 = DOM.getPos(e);\r
+                       DOM.setStyles(t.id + '_menu', {\r
+                               left : p2.x,\r
+                               top : p2.y + e.clientHeight,\r
+                               zIndex : 200000\r
+                       });\r
+                       e = 0;\r
+\r
+                       Event.add(DOM.doc, 'mousedown', t.hideMenu, t);\r
+                       t.onShowMenu.dispatch(t);\r
+\r
+                       if (t._focused) {\r
+                               t._keyHandler = Event.add(t.id + '_menu', 'keydown', function(e) {\r
+                                       if (e.keyCode == 27)\r
+                                               t.hideMenu();\r
+                               });\r
+\r
+                               DOM.select('a', t.id + '_menu')[0].focus(); // Select first link\r
+                       }\r
+\r
+                       t.isMenuVisible = 1;\r
+               },\r
+\r
+               hideMenu : function(e) {\r
+                       var t = this;\r
+\r
+                       // Prevent double toogles by canceling the mouse click event to the button\r
+                       if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id + '_open';}))\r
+                               return;\r
+\r
+                       if (!e || !DOM.getParent(e.target, '.mceSplitButtonMenu')) {\r
+                               DOM.removeClass(t.id, 'mceSplitButtonSelected');\r
+                               Event.remove(DOM.doc, 'mousedown', t.hideMenu, t);\r
+                               Event.remove(t.id + '_menu', 'keydown', t._keyHandler);\r
+                               DOM.hide(t.id + '_menu');\r
+                       }\r
+\r
+                       t.onHideMenu.dispatch(t);\r
+\r
+                       t.isMenuVisible = 0;\r
+               },\r
+\r
+               renderMenu : function() {\r
+                       var t = this, m, i = 0, s = t.settings, n, tb, tr, w;\r
+\r
+                       w = DOM.add(s.menu_container, 'div', {id : t.id + '_menu', 'class' : s['menu_class'] + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'});\r
+                       m = DOM.add(w, 'div', {'class' : s['class'] + ' mceSplitButtonMenu'});\r
+                       DOM.add(m, 'span', {'class' : 'mceMenuLine'});\r
+\r
+                       n = DOM.add(m, 'table', {'class' : 'mceColorSplitMenu'});\r
+                       tb = DOM.add(n, 'tbody');\r
+\r
+                       // Generate color grid\r
+                       i = 0;\r
+                       each(is(s.colors, 'array') ? s.colors : s.colors.split(','), function(c) {\r
+                               c = c.replace(/^#/, '');\r
+\r
+                               if (!i--) {\r
+                                       tr = DOM.add(tb, 'tr');\r
+                                       i = s.grid_width - 1;\r
+                               }\r
+\r
+                               n = DOM.add(tr, 'td');\r
+\r
+                               n = DOM.add(n, 'a', {\r
+                                       href : 'javascript:;',\r
+                                       style : {\r
+                                               backgroundColor : '#' + c\r
+                                       },\r
+                                       _mce_color : '#' + c\r
+                               });\r
+                       });\r
+\r
+                       if (s.more_colors_func) {\r
+                               n = DOM.add(tb, 'tr');\r
+                               n = DOM.add(n, 'td', {colspan : s.grid_width, 'class' : 'mceMoreColors'});\r
+                               n = DOM.add(n, 'a', {id : t.id + '_more', href : 'javascript:;', onclick : 'return false;', 'class' : 'mceMoreColors'}, s.more_colors_title);\r
+\r
+                               Event.add(n, 'click', function(e) {\r
+                                       s.more_colors_func.call(s.more_colors_scope || this);\r
+                                       return Event.cancel(e); // Cancel to fix onbeforeunload problem\r
+                               });\r
+                       }\r
+\r
+                       DOM.addClass(m, 'mceColorSplitMenu');\r
+\r
+                       Event.add(t.id + '_menu', 'click', function(e) {\r
+                               var c;\r
+\r
+                               e = e.target;\r
+\r
+                               if (e.nodeName == 'A' && (c = e.getAttribute('_mce_color')))\r
+                                       t.setColor(c);\r
+\r
+                               return Event.cancel(e); // Prevent IE auto save warning\r
+                       });\r
+\r
+                       return w;\r
+               },\r
+\r
+               setColor : function(c) {\r
+                       var t = this;\r
+\r
+                       DOM.setStyle(t.id + '_preview', 'backgroundColor', c);\r
+\r
+                       t.value = c;\r
+                       t.hideMenu();\r
+                       t.settings.onselect(c);\r
+               },\r
+\r
+               postRender : function() {\r
+                       var t = this, id = t.id;\r
+\r
+                       t.parent();\r
+                       DOM.add(id + '_action', 'div', {id : id + '_preview', 'class' : 'mceColorPreview'});\r
+                       DOM.setStyle(t.id + '_preview', 'backgroundColor', t.value);\r
+               },\r
+\r
+               destroy : function() {\r
+                       this.parent();\r
+\r
+                       Event.clear(this.id + '_menu');\r
+                       Event.clear(this.id + '_more');\r
+                       DOM.remove(this.id + '_menu');\r
+               }\r
+       });\r
+})(tinymce);\r
+\r
+tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {\r
+       renderHTML : function() {\r
+               var t = this, h = '', c, co, dom = tinymce.DOM, s = t.settings, i, pr, nx, cl;\r
+\r
+               cl = t.controls;\r
+               for (i=0; i<cl.length; i++) {\r
+                       // Get current control, prev control, next control and if the control is a list box or not\r
+                       co = cl[i];\r
+                       pr = cl[i - 1];\r
+                       nx = cl[i + 1];\r
+\r
+                       // Add toolbar start\r
+                       if (i === 0) {\r
+                               c = 'mceToolbarStart';\r
+\r
+                               if (co.Button)\r
+                                       c += ' mceToolbarStartButton';\r
+                               else if (co.SplitButton)\r
+                                       c += ' mceToolbarStartSplitButton';\r
+                               else if (co.ListBox)\r
+                                       c += ' mceToolbarStartListBox';\r
+\r
+                               h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->'));\r
+                       }\r
+\r
+                       // Add toolbar end before list box and after the previous button\r
+                       // This is to fix the o2k7 editor skins\r
+                       if (pr && co.ListBox) {\r
+                               if (pr.Button || pr.SplitButton)\r
+                                       h += dom.createHTML('td', {'class' : 'mceToolbarEnd'}, dom.createHTML('span', null, '<!-- IE -->'));\r
+                       }\r
+\r
+                       // Render control HTML\r
+\r
+                       // IE 8 quick fix, needed to propertly generate a hit area for anchors\r
+                       if (dom.stdMode)\r
+                               h += '<td style="position: relative">' + co.renderHTML() + '</td>';\r
+                       else\r
+                               h += '<td>' + co.renderHTML() + '</td>';\r
+\r
+                       // Add toolbar start after list box and before the next button\r
+                       // This is to fix the o2k7 editor skins\r
+                       if (nx && co.ListBox) {\r
+                               if (nx.Button || nx.SplitButton)\r
+                                       h += dom.createHTML('td', {'class' : 'mceToolbarStart'}, dom.createHTML('span', null, '<!-- IE -->'));\r
+                       }\r
+               }\r
+\r
+               c = 'mceToolbarEnd';\r
+\r
+               if (co.Button)\r
+                       c += ' mceToolbarEndButton';\r
+               else if (co.SplitButton)\r
+                       c += ' mceToolbarEndSplitButton';\r
+               else if (co.ListBox)\r
+                       c += ' mceToolbarEndListBox';\r
+\r
+               h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->'));\r
+\r
+               return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || ''}, '<tbody><tr>' + h + '</tr></tbody>');\r
+       }\r
+});\r
+\r
+(function(tinymce) {\r
+       var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each;\r
+\r
+       tinymce.create('tinymce.AddOnManager', {\r
+               items : [],\r
+               urls : {},\r
+               lookup : {},\r
+\r
+               onAdd : new Dispatcher(this),\r
+\r
+               get : function(n) {\r
+                       return this.lookup[n];\r
+               },\r
+\r
+               requireLangPack : function(n) {\r
+                       var s = tinymce.settings;\r
+\r
+                       if (s && s.language)\r
+                               tinymce.ScriptLoader.add(this.urls[n] + '/langs/' + s.language + '.js');\r
+               },\r
+\r
+               add : function(id, o) {\r
+                       this.items.push(o);\r
+                       this.lookup[id] = o;\r
+                       this.onAdd.dispatch(this, id, o);\r
+\r
+                       return o;\r
+               },\r
+\r
+               load : function(n, u, cb, s) {\r
+                       var t = this;\r
+\r
+                       if (t.urls[n])\r
+                               return;\r
+\r
+                       if (u.indexOf('/') != 0 && u.indexOf('://') == -1)\r
+                               u = tinymce.baseURL + '/' +  u;\r
+\r
+                       t.urls[n] = u.substring(0, u.lastIndexOf('/'));\r
+                       tinymce.ScriptLoader.add(u, cb, s);\r
+               }\r
+       });\r
+\r
+       // Create plugin and theme managers\r
+       tinymce.PluginManager = new tinymce.AddOnManager();\r
+       tinymce.ThemeManager = new tinymce.AddOnManager();\r
+}(tinymce));\r
+\r
+(function(tinymce) {\r
+       // Shorten names\r
+       var each = tinymce.each, extend = tinymce.extend,\r
+               DOM = tinymce.DOM, Event = tinymce.dom.Event,\r
+               ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager,\r
+               explode = tinymce.explode,\r
+               Dispatcher = tinymce.util.Dispatcher, undefined, instanceCounter = 0;\r
+\r
+       // Setup some URLs where the editor API is located and where the document is\r
+       tinymce.documentBaseURL = window.location.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');\r
+       if (!/[\/\\]$/.test(tinymce.documentBaseURL))\r
+               tinymce.documentBaseURL += '/';\r
+\r
+       tinymce.baseURL = new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);\r
+\r
+       tinymce.baseURI = new tinymce.util.URI(tinymce.baseURL);\r
+\r
+       // Add before unload listener\r
+       // This was required since IE was leaking memory if you added and removed beforeunload listeners\r
+       // with attachEvent/detatchEvent so this only adds one listener and instances can the attach to the onBeforeUnload event\r
+       tinymce.onBeforeUnload = new Dispatcher(tinymce);\r
+\r
+       // Must be on window or IE will leak if the editor is placed in frame or iframe\r
+       Event.add(window, 'beforeunload', function(e) {\r
+               tinymce.onBeforeUnload.dispatch(tinymce, e);\r
+       });\r
+\r
+       tinymce.onAddEditor = new Dispatcher(tinymce);\r
+\r
+       tinymce.onRemoveEditor = new Dispatcher(tinymce);\r
+\r
+       tinymce.EditorManager = extend(tinymce, {\r
+               editors : [],\r
+\r
+               i18n : {},\r
+\r
+               activeEditor : null,\r
+\r
+               init : function(s) {\r
+                       var t = this, pl, sl = tinymce.ScriptLoader, e, el = [], ed;\r
+\r
+                       function execCallback(se, n, s) {\r
+                               var f = se[n];\r
+\r
+                               if (!f)\r
+                                       return;\r
+\r
+                               if (tinymce.is(f, 'string')) {\r
+                                       s = f.replace(/\.\w+$/, '');\r
+                                       s = s ? tinymce.resolve(s) : 0;\r
+                                       f = tinymce.resolve(f);\r
+                               }\r
+\r
+                               return f.apply(s || this, Array.prototype.slice.call(arguments, 2));\r
+                       };\r
+\r
+                       s = extend({\r
+                               theme : "simple",\r
+                               language : "en"\r
+                       }, s);\r
+\r
+                       t.settings = s;\r
+\r
+                       // Legacy call\r
+                       Event.add(document, 'init', function() {\r
+                               var l, co;\r
+\r
+                               execCallback(s, 'onpageload');\r
+\r
+                               switch (s.mode) {\r
+                                       case "exact":\r
+                                               l = s.elements || '';\r
+\r
+                                               if(l.length > 0) {\r
+                                                       each(explode(l), function(v) {\r
+                                                               if (DOM.get(v)) {\r
+                                                                       ed = new tinymce.Editor(v, s);\r
+                                                                       el.push(ed);\r
+                                                                       ed.render(1);\r
+                                                               } else {\r
+                                                                       each(document.forms, function(f) {\r
+                                                                               each(f.elements, function(e) {\r
+                                                                                       if (e.name === v) {\r
+                                                                                               v = 'mce_editor_' + instanceCounter++;\r
+                                                                                               DOM.setAttrib(e, 'id', v);\r
+\r
+                                                                                               ed = new tinymce.Editor(v, s);\r
+                                                                                               el.push(ed);\r
+                                                                                               ed.render(1);\r
+                                                                                       }\r
+                                                                               });\r
+                                                                       });\r
+                                                               }\r
+                                                       });\r
+                                               }\r
+                                               break;\r
+\r
+                                       case "textareas":\r
+                                       case "specific_textareas":\r
+                                               function hasClass(n, c) {\r
+                                                       return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c);\r
+                                               };\r
+\r
+                                               each(DOM.select('textarea'), function(v) {\r
+                                                       if (s.editor_deselector && hasClass(v, s.editor_deselector))\r
+                                                               return;\r
+\r
+                                                       if (!s.editor_selector || hasClass(v, s.editor_selector)) {\r
+                                                               // Can we use the name\r
+                                                               e = DOM.get(v.name);\r
+                                                               if (!v.id && !e)\r
+                                                                       v.id = v.name;\r
+\r
+                                                               // Generate unique name if missing or already exists\r
+                                                               if (!v.id || t.get(v.id))\r
+                                                                       v.id = DOM.uniqueId();\r
+\r
+                                                               ed = new tinymce.Editor(v.id, s);\r
+                                                               el.push(ed);\r
+                                                               ed.render(1);\r
+                                                       }\r
+                                               });\r
+                                               break;\r
+                               }\r
+\r
+                               // Call onInit when all editors are initialized\r
+                               if (s.oninit) {\r
+                                       l = co = 0;\r
+\r
+                                       each(el, function(ed) {\r
+                                               co++;\r
+\r
+                                               if (!ed.initialized) {\r
+                                                       // Wait for it\r
+                                                       ed.onInit.add(function() {\r
+                                                               l++;\r
+\r
+                                                               // All done\r
+                                                               if (l == co)\r
+                                                                       execCallback(s, 'oninit');\r
+                                                       });\r
+                                               } else\r
+                                                       l++;\r
+\r
+                                               // All done\r
+                                               if (l == co)\r
+                                                       execCallback(s, 'oninit');                                      \r
+                                       });\r
+                               }\r
+                       });\r
+               },\r
+\r
+               get : function(id) {\r
+                       if (id === undefined)\r
+                               return this.editors;\r
+\r
+                       return this.editors[id];\r
+               },\r
+\r
+               getInstanceById : function(id) {\r
+                       return this.get(id);\r
+               },\r
+\r
+               add : function(editor) {\r
+                       var self = this, editors = self.editors;\r
+\r
+                       // Add named and index editor instance\r
+                       editors[editor.id] = editor;\r
+                       editors.push(editor);\r
+\r
+                       self._setActive(editor);\r
+                       self.onAddEditor.dispatch(self, editor);\r
+\r
+\r
+                       return editor;\r
+               },\r
+\r
+               remove : function(editor) {\r
+                       var t = this, i, editors = t.editors;\r
+\r
+                       // Not in the collection\r
+                       if (!editors[editor.id])\r
+                               return null;\r
+\r
+                       delete editors[editor.id];\r
+\r
+                       for (i = 0; i < editors.length; i++) {\r
+                               if (editors[i] == editor) {\r
+                                       editors.splice(i, 1);\r
+                                       break;\r
+                               }\r
+                       }\r
+\r
+                       // Select another editor since the active one was removed\r
+                       if (t.activeEditor == editor)\r
+                               t._setActive(editors[0]);\r
+\r
+                       editor.destroy();\r
+                       t.onRemoveEditor.dispatch(t, editor);\r
+\r
+                       return editor;\r
+               },\r
+\r
+               execCommand : function(c, u, v) {\r
+                       var t = this, ed = t.get(v), w;\r
+\r
+                       // Manager commands\r
+                       switch (c) {\r
+                               case "mceFocus":\r
+                                       ed.focus();\r
+                                       return true;\r
+\r
+                               case "mceAddEditor":\r
+                               case "mceAddControl":\r
+                                       if (!t.get(v))\r
+                                               new tinymce.Editor(v, t.settings).render();\r
+\r
+                                       return true;\r
+\r
+                               case "mceAddFrameControl":\r
+                                       w = v.window;\r
+\r
+                                       // Add tinyMCE global instance and tinymce namespace to specified window\r
+                                       w.tinyMCE = tinyMCE;\r
+                                       w.tinymce = tinymce;\r
+\r
+                                       tinymce.DOM.doc = w.document;\r
+                                       tinymce.DOM.win = w;\r
+\r
+                                       ed = new tinymce.Editor(v.element_id, v);\r
+                                       ed.render();\r
+\r
+                                       // Fix IE memory leaks\r
+                                       if (tinymce.isIE) {\r
+                                               function clr() {\r
+                                                       ed.destroy();\r
+                                                       w.detachEvent('onunload', clr);\r
+                                                       w = w.tinyMCE = w.tinymce = null; // IE leak\r
+                                               };\r
+\r
+                                               w.attachEvent('onunload', clr);\r
+                                       }\r
+\r
+                                       v.page_window = null;\r
+\r
+                                       return true;\r
+\r
+                               case "mceRemoveEditor":\r
+                               case "mceRemoveControl":\r
+                                       if (ed)\r
+                                               ed.remove();\r
+\r
+                                       return true;\r
+\r
+                               case 'mceToggleEditor':\r
+                                       if (!ed) {\r
+                                               t.execCommand('mceAddControl', 0, v);\r
+                                               return true;\r
+                                       }\r
+\r
+                                       if (ed.isHidden())\r
+                                               ed.show();\r
+                                       else\r
+                                               ed.hide();\r
+\r
+                                       return true;\r
+                       }\r
+\r
+                       // Run command on active editor\r
+                       if (t.activeEditor)\r
+                               return t.activeEditor.execCommand(c, u, v);\r
+\r
+                       return false;\r
+               },\r
+\r
+               execInstanceCommand : function(id, c, u, v) {\r
+                       var ed = this.get(id);\r
+\r
+                       if (ed)\r
+                               return ed.execCommand(c, u, v);\r
+\r
+                       return false;\r
+               },\r
+\r
+               triggerSave : function() {\r
+                       each(this.editors, function(e) {\r
+                               e.save();\r
+                       });\r
+               },\r
+\r
+               addI18n : function(p, o) {\r
+                       var lo, i18n = this.i18n;\r
+\r
+                       if (!tinymce.is(p, 'string')) {\r
+                               each(p, function(o, lc) {\r
+                                       each(o, function(o, g) {\r
+                                               each(o, function(o, k) {\r
+                                                       if (g === 'common')\r
+                                                               i18n[lc + '.' + k] = o;\r
+                                                       else\r
+                                                               i18n[lc + '.' + g + '.' + k] = o;\r
+                                               });\r
+                                       });\r
+                               });\r
+                       } else {\r
+                               each(o, function(o, k) {\r
+                                       i18n[p + '.' + k] = o;\r
+                               });\r
+                       }\r
+               },\r
+\r
+               // Private methods\r
+\r
+               _setActive : function(editor) {\r
+                       this.selectedInstance = this.activeEditor = editor;\r
+               }\r
+       });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+       // Shorten these names\r
+       var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend,\r
+               Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isGecko = tinymce.isGecko,\r
+               isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, is = tinymce.is,\r
+               ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager,\r
+               inArray = tinymce.inArray, grep = tinymce.grep, explode = tinymce.explode;\r
+\r
+       tinymce.create('tinymce.Editor', {\r
+               Editor : function(id, s) {\r
+                       var t = this;\r
+\r
+                       t.id = t.editorId = id;\r
+\r
+                       t.execCommands = {};\r
+                       t.queryStateCommands = {};\r
+                       t.queryValueCommands = {};\r
+\r
+                       t.isNotDirty = false;\r
+\r
+                       t.plugins = {};\r
+\r
+                       // Add events to the editor\r
+                       each([\r
+                               'onPreInit',\r
+\r
+                               'onBeforeRenderUI',\r
+\r
+                               'onPostRender',\r
+\r
+                               'onInit',\r
+\r
+                               'onRemove',\r
+\r
+                               'onActivate',\r
+\r
+                               'onDeactivate',\r
+\r
+                               'onClick',\r
+\r
+                               'onEvent',\r
+\r
+                               'onMouseUp',\r
+\r
+                               'onMouseDown',\r
+\r
+                               'onDblClick',\r
+\r
+                               'onKeyDown',\r
+\r
+                               'onKeyUp',\r
+\r
+                               'onKeyPress',\r
+\r
+                               'onContextMenu',\r
+\r
+                               'onSubmit',\r
+\r
+                               'onReset',\r
+\r
+                               'onPaste',\r
+\r
+                               'onPreProcess',\r
+\r
+                               'onPostProcess',\r
+\r
+                               'onBeforeSetContent',\r
+\r
+                               'onBeforeGetContent',\r
+\r
+                               'onSetContent',\r
+\r
+                               'onGetContent',\r
+\r
+                               'onLoadContent',\r
+\r
+                               'onSaveContent',\r
+\r
+                               'onNodeChange',\r
+\r
+                               'onChange',\r
+\r
+                               'onBeforeExecCommand',\r
+\r
+                               'onExecCommand',\r
+\r
+                               'onUndo',\r
+\r
+                               'onRedo',\r
+\r
+                               'onVisualAid',\r
+\r
+                               'onSetProgressState'\r
+                       ], function(e) {\r
+                               t[e] = new Dispatcher(t);\r
+                       });\r
+\r
+                       t.settings = s = extend({\r
+                               id : id,\r
+                               language : 'en',\r
+                               docs_language : 'en',\r
+                               theme : 'simple',\r
+                               skin : 'default',\r
+                               delta_width : 0,\r
+                               delta_height : 0,\r
+                               popup_css : '',\r
+                               plugins : '',\r
+                               document_base_url : tinymce.documentBaseURL,\r
+                               add_form_submit_trigger : 1,\r
+                               submit_patch : 1,\r
+                               add_unload_trigger : 1,\r
+                               convert_urls : 1,\r
+                               relative_urls : 1,\r
+                               remove_script_host : 1,\r
+                               table_inline_editing : 0,\r
+                               object_resizing : 1,\r
+                               cleanup : 1,\r
+                               accessibility_focus : 1,\r
+                               custom_shortcuts : 1,\r
+                               custom_undo_redo_keyboard_shortcuts : 1,\r
+                               custom_undo_redo_restore_selection : 1,\r
+                               custom_undo_redo : 1,\r
+                               doctype : tinymce.isIE6 ? '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' : '<!DOCTYPE>', // Use old doctype on IE 6 to avoid horizontal scroll\r
+                               visual_table_class : 'mceItemTable',\r
+                               visual : 1,\r
+                               font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large',\r
+                               apply_source_formatting : 1,\r
+                               directionality : 'ltr',\r
+                               forced_root_block : 'p',\r
+                               valid_elements : '@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big',\r
+                               hidden_input : 1,\r
+                               padd_empty_editor : 1,\r
+                               render_ui : 1,\r
+                               init_theme : 1,\r
+                               force_p_newlines : 1,\r
+                               indentation : '30px',\r
+                               keep_styles : 1,\r
+                               fix_table_elements : 1,\r
+                               inline_styles : 1,\r
+                               convert_fonts_to_spans : true\r
+                       }, s);\r
+\r
+                       t.documentBaseURI = new tinymce.util.URI(s.document_base_url || tinymce.documentBaseURL, {\r
+                               base_uri : tinyMCE.baseURI\r
+                       });\r
+\r
+                       t.baseURI = tinymce.baseURI;\r
+\r
+                       // Call setup\r
+                       t.execCallback('setup', t);\r
+               },\r
+\r
+               render : function(nst) {\r
+                       var t = this, s = t.settings, id = t.id, sl = tinymce.ScriptLoader;\r
+\r
+                       // Page is not loaded yet, wait for it\r
+                       if (!Event.domLoaded) {\r
+                               Event.add(document, 'init', function() {\r
+                                       t.render();\r
+                               });\r
+                               return;\r
+                       }\r
+\r
+                       tinyMCE.settings = s;\r
+\r
+                       // Element not found, then skip initialization\r
+                       if (!t.getElement())\r
+                               return;\r
+\r
+                       // Add hidden input for non input elements inside form elements\r
+                       if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form'))\r
+                               DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id);\r
+\r
+                       if (tinymce.WindowManager)\r
+                               t.windowManager = new tinymce.WindowManager(t);\r
+\r
+                       if (s.encoding == 'xml') {\r
+                               t.onGetContent.add(function(ed, o) {\r
+                                       if (o.save)\r
+                                               o.content = DOM.encode(o.content);\r
+                               });\r
+                       }\r
+\r
+                       if (s.add_form_submit_trigger) {\r
+                               t.onSubmit.addToTop(function() {\r
+                                       if (t.initialized) {\r
+                                               t.save();\r
+                                               t.isNotDirty = 1;\r
+                                       }\r
+                               });\r
+                       }\r
+\r
+                       if (s.add_unload_trigger) {\r
+                               t._beforeUnload = tinyMCE.onBeforeUnload.add(function() {\r
+                                       if (t.initialized && !t.destroyed && !t.isHidden())\r
+                                               t.save({format : 'raw', no_events : true});\r
+                               });\r
+                       }\r
+\r
+                       tinymce.addUnload(t.destroy, t);\r
+\r
+                       if (s.submit_patch) {\r
+                               t.onBeforeRenderUI.add(function() {\r
+                                       var n = t.getElement().form;\r
+\r
+                                       if (!n)\r
+                                               return;\r
+\r
+                                       // Already patched\r
+                                       if (n._mceOldSubmit)\r
+                                               return;\r
+\r
+                                       // Check page uses id="submit" or name="submit" for it's submit button\r
+                                       if (!n.submit.nodeType && !n.submit.length) {\r
+                                               t.formElement = n;\r
+                                               n._mceOldSubmit = n.submit;\r
+                                               n.submit = function() {\r
+                                                       // Save all instances\r
+                                                       tinymce.triggerSave();\r
+                                                       t.isNotDirty = 1;\r
+\r
+                                                       return t.formElement._mceOldSubmit(t.formElement);\r
+                                               };\r
+                                       }\r
+\r
+                                       n = null;\r
+                               });\r
+                       }\r
+\r
+                       // Load scripts\r
+                       function loadScripts() {\r
+                               if (s.language)\r
+                                       sl.add(tinymce.baseURL + '/langs/' + s.language + '.js');\r
+\r
+                               if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme])\r
+                                       ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js');\r
+\r
+                               each(explode(s.plugins), function(p) {\r
+                                       if (p && p.charAt(0) != '-' && !PluginManager.urls[p]) {\r
+                                               // Skip safari plugin, since it is removed as of 3.3b1\r
+                                               if (p == 'safari')\r
+                                                       return;\r
+\r
+                                               PluginManager.load(p, 'plugins/' + p + '/editor_plugin' + tinymce.suffix + '.js');\r
+                                       }\r
+                               });\r
+\r
+                               // Init when que is loaded\r
+                               sl.loadQueue(function() {\r
+                                       if (!t.removed)\r
+                                               t.init();\r
+                               });\r
+                       };\r
+\r
+                       loadScripts();\r
+               },\r
+\r
+               init : function() {\r
+                       var n, t = this, s = t.settings, w, h, e = t.getElement(), o, ti, u, bi, bc, re;\r
+\r
+                       tinymce.add(t);\r
+\r
+                       if (s.theme) {\r
+                               s.theme = s.theme.replace(/-/, '');\r
+                               o = ThemeManager.get(s.theme);\r
+                               t.theme = new o();\r
+\r
+                               if (t.theme.init && s.init_theme)\r
+                                       t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, ''));\r
+                       }\r
+\r
+                       // Create all plugins\r
+                       each(explode(s.plugins.replace(/\-/g, '')), function(p) {\r
+                               var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po;\r
+\r
+                               if (c) {\r
+                                       po = new c(t, u);\r
+\r
+                                       t.plugins[p] = po;\r
+\r
+                                       if (po.init)\r
+                                               po.init(t, u);\r
+                               }\r
+                       });\r
+\r
+                       // Setup popup CSS path(s)\r
+                       if (s.popup_css !== false) {\r
+                               if (s.popup_css)\r
+                                       s.popup_css = t.documentBaseURI.toAbsolute(s.popup_css);\r
+                               else\r
+                                       s.popup_css = t.baseURI.toAbsolute("themes/" + s.theme + "/skins/" + s.skin + "/dialog.css");\r
+                       }\r
+\r
+                       if (s.popup_css_add)\r
+                               s.popup_css += ',' + t.documentBaseURI.toAbsolute(s.popup_css_add);\r
+\r
+                       t.controlManager = new tinymce.ControlManager(t);\r
+\r
+                       if (s.custom_undo_redo) {\r
+                               // Add initial undo level\r
+                               t.onBeforeExecCommand.add(function(ed, cmd, ui, val, a) {\r
+                                       if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo)) {\r
+                                               if (!t.undoManager.hasUndo())\r
+                                                       t.undoManager.add();\r
+                                       }\r
+                               });\r
+\r
+                               t.onExecCommand.add(function(ed, cmd, ui, val, a) {\r
+                                       if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo))\r
+                                               t.undoManager.add();\r
+                               });\r
+                       }\r
+\r
+                       t.onExecCommand.add(function(ed, c) {\r
+                               // Don't refresh the select lists until caret move\r
+                               if (!/^(FontName|FontSize)$/.test(c))\r
+                                       t.nodeChanged();\r
+                       });\r
+\r
+                       // Remove ghost selections on images and tables in Gecko\r
+                       if (isGecko) {\r
+                               function repaint(a, o) {\r
+                                       if (!o || !o.initial)\r
+                                               t.execCommand('mceRepaint');\r
+                               };\r
+\r
+                               t.onUndo.add(repaint);\r
+                               t.onRedo.add(repaint);\r
+                               t.onSetContent.add(repaint);\r
+                       }\r
+\r
+                       // Enables users to override the control factory\r
+                       t.onBeforeRenderUI.dispatch(t, t.controlManager);\r
+\r
+                       // Measure box\r
+                       if (s.render_ui) {\r
+                               w = s.width || e.style.width || e.offsetWidth;\r
+                               h = s.height || e.style.height || e.offsetHeight;\r
+                               t.orgDisplay = e.style.display;\r
+                               re = /^[0-9\.]+(|px)$/i;\r
+\r
+                               if (re.test('' + w))\r
+                                       w = Math.max(parseInt(w) + (o.deltaWidth || 0), 100);\r
+\r
+                               if (re.test('' + h))\r
+                                       h = Math.max(parseInt(h) + (o.deltaHeight || 0), 100);\r
+\r
+                               // Render UI\r
+                               o = t.theme.renderUI({\r
+                                       targetNode : e,\r
+                                       width : w,\r
+                                       height : h,\r
+                                       deltaWidth : s.delta_width,\r
+                                       deltaHeight : s.delta_height\r
+                               });\r
+\r
+                               t.editorContainer = o.editorContainer;\r
+                       }\r
+\r
+\r
+                       // User specified a document.domain value\r
+                       if (document.domain && location.hostname != document.domain)\r
+                               tinymce.relaxedDomain = document.domain;\r
+\r
+                       // Resize editor\r
+                       DOM.setStyles(o.sizeContainer || o.editorContainer, {\r
+                               width : w,\r
+                               height : h\r
+                       });\r
+\r
+                       h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : '');\r
+                       if (h < 100)\r
+                               h = 100;\r
+\r
+                       t.iframeHTML = s.doctype + '<html><head xmlns="http://www.w3.org/1999/xhtml">';\r
+\r
+                       // We only need to override paths if we have to\r
+                       // IE has a bug where it remove site absolute urls to relative ones if this is specified\r
+                       if (s.document_base_url != tinymce.documentBaseURL)\r
+                               t.iframeHTML += '<base href="' + t.documentBaseURI.getURI() + '" />';\r
+\r
+                       t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=7" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';\r
+\r
+                       if (tinymce.relaxedDomain)\r
+                               t.iframeHTML += '<script type="text/javascript">document.domain = "' + tinymce.relaxedDomain + '";</script>';\r
+\r
+                       bi = s.body_id || 'tinymce';\r
+                       if (bi.indexOf('=') != -1) {\r
+                               bi = t.getParam('body_id', '', 'hash');\r
+                               bi = bi[t.id] || bi;\r
+                       }\r
+\r
+                       bc = s.body_class || '';\r
+                       if (bc.indexOf('=') != -1) {\r
+                               bc = t.getParam('body_class', '', 'hash');\r
+                               bc = bc[t.id] || '';\r
+                       }\r
+\r
+                       t.iframeHTML += '</head><body id="' + bi + '" class="mceContentBody ' + bc + '"></body></html>';\r
+\r
+                       // Domain relaxing enabled, then set document domain\r
+                       if (tinymce.relaxedDomain) {\r
+                               // We need to write the contents here in IE since multiple writes messes up refresh button and back button\r
+                               if (isIE || (tinymce.isOpera && parseFloat(opera.version()) >= 9.5))\r
+                                       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();})()';\r
+                               else if (tinymce.isOpera)\r
+                                       u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";document.close();ed.setupIframe();})()';                                  \r
+                       }\r
+\r
+                       // Create iframe\r
+                       n = DOM.add(o.iframeContainer, 'iframe', {\r
+                               id : t.id + "_ifr",\r
+                               src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7\r
+                               frameBorder : '0',\r
+                               style : {\r
+                                       width : '100%',\r
+                                       height : h\r
+                               }\r
+                       });\r
+\r
+                       t.contentAreaContainer = o.iframeContainer;\r
+                       DOM.get(o.editorContainer).style.display = t.orgDisplay;\r
+                       DOM.get(t.id).style.display = 'none';\r
+\r
+                       if (!isIE || !tinymce.relaxedDomain)\r
+                               t.setupIframe();\r
+\r
+                       e = n = o = null; // Cleanup\r
+               },\r
+\r
+               setupIframe : function() {\r
+                       var t = this, s = t.settings, e = DOM.get(t.id), d = t.getDoc(), h, b;\r
+\r
+                       // Setup iframe body\r
+                       if (!isIE || !tinymce.relaxedDomain) {\r
+                               d.open();\r
+                               d.write(t.iframeHTML);\r
+                               d.close();\r
+                       }\r
+\r
+                       // Design mode needs to be added here Ctrl+A will fail otherwise\r
+                       if (!isIE) {\r
+                               try {\r
+                                       if (!s.readonly)\r
+                                               d.designMode = 'On';\r
+                               } catch (ex) {\r
+                                       // Will fail on Gecko if the editor is placed in an hidden container element\r
+                                       // The design mode will be set ones the editor is focused\r
+                               }\r
+                       }\r
+\r
+                       // IE needs to use contentEditable or it will display non secure items for HTTPS\r
+                       if (isIE) {\r
+                               // It will not steal focus if we hide it while setting contentEditable\r
+                               b = t.getBody();\r
+                               DOM.hide(b);\r
+\r
+                               if (!s.readonly)\r
+                                       b.contentEditable = true;\r
+\r
+                               DOM.show(b);\r
+                       }\r
+\r
+                       t.dom = new tinymce.dom.DOMUtils(t.getDoc(), {\r
+                               keep_values : true,\r
+                               url_converter : t.convertURL,\r
+                               url_converter_scope : t,\r
+                               hex_colors : s.force_hex_style_colors,\r
+                               class_filter : s.class_filter,\r
+                               update_styles : 1,\r
+                               fix_ie_paragraphs : 1,\r
+                               valid_styles : s.valid_styles\r
+                       });\r
+\r
+                       t.schema = new tinymce.dom.Schema();\r
+\r
+                       t.serializer = new tinymce.dom.Serializer(extend(s, {\r
+                               valid_elements : s.verify_html === false ? '*[*]' : s.valid_elements,\r
+                               dom : t.dom,\r
+                               schema : t.schema\r
+                       }));\r
+\r
+                       t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer);\r
+\r
+                       t.formatter = new tinymce.Formatter(this);\r
+\r
+                       // Register default formats\r
+                       t.formatter.register({\r
+                               alignleft : [\r
+                                       {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}},\r
+                                       {selector : 'img,table', styles : {'float' : 'left'}}\r
+                               ],\r
+\r
+                               aligncenter : [\r
+                                       {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}},\r
+                                       {selector : 'img', styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}},\r
+                                       {selector : 'table', styles : {marginLeft : 'auto', marginRight : 'auto'}}\r
+                               ],\r
+\r
+                               alignright : [\r
+                                       {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}},\r
+                                       {selector : 'img,table', styles : {'float' : 'right'}}\r
+                               ],\r
+\r
+                               alignfull : [\r
+                                       {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'justify'}}\r
+                               ],\r
+\r
+                               bold : [\r
+                                       {inline : 'strong'},\r
+                                       {inline : 'span', styles : {fontWeight : 'bold'}},\r
+                                       {inline : 'b'}\r
+                               ],\r
+\r
+                               italic : [\r
+                                       {inline : 'em'},\r
+                                       {inline : 'span', styles : {fontStyle : 'italic'}},\r
+                                       {inline : 'i'}\r
+                               ],\r
+\r
+                               underline : [\r
+                                       {inline : 'span', styles : {textDecoration : 'underline'}, exact : true},\r
+                                       {inline : 'u'}\r
+                               ],\r
+\r
+                               strikethrough : [\r
+                                       {inline : 'span', styles : {textDecoration : 'line-through'}, exact : true},\r
+                                       {inline : 'u'}\r
+                               ],\r
+\r
+                               forecolor : {inline : 'span', styles : {color : '%value'}},\r
+                               hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}},\r
+                               fontname : {inline : 'span', styles : {fontFamily : '%value'}},\r
+                               fontsize : {inline : 'span', styles : {fontSize : '%value'}},\r
+                               blockquote : {block : 'blockquote', wrapper : 1},\r
+\r
+                               removeformat : [\r
+                                       {selector : 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand : true, deep : true},\r
+                                       {selector : 'span', attributes : ['style', 'class'], remove : 'empty', split : true, expand : false, deep : true},\r
+                                       {selector : '*', attributes : ['style', 'class'], expand : false, deep : true}\r
+                               ]\r
+                       });\r
+\r
+                       // Register default block formats\r
+                       each('p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp'.split(/\s/), function(name) {\r
+                               t.formatter.register(name, {block : name});\r
+                       });\r
+\r
+                       // Register user defined formats\r
+                       t.formatter.register(t.settings.formats);\r
+\r
+                       t.undoManager = new tinymce.UndoManager(t);\r
+\r
+                       // Pass through\r
+                       t.undoManager.onAdd.add(function(um, l) {\r
+                               if (!l.initial)\r
+                                       return t.onChange.dispatch(t, l, um);\r
+                       });\r
+\r
+                       t.undoManager.onUndo.add(function(um, l) {\r
+                               return t.onUndo.dispatch(t, l, um);\r
+                       });\r
+\r
+                       t.undoManager.onRedo.add(function(um, l) {\r
+                               return t.onRedo.dispatch(t, l, um);\r
+                       });\r
+\r
+                       t.forceBlocks = new tinymce.ForceBlocks(t, {\r
+                               forced_root_block : s.forced_root_block\r
+                       });\r
+\r
+                       t.editorCommands = new tinymce.EditorCommands(t);\r
+\r
+                       // Pass through\r
+                       t.serializer.onPreProcess.add(function(se, o) {\r
+                               return t.onPreProcess.dispatch(t, o, se);\r
+                       });\r
+\r
+                       t.serializer.onPostProcess.add(function(se, o) {\r
+                               return t.onPostProcess.dispatch(t, o, se);\r
+                       });\r
+\r
+                       t.onPreInit.dispatch(t);\r
+\r
+                       if (!s.gecko_spellcheck)\r
+                               t.getBody().spellcheck = 0;\r
+\r
+                       if (!s.readonly)\r
+                               t._addEvents();\r
+\r
+                       t.controlManager.onPostRender.dispatch(t, t.controlManager);\r
+                       t.onPostRender.dispatch(t);\r
+\r
+                       if (s.directionality)\r
+                               t.getBody().dir = s.directionality;\r
+\r
+                       if (s.nowrap)\r
+                               t.getBody().style.whiteSpace = "nowrap";\r
+\r
+                       if (s.custom_elements) {\r
+                               function handleCustom(ed, o) {\r
+                                       each(explode(s.custom_elements), function(v) {\r
+                                               var n;\r
+\r
+                                               if (v.indexOf('~') === 0) {\r
+                                                       v = v.substring(1);\r
+                                                       n = 'span';\r
+                                               } else\r
+                                                       n = 'div';\r
+\r
+                                               o.content = o.content.replace(new RegExp('<(' + v + ')([^>]*)>', 'g'), '<' + n + ' _mce_name="$1"$2>');\r
+                                               o.content = o.content.replace(new RegExp('</(' + v + ')>', 'g'), '</' + n + '>');\r
+                                       });\r
+                               };\r
+\r
+                               t.onBeforeSetContent.add(handleCustom);\r
+                               t.onPostProcess.add(function(ed, o) {\r
+                                       if (o.set)\r
+                                               handleCustom(ed, o);\r
+                               });\r
+                       }\r
+\r
+                       if (s.handle_node_change_callback) {\r
+                               t.onNodeChange.add(function(ed, cm, n) {\r
+                                       t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed());\r
+                               });\r
+                       }\r
+\r
+                       if (s.save_callback) {\r
+                               t.onSaveContent.add(function(ed, o) {\r
+                                       var h = t.execCallback('save_callback', t.id, o.content, t.getBody());\r
+\r
+                                       if (h)\r
+                                               o.content = h;\r
+                               });\r
+                       }\r
+\r
+                       if (s.onchange_callback) {\r
+                               t.onChange.add(function(ed, l) {\r
+                                       t.execCallback('onchange_callback', t, l);\r
+                               });\r
+                       }\r
+\r
+                       if (s.convert_newlines_to_brs) {\r
+                               t.onBeforeSetContent.add(function(ed, o) {\r
+                                       if (o.initial)\r
+                                               o.content = o.content.replace(/\r?\n/g, '<br />');\r
+                               });\r
+                       }\r
+\r
+                       if (s.fix_nesting && isIE) {\r
+                               t.onBeforeSetContent.add(function(ed, o) {\r
+                                       o.content = t._fixNesting(o.content);\r
+                               });\r
+                       }\r
+\r
+                       if (s.preformatted) {\r
+                               t.onPostProcess.add(function(ed, o) {\r
+                                       o.content = o.content.replace(/^\s*<pre.*?>/, '');\r
+                                       o.content = o.content.replace(/<\/pre>\s*$/, '');\r
+\r
+                                       if (o.set)\r
+                                               o.content = '<pre class="mceItemHidden">' + o.content + '</pre>';\r
+                               });\r
+                       }\r
+\r
+                       if (s.verify_css_classes) {\r
+                               t.serializer.attribValueFilter = function(n, v) {\r
+                                       var s, cl;\r
+\r
+                                       if (n == 'class') {\r
+                                               // Build regexp for classes\r
+                                               if (!t.classesRE) {\r
+                                                       cl = t.dom.getClasses();\r
+\r
+                                                       if (cl.length > 0) {\r
+                                                               s = '';\r
+\r
+                                                               each (cl, function(o) {\r
+                                                                       s += (s ? '|' : '') + o['class'];\r
+                                                               });\r
+\r
+                                                               t.classesRE = new RegExp('(' + s + ')', 'gi');\r
+                                                       }\r
+                                               }\r
+\r
+                                               return !t.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v) || t.classesRE.test(v) ? v : '';\r
+                                       }\r
+\r
+                                       return v;\r
+                               };\r
+                       }\r
+\r
+                       if (s.cleanup_callback) {\r
+                               t.onBeforeSetContent.add(function(ed, o) {\r
+                                       o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);\r
+                               });\r
+\r
+                               t.onPreProcess.add(function(ed, o) {\r
+                                       if (o.set)\r
+                                               t.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o);\r
+\r
+                                       if (o.get)\r
+                                               t.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o);\r
+                               });\r
+\r
+                               t.onPostProcess.add(function(ed, o) {\r
+                                       if (o.set)\r
+                                               o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);\r
+\r
+                                       if (o.get)                                              \r
+                                               o.content = t.execCallback('cleanup_callback', 'get_from_editor', o.content, o);\r
+                               });\r
+                       }\r
+\r
+                       if (s.save_callback) {\r
+                               t.onGetContent.add(function(ed, o) {\r
+                                       if (o.save)\r
+                                               o.content = t.execCallback('save_callback', t.id, o.content, t.getBody());\r
+                               });\r
+                       }\r
+\r
+                       if (s.handle_event_callback) {\r
+                               t.onEvent.add(function(ed, e, o) {\r
+                                       if (t.execCallback('handle_event_callback', e, ed, o) === false)\r
+                                               Event.cancel(e);\r
+                               });\r
+                       }\r
+\r
+                       // Add visual aids when new contents is added\r
+                       t.onSetContent.add(function() {\r
+                               t.addVisual(t.getBody());\r
+                       });\r
+\r
+                       // Remove empty contents\r
+                       if (s.padd_empty_editor) {\r
+                               t.onPostProcess.add(function(ed, o) {\r
+                                       o.content = o.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/, '');\r
+                               });\r
+                       }\r
+\r
+                       if (isGecko) {\r
+                               // Fix gecko link bug, when a link is placed at the end of block elements there is\r
+                               // no way to move the caret behind the link. This fix adds a bogus br element after the link\r
+                               function fixLinks(ed, o) {\r
+                                       each(ed.dom.select('a'), function(n) {\r
+                                               var pn = n.parentNode;\r
+\r
+                                               if (ed.dom.isBlock(pn) && pn.lastChild === n)\r
+                                                       ed.dom.add(pn, 'br', {'_mce_bogus' : 1});\r
+                                       });\r
+                               };\r
+\r
+                               t.onExecCommand.add(function(ed, cmd) {\r
+                                       if (cmd === 'CreateLink')\r
+                                               fixLinks(ed);\r
+                               });\r
+\r
+                               t.onSetContent.add(t.selection.onSetContent.add(fixLinks));\r
+\r
+                               if (!s.readonly) {\r
+                                       try {\r
+                                               // Design mode must be set here once again to fix a bug where\r
+                                               // Ctrl+A/Delete/Backspace didn't work if the editor was added using mceAddControl then removed then added again\r
+                                               d.designMode = 'Off';\r
+                                               d.designMode = 'On';\r
+                                       } catch (ex) {\r
+                                               // Will fail on Gecko if the editor is placed in an hidden container element\r
+                                               // The design mode will be set ones the editor is focused\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+                       // A small timeout was needed since firefox will remove. Bug: #1838304\r
+                       setTimeout(function () {\r
+                               if (t.removed)\r
+                                       return;\r
+\r
+                               t.load({initial : true, format : (s.cleanup_on_startup ? 'html' : 'raw')});\r
+                               t.startContent = t.getContent({format : 'raw'});\r
+                               t.initialized = true;\r
+\r
+                               t.onInit.dispatch(t);\r
+                               t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc());\r
+                               t.execCallback('init_instance_callback', t);\r
+                               t.focus(true);\r
+                               t.nodeChanged({initial : 1});\r
+\r
+                               // Load specified content CSS last\r
+                               if (s.content_css) {\r
+                                       tinymce.each(explode(s.content_css), function(u) {\r
+                                               t.dom.loadCSS(t.documentBaseURI.toAbsolute(u));\r
+                                       });\r
+                               }\r
+\r
+                               // Handle auto focus\r
+                               if (s.auto_focus) {\r
+                                       setTimeout(function () {\r
+                                               var ed = tinymce.get(s.auto_focus);\r
+\r
+                                               ed.selection.select(ed.getBody(), 1);\r
+                                               ed.selection.collapse(1);\r
+                                               ed.getWin().focus();\r
+                                       }, 100);\r
+                               }\r
+                       }, 1);\r
+       \r
+                       e = null;\r
+               },\r
+\r
+\r
+               focus : function(sf) {\r
+                       var oed, t = this, ce = t.settings.content_editable;\r
+\r
+                       if (!sf) {\r
+                               // Is not content editable or the selection is outside the area in IE\r
+                               // the IE statement is needed to avoid bluring if element selections inside layers since\r
+                               // the layer is like it's own document in IE\r
+                               if (!ce && (!isIE || t.selection.getNode().ownerDocument != t.getDoc()))\r
+                                       t.getWin().focus();\r
+\r
+                       }\r
+\r
+                       if (tinymce.activeEditor != t) {\r
+                               if ((oed = tinymce.activeEditor) != null)\r
+                                       oed.onDeactivate.dispatch(oed, t);\r
+\r
+                               t.onActivate.dispatch(t, oed);\r
+                       }\r
+\r
+                       tinymce._setActive(t);\r
+               },\r
+\r
+               execCallback : function(n) {\r
+                       var t = this, f = t.settings[n], s;\r
+\r
+                       if (!f)\r
+                               return;\r
+\r
+                       // Look through lookup\r
+                       if (t.callbackLookup && (s = t.callbackLookup[n])) {\r
+                               f = s.func;\r
+                               s = s.scope;\r
+                       }\r
+\r
+                       if (is(f, 'string')) {\r
+                               s = f.replace(/\.\w+$/, '');\r
+                               s = s ? tinymce.resolve(s) : 0;\r
+                               f = tinymce.resolve(f);\r
+                               t.callbackLookup = t.callbackLookup || {};\r
+                               t.callbackLookup[n] = {func : f, scope : s};\r
+                       }\r
+\r
+                       return f.apply(s || t, Array.prototype.slice.call(arguments, 1));\r
+               },\r
+\r
+               translate : function(s) {\r
+                       var c = this.settings.language || 'en', i18n = tinymce.i18n;\r
+\r
+                       if (!s)\r
+                               return '';\r
+\r
+                       return i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) {\r
+                               return i18n[c + '.' + b] || '{#' + b + '}';\r
+                       });\r
+               },\r
+\r
+               getLang : function(n, dv) {\r
+                       return tinymce.i18n[(this.settings.language || 'en') + '.' + n] || (is(dv) ? dv : '{#' + n + '}');\r
+               },\r
+\r
+               getParam : function(n, dv, ty) {\r
+                       var tr = tinymce.trim, v = is(this.settings[n]) ? this.settings[n] : dv, o;\r
+\r
+                       if (ty === 'hash') {\r
+                               o = {};\r
+\r
+                               if (is(v, 'string')) {\r
+                                       each(v.indexOf('=') > 0 ? v.split(/[;,](?![^=;,]*(?:[;,]|$))/) : v.split(','), function(v) {\r
+                                               v = v.split('=');\r
+\r
+                                               if (v.length > 1)\r
+                                                       o[tr(v[0])] = tr(v[1]);\r
+                                               else\r
+                                                       o[tr(v[0])] = tr(v);\r
+                                       });\r
+                               } else\r
+                                       o = v;\r
+\r
+                               return o;\r
+                       }\r
+\r
+                       return v;\r
+               },\r
+\r
+               nodeChanged : function(o) {\r
+                       var t = this, s = t.selection, n = s.getNode() || t.getBody();\r
+\r
+                       // Fix for bug #1896577 it seems that this can not be fired while the editor is loading\r
+                       if (t.initialized) {\r
+                               o = o || {};\r
+                               n = isIE && n.ownerDocument != t.getDoc() ? t.getBody() : n; // Fix for IE initial state\r
+\r
+                               // Get parents and add them to object\r
+                               o.parents = [];\r
+                               t.dom.getParent(n, function(node) {\r
+                                       if (node.nodeName == 'BODY')\r
+                                               return true;\r
+\r
+                                       o.parents.push(node);\r
+                               });\r
+\r
+                               t.onNodeChange.dispatch(\r
+                                       t,\r
+                                       o ? o.controlManager || t.controlManager : t.controlManager,\r
+                                       n,\r
+                                       s.isCollapsed(),\r
+                                       o\r
+                               );\r
+                       }\r
+               },\r
+\r
+               addButton : function(n, s) {\r
+                       var t = this;\r
+\r
+                       t.buttons = t.buttons || {};\r
+                       t.buttons[n] = s;\r
+               },\r
+\r
+               addCommand : function(n, f, s) {\r
+                       this.execCommands[n] = {func : f, scope : s || this};\r
+               },\r
+\r
+               addQueryStateHandler : function(n, f, s) {\r
+                       this.queryStateCommands[n] = {func : f, scope : s || this};\r
+               },\r
+\r
+               addQueryValueHandler : function(n, f, s) {\r
+                       this.queryValueCommands[n] = {func : f, scope : s || this};\r
+               },\r
+\r
+               addShortcut : function(pa, desc, cmd_func, sc) {\r
+                       var t = this, c;\r
+\r
+                       if (!t.settings.custom_shortcuts)\r
+                               return false;\r
+\r
+                       t.shortcuts = t.shortcuts || {};\r
+\r
+                       if (is(cmd_func, 'string')) {\r
+                               c = cmd_func;\r
+\r
+                               cmd_func = function() {\r
+                                       t.execCommand(c, false, null);\r
+                               };\r
+                       }\r
+\r
+                       if (is(cmd_func, 'object')) {\r
+                               c = cmd_func;\r
+\r
+                               cmd_func = function() {\r
+                                       t.execCommand(c[0], c[1], c[2]);\r
+                               };\r
+                       }\r
+\r
+                       each(explode(pa), function(pa) {\r
+                               var o = {\r
+                                       func : cmd_func,\r
+                                       scope : sc || this,\r
+                                       desc : desc,\r
+                                       alt : false,\r
+                                       ctrl : false,\r
+                                       shift : false\r
+                               };\r
+\r
+                               each(explode(pa, '+'), function(v) {\r
+                                       switch (v) {\r
+                                               case 'alt':\r
+                                               case 'ctrl':\r
+                                               case 'shift':\r
+                                                       o[v] = true;\r
+                                                       break;\r
+\r
+                                               default:\r
+                                                       o.charCode = v.charCodeAt(0);\r
+                                                       o.keyCode = v.toUpperCase().charCodeAt(0);\r
+                                       }\r
+                               });\r
+\r
+                               t.shortcuts[(o.ctrl ? 'ctrl' : '') + ',' + (o.alt ? 'alt' : '') + ',' + (o.shift ? 'shift' : '') + ',' + o.keyCode] = o;\r
+                       });\r
+\r
+                       return true;\r
+               },\r
+\r
+               execCommand : function(cmd, ui, val, a) {\r
+                       var t = this, s = 0, o, st;\r
+\r
+                       if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd) && (!a || !a.skip_focus))\r
+                               t.focus();\r
+\r
+                       o = {};\r
+                       t.onBeforeExecCommand.dispatch(t, cmd, ui, val, o);\r
+                       if (o.terminate)\r
+                               return false;\r
+\r
+                       // Command callback\r
+                       if (t.execCallback('execcommand_callback', t.id, t.selection.getNode(), cmd, ui, val)) {\r
+                               t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
+                               return true;\r
+                       }\r
+\r
+                       // Registred commands\r
+                       if (o = t.execCommands[cmd]) {\r
+                               st = o.func.call(o.scope, ui, val);\r
+\r
+                               // Fall through on true\r
+                               if (st !== true) {\r
+                                       t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
+                                       return st;\r
+                               }\r
+                       }\r
+\r
+                       // Plugin commands\r
+                       each(t.plugins, function(p) {\r
+                               if (p.execCommand && p.execCommand(cmd, ui, val)) {\r
+                                       t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
+                                       s = 1;\r
+                                       return false;\r
+                               }\r
+                       });\r
+\r
+                       if (s)\r
+                               return true;\r
+\r
+                       // Theme commands\r
+                       if (t.theme && t.theme.execCommand && t.theme.execCommand(cmd, ui, val)) {\r
+                               t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
+                               return true;\r
+                       }\r
+\r
+                       // Execute global commands\r
+                       if (tinymce.GlobalCommands.execCommand(t, cmd, ui, val)) {\r
+                               t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
+                               return true;\r
+                       }\r
+\r
+                       // Editor commands\r
+                       if (t.editorCommands.execCommand(cmd, ui, val)) {\r
+                               t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
+                               return true;\r
+                       }\r
+\r
+                       // Browser commands\r
+                       t.getDoc().execCommand(cmd, ui, val);\r
+                       t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
+               },\r
+\r
+               queryCommandState : function(cmd) {\r
+                       var t = this, o, s;\r
+\r
+                       // Is hidden then return undefined\r
+                       if (t._isHidden())\r
+                               return;\r
+\r
+                       // Registred commands\r
+                       if (o = t.queryStateCommands[cmd]) {\r
+                               s = o.func.call(o.scope);\r
+\r
+                               // Fall though on true\r
+                               if (s !== true)\r
+                                       return s;\r
+                       }\r
+\r
+                       // Registred commands\r
+                       o = t.editorCommands.queryCommandState(cmd);\r
+                       if (o !== -1)\r
+                               return o;\r
+\r
+                       // Browser commands\r
+                       try {\r
+                               return this.getDoc().queryCommandState(cmd);\r
+                       } catch (ex) {\r
+                               // Fails sometimes see bug: 1896577\r
+                       }\r
+               },\r
+\r
+               queryCommandValue : function(c) {\r
+                       var t = this, o, s;\r
+\r
+                       // Is hidden then return undefined\r
+                       if (t._isHidden())\r
+                               return;\r
+\r
+                       // Registred commands\r
+                       if (o = t.queryValueCommands[c]) {\r
+                               s = o.func.call(o.scope);\r
+\r
+                               // Fall though on true\r
+                               if (s !== true)\r
+                                       return s;\r
+                       }\r
+\r
+                       // Registred commands\r
+                       o = t.editorCommands.queryCommandValue(c);\r
+                       if (is(o))\r
+                               return o;\r
+\r
+                       // Browser commands\r
+                       try {\r
+                               return this.getDoc().queryCommandValue(c);\r
+                       } catch (ex) {\r
+                               // Fails sometimes see bug: 1896577\r
+                       }\r
+               },\r
+\r
+               show : function() {\r
+                       var t = this;\r
+\r
+                       DOM.show(t.getContainer());\r
+                       DOM.hide(t.id);\r
+                       t.load();\r
+               },\r
+\r
+               hide : function() {\r
+                       var t = this, d = t.getDoc();\r
+\r
+                       // Fixed bug where IE has a blinking cursor left from the editor\r
+                       if (isIE && d)\r
+                               d.execCommand('SelectAll');\r
+\r
+                       // We must save before we hide so Safari doesn't crash\r
+                       t.save();\r
+                       DOM.hide(t.getContainer());\r
+                       DOM.setStyle(t.id, 'display', t.orgDisplay);\r
+               },\r
+\r
+               isHidden : function() {\r
+                       return !DOM.isHidden(this.id);\r
+               },\r
+\r
+               setProgressState : function(b, ti, o) {\r
+                       this.onSetProgressState.dispatch(this, b, ti, o);\r
+\r
+                       return b;\r
+               },\r
+\r
+               load : function(o) {\r
+                       var t = this, e = t.getElement(), h;\r
+\r
+                       if (e) {\r
+                               o = o || {};\r
+                               o.load = true;\r
+\r
+                               // Double encode existing entities in the value\r
+                               h = t.setContent(is(e.value) ? e.value : e.innerHTML, o);\r
+                               o.element = e;\r
+\r
+                               if (!o.no_events)\r
+                                       t.onLoadContent.dispatch(t, o);\r
+\r
+                               o.element = e = null;\r
+\r
+                               return h;\r
+                       }\r
+               },\r
+\r
+               save : function(o) {\r
+                       var t = this, e = t.getElement(), h, f;\r
+\r
+                       if (!e || !t.initialized)\r
+                               return;\r
+\r
+                       o = o || {};\r
+                       o.save = true;\r
+\r
+                       // Add undo level will trigger onchange event\r
+                       if (!o.no_events) {\r
+                               t.undoManager.typing = 0;\r
+                               t.undoManager.add();\r
+                       }\r
+\r
+                       o.element = e;\r
+                       h = o.content = t.getContent(o);\r
+\r
+                       if (!o.no_events)\r
+                               t.onSaveContent.dispatch(t, o);\r
+\r
+                       h = o.content;\r
+\r
+                       if (!/TEXTAREA|INPUT/i.test(e.nodeName)) {\r
+                               e.innerHTML = h;\r
+\r
+                               // Update hidden form element\r
+                               if (f = DOM.getParent(t.id, 'form')) {\r
+                                       each(f.elements, function(e) {\r
+                                               if (e.name == t.id) {\r
+                                                       e.value = h;\r
+                                                       return false;\r
+                                               }\r
+                                       });\r
+                               }\r
+                       } else\r
+                               e.value = h;\r
+\r
+                       o.element = e = null;\r
+\r
+                       return h;\r
+               },\r
+\r
+               setContent : function(h, o) {\r
+                       var t = this;\r
+\r
+                       o = o || {};\r
+                       o.format = o.format || 'html';\r
+                       o.set = true;\r
+                       o.content = h;\r
+\r
+                       if (!o.no_events)\r
+                               t.onBeforeSetContent.dispatch(t, o);\r
+\r
+                       // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content\r
+                       // It will also be impossible to place the caret in the editor unless there is a BR element present\r
+                       if (!tinymce.isIE && (h.length === 0 || /^\s+$/.test(h))) {\r
+                               o.content = t.dom.setHTML(t.getBody(), '<br _mce_bogus="1" />');\r
+                               o.format = 'raw';\r
+                       }\r
+\r
+                       o.content = t.dom.setHTML(t.getBody(), tinymce.trim(o.content));\r
+\r
+                       if (o.format != 'raw' && t.settings.cleanup) {\r
+                               o.getInner = true;\r
+                               o.content = t.dom.setHTML(t.getBody(), t.serializer.serialize(t.getBody(), o));\r
+                       }\r
+\r
+                       if (!o.no_events)\r
+                               t.onSetContent.dispatch(t, o);\r
+\r
+                       return o.content;\r
+               },\r
+\r
+               getContent : function(o) {\r
+                       var t = this, h;\r
+\r
+                       o = o || {};\r
+                       o.format = o.format || 'html';\r
+                       o.get = true;\r
+\r
+                       if (!o.no_events)\r
+                               t.onBeforeGetContent.dispatch(t, o);\r
+\r
+                       if (o.format != 'raw' && t.settings.cleanup) {\r
+                               o.getInner = true;\r
+                               h = t.serializer.serialize(t.getBody(), o);\r
+                       } else\r
+                               h = t.getBody().innerHTML;\r
+\r
+                       h = h.replace(/^\s*|\s*$/g, '');\r
+                       o.content = h;\r
+\r
+                       if (!o.no_events)\r
+                               t.onGetContent.dispatch(t, o);\r
+\r
+                       return o.content;\r
+               },\r
+\r
+               isDirty : function() {\r
+                       var t = this;\r
+\r
+                       return tinymce.trim(t.startContent) != tinymce.trim(t.getContent({format : 'raw', no_events : 1})) && !t.isNotDirty;\r
+               },\r
+\r
+               getContainer : function() {\r
+                       var t = this;\r
+\r
+                       if (!t.container)\r
+                               t.container = DOM.get(t.editorContainer || t.id + '_parent');\r
+\r
+                       return t.container;\r
+               },\r
+\r
+               getContentAreaContainer : function() {\r
+                       return this.contentAreaContainer;\r
+               },\r
+\r
+               getElement : function() {\r
+                       return DOM.get(this.settings.content_element || this.id);\r
+               },\r
+\r
+               getWin : function() {\r
+                       var t = this, e;\r
+\r
+                       if (!t.contentWindow) {\r
+                               e = DOM.get(t.id + "_ifr");\r
+\r
+                               if (e)\r
+                                       t.contentWindow = e.contentWindow;\r
+                       }\r
+\r
+                       return t.contentWindow;\r
+               },\r
+\r
+               getDoc : function() {\r
+                       var t = this, w;\r
+\r
+                       if (!t.contentDocument) {\r
+                               w = t.getWin();\r
+\r
+                               if (w)\r
+                                       t.contentDocument = w.document;\r
+                       }\r
+\r
+                       return t.contentDocument;\r
+               },\r
+\r
+               getBody : function() {\r
+                       return this.bodyElement || this.getDoc().body;\r
+               },\r
+\r
+               convertURL : function(u, n, e) {\r
+                       var t = this, s = t.settings;\r
+\r
+                       // Use callback instead\r
+                       if (s.urlconverter_callback)\r
+                               return t.execCallback('urlconverter_callback', u, e, true, n);\r
+\r
+                       // Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs\r
+                       if (!s.convert_urls || (e && e.nodeName == 'LINK') || u.indexOf('file:') === 0)\r
+                               return u;\r
+\r
+                       // Convert to relative\r
+                       if (s.relative_urls)\r
+                               return t.documentBaseURI.toRelative(u);\r
+\r
+                       // Convert to absolute\r
+                       u = t.documentBaseURI.toAbsolute(u, s.remove_script_host);\r
+\r
+                       return u;\r
+               },\r
+\r
+               addVisual : function(e) {\r
+                       var t = this, s = t.settings;\r
+\r
+                       e = e || t.getBody();\r
+\r
+                       if (!is(t.hasVisual))\r
+                               t.hasVisual = s.visual;\r
+\r
+                       each(t.dom.select('table,a', e), function(e) {\r
+                               var v;\r
+\r
+                               switch (e.nodeName) {\r
+                                       case 'TABLE':\r
+                                               v = t.dom.getAttrib(e, 'border');\r
+\r
+                                               if (!v || v == '0') {\r
+                                                       if (t.hasVisual)\r
+                                                               t.dom.addClass(e, s.visual_table_class);\r
+                                                       else\r
+                                                               t.dom.removeClass(e, s.visual_table_class);\r
+                                               }\r
+\r
+                                               return;\r
+\r
+                                       case 'A':\r
+                                               v = t.dom.getAttrib(e, 'name');\r
+\r
+                                               if (v) {\r
+                                                       if (t.hasVisual)\r
+                                                               t.dom.addClass(e, 'mceItemAnchor');\r
+                                                       else\r
+                                                               t.dom.removeClass(e, 'mceItemAnchor');\r
+                                               }\r
+\r
+                                               return;\r
+                               }\r
+                       });\r
+\r
+                       t.onVisualAid.dispatch(t, e, t.hasVisual);\r
+               },\r
+\r
+               remove : function() {\r
+                       var t = this, e = t.getContainer();\r
+\r
+                       t.removed = 1; // Cancels post remove event execution\r
+                       t.hide();\r
+\r
+                       t.execCallback('remove_instance_callback', t);\r
+                       t.onRemove.dispatch(t);\r
+\r
+                       // Clear all execCommand listeners this is required to avoid errors if the editor was removed inside another command\r
+                       t.onExecCommand.listeners = [];\r
+\r
+                       tinymce.remove(t);\r
+                       DOM.remove(e);\r
+               },\r
+\r
+               destroy : function(s) {\r
+                       var t = this;\r
+\r
+                       // One time is enough\r
+                       if (t.destroyed)\r
+                               return;\r
+\r
+                       if (!s) {\r
+                               tinymce.removeUnload(t.destroy);\r
+                               tinyMCE.onBeforeUnload.remove(t._beforeUnload);\r
+\r
+                               // Manual destroy\r
+                               if (t.theme && t.theme.destroy)\r
+                                       t.theme.destroy();\r
+\r
+                               // Destroy controls, selection and dom\r
+                               t.controlManager.destroy();\r
+                               t.selection.destroy();\r
+                               t.dom.destroy();\r
+\r
+                               // Remove all events\r
+\r
+                               // Don't clear the window or document if content editable\r
+                               // is enabled since other instances might still be present\r
+                               if (!t.settings.content_editable) {\r
+                                       Event.clear(t.getWin());\r
+                                       Event.clear(t.getDoc());\r
+                               }\r
+\r
+                               Event.clear(t.getBody());\r
+                               Event.clear(t.formElement);\r
+                       }\r
+\r
+                       if (t.formElement) {\r
+                               t.formElement.submit = t.formElement._mceOldSubmit;\r
+                               t.formElement._mceOldSubmit = null;\r
+                       }\r
+\r
+                       t.contentAreaContainer = t.formElement = t.container = t.settings.content_element = t.bodyElement = t.contentDocument = t.contentWindow = null;\r
+\r
+                       if (t.selection)\r
+                               t.selection = t.selection.win = t.selection.dom = t.selection.dom.doc = null;\r
+\r
+                       t.destroyed = 1;\r
+               },\r
+\r
+               // Internal functions\r
+\r
+               _addEvents : function() {\r
+                       // 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset\r
+                       var t = this, i, s = t.settings, lo = {\r
+                               mouseup : 'onMouseUp',\r
+                               mousedown : 'onMouseDown',\r
+                               click : 'onClick',\r
+                               keyup : 'onKeyUp',\r
+                               keydown : 'onKeyDown',\r
+                               keypress : 'onKeyPress',\r
+                               submit : 'onSubmit',\r
+                               reset : 'onReset',\r
+                               contextmenu : 'onContextMenu',\r
+                               dblclick : 'onDblClick',\r
+                               paste : 'onPaste' // Doesn't work in all browsers yet\r
+                       };\r
+\r
+                       function eventHandler(e, o) {\r
+                               var ty = e.type;\r
+\r
+                               // Don't fire events when it's removed\r
+                               if (t.removed)\r
+                                       return;\r
+\r
+                               // Generic event handler\r
+                               if (t.onEvent.dispatch(t, e, o) !== false) {\r
+                                       // Specific event handler\r
+                                       t[lo[e.fakeType || e.type]].dispatch(t, e, o);\r
+                               }\r
+                       };\r
+\r
+                       // Add DOM events\r
+                       each(lo, function(v, k) {\r
+                               switch (k) {\r
+                                       case 'contextmenu':\r
+                                               if (tinymce.isOpera) {\r
+                                                       // Fake contextmenu on Opera\r
+                                                       t.dom.bind(t.getBody(), 'mousedown', function(e) {\r
+                                                               if (e.ctrlKey) {\r
+                                                                       e.fakeType = 'contextmenu';\r
+                                                                       eventHandler(e);\r
+                                                               }\r
+                                                       });\r
+                                               } else\r
+                                                       t.dom.bind(t.getBody(), k, eventHandler);\r
+                                               break;\r
+\r
+                                       case 'paste':\r
+                                               t.dom.bind(t.getBody(), k, function(e) {\r
+                                                       eventHandler(e);\r
+                                               });\r
+                                               break;\r
+\r
+                                       case 'submit':\r
+                                       case 'reset':\r
+                                               t.dom.bind(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler);\r
+                                               break;\r
+\r
+                                       default:\r
+                                               t.dom.bind(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler);\r
+                               }\r
+                       });\r
+\r
+                       t.dom.bind(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) {\r
+                               t.focus(true);\r
+                       });\r
+\r
+\r
+                       // Fixes bug where a specified document_base_uri could result in broken images\r
+                       // This will also fix drag drop of images in Gecko\r
+                       if (tinymce.isGecko) {\r
+                               // Convert all images to absolute URLs\r
+/*                             t.onSetContent.add(function(ed, o) {\r
+                                       each(ed.dom.select('img'), function(e) {\r
+                                               var v;\r
+\r
+                                               if (v = e.getAttribute('_mce_src'))\r
+                                                       e.src = t.documentBaseURI.toAbsolute(v);\r
+                                       })\r
+                               });*/\r
+\r
+                               t.dom.bind(t.getDoc(), 'DOMNodeInserted', function(e) {\r
+                                       var v;\r
+\r
+                                       e = e.target;\r
+\r
+                                       if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('_mce_src')))\r
+                                               e.src = t.documentBaseURI.toAbsolute(v);\r
+                               });\r
+                       }\r
+\r
+                       // Set various midas options in Gecko\r
+                       if (isGecko) {\r
+                               function setOpts() {\r
+                                       var t = this, d = t.getDoc(), s = t.settings;\r
+\r
+                                       if (isGecko && !s.readonly) {\r
+                                               if (t._isHidden()) {\r
+                                                       try {\r
+                                                               if (!s.content_editable)\r
+                                                                       d.designMode = 'On';\r
+                                                       } catch (ex) {\r
+                                                               // Fails if it's hidden\r
+                                                       }\r
+                                               }\r
+\r
+                                               try {\r
+                                                       // Try new Gecko method\r
+                                                       d.execCommand("styleWithCSS", 0, false);\r
+                                               } catch (ex) {\r
+                                                       // Use old method\r
+                                                       if (!t._isHidden())\r
+                                                               try {d.execCommand("useCSS", 0, true);} catch (ex) {}\r
+                                               }\r
+\r
+                                               if (!s.table_inline_editing)\r
+                                                       try {d.execCommand('enableInlineTableEditing', false, false);} catch (ex) {}\r
+\r
+                                               if (!s.object_resizing)\r
+                                                       try {d.execCommand('enableObjectResizing', false, false);} catch (ex) {}\r
+                                       }\r
+                               };\r
+\r
+                               t.onBeforeExecCommand.add(setOpts);\r
+                               t.onMouseDown.add(setOpts);\r
+                       }\r
+\r
+                       // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250\r
+                       // WebKit can't even do simple things like selecting an image\r
+                       // This also fixes so it's possible to select mceItemAnchors\r
+                       if (tinymce.isWebKit) {\r
+                               t.onClick.add(function(ed, e) {\r
+                                       e = e.target;\r
+\r
+                                       // Needs tobe the setBaseAndExtend or it will fail to select floated images\r
+                                       if (e.nodeName == 'IMG' || (e.nodeName == 'A' && t.dom.hasClass(e, 'mceItemAnchor')))\r
+                                               t.selection.getSel().setBaseAndExtent(e, 0, e, 1);\r
+                               });\r
+                       }\r
+\r
+                       // Add node change handlers\r
+                       t.onMouseUp.add(t.nodeChanged);\r
+                       t.onClick.add(t.nodeChanged);\r
+                       t.onKeyUp.add(function(ed, e) {\r
+                               var c = e.keyCode;\r
+\r
+                               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)\r
+                                       t.nodeChanged();\r
+                       });\r
+\r
+                       // Add reset handler\r
+                       t.onReset.add(function() {\r
+                               t.setContent(t.startContent, {format : 'raw'});\r
+                       });\r
+\r
+                       // Add shortcuts\r
+                       if (s.custom_shortcuts) {\r
+                               if (s.custom_undo_redo_keyboard_shortcuts) {\r
+                                       t.addShortcut('ctrl+z', t.getLang('undo_desc'), 'Undo');\r
+                                       t.addShortcut('ctrl+y', t.getLang('redo_desc'), 'Redo');\r
+                               }\r
+\r
+                               // Add default shortcuts for gecko\r
+                               if (isGecko) {\r
+                                       t.addShortcut('ctrl+b', t.getLang('bold_desc'), 'Bold');\r
+                                       t.addShortcut('ctrl+i', t.getLang('italic_desc'), 'Italic');\r
+                                       t.addShortcut('ctrl+u', t.getLang('underline_desc'), 'Underline');\r
+                               }\r
+\r
+                               // BlockFormat shortcuts keys\r
+                               for (i=1; i<=6; i++)\r
+                                       t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]);\r
+\r
+                               t.addShortcut('ctrl+7', '', ['FormatBlock', false, '<p>']);\r
+                               t.addShortcut('ctrl+8', '', ['FormatBlock', false, '<div>']);\r
+                               t.addShortcut('ctrl+9', '', ['FormatBlock', false, '<address>']);\r
+\r
+                               function find(e) {\r
+                                       var v = null;\r
+\r
+                                       if (!e.altKey && !e.ctrlKey && !e.metaKey)\r
+                                               return v;\r
+\r
+                                       each(t.shortcuts, function(o) {\r
+                                               if (tinymce.isMac && o.ctrl != e.metaKey)\r
+                                                       return;\r
+                                               else if (!tinymce.isMac && o.ctrl != e.ctrlKey)\r
+                                                       return;\r
+\r
+                                               if (o.alt != e.altKey)\r
+                                                       return;\r
+\r
+                                               if (o.shift != e.shiftKey)\r
+                                                       return;\r
+\r
+                                               if (e.keyCode == o.keyCode || (e.charCode && e.charCode == o.charCode)) {\r
+                                                       v = o;\r
+                                                       return false;\r
+                                               }\r
+                                       });\r
+\r
+                                       return v;\r
+                               };\r
+\r
+                               t.onKeyUp.add(function(ed, e) {\r
+                                       var o = find(e);\r
+\r
+                                       if (o)\r
+                                               return Event.cancel(e);\r
+                               });\r
+\r
+                               t.onKeyPress.add(function(ed, e) {\r
+                                       var o = find(e);\r
+\r
+                                       if (o)\r
+                                               return Event.cancel(e);\r
+                               });\r
+\r
+                               t.onKeyDown.add(function(ed, e) {\r
+                                       var o = find(e);\r
+\r
+                                       if (o) {\r
+                                               o.func.call(o.scope);\r
+                                               return Event.cancel(e);\r
+                                       }\r
+                               });\r
+                       }\r
+\r
+                       if (tinymce.isIE) {\r
+                               // Fix so resize will only update the width and height attributes not the styles of an image\r
+                               // It will also block mceItemNoResize items\r
+                               t.dom.bind(t.getDoc(), 'controlselect', function(e) {\r
+                                       var re = t.resizeInfo, cb;\r
+\r
+                                       e = e.target;\r
+\r
+                                       // Don't do this action for non image elements\r
+                                       if (e.nodeName !== 'IMG')\r
+                                               return;\r
+\r
+                                       if (re)\r
+                                               t.dom.unbind(re.node, re.ev, re.cb);\r
+\r
+                                       if (!t.dom.hasClass(e, 'mceItemNoResize')) {\r
+                                               ev = 'resizeend';\r
+                                               cb = t.dom.bind(e, ev, function(e) {\r
+                                                       var v;\r
+\r
+                                                       e = e.target;\r
+\r
+                                                       if (v = t.dom.getStyle(e, 'width')) {\r
+                                                               t.dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, ''));\r
+                                                               t.dom.setStyle(e, 'width', '');\r
+                                                       }\r
+\r
+                                                       if (v = t.dom.getStyle(e, 'height')) {\r
+                                                               t.dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, ''));\r
+                                                               t.dom.setStyle(e, 'height', '');\r
+                                                       }\r
+                                               });\r
+                                       } else {\r
+                                               ev = 'resizestart';\r
+                                               cb = t.dom.bind(e, 'resizestart', Event.cancel, Event);\r
+                                       }\r
+\r
+                                       re = t.resizeInfo = {\r
+                                               node : e,\r
+                                               ev : ev,\r
+                                               cb : cb\r
+                                       };\r
+                               });\r
+\r
+                               t.onKeyDown.add(function(ed, e) {\r
+                                       switch (e.keyCode) {\r
+                                               case 8:\r
+                                                       // Fix IE control + backspace browser bug\r
+                                                       if (t.selection.getRng().item) {\r
+                                                               ed.dom.remove(t.selection.getRng().item(0));\r
+                                                               return Event.cancel(e);\r
+                                                       }\r
+                                       }\r
+                               });\r
+\r
+                               /*if (t.dom.boxModel) {\r
+                                       t.getBody().style.height = '100%';\r
+\r
+                                       Event.add(t.getWin(), 'resize', function(e) {\r
+                                               var docElm = t.getDoc().documentElement;\r
+\r
+                                               docElm.style.height = (docElm.offsetHeight - 10) + 'px';\r
+                                       });\r
+                               }*/\r
+                       }\r
+\r
+                       if (tinymce.isOpera) {\r
+                               t.onClick.add(function(ed, e) {\r
+                                       Event.prevent(e);\r
+                               });\r
+                       }\r
+\r
+                       // Add custom undo/redo handlers\r
+                       if (s.custom_undo_redo) {\r
+                               function addUndo() {\r
+                                       t.undoManager.typing = 0;\r
+                                       t.undoManager.add();\r
+                               };\r
+\r
+                               t.dom.bind(t.getDoc(), 'focusout', function(e) {\r
+                                       if (!t.removed && t.undoManager.typing)\r
+                                               addUndo();\r
+                               });\r
+\r
+                               t.onKeyUp.add(function(ed, e) {\r
+                                       if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45 || e.ctrlKey)\r
+                                               addUndo();\r
+                               });\r
+\r
+                               t.onKeyDown.add(function(ed, e) {\r
+                                       // Is caracter positon keys\r
+                                       if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45) {\r
+                                               if (t.undoManager.typing)\r
+                                                       addUndo();\r
+\r
+                                               return;\r
+                                       }\r
+\r
+                                       if (!t.undoManager.typing) {\r
+                                               t.undoManager.add();\r
+                                               t.undoManager.typing = 1;\r
+                                       }\r
+                               });\r
+\r
+                               t.onMouseDown.add(function() {\r
+                                       if (t.undoManager.typing)\r
+                                               addUndo();\r
+                               });\r
+                       }\r
+               },\r
+\r
+               _isHidden : function() {\r
+                       var s;\r
+\r
+                       if (!isGecko)\r
+                               return 0;\r
+\r
+                       // Weird, wheres that cursor selection?\r
+                       s = this.selection.getSel();\r
+                       return (!s || !s.rangeCount || s.rangeCount == 0);\r
+               },\r
+\r
+               // Fix for bug #1867292\r
+               _fixNesting : function(s) {\r
+                       var d = [], i;\r
+\r
+                       s = s.replace(/<(\/)?([^\s>]+)[^>]*?>/g, function(a, b, c) {\r
+                               var e;\r
+\r
+                               // Handle end element\r
+                               if (b === '/') {\r
+                                       if (!d.length)\r
+                                               return '';\r
+\r
+                                       if (c !== d[d.length - 1].tag) {\r
+                                               for (i=d.length - 1; i>=0; i--) {\r
+                                                       if (d[i].tag === c) {\r
+                                                               d[i].close = 1;\r
+                                                               break;\r
+                                                       }\r
+                                               }\r
+\r
+                                               return '';\r
+                                       } else {\r
+                                               d.pop();\r
+\r
+                                               if (d.length && d[d.length - 1].close) {\r
+                                                       a = a + '</' + d[d.length - 1].tag + '>';\r
+                                                       d.pop();\r
+                                               }\r
+                                       }\r
+                               } else {\r
+                                       // Ignore these\r
+                                       if (/^(br|hr|input|meta|img|link|param)$/i.test(c))\r
+                                               return a;\r
+\r
+                                       // Ignore closed ones\r
+                                       if (/\/>$/.test(a))\r
+                                               return a;\r
+\r
+                                       d.push({tag : c}); // Push start element\r
+                               }\r
+\r
+                               return a;\r
+                       });\r
+\r
+                       // End all open tags\r
+                       for (i=d.length - 1; i>=0; i--)\r
+                               s += '</' + d[i].tag + '>';\r
+\r
+                       return s;\r
+               }\r
+       });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+       // Added for compression purposes\r
+       var each = tinymce.each, undefined, TRUE = true, FALSE = false;\r
+\r
+       tinymce.EditorCommands = function(editor) {\r
+               var dom = editor.dom,\r
+                       selection = editor.selection,\r
+                       commands = {state: {}, exec : {}, value : {}},\r
+                       settings = editor.settings,\r
+                       bookmark;\r
+\r
+               function execCommand(command, ui, value) {\r
+                       var func;\r
+\r
+                       command = command.toLowerCase();\r
+                       if (func = commands.exec[command]) {\r
+                               func(command, ui, value);\r
+                               return TRUE;\r
+                       }\r
+\r
+                       return FALSE;\r
+               };\r
+\r
+               function queryCommandState(command) {\r
+                       var func;\r
+\r
+                       command = command.toLowerCase();\r
+                       if (func = commands.state[command])\r
+                               return func(command);\r
+\r
+                       return -1;\r
+               };\r
+\r
+               function queryCommandValue(command) {\r
+                       var func;\r
+\r
+                       command = command.toLowerCase();\r
+                       if (func = commands.value[command])\r
+                               return func(command);\r
+\r
+                       return FALSE;\r
+               };\r
+\r
+               function addCommands(command_list, type) {\r
+                       type = type || 'exec';\r
+\r
+                       each(command_list, function(callback, command) {\r
+                               each(command.toLowerCase().split(','), function(command) {\r
+                                       commands[type][command] = callback;\r
+                               });\r
+                       });\r
+               };\r
+\r
+               // Expose public methods\r
+               tinymce.extend(this, {\r
+                       execCommand : execCommand,\r
+                       queryCommandState : queryCommandState,\r
+                       queryCommandValue : queryCommandValue,\r
+                       addCommands : addCommands\r
+               });\r
+\r
+               // Private methods\r
+\r
+               function execNativeCommand(command, ui, value) {\r
+                       if (ui === undefined)\r
+                               ui = FALSE;\r
+\r
+                       if (value === undefined)\r
+                               value = null;\r
+\r
+                       return editor.getDoc().execCommand(command, ui, value);\r
+               };\r
+\r
+               function isFormatMatch(name) {\r
+                       return editor.formatter.match(name);\r
+               };\r
+\r
+               function toggleFormat(name, value) {\r
+                       editor.formatter.toggle(name, value ? {value : value} : undefined);\r
+               };\r
+\r
+               function storeSelection(type) {\r
+                       bookmark = selection.getBookmark(type);\r
+               };\r
+\r
+               function restoreSelection() {\r
+                       selection.moveToBookmark(bookmark);\r
+               };\r
+\r
+               // Add execCommand overrides\r
+               addCommands({\r
+                       // Ignore these, added for compatibility\r
+                       'mceResetDesignMode,mceBeginUndoLevel' : function() {},\r
+\r
+                       // Add undo manager logic\r
+                       'mceEndUndoLevel,mceAddUndoLevel' : function() {\r
+                               editor.undoManager.add();\r
+                       },\r
+\r
+                       'Cut,Copy,Paste' : function(command) {\r
+                               var doc = editor.getDoc(), failed;\r
+\r
+                               // Try executing the native command\r
+                               try {\r
+                                       execNativeCommand(command);\r
+                               } catch (ex) {\r
+                                       // Command failed\r
+                                       failed = TRUE;\r
+                               }\r
+\r
+                               // Present alert message about clipboard access not being available\r
+                               if (failed || !doc.queryCommandEnabled(command)) {\r
+                                       if (tinymce.isGecko) {\r
+                                               editor.windowManager.confirm(editor.getLang('clipboard_msg'), function(state) {\r
+                                                       if (state)\r
+                                                               open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', '_blank');\r
+                                               });\r
+                                       } else\r
+                                               editor.windowManager.alert(editor.getLang('clipboard_no_support'));\r
+                               }\r
+                       },\r
+\r
+                       // Override unlink command\r
+                       unlink : function(command) {\r
+                               if (selection.isCollapsed())\r
+                                       selection.select(selection.getNode());\r
+\r
+                               execNativeCommand(command);\r
+                               selection.collapse(FALSE);\r
+                       },\r
+\r
+                       // Override justify commands to use the text formatter engine\r
+                       'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) {\r
+                               var align = command.substring(7);\r
+\r
+                               // Remove all other alignments first\r
+                               each('left,center,right,full'.split(','), function(name) {\r
+                                       if (align != name)\r
+                                               editor.formatter.remove('align' + name);\r
+                               });\r
+\r
+                               toggleFormat('align' + align);\r
+                       },\r
+\r
+                       // Override list commands to fix WebKit bug\r
+                       'InsertUnorderedList,InsertOrderedList' : function(command) {\r
+                               var listElm, listParent;\r
+\r
+                               execNativeCommand(command);\r
+\r
+                               // WebKit produces lists within block elements so we need to split them\r
+                               // we will replace the native list creation logic to custom logic later on\r
+                               // TODO: Remove this when the list creation logic is removed\r
+                               listElm = dom.getParent(selection.getNode(), 'ol,ul');\r
+                               if (listElm) {\r
+                                       listParent = listElm.parentNode;\r
+\r
+                                       // If list is within a text block then split that block\r
+                                       if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) {\r
+                                               storeSelection();\r
+                                               dom.split(listParent, listElm);\r
+                                               restoreSelection();\r
+                                       }\r
+                               }\r
+                       },\r
+\r
+                       // Override commands to use the text formatter engine\r
+                       'Bold,Italic,Underline,Strikethrough' : function(command) {\r
+                               toggleFormat(command);\r
+                       },\r
+\r
+                       // Override commands to use the text formatter engine\r
+                       'ForeColor,HiliteColor,FontName' : function(command, ui, value) {\r
+                               toggleFormat(command, value);\r
+                       },\r
+\r
+                       FontSize : function(command, ui, value) {\r
+                               var fontClasses, fontSizes;\r
+\r
+                               // Convert font size 1-7 to styles\r
+                               if (value >= 1 && value <= 7) {\r
+                                       fontSizes = tinymce.explode(settings.font_size_style_values);\r
+                                       fontClasses = tinymce.explode(settings.font_size_classes);\r
+\r
+                                       if (fontClasses)\r
+                                               value = fontClasses[value - 1] || value;\r
+                                       else\r
+                                               value = fontSizes[value - 1] || value;\r
+                               }\r
+\r
+                               toggleFormat(command, value);\r
+                       },\r
+\r
+                       RemoveFormat : function(command) {\r
+                               editor.formatter.remove(command);\r
+                       },\r
+\r
+                       mceBlockQuote : function(command) {\r
+                               toggleFormat('blockquote');\r
+                       },\r
+\r
+                       FormatBlock : function(command, ui, value) {\r
+                               return toggleFormat(value);\r
+                       },\r
+\r
+                       mceCleanup : function() {\r
+                               storeSelection();\r
+                               editor.setContent(editor.getContent({cleanup : TRUE}), {cleanup : TRUE});\r
+                               restoreSelection();\r
+                       },\r
+\r
+                       mceRemoveNode : function(command, ui, value) {\r
+                               var node = value || selection.getNode();\r
+\r
+                               // Make sure that the body node isn't removed\r
+                               if (node != ed.getBody()) {\r
+                                       storeSelection();\r
+                                       editor.dom.remove(node, TRUE);\r
+                                       restoreSelection();\r
+                               }\r
+                       },\r
+\r
+                       mceSelectNodeDepth : function(command, ui, value) {\r
+                               var counter = 0;\r
+\r
+                               dom.getParent(selection.getNode(), function(node) {\r
+                                       if (node.nodeType == 1 && counter++ == value) {\r
+                                               selection.select(node);\r
+                                               return FALSE;\r
+                                       }\r
+                               }, editor.getBody());\r
+                       },\r
+\r
+                       mceSelectNode : function(command, ui, value) {\r
+                               selection.select(value);\r
+                       },\r
+\r
+                       mceInsertContent : function(command, ui, value) {\r
+                               selection.setContent(value);\r
+                       },\r
+\r
+                       mceInsertRawHTML : function(command, ui, value) {\r
+                               selection.setContent('tiny_mce_marker');\r
+                               editor.setContent(editor.getContent().replace(/tiny_mce_marker/g, value));\r
+                       },\r
+\r
+                       mceSetContent : function(command, ui, value) {\r
+                               editor.setContent(value);\r
+                       },\r
+\r
+                       'Indent,Outdent' : function(command) {\r
+                               var intentValue, indentUnit, value;\r
+\r
+                               // Setup indent level\r
+                               intentValue = settings.indentation;\r
+                               indentUnit = /[a-z%]+$/i.exec(intentValue);\r
+                               intentValue = parseInt(intentValue);\r
+\r
+                               if (!queryCommandState('InsertUnorderedList') && !queryCommandState('InsertOrderedList')) {\r
+                                       each(selection.getSelectedBlocks(), function(element) {\r
+                                               if (command == 'outdent') {\r
+                                                       value = Math.max(0, parseInt(element.style.paddingLeft || 0) - intentValue);\r
+                                                       dom.setStyle(element, 'paddingLeft', value ? value + indentUnit : '');\r
+                                               } else\r
+                                                       dom.setStyle(element, 'paddingLeft', (parseInt(element.style.paddingLeft || 0) + intentValue) + indentUnit);\r
+                                       });\r
+                               } else\r
+                                       execNativeCommand(command);\r
+                       },\r
+\r
+                       mceRepaint : function() {\r
+                               var bookmark;\r
+\r
+                               if (tinymce.isGecko) {\r
+                                       try {\r
+                                               storeSelection(TRUE);\r
+\r
+                                               if (selection.getSel())\r
+                                                       selection.getSel().selectAllChildren(editor.getBody());\r
+\r
+                                               selection.collapse(TRUE);\r
+                                               restoreSelection();\r
+                                       } catch (ex) {\r
+                                               // Ignore\r
+                                       }\r
+                               }\r
+                       },\r
+\r
+                       InsertHorizontalRule : function() {\r
+                               selection.setContent('<hr />');\r
+                       },\r
+\r
+                       mceToggleVisualAid : function() {\r
+                               editor.hasVisual = !editor.hasVisual;\r
+                               editor.addVisual();\r
+                       },\r
+\r
+                       mceReplaceContent : function(command, ui, value) {\r
+                               selection.setContent(value.replace(/\{\$selection\}/g, selection.getContent({format : 'text'})));\r
+                       },\r
+\r
+                       mceInsertLink : function(command, ui, value) {\r
+                               var link = dom.getParent(selection.getNode(), 'a');\r
+\r
+                               if (tinymce.is(value, 'string'))\r
+                                       value = {href : value};\r
+\r
+                               if (!link) {\r
+                                       execNativeCommand('CreateLink', FALSE, 'javascript:mctmp(0);');\r
+                                       each(dom.select('a[href=javascript:mctmp(0);]'), function(link) {\r
+                                               dom.setAttribs(link, value);\r
+                                       });\r
+                               } else {\r
+                                       if (value.href)\r
+                                               dom.setAttribs(link, value);\r
+                                       else\r
+                                               ed.dom.remove(link, TRUE);\r
+                               }\r
+                       }\r
+               });\r
+\r
+               // Add queryCommandState overrides\r
+               addCommands({\r
+                       // Override justify commands\r
+                       'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) {\r
+                               return isFormatMatch('align' + command.substring(7));\r
+                       },\r
+\r
+                       'Bold,Italic,Underline,Strikethrough' : function(command) {\r
+                               return isFormatMatch(command);\r
+                       },\r
+\r
+                       mceBlockQuote : function() {\r
+                               return isFormatMatch('blockquote');\r
+                       },\r
+\r
+                       Outdent : function() {\r
+                               var node;\r
+\r
+                               if (settings.inline_styles) {\r
+                                       if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0)\r
+                                               return TRUE;\r
+\r
+                                       if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0)\r
+                                               return TRUE;\r
+                               }\r
+\r
+                               return queryCommandState('InsertUnorderedList') || queryCommandState('InsertOrderedList') || (!settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE'));\r
+                       },\r
+\r
+                       'InsertUnorderedList,InsertOrderedList' : function(command) {\r
+                               return dom.getParent(selection.getNode(), command == 'insertunorderedlist' ? 'UL' : 'OL');\r
+                       }\r
+               }, 'state');\r
+\r
+               // Add queryCommandValue overrides\r
+               addCommands({\r
+                       'FontSize,FontName' : function(command) {\r
+                               var value = 0, parent;\r
+\r
+                               if (parent = dom.getParent(selection.getNode(), 'span')) {\r
+                                       if (command == 'fontsize')\r
+                                               value = parent.style.fontSize;\r
+                                       else\r
+                                               value = parent.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase();\r
+                               }\r
+\r
+                               return value;\r
+                       }\r
+               }, 'value');\r
+\r
+               // Add undo manager logic\r
+               if (settings.custom_undo_redo) {\r
+                       addCommands({\r
+                               Undo : function() {\r
+                                       editor.undoManager.undo();\r
+                               },\r
+\r
+                               Redo : function() {\r
+                                       editor.undoManager.redo();\r
+                               }\r
+                       });\r
+               }\r
+       };\r
+})(tinymce);\r
+(function(tinymce) {\r
+       tinymce.create('tinymce.UndoManager', {\r
+               index : 0,\r
+               data : null,\r
+               typing : 0,\r
+\r
+               UndoManager : function(ed) {\r
+                       var t = this, Dispatcher = tinymce.util.Dispatcher;\r
+\r
+                       t.editor = ed;\r
+                       t.data = [];\r
+                       t.onAdd = new Dispatcher(this);\r
+                       t.onUndo = new Dispatcher(this);\r
+                       t.onRedo = new Dispatcher(this);\r
+               },\r
+\r
+               add : function(l) {\r
+                       var t = this, i, ed = t.editor, b, s = ed.settings, la;\r
+\r
+                       l = l || {};\r
+                       l.content = l.content || ed.getContent({format : 'raw', no_events : 1});\r
+                       l.content = l.content.replace(/^\s*|\s*$/g, '');\r
+\r
+                       // Add undo level if needed\r
+                       la = t.data[t.index];\r
+                       if (la && la.content == l.content) {\r
+                               if (t.index > 0 || t.data.length == 1)\r
+                                       return null;\r
+                       }\r
+\r
+                       // Time to compress\r
+                       if (s.custom_undo_redo_levels) {\r
+                               if (t.data.length > s.custom_undo_redo_levels) {\r
+                                       for (i = 0; i < t.data.length - 1; i++)\r
+                                               t.data[i] = t.data[i + 1];\r
+\r
+                                       t.data.length--;\r
+                                       t.index = t.data.length;\r
+                               }\r
+                       }\r
+\r
+                       if (s.custom_undo_redo_restore_selection)\r
+                               l.bookmark = b = l.bookmark || ed.selection.getBookmark(2, true);\r
+\r
+                       // Crop array if needed\r
+                       if (t.index < t.data.length - 1) {\r
+                               // Treat first level as initial\r
+                               if (t.index == 0)\r
+                                       t.data = [];\r
+                               else\r
+                                       t.data.length = t.index + 1;\r
+                       }\r
+\r
+                       t.data.push(l);\r
+                       t.index = t.data.length - 1;\r
+\r
+                       t.onAdd.dispatch(t, l);\r
+                       ed.isNotDirty = 0;\r
+\r
+                       //console.log(t.index);\r
+                       //console.dir(t.data);\r
+\r
+                       return l;\r
+               },\r
+\r
+               undo : function() {\r
+                       var t = this, ed = t.editor, l = l, i;\r
+\r
+                       if (t.typing) {\r
+                               t.add();\r
+                               t.typing = 0;\r
+                       }\r
+\r
+                       if (t.index > 0) {\r
+                               l = t.data[--t.index];\r
+\r
+                               ed.setContent(l.content, {format : 'raw'});\r
+                               ed.selection.moveToBookmark(l.bookmark);\r
+\r
+                               t.onUndo.dispatch(t, l);\r
+                       }\r
+\r
+                       return l;\r
+               },\r
+\r
+               redo : function() {\r
+                       var t = this, ed = t.editor, l = null;\r
+\r
+                       if (t.index < t.data.length - 1) {\r
+                               l = t.data[++t.index];\r
+                               ed.setContent(l.content, {format : 'raw'});\r
+                               ed.selection.moveToBookmark(l.bookmark);\r
+\r
+                               t.onRedo.dispatch(t, l);\r
+                       }\r
+\r
+                       return l;\r
+               },\r
+\r
+               clear : function() {\r
+                       var t = this;\r
+\r
+                       t.data = [];\r
+                       t.index = 0;\r
+                       t.typing = 0;\r
+               },\r
+\r
+               hasUndo : function() {\r
+                       return this.index > 0 || this.typing;\r
+               },\r
+\r
+               hasRedo : function() {\r
+                       return this.index < this.data.length - 1;\r
+               }\r
+       });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+       // Shorten names\r
+       var Event = tinymce.dom.Event,\r
+               isIE = tinymce.isIE,\r
+               isGecko = tinymce.isGecko,\r
+               isOpera = tinymce.isOpera,\r
+               each = tinymce.each,\r
+               extend = tinymce.extend,\r
+               TRUE = true,\r
+               FALSE = false;\r
+\r
+       // Checks if the selection/caret is at the end of the specified block element\r
+       function isAtEnd(rng, par) {\r
+               var rng2 = par.ownerDocument.createRange();\r
+\r
+               rng2.setStart(rng.endContainer, rng.endOffset);\r
+               rng2.setEndAfter(par);\r
+\r
+               // 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\r
+               return rng2.cloneContents().textContent.length == 0;\r
+       };\r
+\r
+       function isEmpty(n) {\r
+               n = n.innerHTML;\r
+\r
+               n = n.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi, '-'); // Keep these convert them to - chars\r
+               n = n.replace(/<[^>]+>/g, ''); // Remove all tags\r
+\r
+               return n.replace(/[ \u00a0\t\r\n]+/g, '') == '';\r
+       };\r
+\r
+       function splitList(selection, dom, li) {\r
+               var listBlock, block;\r
+\r
+               if (isEmpty(li)) {\r
+                       listBlock = dom.getParent(li, 'ul,ol');\r
+\r
+                       if (!dom.getParent(listBlock.parentNode, 'ul,ol')) {\r
+                               dom.split(listBlock, li);\r
+                               block = dom.create('p', 0, '<br _mce_bogus="1" />');\r
+                               dom.replace(block, li);\r
+                               selection.select(block, 1);\r
+                       }\r
+\r
+                       return FALSE;\r
+               }\r
+\r
+               return TRUE;\r
+       };\r
+\r
+       tinymce.create('tinymce.ForceBlocks', {\r
+               ForceBlocks : function(ed) {\r
+                       var t = this, s = ed.settings, elm;\r
+\r
+                       t.editor = ed;\r
+                       t.dom = ed.dom;\r
+                       elm = (s.forced_root_block || 'p').toLowerCase();\r
+                       s.element = elm.toUpperCase();\r
+\r
+                       ed.onPreInit.add(t.setup, t);\r
+\r
+                       t.reOpera = new RegExp('(\\u00a0|&#160;|&nbsp;)<\/' + elm + '>', 'gi');\r
+                       t.rePadd = new RegExp('<p( )([^>]+)><\\\/p>|<p( )([^>]+)\\\/>|<p( )([^>]+)>\\s+<\\\/p>|<p><\\\/p>|<p\\\/>|<p>\\s+<\\\/p>'.replace(/p/g, elm), 'gi');\r
+                       t.reNbsp2BR1 = new RegExp('<p( )([^>]+)>[\\s\\u00a0]+<\\\/p>|<p>[\\s\\u00a0]+<\\\/p>'.replace(/p/g, elm), 'gi');\r
+                       t.reNbsp2BR2 = new RegExp('<%p()([^>]+)>(&nbsp;|&#160;)<\\\/%p>|<%p>(&nbsp;|&#160;)<\\\/%p>'.replace(/%p/g, elm), 'gi');\r
+                       t.reBR2Nbsp = new RegExp('<p( )([^>]+)>\\s*<br \\\/>\\s*<\\\/p>|<p>\\s*<br \\\/>\\s*<\\\/p>'.replace(/p/g, elm), 'gi');\r
+\r
+                       function padd(ed, o) {\r
+                               if (isOpera)\r
+                                       o.content = o.content.replace(t.reOpera, '</' + elm + '>');\r
+\r
+                               o.content = o.content.replace(t.rePadd, '<' + elm + '$1$2$3$4$5$6>\u00a0</' + elm + '>');\r
+\r
+                               if (!isIE && !isOpera && o.set) {\r
+                                       // Use &nbsp; instead of BR in padded paragraphs\r
+                                       o.content = o.content.replace(t.reNbsp2BR1, '<' + elm + '$1$2><br /></' + elm + '>');\r
+                                       o.content = o.content.replace(t.reNbsp2BR2, '<' + elm + '$1$2><br /></' + elm + '>');\r
+                               } else\r
+                                       o.content = o.content.replace(t.reBR2Nbsp, '<' + elm + '$1$2>\u00a0</' + elm + '>');\r
+                       };\r
+\r
+                       ed.onBeforeSetContent.add(padd);\r
+                       ed.onPostProcess.add(padd);\r
+\r
+                       if (s.forced_root_block) {\r
+                               ed.onInit.add(t.forceRoots, t);\r
+                               ed.onSetContent.add(t.forceRoots, t);\r
+                               ed.onBeforeGetContent.add(t.forceRoots, t);\r
+                       }\r
+               },\r
+\r
+               setup : function() {\r
+                       var t = this, ed = t.editor, s = ed.settings, dom = ed.dom, selection = ed.selection;\r
+\r
+                       // Force root blocks when typing and when getting output\r
+                       if (s.forced_root_block) {\r
+                               ed.onBeforeExecCommand.add(t.forceRoots, t);\r
+                               ed.onKeyUp.add(t.forceRoots, t);\r
+                               ed.onPreProcess.add(t.forceRoots, t);\r
+                       }\r
+\r
+                       if (s.force_br_newlines) {\r
+                               // Force IE to produce BRs on enter\r
+                               if (isIE) {\r
+                                       ed.onKeyPress.add(function(ed, e) {\r
+                                               var n;\r
+\r
+                                               if (e.keyCode == 13 && selection.getNode().nodeName != 'LI') {\r
+                                                       selection.setContent('<br id="__" /> ', {format : 'raw'});\r
+                                                       n = dom.get('__');\r
+                                                       n.removeAttribute('id');\r
+                                                       selection.select(n);\r
+                                                       selection.collapse();\r
+                                                       return Event.cancel(e);\r
+                                               }\r
+                                       });\r
+                               }\r
+                       }\r
+\r
+                       if (!isIE && s.force_p_newlines) {\r
+                               ed.onKeyPress.add(function(ed, e) {\r
+                                       if (e.keyCode == 13 && !e.shiftKey && !t.insertPara(e))\r
+                                               Event.cancel(e);\r
+                               });\r
+\r
+                               if (isGecko) {\r
+                                       ed.onKeyDown.add(function(ed, e) {\r
+                                               if ((e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey)\r
+                                                       t.backspaceDelete(e, e.keyCode == 8);\r
+                                       });\r
+                               }\r
+                       }\r
+\r
+                       // Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973\r
+                       if (tinymce.isWebKit) {\r
+                               function insertBr(ed) {\r
+                                       var rng = selection.getRng(), br, div = dom.create('div', null, ' '), divYPos, vpHeight = dom.getViewPort(ed.getWin()).h;\r
+\r
+                                       // Insert BR element\r
+                                       rng.insertNode(br = dom.create('br'));\r
+\r
+                                       // Place caret after BR\r
+                                       rng.setStartAfter(br);\r
+                                       rng.setEndAfter(br);\r
+                                       selection.setRng(rng);\r
+\r
+                                       // Could not place caret after BR then insert an nbsp entity and move the caret\r
+                                       if (selection.getSel().focusNode == br.previousSibling) {\r
+                                               selection.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'), br));\r
+                                               selection.collapse(TRUE);\r
+                                       }\r
+\r
+                                       // Create a temporary DIV after the BR and get the position as it\r
+                                       // seems like getPos() returns 0 for text nodes and BR elements.\r
+                                       dom.insertAfter(div, br);\r
+                                       divYPos = dom.getPos(div).y;\r
+                                       dom.remove(div);\r
+\r
+                                       // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117\r
+                                       if (divYPos > vpHeight) // It is not necessary to scroll if the DIV is inside the view port.\r
+                                               ed.getWin().scrollTo(0, divYPos);\r
+                               };\r
+\r
+                               ed.onKeyPress.add(function(ed, e) {\r
+                                       if (e.keyCode == 13 && (e.shiftKey || s.force_br_newlines)) {\r
+                                               insertBr(ed);\r
+                                               Event.cancel(e);\r
+                                       }\r
+                               });\r
+                       }\r
+\r
+                       // Padd empty inline elements within block elements\r
+                       // For example: <p><strong><em></em></strong></p> becomes <p><strong><em>&nbsp;</em></strong></p>\r
+                       ed.onPreProcess.add(function(ed, o) {\r
+                               each(dom.select('p,h1,h2,h3,h4,h5,h6,div', o.node), function(p) {\r
+                                       if (isEmpty(p)) {\r
+                                               each(dom.select('span,em,strong,b,i', o.node), function(n) {\r
+                                                       if (!n.hasChildNodes()) {\r
+                                                               n.appendChild(ed.getDoc().createTextNode('\u00a0'));\r
+                                                               return FALSE; // Break the loop one padding is enough\r
+                                                       }\r
+                                               });\r
+                                       }\r
+                               });\r
+                       });\r
+\r
+                       // IE specific fixes\r
+                       if (isIE) {\r
+                               // Replaces IE:s auto generated paragraphs with the specified element name\r
+                               if (s.element != 'P') {\r
+                                       ed.onKeyPress.add(function(ed, e) {\r
+                                               t.lastElm = selection.getNode().nodeName;\r
+                                       });\r
+\r
+                                       ed.onKeyUp.add(function(ed, e) {\r
+                                               var bl, n = selection.getNode(), b = ed.getBody();\r
+\r
+                                               if (b.childNodes.length === 1 && n.nodeName == 'P') {\r
+                                                       n = dom.rename(n, s.element);\r
+                                                       selection.select(n);\r
+                                                       selection.collapse();\r
+                                                       ed.nodeChanged();\r
+                                               } else if (e.keyCode == 13 && !e.shiftKey && t.lastElm != 'P') {\r
+                                                       bl = dom.getParent(n, 'p');\r
+\r
+                                                       if (bl) {\r
+                                                               dom.rename(bl, s.element);\r
+                                                               ed.nodeChanged();\r
+                                                       }\r
+                                               }\r
+                                       });\r
+                               }\r
+                       }\r
+               },\r
+\r
+               find : function(n, t, s) {\r
+                       var ed = this.editor, w = ed.getDoc().createTreeWalker(n, 4, null, FALSE), c = -1;\r
+\r
+                       while (n = w.nextNode()) {\r
+                               c++;\r
+\r
+                               // Index by node\r
+                               if (t == 0 && n == s)\r
+                                       return c;\r
+\r
+                               // Node by index\r
+                               if (t == 1 && c == s)\r
+                                       return n;\r
+                       }\r
+\r
+                       return -1;\r
+               },\r
+\r
+               forceRoots : function(ed, e) {\r
+                       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;\r
+                       var nx, bl, bp, sp, le, nl = b.childNodes, i, n, eid;\r
+\r
+                       // Fix for bug #1863847\r
+                       //if (e && e.keyCode == 13)\r
+                       //      return TRUE;\r
+\r
+                       // Wrap non blocks into blocks\r
+                       for (i = nl.length - 1; i >= 0; i--) {\r
+                               nx = nl[i];\r
+\r
+                               // Ignore internal elements\r
+                               if (nx.nodeType === 1 && nx.getAttribute('_mce_type')) {\r
+                                       bl = null;\r
+                                       continue;\r
+                               }\r
+\r
+                               // Is text or non block element\r
+                               if (nx.nodeType === 3 || (!t.dom.isBlock(nx) && nx.nodeType !== 8 && !/^(script|mce:script|style|mce:style)$/i.test(nx.nodeName))) {\r
+                                       if (!bl) {\r
+                                               // Create new block but ignore whitespace\r
+                                               if (nx.nodeType != 3 || /[^\s]/g.test(nx.nodeValue)) {\r
+                                                       // Store selection\r
+                                                       if (si == -2 && r) {\r
+                                                               if (!isIE) {\r
+                                                                       // If selection is element then mark it\r
+                                                                       if (r.startContainer.nodeType == 1 && (n = r.startContainer.childNodes[r.startOffset]) && n.nodeType == 1) {\r
+                                                                               // Save the id of the selected element\r
+                                                                               eid = n.getAttribute("id");\r
+                                                                               n.setAttribute("id", "__mce");\r
+                                                                       } else {\r
+                                                                               // If element is inside body, might not be the case in contentEdiable mode\r
+                                                                               if (ed.dom.getParent(r.startContainer, function(e) {return e === b;})) {\r
+                                                                                       so = r.startOffset;\r
+                                                                                       eo = r.endOffset;\r
+                                                                                       si = t.find(b, 0, r.startContainer);\r
+                                                                                       ei = t.find(b, 0, r.endContainer);\r
+                                                                               }\r
+                                                                       }\r
+                                                               } else {\r
+                                                                       tr = d.body.createTextRange();\r
+                                                                       tr.moveToElementText(b);\r
+                                                                       tr.collapse(1);\r
+                                                                       bp = tr.move('character', c) * -1;\r
+\r
+                                                                       tr = r.duplicate();\r
+                                                                       tr.collapse(1);\r
+                                                                       sp = tr.move('character', c) * -1;\r
+\r
+                                                                       tr = r.duplicate();\r
+                                                                       tr.collapse(0);\r
+                                                                       le = (tr.move('character', c) * -1) - sp;\r
+\r
+                                                                       si = sp - bp;\r
+                                                                       ei = le;\r
+                                                               }\r
+                                                       }\r
+\r
+                                                       // Uses replaceChild instead of cloneNode since it removes selected attribute from option elements on IE\r
+                                                       // See: http://support.microsoft.com/kb/829907\r
+                                                       bl = ed.dom.create(ed.settings.forced_root_block);\r
+                                                       nx.parentNode.replaceChild(bl, nx);\r
+                                                       bl.appendChild(nx);\r
+                                               }\r
+                                       } else {\r
+                                               if (bl.hasChildNodes())\r
+                                                       bl.insertBefore(nx, bl.firstChild);\r
+                                               else\r
+                                                       bl.appendChild(nx);\r
+                                       }\r
+                               } else\r
+                                       bl = null; // Time to create new block\r
+                       }\r
+\r
+                       // Restore selection\r
+                       if (si != -2) {\r
+                               if (!isIE) {\r
+                                       bl = b.getElementsByTagName(ed.settings.element)[0];\r
+                                       r = d.createRange();\r
+\r
+                                       // Select last location or generated block\r
+                                       if (si != -1)\r
+                                               r.setStart(t.find(b, 1, si), so);\r
+                                       else\r
+                                               r.setStart(bl, 0);\r
+\r
+                                       // Select last location or generated block\r
+                                       if (ei != -1)\r
+                                               r.setEnd(t.find(b, 1, ei), eo);\r
+                                       else\r
+                                               r.setEnd(bl, 0);\r
+\r
+                                       if (s) {\r
+                                               s.removeAllRanges();\r
+                                               s.addRange(r);\r
+                                       }\r
+                               } else {\r
+                                       try {\r
+                                               r = s.createRange();\r
+                                               r.moveToElementText(b);\r
+                                               r.collapse(1);\r
+                                               r.moveStart('character', si);\r
+                                               r.moveEnd('character', ei);\r
+                                               r.select();\r
+                                       } catch (ex) {\r
+                                               // Ignore\r
+                                       }\r
+                               }\r
+                       } else if (!isIE && (n = ed.dom.get('__mce'))) {\r
+                               // Restore the id of the selected element\r
+                               if (eid)\r
+                                       n.setAttribute('id', eid);\r
+                               else\r
+                                       n.removeAttribute('id');\r
+\r
+                               // Move caret before selected element\r
+                               r = d.createRange();\r
+                               r.setStartBefore(n);\r
+                               r.setEndBefore(n);\r
+                               se.setRng(r);\r
+                       }\r
+               },\r
+\r
+               getParentBlock : function(n) {\r
+                       var d = this.dom;\r
+\r
+                       return d.getParent(n, d.isBlock);\r
+               },\r
+\r
+               insertPara : function(e) {\r
+                       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;\r
+                       var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n, vp = dom.getViewPort(ed.getWin()), y, ch, car;\r
+\r
+                       // If root blocks are forced then use Operas default behavior since it's really good\r
+// Removed due to bug: #1853816\r
+//                     if (se.forced_root_block && isOpera)\r
+//                             return TRUE;\r
+\r
+                       // Setup before range\r
+                       rb = d.createRange();\r
+\r
+                       // If is before the first block element and in body, then move it into first block element\r
+                       rb.setStart(s.anchorNode, s.anchorOffset);\r
+                       rb.collapse(TRUE);\r
+\r
+                       // Setup after range\r
+                       ra = d.createRange();\r
+\r
+                       // If is before the first block element and in body, then move it into first block element\r
+                       ra.setStart(s.focusNode, s.focusOffset);\r
+                       ra.collapse(TRUE);\r
+\r
+                       // Setup start/end points\r
+                       dir = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0;\r
+                       sn = dir ? s.anchorNode : s.focusNode;\r
+                       so = dir ? s.anchorOffset : s.focusOffset;\r
+                       en = dir ? s.focusNode : s.anchorNode;\r
+                       eo = dir ? s.focusOffset : s.anchorOffset;\r
+\r
+                       // If selection is in empty table cell\r
+                       if (sn === en && /^(TD|TH)$/.test(sn.nodeName)) {\r
+                               if (sn.firstChild.nodeName == 'BR')\r
+                                       dom.remove(sn.firstChild); // Remove BR\r
+\r
+                               // Create two new block elements\r
+                               if (sn.childNodes.length == 0) {\r
+                                       ed.dom.add(sn, se.element, null, '<br />');\r
+                                       aft = ed.dom.add(sn, se.element, null, '<br />');\r
+                               } else {\r
+                                       n = sn.innerHTML;\r
+                                       sn.innerHTML = '';\r
+                                       ed.dom.add(sn, se.element, null, n);\r
+                                       aft = ed.dom.add(sn, se.element, null, '<br />');\r
+                               }\r
+\r
+                               // Move caret into the last one\r
+                               r = d.createRange();\r
+                               r.selectNodeContents(aft);\r
+                               r.collapse(1);\r
+                               ed.selection.setRng(r);\r
+\r
+                               return FALSE;\r
+                       }\r
+\r
+                       // If the caret is in an invalid location in FF we need to move it into the first block\r
+                       if (sn == b && en == b && b.firstChild && ed.dom.isBlock(b.firstChild)) {\r
+                               sn = en = sn.firstChild;\r
+                               so = eo = 0;\r
+                               rb = d.createRange();\r
+                               rb.setStart(sn, 0);\r
+                               ra = d.createRange();\r
+                               ra.setStart(en, 0);\r
+                       }\r
+\r
+                       // Never use body as start or end node\r
+                       sn = sn.nodeName == "HTML" ? d.body : sn; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes\r
+                       sn = sn.nodeName == "BODY" ? sn.firstChild : sn;\r
+                       en = en.nodeName == "HTML" ? d.body : en; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes\r
+                       en = en.nodeName == "BODY" ? en.firstChild : en;\r
+\r
+                       // Get start and end blocks\r
+                       sb = t.getParentBlock(sn);\r
+                       eb = t.getParentBlock(en);\r
+                       bn = sb ? sb.nodeName : se.element; // Get block name to create\r
+\r
+                       // Return inside list use default browser behavior\r
+                       if (n = t.dom.getParent(sb, 'li,pre')) {\r
+                               if (n.nodeName == 'LI')\r
+                                       return splitList(ed.selection, t.dom, n);\r
+\r
+                               return TRUE;\r
+                       }\r
+\r
+                       // If caption or absolute layers then always generate new blocks within\r
+                       if (sb && (sb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) {\r
+                               bn = se.element;\r
+                               sb = null;\r
+                       }\r
+\r
+                       // If caption or absolute layers then always generate new blocks within\r
+                       if (eb && (eb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) {\r
+                               bn = se.element;\r
+                               eb = null;\r
+                       }\r
+\r
+                       // Use P instead\r
+                       if (/(TD|TABLE|TH|CAPTION)/.test(bn) || (sb && bn == "DIV" && /left|right/gi.test(dom.getStyle(sb, 'float', 1)))) {\r
+                               bn = se.element;\r
+                               sb = eb = null;\r
+                       }\r
+\r
+                       // Setup new before and after blocks\r
+                       bef = (sb && sb.nodeName == bn) ? sb.cloneNode(0) : ed.dom.create(bn);\r
+                       aft = (eb && eb.nodeName == bn) ? eb.cloneNode(0) : ed.dom.create(bn);\r
+\r
+                       // Remove id from after clone\r
+                       aft.removeAttribute('id');\r
+\r
+                       // Is header and cursor is at the end, then force paragraph under\r
+                       if (/^(H[1-6])$/.test(bn) && isAtEnd(r, sb))\r
+                               aft = ed.dom.create(se.element);\r
+\r
+                       // Find start chop node\r
+                       n = sc = sn;\r
+                       do {\r
+                               if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName))\r
+                                       break;\r
+\r
+                               sc = n;\r
+                       } while ((n = n.previousSibling ? n.previousSibling : n.parentNode));\r
+\r
+                       // Find end chop node\r
+                       n = ec = en;\r
+                       do {\r
+                               if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName))\r
+                                       break;\r
+\r
+                               ec = n;\r
+                       } while ((n = n.nextSibling ? n.nextSibling : n.parentNode));\r
+\r
+                       // Place first chop part into before block element\r
+                       if (sc.nodeName == bn)\r
+                               rb.setStart(sc, 0);\r
+                       else\r
+                               rb.setStartBefore(sc);\r
+\r
+                       rb.setEnd(sn, so);\r
+                       bef.appendChild(rb.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari\r
+\r
+                       // Place secnd chop part within new block element\r
+                       try {\r
+                               ra.setEndAfter(ec);\r
+                       } catch(ex) {\r
+                               //console.debug(s.focusNode, s.focusOffset);\r
+                       }\r
+\r
+                       ra.setStart(en, eo);\r
+                       aft.appendChild(ra.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari\r
+\r
+                       // Create range around everything\r
+                       r = d.createRange();\r
+                       if (!sc.previousSibling && sc.parentNode.nodeName == bn) {\r
+                               r.setStartBefore(sc.parentNode);\r
+                       } else {\r
+                               if (rb.startContainer.nodeName == bn && rb.startOffset == 0)\r
+                                       r.setStartBefore(rb.startContainer);\r
+                               else\r
+                                       r.setStart(rb.startContainer, rb.startOffset);\r
+                       }\r
+\r
+                       if (!ec.nextSibling && ec.parentNode.nodeName == bn)\r
+                               r.setEndAfter(ec.parentNode);\r
+                       else\r
+                               r.setEnd(ra.endContainer, ra.endOffset);\r
+\r
+                       // Delete and replace it with new block elements\r
+                       r.deleteContents();\r
+\r
+                       if (isOpera)\r
+                               ed.getWin().scrollTo(0, vp.y);\r
+\r
+                       // Never wrap blocks in blocks\r
+                       if (bef.firstChild && bef.firstChild.nodeName == bn)\r
+                               bef.innerHTML = bef.firstChild.innerHTML;\r
+\r
+                       if (aft.firstChild && aft.firstChild.nodeName == bn)\r
+                               aft.innerHTML = aft.firstChild.innerHTML;\r
+\r
+                       // Padd empty blocks\r
+                       if (isEmpty(bef))\r
+                               bef.innerHTML = '<br />';\r
+\r
+                       function appendStyles(e, en) {\r
+                               var nl = [], nn, n, i;\r
+\r
+                               e.innerHTML = '';\r
+\r
+                               // Make clones of style elements\r
+                               if (se.keep_styles) {\r
+                                       n = en;\r
+                                       do {\r
+                                               // We only want style specific elements\r
+                                               if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(n.nodeName)) {\r
+                                                       nn = n.cloneNode(FALSE);\r
+                                                       dom.setAttrib(nn, 'id', ''); // Remove ID since it needs to be unique\r
+                                                       nl.push(nn);\r
+                                               }\r
+                                       } while (n = n.parentNode);\r
+                               }\r
+\r
+                               // Append style elements to aft\r
+                               if (nl.length > 0) {\r
+                                       for (i = nl.length - 1, nn = e; i >= 0; i--)\r
+                                               nn = nn.appendChild(nl[i]);\r
+\r
+                                       // Padd most inner style element\r
+                                       nl[0].innerHTML = isOpera ? '&nbsp;' : '<br />'; // Extra space for Opera so that the caret can move there\r
+                                       return nl[0]; // Move caret to most inner element\r
+                               } else\r
+                                       e.innerHTML = isOpera ? '&nbsp;' : '<br />'; // Extra space for Opera so that the caret can move there\r
+                       };\r
+\r
+                       // Fill empty afterblook with current style\r
+                       if (isEmpty(aft))\r
+                               car = appendStyles(aft, en);\r
+\r
+                       // Opera needs this one backwards for older versions\r
+                       if (isOpera && parseFloat(opera.version()) < 9.5) {\r
+                               r.insertNode(bef);\r
+                               r.insertNode(aft);\r
+                       } else {\r
+                               r.insertNode(aft);\r
+                               r.insertNode(bef);\r
+                       }\r
+\r
+                       // Normalize\r
+                       aft.normalize();\r
+                       bef.normalize();\r
+\r
+                       function first(n) {\r
+                               return d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, FALSE).nextNode() || n;\r
+                       };\r
+\r
+                       // Move cursor and scroll into view\r
+                       r = d.createRange();\r
+                       r.selectNodeContents(isGecko ? first(car || aft) : car || aft);\r
+                       r.collapse(1);\r
+                       s.removeAllRanges();\r
+                       s.addRange(r);\r
+\r
+                       // 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\r
+                       y = ed.dom.getPos(aft).y;\r
+                       ch = aft.clientHeight;\r
+\r
+                       // Is element within viewport\r
+                       if (y < vp.y || y + ch > vp.y + vp.h) {\r
+                               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\r
+                               //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));\r
+                       }\r
+\r
+                       return FALSE;\r
+               },\r
+\r
+               backspaceDelete : function(e, bs) {\r
+                       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;\r
+\r
+                       // The caret sometimes gets stuck in Gecko if you delete empty paragraphs\r
+                       // This workaround removes the element by hand and moves the caret to the previous element\r
+                       if (sc && ed.dom.isBlock(sc) && !/^(TD|TH)$/.test(sc.nodeName) && bs) {\r
+                               if (sc.childNodes.length == 0 || (sc.childNodes.length == 1 && sc.firstChild.nodeName == 'BR')) {\r
+                                       // Find previous block element\r
+                                       n = sc;\r
+                                       while ((n = n.previousSibling) && !ed.dom.isBlock(n)) ;\r
+\r
+                                       if (n) {\r
+                                               if (sc != b.firstChild) {\r
+                                                       // Find last text node\r
+                                                       w = ed.dom.doc.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, FALSE);\r
+                                                       while (tn = w.nextNode())\r
+                                                               n = tn;\r
+\r
+                                                       // Place caret at the end of last text node\r
+                                                       r = ed.getDoc().createRange();\r
+                                                       r.setStart(n, n.nodeValue ? n.nodeValue.length : 0);\r
+                                                       r.setEnd(n, n.nodeValue ? n.nodeValue.length : 0);\r
+                                                       se.setRng(r);\r
+\r
+                                                       // Remove the target container\r
+                                                       ed.dom.remove(sc);\r
+                                               }\r
+\r
+                                               return Event.cancel(e);\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+                       // Gecko generates BR elements here and there, we don't like those so lets remove them\r
+                       function handler(e) {\r
+                               var pr;\r
+\r
+                               e = e.target;\r
+\r
+                               // A new BR was created in a block element, remove it\r
+                               if (e && e.parentNode && e.nodeName == 'BR' && (n = t.getParentBlock(e))) {\r
+                                       pr = e.previousSibling;\r
+\r
+                                       Event.remove(b, 'DOMNodeInserted', handler);\r
+\r
+                                       // Is there whitespace at the end of the node before then we might need the pesky BR\r
+                                       // to place the caret at a correct location see bug: #2013943\r
+                                       if (pr && pr.nodeType == 3 && /\s+$/.test(pr.nodeValue))\r
+                                               return;\r
+\r
+                                       // Only remove BR elements that got inserted in the middle of the text\r
+                                       if (e.previousSibling || e.nextSibling)\r
+                                               ed.dom.remove(e);\r
+                               }\r
+                       };\r
+\r
+                       // Listen for new nodes\r
+                       Event._add(b, 'DOMNodeInserted', handler);\r
+\r
+                       // Remove listener\r
+                       window.setTimeout(function() {\r
+                               Event._remove(b, 'DOMNodeInserted', handler);\r
+                       }, 1);\r
+               }\r
+       });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+       // Shorten names\r
+       var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend;\r
+\r
+       tinymce.create('tinymce.ControlManager', {\r
+               ControlManager : function(ed, s) {\r
+                       var t = this, i;\r
+\r
+                       s = s || {};\r
+                       t.editor = ed;\r
+                       t.controls = {};\r
+                       t.onAdd = new tinymce.util.Dispatcher(t);\r
+                       t.onPostRender = new tinymce.util.Dispatcher(t);\r
+                       t.prefix = s.prefix || ed.id + '_';\r
+                       t._cls = {};\r
+\r
+                       t.onPostRender.add(function() {\r
+                               each(t.controls, function(c) {\r
+                                       c.postRender();\r
+                               });\r
+                       });\r
+               },\r
+\r
+               get : function(id) {\r
+                       return this.controls[this.prefix + id] || this.controls[id];\r
+               },\r
+\r
+               setActive : function(id, s) {\r
+                       var c = null;\r
+\r
+                       if (c = this.get(id))\r
+                               c.setActive(s);\r
+\r
+                       return c;\r
+               },\r
+\r
+               setDisabled : function(id, s) {\r
+                       var c = null;\r
+\r
+                       if (c = this.get(id))\r
+                               c.setDisabled(s);\r
+\r
+                       return c;\r
+               },\r
+\r
+               add : function(c) {\r
+                       var t = this;\r
+\r
+                       if (c) {\r
+                               t.controls[c.id] = c;\r
+                               t.onAdd.dispatch(c, t);\r
+                       }\r
+\r
+                       return c;\r
+               },\r
+\r
+               createControl : function(n) {\r
+                       var c, t = this, ed = t.editor;\r
+\r
+                       each(ed.plugins, function(p) {\r
+                               if (p.createControl) {\r
+                                       c = p.createControl(n, t);\r
+\r
+                                       if (c)\r
+                                               return false;\r
+                               }\r
+                       });\r
+\r
+                       switch (n) {\r
+                               case "|":\r
+                               case "separator":\r
+                                       return t.createSeparator();\r
+                       }\r
+\r
+                       if (!c && ed.buttons && (c = ed.buttons[n]))\r
+                               return t.createButton(n, c);\r
+\r
+                       return t.add(c);\r
+               },\r
+\r
+               createDropMenu : function(id, s, cc) {\r
+                       var t = this, ed = t.editor, c, bm, v, cls;\r
+\r
+                       s = extend({\r
+                               'class' : 'mceDropDown',\r
+                               constrain : ed.settings.constrain_menus\r
+                       }, s);\r
+\r
+                       s['class'] = s['class'] + ' ' + ed.getParam('skin') + 'Skin';\r
+                       if (v = ed.getParam('skin_variant'))\r
+                               s['class'] += ' ' + ed.getParam('skin') + 'Skin' + v.substring(0, 1).toUpperCase() + v.substring(1);\r
+\r
+                       id = t.prefix + id;\r
+                       cls = cc || t._cls.dropmenu || tinymce.ui.DropMenu;\r
+                       c = t.controls[id] = new cls(id, s);\r
+                       c.onAddItem.add(function(c, o) {\r
+                               var s = o.settings;\r
+\r
+                               s.title = ed.getLang(s.title, s.title);\r
+\r
+                               if (!s.onclick) {\r
+                                       s.onclick = function(v) {\r
+                                               if (s.cmd)\r
+                                                       ed.execCommand(s.cmd, s.ui || false, s.value);\r
+                                       };\r
+                               }\r
+                       });\r
+\r
+                       ed.onRemove.add(function() {\r
+                               c.destroy();\r
+                       });\r
+\r
+                       // Fix for bug #1897785, #1898007\r
+                       if (tinymce.isIE) {\r
+                               c.onShowMenu.add(function() {\r
+                                       // IE 8 needs focus in order to store away a range with the current collapsed caret location\r
+                                       ed.focus();\r
+\r
+                                       bm = ed.selection.getBookmark(1);\r
+                               });\r
+\r
+                               c.onHideMenu.add(function() {\r
+                                       if (bm) {\r
+                                               ed.selection.moveToBookmark(bm);\r
+                                               bm = 0;\r
+                                       }\r
+                               });\r
+                       }\r
+\r
+                       return t.add(c);\r
+               },\r
+\r
+               createListBox : function(id, s, cc) {\r
+                       var t = this, ed = t.editor, cmd, c, cls;\r
+\r
+                       if (t.get(id))\r
+                               return null;\r
+\r
+                       s.title = ed.translate(s.title);\r
+                       s.scope = s.scope || ed;\r
+\r
+                       if (!s.onselect) {\r
+                               s.onselect = function(v) {\r
+                                       ed.execCommand(s.cmd, s.ui || false, v || s.value);\r
+                               };\r
+                       }\r
+\r
+                       s = extend({\r
+                               title : s.title,\r
+                               'class' : 'mce_' + id,\r
+                               scope : s.scope,\r
+                               control_manager : t\r
+                       }, s);\r
+\r
+                       id = t.prefix + id;\r
+\r
+                       if (ed.settings.use_native_selects)\r
+                               c = new tinymce.ui.NativeListBox(id, s);\r
+                       else {\r
+                               cls = cc || t._cls.listbox || tinymce.ui.ListBox;\r
+                               c = new cls(id, s);\r
+                       }\r
+\r
+                       t.controls[id] = c;\r
+\r
+                       // Fix focus problem in Safari\r
+                       if (tinymce.isWebKit) {\r
+                               c.onPostRender.add(function(c, n) {\r
+                                       // Store bookmark on mousedown\r
+                                       Event.add(n, 'mousedown', function() {\r
+                                               ed.bookmark = ed.selection.getBookmark(1);\r
+                                       });\r
+\r
+                                       // Restore on focus, since it might be lost\r
+                                       Event.add(n, 'focus', function() {\r
+                                               ed.selection.moveToBookmark(ed.bookmark);\r
+                                               ed.bookmark = null;\r
+                                       });\r
+                               });\r
+                       }\r
+\r
+                       if (c.hideMenu)\r
+                               ed.onMouseDown.add(c.hideMenu, c);\r
+\r
+                       return t.add(c);\r
+               },\r
+\r
+               createButton : function(id, s, cc) {\r
+                       var t = this, ed = t.editor, o, c, cls;\r
+\r
+                       if (t.get(id))\r
+                               return null;\r
+\r
+                       s.title = ed.translate(s.title);\r
+                       s.label = ed.translate(s.label);\r
+                       s.scope = s.scope || ed;\r
+\r
+                       if (!s.onclick && !s.menu_button) {\r
+                               s.onclick = function() {\r
+                                       ed.execCommand(s.cmd, s.ui || false, s.value);\r
+                               };\r
+                       }\r
+\r
+                       s = extend({\r
+                               title : s.title,\r
+                               'class' : 'mce_' + id,\r
+                               unavailable_prefix : ed.getLang('unavailable', ''),\r
+                               scope : s.scope,\r
+                               control_manager : t\r
+                       }, s);\r
+\r
+                       id = t.prefix + id;\r
+\r
+                       if (s.menu_button) {\r
+                               cls = cc || t._cls.menubutton || tinymce.ui.MenuButton;\r
+                               c = new cls(id, s);\r
+                               ed.onMouseDown.add(c.hideMenu, c);\r
+                       } else {\r
+                               cls = t._cls.button || tinymce.ui.Button;\r
+                               c = new cls(id, s);\r
+                       }\r
+\r
+                       return t.add(c);\r
+               },\r
+\r
+               createMenuButton : function(id, s, cc) {\r
+                       s = s || {};\r
+                       s.menu_button = 1;\r
+\r
+                       return this.createButton(id, s, cc);\r
+               },\r
+\r
+               createSplitButton : function(id, s, cc) {\r
+                       var t = this, ed = t.editor, cmd, c, cls;\r
+\r
+                       if (t.get(id))\r
+                               return null;\r
+\r
+                       s.title = ed.translate(s.title);\r
+                       s.scope = s.scope || ed;\r
+\r
+                       if (!s.onclick) {\r
+                               s.onclick = function(v) {\r
+                                       ed.execCommand(s.cmd, s.ui || false, v || s.value);\r
+                               };\r
+                       }\r
+\r
+                       if (!s.onselect) {\r
+                               s.onselect = function(v) {\r
+                                       ed.execCommand(s.cmd, s.ui || false, v || s.value);\r
+                               };\r
+                       }\r
+\r
+                       s = extend({\r
+                               title : s.title,\r
+                               'class' : 'mce_' + id,\r
+                               scope : s.scope,\r
+                               control_manager : t\r
+                       }, s);\r
+\r
+                       id = t.prefix + id;\r
+                       cls = cc || t._cls.splitbutton || tinymce.ui.SplitButton;\r
+                       c = t.add(new cls(id, s));\r
+                       ed.onMouseDown.add(c.hideMenu, c);\r
+\r
+                       return c;\r
+               },\r
+\r
+               createColorSplitButton : function(id, s, cc) {\r
+                       var t = this, ed = t.editor, cmd, c, cls, bm;\r
+\r
+                       if (t.get(id))\r
+                               return null;\r
+\r
+                       s.title = ed.translate(s.title);\r
+                       s.scope = s.scope || ed;\r
+\r
+                       if (!s.onclick) {\r
+                               s.onclick = function(v) {\r
+                                       if (tinymce.isIE)\r
+                                               bm = ed.selection.getBookmark(1);\r
+\r
+                                       ed.execCommand(s.cmd, s.ui || false, v || s.value);\r
+                               };\r
+                       }\r
+\r
+                       if (!s.onselect) {\r
+                               s.onselect = function(v) {\r
+                                       ed.execCommand(s.cmd, s.ui || false, v || s.value);\r
+                               };\r
+                       }\r
+\r
+                       s = extend({\r
+                               title : s.title,\r
+                               'class' : 'mce_' + id,\r
+                               'menu_class' : ed.getParam('skin') + 'Skin',\r
+                               scope : s.scope,\r
+                               more_colors_title : ed.getLang('more_colors')\r
+                       }, s);\r
+\r
+                       id = t.prefix + id;\r
+                       cls = cc || t._cls.colorsplitbutton || tinymce.ui.ColorSplitButton;\r
+                       c = new cls(id, s);\r
+                       ed.onMouseDown.add(c.hideMenu, c);\r
+\r
+                       // Remove the menu element when the editor is removed\r
+                       ed.onRemove.add(function() {\r
+                               c.destroy();\r
+                       });\r
+\r
+                       // Fix for bug #1897785, #1898007\r
+                       if (tinymce.isIE) {\r
+                               c.onShowMenu.add(function() {\r
+                                       // IE 8 needs focus in order to store away a range with the current collapsed caret location\r
+                                       ed.focus();\r
+                                       bm = ed.selection.getBookmark(1);\r
+                               });\r
+\r
+                               c.onHideMenu.add(function() {\r
+                                       if (bm) {\r
+                                               ed.selection.moveToBookmark(bm);\r
+                                               bm = 0;\r
+                                       }\r
+                               });\r
+                       }\r
+\r
+                       return t.add(c);\r
+               },\r
+\r
+               createToolbar : function(id, s, cc) {\r
+                       var c, t = this, cls;\r
+\r
+                       id = t.prefix + id;\r
+                       cls = cc || t._cls.toolbar || tinymce.ui.Toolbar;\r
+                       c = new cls(id, s);\r
+\r
+                       if (t.get(id))\r
+                               return null;\r
+\r
+                       return t.add(c);\r
+               },\r
+\r
+               createSeparator : function(cc) {\r
+                       var cls = cc || this._cls.separator || tinymce.ui.Separator;\r
+\r
+                       return new cls();\r
+               },\r
+\r
+               setControlType : function(n, c) {\r
+                       return this._cls[n.toLowerCase()] = c;\r
+               },\r
+       \r
+               destroy : function() {\r
+                       each(this.controls, function(c) {\r
+                               c.destroy();\r
+                       });\r
+\r
+                       this.controls = null;\r
+               }\r
+       });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+       var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isIE = tinymce.isIE, isOpera = tinymce.isOpera;\r
+\r
+       tinymce.create('tinymce.WindowManager', {\r
+               WindowManager : function(ed) {\r
+                       var t = this;\r
+\r
+                       t.editor = ed;\r
+                       t.onOpen = new Dispatcher(t);\r
+                       t.onClose = new Dispatcher(t);\r
+                       t.params = {};\r
+                       t.features = {};\r
+               },\r
+\r
+               open : function(s, p) {\r
+                       var t = this, f = '', x, y, mo = t.editor.settings.dialog_type == 'modal', w, sw, sh, vp = tinymce.DOM.getViewPort(), u;\r
+\r
+                       // Default some options\r
+                       s = s || {};\r
+                       p = p || {};\r
+                       sw = isOpera ? vp.w : screen.width; // Opera uses windows inside the Opera window\r
+                       sh = isOpera ? vp.h : screen.height;\r
+                       s.name = s.name || 'mc_' + new Date().getTime();\r
+                       s.width = parseInt(s.width || 320);\r
+                       s.height = parseInt(s.height || 240);\r
+                       s.resizable = true;\r
+                       s.left = s.left || parseInt(sw / 2.0) - (s.width / 2.0);\r
+                       s.top = s.top || parseInt(sh / 2.0) - (s.height / 2.0);\r
+                       p.inline = false;\r
+                       p.mce_width = s.width;\r
+                       p.mce_height = s.height;\r
+                       p.mce_auto_focus = s.auto_focus;\r
+\r
+                       if (mo) {\r
+                               if (isIE) {\r
+                                       s.center = true;\r
+                                       s.help = false;\r
+                                       s.dialogWidth = s.width + 'px';\r
+                                       s.dialogHeight = s.height + 'px';\r
+                                       s.scroll = s.scrollbars || false;\r
+                               }\r
+                       }\r
+\r
+                       // Build features string\r
+                       each(s, function(v, k) {\r
+                               if (tinymce.is(v, 'boolean'))\r
+                                       v = v ? 'yes' : 'no';\r
+\r
+                               if (!/^(name|url)$/.test(k)) {\r
+                                       if (isIE && mo)\r
+                                               f += (f ? ';' : '') + k + ':' + v;\r
+                                       else\r
+                                               f += (f ? ',' : '') + k + '=' + v;\r
+                               }\r
+                       });\r
+\r
+                       t.features = s;\r
+                       t.params = p;\r
+                       t.onOpen.dispatch(t, s, p);\r
+\r
+                       u = s.url || s.file;\r
+                       u = tinymce._addVer(u);\r
+\r
+                       try {\r
+                               if (isIE && mo) {\r
+                                       w = 1;\r
+                                       window.showModalDialog(u, window, f);\r
+                               } else\r
+                                       w = window.open(u, s.name, f);\r
+                       } catch (ex) {\r
+                               // Ignore\r
+                       }\r
+\r
+                       if (!w)\r
+                               alert(t.editor.getLang('popup_blocked'));\r
+               },\r
+\r
+               close : function(w) {\r
+                       w.close();\r
+                       this.onClose.dispatch(this);\r
+               },\r
+\r
+               createInstance : function(cl, a, b, c, d, e) {\r
+                       var f = tinymce.resolve(cl);\r
+\r
+                       return new f(a, b, c, d, e);\r
+               },\r
+\r
+               confirm : function(t, cb, s, w) {\r
+                       w = w || window;\r
+\r
+                       cb.call(s || this, w.confirm(this._decode(this.editor.getLang(t, t))));\r
+               },\r
+\r
+               alert : function(tx, cb, s, w) {\r
+                       var t = this;\r
+\r
+                       w = w || window;\r
+                       w.alert(t._decode(t.editor.getLang(tx, tx)));\r
+\r
+                       if (cb)\r
+                               cb.call(s || t);\r
+               },\r
+\r
+               resizeBy : function(dw, dh, win) {\r
+                       win.resizeBy(dw, dh);\r
+               },\r
+\r
+               // Internal functions\r
+\r
+               _decode : function(s) {\r
+                       return tinymce.DOM.decode(s).replace(/\\n/g, '\n');\r
+               }\r
+       });\r
+}(tinymce));\r
+(function(tinymce) {\r
+       function CommandManager() {\r
+               var execCommands = {}, queryStateCommands = {}, queryValueCommands = {};\r
+\r
+               function add(collection, cmd, func, scope) {\r
+                       if (typeof(cmd) == 'string')\r
+                               cmd = [cmd];\r
+\r
+                       tinymce.each(cmd, function(cmd) {\r
+                               collection[cmd.toLowerCase()] = {func : func, scope : scope};\r
+                       });\r
+               };\r
+\r
+               tinymce.extend(this, {\r
+                       add : function(cmd, func, scope) {\r
+                               add(execCommands, cmd, func, scope);\r
+                       },\r
+\r
+                       addQueryStateHandler : function(cmd, func, scope) {\r
+                               add(queryStateCommands, cmd, func, scope);\r
+                       },\r
+\r
+                       addQueryValueHandler : function(cmd, func, scope) {\r
+                               add(queryValueCommands, cmd, func, scope);\r
+                       },\r
+\r
+                       execCommand : function(scope, cmd, ui, value, args) {\r
+                               if (cmd = execCommands[cmd.toLowerCase()]) {\r
+                                       if (cmd.func.call(scope || cmd.scope, ui, value, args) !== false)\r
+                                               return true;\r
+                               }\r
+                       },\r
+\r
+                       queryCommandValue : function() {\r
+                               if (cmd = queryValueCommands[cmd.toLowerCase()])\r
+                                       return cmd.func.call(scope || cmd.scope, ui, value, args);\r
+                       },\r
+\r
+                       queryCommandState : function() {\r
+                               if (cmd = queryStateCommands[cmd.toLowerCase()])\r
+                                       return cmd.func.call(scope || cmd.scope, ui, value, args);\r
+                       }\r
+               });\r
+       };\r
+\r
+       tinymce.GlobalCommands = new CommandManager();\r
+})(tinymce);\r
+(function(tinymce) {\r
+       tinymce.Formatter = function(ed) {\r
+               var formats = {},\r
+                       each = tinymce.each,\r
+                       dom = ed.dom,\r
+                       selection = ed.selection,\r
+                       TreeWalker = tinymce.dom.TreeWalker,\r
+                       rangeUtils = new tinymce.dom.RangeUtils(dom),\r
+                       isValid = ed.schema.isValid,\r
+                       isBlock = dom.isBlock,\r
+                       forcedRootBlock = ed.settings.forced_root_block,\r
+                       nodeIndex = dom.nodeIndex,\r
+                       INVISIBLE_CHAR = '\uFEFF',\r
+                       MCE_ATTR_RE = /^(src|href|style)$/,\r
+                       FALSE = false,\r
+                       TRUE = true,\r
+                       undefined,\r
+                       caretHandler,\r
+                       pendingFormats;\r
+\r
+               function getParents(node, selector) {\r
+                       return dom.getParents(node, selector, dom.getRoot());\r
+               };\r
+\r
+               function resetPending() {\r
+                       // Needs reset\r
+                       if (!pendingFormats || pendingFormats.apply.length || pendingFormats.remove.length)\r
+                               pendingFormats = {apply : [], remove : []};\r
+               };\r
+\r
+               ed.onMouseUp.add(resetPending);\r
+               resetPending();\r
+\r
+               // Public functions\r
+\r
+               function get(name) {\r
+                       return name ? formats[name] : formats;\r
+               };\r
+\r
+               function register(name, format) {\r
+                       if (name) {\r
+                               if (typeof(name) !== 'string') {\r
+                                       each(name, function(format, name) {\r
+                                               register(name, format);\r
+                                       });\r
+                               } else {\r
+                                       // Force format into array and add it to internal collection\r
+                                       format = format.length ? format : [format];\r
+\r
+                                       each(format, function(format) {\r
+                                               // Set deep to false by default on selector formats this to avoid removing\r
+                                               // alignment on images inside paragraphs when alignment is changed on paragraphs\r
+                                               if (format.deep === undefined)\r
+                                                       format.deep = !format.selector;\r
+\r
+                                               // Default to true\r
+                                               if (format.split === undefined)\r
+                                                       format.split = !format.selector;\r
+\r
+                                               // Default to true\r
+                                               if (format.remove === undefined && format.selector)\r
+                                                       format.remove = 'none';\r
+\r
+                                               // Split classes if needed\r
+                                               if (typeof(format.classes) === 'string')\r
+                                                       format.classes = format.classes.split(/\s+/);\r
+                                       });\r
+\r
+                                       formats[name] = format;\r
+                               }\r
+                       }\r
+               };\r
+\r
+               function apply(name, vars, node) {\r
+                       var formatList = get(name), format = formatList[0], bookmark, rng, i;\r
+\r
+                       function moveStart(rng) {\r
+                               var container = rng.startContainer,\r
+                                       offset = rng.startOffset,\r
+                                       walker, node;\r
+\r
+                               // Move startContainer/startOffset in to a suitable node\r
+                               if (container.nodeType == 1 || container.nodeValue === "") {\r
+                                       walker = new TreeWalker(container.childNodes[offset]);\r
+                                       for (node = walker.current(); node; node = walker.next()) {\r
+                                               if (node.nodeType == 3 && !isBlock(node.parentNode) && !isWhiteSpaceNode(node)) {\r
+                                                       rng.setStart(node, 0);\r
+                                                       break;\r
+                                               }\r
+                                       }\r
+                               }\r
+\r
+                               return rng;\r
+                       };\r
+\r
+                       function setElementFormat(elm, fmt) {\r
+                               fmt = fmt || format;\r
+\r
+                               if (elm) {\r
+                                       each(fmt.styles, function(value, name) {\r
+                                               dom.setStyle(elm, name, replaceVars(value, vars));\r
+                                       });\r
+\r
+                                       each(fmt.attributes, function(value, name) {\r
+                                               dom.setAttrib(elm, name, replaceVars(value, vars));\r
+                                       });\r
+\r
+                                       each(fmt.classes, function(value) {\r
+                                               value = replaceVars(value, vars);\r
+\r
+                                               if (!dom.hasClass(elm, value))\r
+                                                       dom.addClass(elm, value);\r
+                                       });\r
+                               }\r
+                       };\r
+\r
+                       function applyRngStyle(rng) {\r
+                               var newWrappers = [], wrapName, wrapElm;\r
+\r
+                               // Setup wrapper element\r
+                               wrapName = format.inline || format.block;\r
+                               wrapElm = dom.create(wrapName);\r
+                               setElementFormat(wrapElm);\r
+\r
+                               rangeUtils.walk(rng, function(nodes) {\r
+                                       var currentWrapElm;\r
+\r
+                                       function process(node) {\r
+                                               var nodeName = node.nodeName.toLowerCase(), parentName = node.parentNode.nodeName.toLowerCase();\r
+\r
+                                               // Stop wrapping on br elements\r
+                                               if (isEq(nodeName, 'br')) {\r
+                                                       currentWrapElm = 0;\r
+\r
+                                                       // Remove any br elements when we wrap things\r
+                                                       if (format.block)\r
+                                                               dom.remove(node);\r
+\r
+                                                       return;\r
+                                               }\r
+\r
+                                               // If node is wrapper type\r
+                                               if (format.wrapper && matchNode(node, name, vars)) {\r
+                                                       currentWrapElm = 0;\r
+                                                       return;\r
+                                               }\r
+\r
+                                               // Can we rename the block\r
+                                               if (format.block && !format.wrapper && isTextBlock(nodeName)) {\r
+                                                       node = dom.rename(node, wrapName);\r
+                                                       setElementFormat(node);\r
+                                                       newWrappers.push(node);\r
+                                                       currentWrapElm = 0;\r
+                                                       return;\r
+                                               }\r
+\r
+                                               // Handle selector patterns\r
+                                               if (format.selector) {\r
+                                                       // Look for matching formats\r
+                                                       each(formatList, function(format) {\r
+                                                               if (dom.is(node, format.selector))\r
+                                                                       setElementFormat(node, format);\r
+                                                       });\r
+\r
+                                                       return;\r
+                                               }\r
+\r
+                                               // Is it valid to wrap this item\r
+                                               if (isValid(wrapName, nodeName) && isValid(parentName, wrapName)) {\r
+                                                       // Start wrapping\r
+                                                       if (!currentWrapElm) {\r
+                                                               // Wrap the node\r
+                                                               currentWrapElm = wrapElm.cloneNode(FALSE);\r
+                                                               node.parentNode.insertBefore(currentWrapElm, node);\r
+                                                               newWrappers.push(currentWrapElm);\r
+                                                       }\r
+\r
+                                                       currentWrapElm.appendChild(node);\r
+                                               } else {\r
+                                                       // Start a new wrapper for possible children\r
+                                                       currentWrapElm = 0;\r
+\r
+                                                       each(tinymce.grep(node.childNodes), process);\r
+\r
+                                                       // End the last wrapper\r
+                                                       currentWrapElm = 0;\r
+                                               }\r
+                                       };\r
+\r
+                                       // Process siblings from range\r
+                                       each(nodes, process);\r
+                               });\r
+\r
+                               // Cleanup\r
+                               each(newWrappers, function(node) {\r
+                                       var childCount;\r
+\r
+                                       function getChildCount(node) {\r
+                                               var count = 0;\r
+\r
+                                               each(node.childNodes, function(node) {\r
+                                                       if (!isWhiteSpaceNode(node) && !isBookmarkNode(node))\r
+                                                               count++;\r
+                                               });\r
+\r
+                                               return count;\r
+                                       };\r
+\r
+                                       function mergeStyles(node) {\r
+                                               var child, clone;\r
+\r
+                                               each(node.childNodes, function(node) {\r
+                                                       if (node.nodeType == 1 && !isBookmarkNode(node)) {\r
+                                                               child = node;\r
+                                                               return FALSE; // break loop\r
+                                                       }\r
+                                               });\r
+\r
+                                               // If child was found and of the same type as the current node\r
+                                               if (child && matchName(child, format)) {\r
+                                                       clone = child.cloneNode(FALSE);\r
+                                                       setElementFormat(clone);\r
+\r
+                                                       dom.replace(clone, node, TRUE);\r
+                                                       dom.remove(child, 1);\r
+                                               }\r
+\r
+                                               return clone || node;\r
+                                       };\r
+\r
+                                       childCount = getChildCount(node);\r
+\r
+                                       // Remove empty nodes\r
+                                       if (childCount === 0) {\r
+                                               dom.remove(node, 1);\r
+                                               return;\r
+                                       }\r
+\r
+                                       if (format.inline || format.wrapper) {\r
+                                               // Merges the current node with it's children of similar type to reduce the number of elements\r
+                                               if (!format.exact && childCount === 1)\r
+                                                       node = mergeStyles(node);\r
+\r
+                                               // Remove/merge children\r
+                                               each(formatList, function(format) {\r
+                                                       // Merge all children of similar type will move styles from child to parent\r
+                                                       // this: <span style="color:red"><b><span style="color:red; font-size:10px">text</span></b></span>\r
+                                                       // will become: <span style="color:red"><b><span style="font-size:10px">text</span></b></span>\r
+                                                       each(dom.select(format.inline, node), function(child) {\r
+                                                               removeFormat(format, vars, child, format.exact ? child : null);\r
+                                                       });\r
+                                               });\r
+\r
+                                               // Look for parent with similar style format\r
+                                               dom.getParent(node.parentNode, function(parent) {\r
+                                                       if (matchNode(parent, name, vars)) {\r
+                                                               dom.remove(node, 1);\r
+                                                               node = 0;\r
+                                                               return TRUE;\r
+                                                       }\r
+                                               });\r
+\r
+                                               // Merge next and previous siblings if they are similar <b>text</b><b>text</b> becomes <b>texttext</b>\r
+                                               if (node) {\r
+                                                       node = mergeSiblings(getNonWhiteSpaceSibling(node), node);\r
+                                                       node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE));\r
+                                               }\r
+                                       }\r
+                               });\r
+                       };\r
+\r
+                       if (format) {\r
+                               if (node) {\r
+                                       rng = dom.createRng();\r
+\r
+                                       rng.setStartBefore(node);\r
+                                       rng.setEndAfter(node);\r
+\r
+                                       applyRngStyle(rng);\r
+                               } else {\r
+                                       if (!selection.isCollapsed() || !format.inline) {\r
+                                               // Apply formatting to selection\r
+                                               bookmark = selection.getBookmark();\r
+                                               applyRngStyle(expandRng(selection.getRng(TRUE), formatList));\r
+\r
+                                               selection.moveToBookmark(bookmark);\r
+                                               selection.setRng(moveStart(selection.getRng(TRUE)));\r
+                                               ed.nodeChanged();\r
+                                       } else\r
+                                               performCaretAction('apply', name, vars);\r
+                               }\r
+                       }\r
+               };\r
+\r
+               function remove(name, vars, node) {\r
+                       var formatList = get(name), format = formatList[0], bookmark, i, rng;\r
+\r
+                       // Merges the styles for each node\r
+                       function process(node) {\r
+                               var children, i, l;\r
+\r
+                               // Grab the children first since the nodelist might be changed\r
+                               children = tinymce.grep(node.childNodes);\r
+\r
+                               // Process current node\r
+                               for (i = 0, l = formatList.length; i < l; i++) {\r
+                                       if (removeFormat(formatList[i], vars, node, node))\r
+                                               break;\r
+                               }\r
+\r
+                               // Process the children\r
+                               if (format.deep) {\r
+                                       for (i = 0, l = children.length; i < l; i++)\r
+                                               process(children[i]);\r
+                               }\r
+                       };\r
+\r
+                       function findFormatRoot(container) {\r
+                               var formatRoot;\r
+\r
+                               // Find format root\r
+                               each(getParents(container.parentNode).reverse(), function(parent) {\r
+                                       // Find format root element\r
+                                       if (!formatRoot && parent.id != '_start' && parent.id != '_end') {\r
+                                               // If the matched format has a remove none flag we shouldn't split it\r
+                                               if (!isBlock(parent) && matchNode(parent, name, vars))\r
+                                                       formatRoot = parent;\r
+                                       }\r
+                               });\r
+\r
+                               return formatRoot;\r
+                       };\r
+\r
+                       function wrapAndSplit(format_root, container, target, split) {\r
+                               var parent, clone, lastClone, firstClone, i, formatRootParent;\r
+\r
+                               // Format root found then clone formats and split it\r
+                               if (format_root) {\r
+                                       formatRootParent = format_root.parentNode;\r
+\r
+                                       for (parent = container.parentNode; parent && parent != formatRootParent; parent = parent.parentNode) {\r
+                                               clone = parent.cloneNode(FALSE);\r
+\r
+                                               for (i = 0; i < formatList.length; i++) {\r
+                                                       if (removeFormat(formatList[i], vars, clone, clone)) {\r
+                                                               clone = 0;\r
+                                                               break;\r
+                                                       }\r
+                                               }\r
+\r
+                                               // Build wrapper node\r
+                                               if (clone) {\r
+                                                       if (lastClone)\r
+                                                               clone.appendChild(lastClone);\r
+\r
+                                                       if (!firstClone)\r
+                                                               firstClone = clone;\r
+\r
+                                                       lastClone = clone;\r
+                                               }\r
+                                       }\r
+\r
+                                       if (split)\r
+                                               container = dom.split(format_root, container);\r
+\r
+                                       // Wrap container in cloned formats\r
+                                       if (lastClone) {\r
+                                               target.parentNode.insertBefore(lastClone, target);\r
+                                               firstClone.appendChild(target);\r
+                                       }\r
+                               }\r
+\r
+                               return container;\r
+                       };\r
+\r
+                       function splitToFormatRoot(container) {\r
+                               return wrapAndSplit(findFormatRoot(container), container, container, true);\r
+                       };\r
+\r
+                       function unwrap(start) {\r
+                               var node = dom.get(start ? '_start' : '_end'),\r
+                                       out = node[start ? 'firstChild' : 'lastChild'];\r
+\r
+                               dom.remove(node, 1);\r
+\r
+                               return out;\r
+                       };\r
+\r
+                       function removeRngStyle(rng) {\r
+                               var startContainer, endContainer;\r
+\r
+                               rng = expandRng(rng, formatList, TRUE);\r
+\r
+                               if (format.split) {\r
+                                       startContainer = getContainer(rng, TRUE);\r
+                                       endContainer = getContainer(rng);\r
+\r
+                                       if (startContainer != endContainer) {\r
+                                               // Wrap start/end nodes in span element since these might be cloned/moved\r
+                                               startContainer = wrap(startContainer, 'span', {id : '_start', _mce_type : 'bookmark'});\r
+                                               endContainer = wrap(endContainer, 'span', {id : '_end', _mce_type : 'bookmark'});\r
+\r
+                                               // Split start/end\r
+                                               splitToFormatRoot(startContainer);\r
+                                               splitToFormatRoot(endContainer);\r
+\r
+                                               // Unwrap start/end to get real elements again\r
+                                               startContainer = unwrap(TRUE);\r
+                                               endContainer = unwrap();\r
+                                       } else\r
+                                               startContainer = endContainer = splitToFormatRoot(startContainer);\r
+\r
+                                       // Update range positions since they might have changed after the split operations\r
+                                       rng.startContainer = startContainer.parentNode;\r
+                                       rng.startOffset = nodeIndex(startContainer);\r
+                                       rng.endContainer = endContainer.parentNode;\r
+                                       rng.endOffset = nodeIndex(endContainer) + 1;\r
+                               }\r
+\r
+                               // Remove items between start/end\r
+                               rangeUtils.walk(rng, function(nodes) {\r
+                                       each(nodes, function(node) {\r
+                                               process(node);\r
+                                       });\r
+                               });\r
+                       };\r
+\r
+                       // Handle node\r
+                       if (node) {\r
+                               rng = dom.createRng();\r
+                               rng.setStartBefore(node);\r
+                               rng.setEndAfter(node);\r
+                               removeRngStyle(rng);\r
+                               return;\r
+                       }\r
+\r
+                       if (!selection.isCollapsed() || !format.inline) {\r
+                               bookmark = selection.getBookmark();\r
+                               removeRngStyle(selection.getRng(TRUE));\r
+                               selection.moveToBookmark(bookmark);\r
+                               ed.nodeChanged();\r
+                       } else\r
+                               performCaretAction('remove', name, vars);\r
+               };\r
+\r
+               function toggle(name, vars, node) {\r
+                       if (match(name, vars, node))\r
+                               remove(name, vars, node);\r
+                       else\r
+                               apply(name, vars, node);\r
+               };\r
+\r
+               function matchNode(node, name, vars) {\r
+                       var formatList = get(name), format, i, classes;\r
+\r
+                       function matchItems(node, format, item_name) {\r
+                               var key, value, items = format[item_name], i;\r
+\r
+                               // Check all items\r
+                               if (items) {\r
+                                       // Non indexed object\r
+                                       if (items.length === undefined) {\r
+                                               for (key in items) {\r
+                                                       if (items.hasOwnProperty(key)) {\r
+                                                               if (item_name === 'attributes')\r
+                                                                       value = dom.getAttrib(node, key);\r
+                                                               else\r
+                                                                       value = getStyle(node, key);\r
+\r
+                                                               if (!isEq(value, replaceVars(items[key], vars)))\r
+                                                                       return;\r
+                                                       }\r
+                                               }\r
+                                       } else {\r
+                                               // Only one match needed for indexed arrays\r
+                                               for (i = 0; i < items.length; i++) {\r
+                                                       if (item_name === 'attributes' ? dom.getAttrib(node, items[i]) : getStyle(node, items[i]))\r
+                                                               return TRUE;\r
+                                               }\r
+                                       }\r
+                               }\r
+\r
+                               return TRUE;\r
+                       };\r
+\r
+                       if (formatList && node) {\r
+                               // Check each format in list\r
+                               for (i = 0; i < formatList.length; i++) {\r
+                                       format = formatList[i];\r
+\r
+                                       // Name name, attributes, styles and classes\r
+                                       if (matchName(node, format) && matchItems(node, format, 'attributes') && matchItems(node, format, 'styles')) {\r
+                                               // Match classes\r
+                                               if (classes = format.classes) {\r
+                                                       for (i = 0; i < classes.length; i++) {\r
+                                                               if (!dom.hasClass(node, classes[i]))\r
+                                                                       return;\r
+                                                       }\r
+                                               }\r
+\r
+                                               return TRUE;\r
+                                       }\r
+                               }\r
+                       }\r
+               };\r
+\r
+               function match(name, vars, node) {\r
+                       var startNode, i;\r
+\r
+                       function matchParents(node) {\r
+                               // Find first node with similar format settings\r
+                               node = dom.getParent(node, function(node) {\r
+                                       return !!matchNode(node, name, vars);\r
+                               });\r
+\r
+                               // Do an exact check on the similar format element\r
+                               return matchNode(node, name, vars);\r
+                       };\r
+\r
+                       // Check specified node\r
+                       if (node)\r
+                               return matchParents(node);\r
+\r
+                       // Check pending formats\r
+                       if (selection.isCollapsed()) {\r
+                               for (i = pendingFormats.apply.length - 1; i >= 0; i--) {\r
+                                       if (pendingFormats.apply[i].name == name)\r
+                                               return true;\r
+                               }\r
+\r
+                               for (i = pendingFormats.remove.length - 1; i >= 0; i--) {\r
+                                       if (pendingFormats.remove[i].name == name)\r
+                                               return false;\r
+                               }\r
+\r
+                               return matchParents(selection.getNode());\r
+                       }\r
+\r
+                       // Check selected node\r
+                       node = selection.getNode();\r
+                       if (matchParents(node))\r
+                               return TRUE;\r
+\r
+                       // Check start node if it's different\r
+                       startNode = selection.getStart();\r
+                       if (startNode != node) {\r
+                               if (matchParents(startNode))\r
+                                       return TRUE;\r
+                       }\r
+\r
+                       return FALSE;\r
+               };\r
+\r
+               function canApply(name) {\r
+                       var formatList = get(name), startNode, parents, i, x, selector;\r
+\r
+                       if (formatList) {\r
+                               startNode = selection.getStart();\r
+                               parents = getParents(startNode);\r
+\r
+                               for (x = formatList.length - 1; x >= 0; x--) {\r
+                                       selector = formatList[x].selector;\r
+\r
+                                       // Format is not selector based, then always return TRUE\r
+                                       if (!selector)\r
+                                               return TRUE;\r
+\r
+                                       for (i = parents.length - 1; i >= 0; i--) {\r
+                                               if (dom.is(parents[i], selector))\r
+                                                       return TRUE;\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+                       return FALSE;\r
+               };\r
+\r
+               // Expose to public\r
+               tinymce.extend(this, {\r
+                       get : get,\r
+                       register : register,\r
+                       apply : apply,\r
+                       remove : remove,\r
+                       toggle : toggle,\r
+                       match : match,\r
+                       matchNode : matchNode,\r
+                       canApply : canApply\r
+               });\r
+\r
+               // Private functions\r
+\r
+               function matchName(node, format) {\r
+                       // Check for inline match\r
+                       if (isEq(node, format.inline))\r
+                               return TRUE;\r
+\r
+                       // Check for block match\r
+                       if (isEq(node, format.block))\r
+                               return TRUE;\r
+\r
+                       // Check for selector match\r
+                       if (format.selector)\r
+                               return dom.is(node, format.selector);\r
+               };\r
+\r
+               function isEq(str1, str2) {\r
+                       str1 = str1 || '';\r
+                       str2 = str2 || '';\r
+\r
+                       str1 = str1.nodeName || str1;\r
+                       str2 = str2.nodeName || str2;\r
+\r
+                       return str1.toLowerCase() == str2.toLowerCase();\r
+               };\r
+\r
+               function getStyle(node, name) {\r
+                       var styleVal = dom.getStyle(node, name);\r
+\r
+                       // Force the format to hex\r
+                       if (name == 'color' || name == 'backgroundColor')\r
+                               styleVal = dom.toHex(styleVal);\r
+\r
+                       // Opera will return bold as 700\r
+                       if (name == 'fontWeight' && styleVal == 700)\r
+                               styleVal = 'bold';\r
+\r
+                       return '' + styleVal;\r
+               };\r
+\r
+               function replaceVars(value, vars) {\r
+                       if (typeof(value) != "string")\r
+                               value = value(vars);\r
+                       else if (vars) {\r
+                               value = value.replace(/%(\w+)/g, function(str, name) {\r
+                                       return vars[name] || str;\r
+                               });\r
+                       }\r
+\r
+                       return value;\r
+               };\r
+\r
+               function isWhiteSpaceNode(node) {\r
+                       return node && node.nodeType === 3 && /^\s*$/.test(node.nodeValue);\r
+               };\r
+\r
+               function wrap(node, name, attrs) {\r
+                       var wrapper = dom.create(name, attrs);\r
+\r
+                       node.parentNode.insertBefore(wrapper, node);\r
+                       wrapper.appendChild(node);\r
+\r
+                       return wrapper;\r
+               };\r
+\r
+               function expandRng(rng, format, remove) {\r
+                       var startContainer = rng.startContainer,\r
+                               startOffset = rng.startOffset,\r
+                               endContainer = rng.endContainer,\r
+                               endOffset = rng.endOffset, sibling, lastIdx;\r
+\r
+                       // This function walks up the tree if there is no siblings before/after the node\r
+                       function findParentContainer(container, child_name, sibling_name, root) {\r
+                               var parent, child;\r
+\r
+                               root = root || dom.getRoot();\r
+\r
+                               for (;;) {\r
+                                       // Check if we can move up are we at root level or body level\r
+                                       parent = container.parentNode;\r
+\r
+                                       // Stop expanding on block elements or root depending on format\r
+                                       if (parent == root || (!format[0].block_expand && isBlock(parent)))\r
+                                               return container;\r
+\r
+                                       for (sibling = parent[child_name]; sibling && sibling != container; sibling = sibling[sibling_name]) {\r
+                                               if (sibling.nodeType == 1 && !isBookmarkNode(sibling))\r
+                                                       return container;\r
+\r
+                                               if (sibling.nodeType == 3 && !isWhiteSpaceNode(sibling))\r
+                                                       return container;\r
+                                       }\r
+\r
+                                       container = container.parentNode;\r
+                               }\r
+\r
+                               return container;\r
+                       };\r
+\r
+                       // If index based start position then resolve it\r
+                       if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) {\r
+                               lastIdx = startContainer.childNodes.length - 1;\r
+                               startContainer = startContainer.childNodes[startOffset > lastIdx ? lastIdx : startOffset];\r
+\r
+                               if (startContainer.nodeType == 3)\r
+                                       startOffset = 0;\r
+                       }\r
+\r
+                       // If index based end position then resolve it\r
+                       if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) {\r
+                               lastIdx = endContainer.childNodes.length - 1;\r
+                               endContainer = endContainer.childNodes[endOffset > lastIdx ? lastIdx : endOffset - 1];\r
+\r
+                               if (endContainer.nodeType == 3)\r
+                                       endOffset = endContainer.nodeValue.length;\r
+                       }\r
+\r
+                       // Exclude bookmark nodes if possible\r
+                       if (isBookmarkNode(startContainer.parentNode))\r
+                               startContainer = startContainer.parentNode;\r
+\r
+                       if (isBookmarkNode(startContainer))\r
+                               startContainer = startContainer.nextSibling || startContainer;\r
+\r
+                       if (isBookmarkNode(endContainer.parentNode))\r
+                               endContainer = endContainer.parentNode;\r
+\r
+                       if (isBookmarkNode(endContainer))\r
+                               endContainer = endContainer.previousSibling || endContainer;\r
+\r
+                       // Move start/end point up the tree if the leaves are sharp and if we are in different containers\r
+                       // Example * becomes !: !<p><b><i>*text</i><i>text*</i></b></p>!\r
+                       // This will reduce the number of wrapper elements that needs to be created\r
+                       // Move start point up the tree\r
+                       if (format[0].inline || format[0].block_expand) {\r
+                               startContainer = findParentContainer(startContainer, 'firstChild', 'nextSibling');\r
+                               endContainer = findParentContainer(endContainer, 'lastChild', 'previousSibling');\r
+                       }\r
+\r
+                       // Expand start/end container to matching selector\r
+                       if (format[0].selector && format[0].expand !== FALSE) {\r
+                               function findSelectorEndPoint(container, sibling_name) {\r
+                                       var parents, i, y;\r
+\r
+                                       if (container.nodeType == 3 && container.nodeValue.length == 0 && container[sibling_name])\r
+                                               container = container[sibling_name];\r
+\r
+                                       parents = getParents(container);\r
+                                       for (i = 0; i < parents.length; i++) {\r
+                                               for (y = 0; y < format.length; y++) {\r
+                                                       if (dom.is(parents[i], format[y].selector))\r
+                                                               return parents[i];\r
+                                               }\r
+                                       }\r
+\r
+                                       return container;\r
+                               };\r
+\r
+                               // Find new startContainer/endContainer if there is better one\r
+                               startContainer = findSelectorEndPoint(startContainer, 'previousSibling');\r
+                               endContainer = findSelectorEndPoint(endContainer, 'nextSibling');\r
+                       }\r
+\r
+                       // Expand start/end container to matching block element or text node\r
+                       if (format[0].block || format[0].selector) {\r
+                               function findBlockEndPoint(container, sibling_name, sibling_name2) {\r
+                                       var node;\r
+\r
+                                       // Expand to block of similar type\r
+                                       if (!format[0].wrapper)\r
+                                               node = dom.getParent(container, format[0].block);\r
+\r
+                                       // Expand to first wrappable block element or any block element\r
+                                       if (!node)\r
+                                               node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isBlock);\r
+\r
+                                       // Exclude inner lists from wrapping\r
+                                       if (node && format[0].wrapper)\r
+                                               node = getParents(node, 'ul,ol').reverse()[0] || node;\r
+\r
+                                       // Didn't find a block element look for first/last wrappable element\r
+                                       if (!node) {\r
+                                               node = container;\r
+\r
+                                               while (node[sibling_name] && !isBlock(node[sibling_name])) {\r
+                                                       node = node[sibling_name];\r
+\r
+                                                       // Break on BR but include it will be removed later on\r
+                                                       // we can't remove it now since we need to check if it can be wrapped\r
+                                                       if (isEq(node, 'br'))\r
+                                                               break;\r
+                                               }\r
+                                       }\r
+\r
+                                       return node || container;\r
+                               };\r
+\r
+                               // Find new startContainer/endContainer if there is better one\r
+                               startContainer = findBlockEndPoint(startContainer, 'previousSibling');\r
+                               endContainer = findBlockEndPoint(endContainer, 'nextSibling');\r
+\r
+                               // Non block element then try to expand up the leaf\r
+                               if (format[0].block) {\r
+                                       if (!isBlock(startContainer))\r
+                                               startContainer = findParentContainer(startContainer, 'firstChild', 'nextSibling');\r
+\r
+                                       if (!isBlock(endContainer))\r
+                                               endContainer = findParentContainer(endContainer, 'lastChild', 'previousSibling');\r
+                               }\r
+                       }\r
+\r
+                       // Setup index for startContainer\r
+                       if (startContainer.nodeType == 1) {\r
+                               startOffset = nodeIndex(startContainer);\r
+                               startContainer = startContainer.parentNode;\r
+                       }\r
+\r
+                       // Setup index for endContainer\r
+                       if (endContainer.nodeType == 1) {\r
+                               endOffset = nodeIndex(endContainer) + 1;\r
+                               endContainer = endContainer.parentNode;\r
+                       }\r
+\r
+                       // Return new range like object\r
+                       return {\r
+                               startContainer : startContainer,\r
+                               startOffset : startOffset,\r
+                               endContainer : endContainer,\r
+                               endOffset : endOffset\r
+                       };\r
+               }\r
+\r
+               function removeFormat(format, vars, node, compare_node) {\r
+                       var i, attrs, stylesModified;\r
+\r
+                       // Check if node matches format\r
+                       if (!matchName(node, format))\r
+                               return FALSE;\r
+\r
+                       // Should we compare with format attribs and styles\r
+                       if (format.remove != 'all') {\r
+                               // Remove styles\r
+                               each(format.styles, function(value, name) {\r
+                                       value = replaceVars(value, vars);\r
+\r
+                                       // Indexed array\r
+                                       if (typeof(name) === 'number') {\r
+                                               name = value;\r
+                                               compare_node = 0;\r
+                                       }\r
+\r
+                                       if (!compare_node || isEq(getStyle(compare_node, name), value))\r
+                                               dom.setStyle(node, name, '');\r
+\r
+                                       stylesModified = 1;\r
+                               });\r
+\r
+                               // Remove style attribute if it's empty\r
+                               if (stylesModified && dom.getAttrib(node, 'style') == '') {\r
+                                       node.removeAttribute('style');\r
+                                       node.removeAttribute('_mce_style');\r
+                               }\r
+\r
+                               // Remove attributes\r
+                               each(format.attributes, function(value, name) {\r
+                                       var valueOut;\r
+\r
+                                       value = replaceVars(value, vars);\r
+\r
+                                       // Indexed array\r
+                                       if (typeof(name) === 'number') {\r
+                                               name = value;\r
+                                               compare_node = 0;\r
+                                       }\r
+\r
+                                       if (!compare_node || isEq(dom.getAttrib(compare_node, name), value)) {\r
+                                               // Keep internal classes\r
+                                               if (name == 'class') {\r
+                                                       value = dom.getAttrib(node, name);\r
+                                                       if (value) {\r
+                                                               // Build new class value where everything is removed except the internal prefixed classes\r
+                                                               valueOut = '';\r
+                                                               each(value.split(/\s+/), function(cls) {\r
+                                                                       if (/mce\w+/.test(cls))\r
+                                                                               valueOut += (valueOut ? ' ' : '') + cls;\r
+                                                               });\r
+\r
+                                                               // We got some internal classes left\r
+                                                               if (valueOut) {\r
+                                                                       dom.setAttrib(node, name, valueOut);\r
+                                                                       return;\r
+                                                               }\r
+                                                       }\r
+                                               }\r
+\r
+                                               // IE6 has a bug where the attribute doesn't get removed correctly\r
+                                               if (name == "class")\r
+                                                       node.removeAttribute('className');\r
+\r
+                                               // Remove mce prefixed attributes\r
+                                               if (MCE_ATTR_RE.test(name))\r
+                                                       node.removeAttribute('_mce_' + name);\r
+\r
+                                               node.removeAttribute(name);\r
+                                       }\r
+                               });\r
+\r
+                               // Remove classes\r
+                               each(format.classes, function(value) {\r
+                                       value = replaceVars(value, vars);\r
+\r
+                                       if (!compare_node || dom.hasClass(compare_node, value))\r
+                                               dom.removeClass(node, value);\r
+                               });\r
+\r
+                               // Check for non internal attributes\r
+                               attrs = dom.getAttribs(node);\r
+                               for (i = 0; i < attrs.length; i++) {\r
+                                       if (attrs[i].nodeName.indexOf('_') !== 0)\r
+                                               return FALSE;\r
+                               }\r
+                       }\r
+\r
+                       // Remove the inline child if it's empty for example <b> or <span>\r
+                       if (format.remove != 'none') {\r
+                               removeNode(node, format);\r
+                               return TRUE;\r
+                       }\r
+               };\r
+\r
+               function removeNode(node, format) {\r
+                       var parentNode = node.parentNode, rootBlockElm;\r
+\r
+                       if (format.block) {\r
+                               if (!forcedRootBlock) {\r
+                                       function find(node, next, inc) {\r
+                                               node = getNonWhiteSpaceSibling(node, next, inc);\r
+\r
+                                               return !node || (node.nodeName == 'BR' || isBlock(node));\r
+                                       };\r
+\r
+                                       // Append BR elements if needed before we remove the block\r
+                                       if (isBlock(node) && !isBlock(parentNode)) {\r
+                                               if (!find(node, FALSE) && !find(node.firstChild, TRUE, 1))\r
+                                                       node.insertBefore(dom.create('br'), node.firstChild);\r
+\r
+                                               if (!find(node, TRUE) && !find(node.lastChild, FALSE, 1))\r
+                                                       node.appendChild(dom.create('br'));\r
+                                       }\r
+                               } else {\r
+                                       // Wrap the block in a forcedRootBlock if we are at the root of document\r
+                                       if (parentNode == dom.getRoot()) {\r
+                                               if (!format.list_block || !isEq(node, format.list_block)) {\r
+                                                       each(tinymce.grep(node.childNodes), function(node) {\r
+                                                               if (isValid(forcedRootBlock, node.nodeName.toLowerCase())) {\r
+                                                                       if (!rootBlockElm)\r
+                                                                               rootBlockElm = wrap(node, forcedRootBlock);\r
+                                                                       else\r
+                                                                               rootBlockElm.appendChild(node);\r
+                                                               } else\r
+                                                                       rootBlockElm = 0;\r
+                                                       });\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+                       dom.remove(node, 1);\r
+               };\r
+\r
+               function getNonWhiteSpaceSibling(node, next, inc) {\r
+                       if (node) {\r
+                               next = next ? 'nextSibling' : 'previousSibling';\r
+\r
+                               for (node = inc ? node : node[next]; node; node = node[next]) {\r
+                                       if (node.nodeType == 1 || !isWhiteSpaceNode(node))\r
+                                               return node;\r
+                               }\r
+                       }\r
+               };\r
+\r
+               function isBookmarkNode(node) {\r
+                       return node && node.nodeType == 1 && node.getAttribute('_mce_type') == 'bookmark';\r
+               };\r
+\r
+               function mergeSiblings(prev, next) {\r
+                       var marker, sibling, tmpSibling;\r
+\r
+                       function compareElements(node1, node2) {\r
+                               // Not the same name\r
+                               if (node1.nodeName != node2.nodeName)\r
+                                       return FALSE;\r
+\r
+                               function getAttribs(node) {\r
+                                       var attribs = {};\r
+\r
+                                       each(dom.getAttribs(node), function(attr) {\r
+                                               var name = attr.nodeName.toLowerCase();\r
+\r
+                                               // Don't compare internal attributes or style\r
+                                               if (name.indexOf('_') !== 0 && name !== 'style')\r
+                                                       attribs[name] = dom.getAttrib(node, name);\r
+                                       });\r
+\r
+                                       return attribs;\r
+                               };\r
+\r
+                               function compareObjects(obj1, obj2) {\r
+                                       var value, name;\r
+\r
+                                       for (name in obj1) {\r
+                                               // Obj1 has item obj2 doesn't have\r
+                                               if (obj1.hasOwnProperty(name)) {\r
+                                                       value = obj2[name];\r
+\r
+                                                       // Obj2 doesn't have obj1 item\r
+                                                       if (value === undefined)\r
+                                                               return FALSE;\r
+\r
+                                                       // Obj2 item has a different value\r
+                                                       if (obj1[name] != value)\r
+                                                               return FALSE;\r
+\r
+                                                       // Delete similar value\r
+                                                       delete obj2[name];\r
+                                               }\r
+                                       }\r
+\r
+                                       // Check if obj 2 has something obj 1 doesn't have\r
+                                       for (name in obj2) {\r
+                                               // Obj2 has item obj1 doesn't have\r
+                                               if (obj2.hasOwnProperty(name))\r
+                                                       return FALSE;\r
+                                       }\r
+\r
+                                       return TRUE;\r
+                               };\r
+\r
+                               // Attribs are not the same\r
+                               if (!compareObjects(getAttribs(node1), getAttribs(node2)))\r
+                                       return FALSE;\r
+\r
+                               // Styles are not the same\r
+                               if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style'))))\r
+                                       return FALSE;\r
+\r
+                               return TRUE;\r
+                       };\r
+\r
+                       // Check if next/prev exists and that they are elements\r
+                       if (prev && next) {\r
+                               function findElementSibling(node, sibling_name) {\r
+                                       for (sibling = node; sibling; sibling = sibling[sibling_name]) {\r
+                                               if (sibling.nodeType == 3 && !isWhiteSpaceNode(sibling))\r
+                                                       return node;\r
+\r
+                                               if (sibling.nodeType == 1 && !isBookmarkNode(sibling))\r
+                                                       return sibling;\r
+                                       }\r
+\r
+                                       return node;\r
+                               };\r
+\r
+                               // If previous sibling is empty then jump over it\r
+                               prev = findElementSibling(prev, 'previousSibling');\r
+                               next = findElementSibling(next, 'nextSibling');\r
+\r
+                               // Compare next and previous nodes\r
+                               if (compareElements(prev, next)) {\r
+                                       // Append nodes between\r
+                                       for (sibling = prev.nextSibling; sibling && sibling != next;) {\r
+                                               tmpSibling = sibling;\r
+                                               sibling = sibling.nextSibling;\r
+                                               prev.appendChild(tmpSibling);\r
+                                       }\r
+\r
+                                       // Remove next node\r
+                                       dom.remove(next);\r
+\r
+                                       // Move children into prev node\r
+                                       each(tinymce.grep(next.childNodes), function(node) {\r
+                                               prev.appendChild(node);\r
+                                       });\r
+\r
+                                       return prev;\r
+                               }\r
+                       }\r
+\r
+                       return next;\r
+               };\r
+\r
+               function isTextBlock(name) {\r
+                       return /^(h[1-6]|p|div|pre|address)$/.test(name);\r
+               };\r
+\r
+               function getContainer(rng, start) {\r
+                       var container, offset, lastIdx;\r
+\r
+                       container = rng[start ? 'startContainer' : 'endContainer'];\r
+                       offset = rng[start ? 'startOffset' : 'endOffset'];\r
+\r
+                       if (container.nodeType == 1) {\r
+                               lastIdx = container.childNodes.length - 1;\r
+\r
+                               if (!start && offset)\r
+                                       offset--;\r
+\r
+                               container = container.childNodes[offset > lastIdx ? lastIdx : offset];\r
+                       }\r
+\r
+                       return container;\r
+               };\r
+\r
+               function performCaretAction(type, name, vars) {\r
+                       var i, rng, selectedNode = selection.getNode().parentNode,\r
+                               doc = ed.getDoc(), marker = 'mceinline',\r
+                               events = ['onKeyDown', 'onKeyUp', 'onKeyPress'],\r
+                               currentPendingFormats = pendingFormats[type],\r
+                               otherPendingFormats = pendingFormats[type == 'apply' ? 'remove' : 'apply'];\r
+\r
+                       // Check if it already exists\r
+                       for (i = currentPendingFormats.length - 1; i >= 0; i--) {\r
+                               if (currentPendingFormats[i].name == name)\r
+                                       return;\r
+                       }\r
+\r
+                       currentPendingFormats.push({name : name, vars : vars});\r
+\r
+                       // Check if it's in the oter type\r
+                       for (i = otherPendingFormats.length - 1; i >= 0; i--) {\r
+                               if (otherPendingFormats[i].name == name)\r
+                                       otherPendingFormats.splice(i, 1);\r
+                       }\r
+\r
+                       function unbind() {\r
+                               if (caretHandler) {\r
+                                       each(events, function(event) {\r
+                                               ed[event].remove(caretHandler);\r
+                                       });\r
+\r
+                                       caretHandler = 0;\r
+                               }\r
+                       };\r
+\r
+                       function perform(caret_node) {\r
+                               // Apply pending formats\r
+                               each(pendingFormats.apply.reverse(), function(item) {\r
+                                       apply(item.name, item.vars, caret_node);\r
+                               });\r
+\r
+                               // Remove pending formats\r
+                               each(pendingFormats.remove.reverse(), function(item) {\r
+                                       remove(item.name, item.vars, caret_node);\r
+                               });\r
+\r
+                               dom.remove(caret_node, 1);\r
+                               resetPending();\r
+                       };\r
+\r
+                       function isMarker(node) {\r
+                               return node.face == marker || node.style.fontFamily == marker;\r
+                       };\r
+\r
+                       unbind();\r
+\r
+                       doc.execCommand('FontName', false, marker);\r
+\r
+                       // IE will convert the current word\r
+                       each(dom.select('font,span', selectedNode), function(node) {\r
+                               var bookmark;\r
+\r
+                               if (isMarker(node)) {\r
+                                       bookmark = selection.getBookmark();\r
+                                       perform(node);\r
+                                       selection.moveToBookmark(bookmark);\r
+                                       ed.nodeChanged();\r
+                                       selectedNode = 0;\r
+                               }\r
+                       });\r
+\r
+                       if (selectedNode) {\r
+                               caretHandler = function(ed, e) {\r
+                                       each(dom.select('font,span', selectedNode), function(node) {\r
+                                               var bookmark, textNode;\r
+\r
+                                               // Look for marker\r
+                                               if (node.face == marker || node.style.fontFamily == marker) {\r
+                                                       textNode = node.firstChild;\r
+\r
+                                                       perform(node);\r
+\r
+                                                       rng = dom.createRng();\r
+                                                       rng.setStart(textNode, textNode.nodeValue.length);\r
+                                                       rng.setEnd(textNode, textNode.nodeValue.length);\r
+                                                       selection.setRng(rng);\r
+                                                       ed.nodeChanged();\r
+\r
+                                                       unbind();\r
+                                               }\r
+                                       });\r
+\r
+                                       // Always unbind and clear pending styles on keyup\r
+                                       if (e.type == 'keyup') {\r
+                                               unbind();\r
+                                               resetPending();\r
+                                       }\r
+                               };\r
+\r
+                               each(events, function(event) {\r
+                                       ed[event].addToTop(caretHandler);\r
+                               });\r
+                       }\r
+               }\r
+       };\r
+})(tinymce);\r
+\r
+tinymce.onAddEditor.add(function(tinymce, ed) {\r
+       var filters, fontSizes, dom, settings = ed.settings;\r
+\r
+       if (settings.inline_styles) {\r
+               fontSizes = tinymce.explode(settings.font_size_style_values);\r
+\r
+               function replaceWithSpan(node, styles) {\r
+                       dom.replace(dom.create('span', {\r
+                               style : styles\r
+                       }), node, 1);\r
+               };\r
+\r
+               filters = {\r
+                       font : function(dom, node) {\r
+                               replaceWithSpan(node, {\r
+                                       backgroundColor : node.style.backgroundColor,\r
+                                       color : node.color,\r
+                                       fontFamily : node.face,\r
+                                       fontSize : fontSizes[parseInt(node.size) - 1]\r
+                               });\r
+                       },\r
+\r
+                       u : function(dom, node) {\r
+                               replaceWithSpan(node, {\r
+                                       textDecoration : 'underline'\r
+                               });\r
+                       },\r
+\r
+                       strike : function(dom, node) {\r
+                               replaceWithSpan(node, {\r
+                                       textDecoration : 'line-through'\r
+                               });\r
+                       }\r
+               };\r
+\r
+               function convert(editor, params) {\r
+                       dom = editor.dom;\r
+\r
+                       if (settings.convert_fonts_to_spans) {\r
+                               tinymce.each(dom.select('font,u,strike', params.node), function(node) {\r
+                                       filters[node.nodeName.toLowerCase()](ed.dom, node);\r
+                               });\r
+                       }\r
+               };\r
+\r
+               ed.onPreProcess.add(convert);\r
+\r
+               ed.onInit.add(function() {\r
+                       ed.selection.onSetContent.add(convert);\r
+               });\r
+       }\r
+});\r
+\r
diff --git a/docs/include/jscripts/tiny_mce/utils/editable_selects.js b/docs/include/jscripts/tiny_mce/utils/editable_selects.js
new file mode 100644 (file)
index 0000000..fd943c0
--- /dev/null
@@ -0,0 +1,70 @@
+/**\r
+ * editable_selects.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+var TinyMCE_EditableSelects = {\r
+       editSelectElm : null,\r
+\r
+       init : function() {\r
+               var nl = document.getElementsByTagName("select"), i, d = document, o;\r
+\r
+               for (i=0; i<nl.length; i++) {\r
+                       if (nl[i].className.indexOf('mceEditableSelect') != -1) {\r
+                               o = new Option('(value)', '__mce_add_custom__');\r
+\r
+                               o.className = 'mceAddSelectValue';\r
+\r
+                               nl[i].options[nl[i].options.length] = o;\r
+                               nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;\r
+                       }\r
+               }\r
+       },\r
+\r
+       onChangeEditableSelect : function(e) {\r
+               var d = document, ne, se = window.event ? window.event.srcElement : e.target;\r
+\r
+               if (se.options[se.selectedIndex].value == '__mce_add_custom__') {\r
+                       ne = d.createElement("input");\r
+                       ne.id = se.id + "_custom";\r
+                       ne.name = se.name + "_custom";\r
+                       ne.type = "text";\r
+\r
+                       ne.style.width = se.offsetWidth + 'px';\r
+                       se.parentNode.insertBefore(ne, se);\r
+                       se.style.display = 'none';\r
+                       ne.focus();\r
+                       ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;\r
+                       ne.onkeydown = TinyMCE_EditableSelects.onKeyDown;\r
+                       TinyMCE_EditableSelects.editSelectElm = se;\r
+               }\r
+       },\r
+\r
+       onBlurEditableSelectInput : function() {\r
+               var se = TinyMCE_EditableSelects.editSelectElm;\r
+\r
+               if (se) {\r
+                       if (se.previousSibling.value != '') {\r
+                               addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);\r
+                               selectByValue(document.forms[0], se.id, se.previousSibling.value);\r
+                       } else\r
+                               selectByValue(document.forms[0], se.id, '');\r
+\r
+                       se.style.display = 'inline';\r
+                       se.parentNode.removeChild(se.previousSibling);\r
+                       TinyMCE_EditableSelects.editSelectElm = null;\r
+               }\r
+       },\r
+\r
+       onKeyDown : function(e) {\r
+               e = e || window.event;\r
+\r
+               if (e.keyCode == 13)\r
+                       TinyMCE_EditableSelects.onBlurEditableSelectInput();\r
+       }\r
+};\r
diff --git a/docs/include/jscripts/tiny_mce/utils/form_utils.js b/docs/include/jscripts/tiny_mce/utils/form_utils.js
new file mode 100644 (file)
index 0000000..2617a26
--- /dev/null
@@ -0,0 +1,200 @@
+/**\r
+ * form_utils.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));\r
+\r
+function getColorPickerHTML(id, target_form_element) {\r
+       var h = "";\r
+\r
+       h += '<a id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';\r
+       h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;</span></a>';\r
+\r
+       return h;\r
+}\r
+\r
+function updateColor(img_id, form_element_id) {\r
+       document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;\r
+}\r
+\r
+function setBrowserDisabled(id, state) {\r
+       var img = document.getElementById(id);\r
+       var lnk = document.getElementById(id + "_link");\r
+\r
+       if (lnk) {\r
+               if (state) {\r
+                       lnk.setAttribute("realhref", lnk.getAttribute("href"));\r
+                       lnk.removeAttribute("href");\r
+                       tinyMCEPopup.dom.addClass(img, 'disabled');\r
+               } else {\r
+                       if (lnk.getAttribute("realhref"))\r
+                               lnk.setAttribute("href", lnk.getAttribute("realhref"));\r
+\r
+                       tinyMCEPopup.dom.removeClass(img, 'disabled');\r
+               }\r
+       }\r
+}\r
+\r
+function getBrowserHTML(id, target_form_element, type, prefix) {\r
+       var option = prefix + "_" + type + "_browser_callback", cb, html;\r
+\r
+       cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));\r
+\r
+       if (!cb)\r
+               return "";\r
+\r
+       html = "";\r
+       html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">';\r
+       html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;</span></a>';\r
+\r
+       return html;\r
+}\r
+\r
+function openBrowser(img_id, target_form_element, type, option) {\r
+       var img = document.getElementById(img_id);\r
+\r
+       if (img.className != "mceButtonDisabled")\r
+               tinyMCEPopup.openBrowser(target_form_element, type, option);\r
+}\r
+\r
+function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {\r
+       if (!form_obj || !form_obj.elements[field_name])\r
+               return;\r
+\r
+       var sel = form_obj.elements[field_name];\r
+\r
+       var found = false;\r
+       for (var i=0; i<sel.options.length; i++) {\r
+               var option = sel.options[i];\r
+\r
+               if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {\r
+                       option.selected = true;\r
+                       found = true;\r
+               } else\r
+                       option.selected = false;\r
+       }\r
+\r
+       if (!found && add_custom && value != '') {\r
+               var option = new Option(value, value);\r
+               option.selected = true;\r
+               sel.options[sel.options.length] = option;\r
+               sel.selectedIndex = sel.options.length - 1;\r
+       }\r
+\r
+       return found;\r
+}\r
+\r
+function getSelectValue(form_obj, field_name) {\r
+       var elm = form_obj.elements[field_name];\r
+\r
+       if (elm == null || elm.options == null || elm.selectedIndex === -1)\r
+               return "";\r
+\r
+       return elm.options[elm.selectedIndex].value;\r
+}\r
+\r
+function addSelectValue(form_obj, field_name, name, value) {\r
+       var s = form_obj.elements[field_name];\r
+       var o = new Option(name, value);\r
+       s.options[s.options.length] = o;\r
+}\r
+\r
+function addClassesToList(list_id, specific_option) {\r
+       // Setup class droplist\r
+       var styleSelectElm = document.getElementById(list_id);\r
+       var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);\r
+       styles = tinyMCEPopup.getParam(specific_option, styles);\r
+\r
+       if (styles) {\r
+               var stylesAr = styles.split(';');\r
+\r
+               for (var i=0; i<stylesAr.length; i++) {\r
+                       if (stylesAr != "") {\r
+                               var key, value;\r
+\r
+                               key = stylesAr[i].split('=')[0];\r
+                               value = stylesAr[i].split('=')[1];\r
+\r
+                               styleSelectElm.options[styleSelectElm.length] = new Option(key, value);\r
+                       }\r
+               }\r
+       } else {\r
+               tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {\r
+                       styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);\r
+               });\r
+       }\r
+}\r
+\r
+function isVisible(element_id) {\r
+       var elm = document.getElementById(element_id);\r
+\r
+       return elm && elm.style.display != "none";\r
+}\r
+\r
+function convertRGBToHex(col) {\r
+       var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");\r
+\r
+       var rgb = col.replace(re, "$1,$2,$3").split(',');\r
+       if (rgb.length == 3) {\r
+               r = parseInt(rgb[0]).toString(16);\r
+               g = parseInt(rgb[1]).toString(16);\r
+               b = parseInt(rgb[2]).toString(16);\r
+\r
+               r = r.length == 1 ? '0' + r : r;\r
+               g = g.length == 1 ? '0' + g : g;\r
+               b = b.length == 1 ? '0' + b : b;\r
+\r
+               return "#" + r + g + b;\r
+       }\r
+\r
+       return col;\r
+}\r
+\r
+function convertHexToRGB(col) {\r
+       if (col.indexOf('#') != -1) {\r
+               col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');\r
+\r
+               r = parseInt(col.substring(0, 2), 16);\r
+               g = parseInt(col.substring(2, 4), 16);\r
+               b = parseInt(col.substring(4, 6), 16);\r
+\r
+               return "rgb(" + r + "," + g + "," + b + ")";\r
+       }\r
+\r
+       return col;\r
+}\r
+\r
+function trimSize(size) {\r
+       return size.replace(/([0-9\.]+)px|(%|in|cm|mm|em|ex|pt|pc)/, '$1$2');\r
+}\r
+\r
+function getCSSSize(size) {\r
+       size = trimSize(size);\r
+\r
+       if (size == "")\r
+               return "";\r
+\r
+       // Add px\r
+       if (/^[0-9]+$/.test(size))\r
+               size += 'px';\r
+\r
+       return size;\r
+}\r
+\r
+function getStyle(elm, attrib, style) {\r
+       var val = tinyMCEPopup.dom.getAttrib(elm, attrib);\r
+\r
+       if (val != '')\r
+               return '' + val;\r
+\r
+       if (typeof(style) == 'undefined')\r
+               style = attrib;\r
+\r
+       return tinyMCEPopup.dom.getStyle(elm, style);\r
+}\r
diff --git a/docs/include/jscripts/tiny_mce/utils/mctabs.js b/docs/include/jscripts/tiny_mce/utils/mctabs.js
new file mode 100644 (file)
index 0000000..825d4c1
--- /dev/null
@@ -0,0 +1,77 @@
+/**\r
+ * mctabs.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+function MCTabs() {\r
+       this.settings = [];\r
+};\r
+\r
+MCTabs.prototype.init = function(settings) {\r
+       this.settings = settings;\r
+};\r
+\r
+MCTabs.prototype.getParam = function(name, default_value) {\r
+       var value = null;\r
+\r
+       value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];\r
+\r
+       // Fix bool values\r
+       if (value == "true" || value == "false")\r
+               return (value == "true");\r
+\r
+       return value;\r
+};\r
+\r
+MCTabs.prototype.displayTab = function(tab_id, panel_id) {\r
+       var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i;\r
+\r
+       panelElm= document.getElementById(panel_id);\r
+       panelContainerElm = panelElm ? panelElm.parentNode : null;\r
+       tabElm = document.getElementById(tab_id);\r
+       tabContainerElm = tabElm ? tabElm.parentNode : null;\r
+       selectionClass = this.getParam('selection_class', 'current');\r
+\r
+       if (tabElm && tabContainerElm) {\r
+               nodes = tabContainerElm.childNodes;\r
+\r
+               // Hide all other tabs\r
+               for (i = 0; i < nodes.length; i++) {\r
+                       if (nodes[i].nodeName == "LI")\r
+                               nodes[i].className = '';\r
+               }\r
+\r
+               // Show selected tab\r
+               tabElm.className = 'current';\r
+       }\r
+\r
+       if (panelElm && panelContainerElm) {\r
+               nodes = panelContainerElm.childNodes;\r
+\r
+               // Hide all other panels\r
+               for (i = 0; i < nodes.length; i++) {\r
+                       if (nodes[i].nodeName == "DIV")\r
+                               nodes[i].className = 'panel';\r
+               }\r
+\r
+               // Show selected panel\r
+               panelElm.className = 'current';\r
+       }\r
+};\r
+\r
+MCTabs.prototype.getAnchor = function() {\r
+       var pos, url = document.location.href;\r
+\r
+       if ((pos = url.lastIndexOf('#')) != -1)\r
+               return url.substring(pos + 1);\r
+\r
+       return "";\r
+};\r
+\r
+// Global instance\r
+var mcTabs = new MCTabs();\r
diff --git a/docs/include/jscripts/tiny_mce/utils/validate.js b/docs/include/jscripts/tiny_mce/utils/validate.js
new file mode 100644 (file)
index 0000000..a6fcf97
--- /dev/null
@@ -0,0 +1,220 @@
+/**\r
+ * validate.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+/**\r
+       // String validation:\r
+\r
+       if (!Validator.isEmail('myemail'))\r
+               alert('Invalid email.');\r
+\r
+       // Form validation:\r
+\r
+       var f = document.forms['myform'];\r
+\r
+       if (!Validator.isEmail(f.myemail))\r
+               alert('Invalid email.');\r
+*/\r
+\r
+var Validator = {\r
+       isEmail : function(s) {\r
+               return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');\r
+       },\r
+\r
+       isAbsUrl : function(s) {\r
+               return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');\r
+       },\r
+\r
+       isSize : function(s) {\r
+               return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$');\r
+       },\r
+\r
+       isId : function(s) {\r
+               return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');\r
+       },\r
+\r
+       isEmpty : function(s) {\r
+               var nl, i;\r
+\r
+               if (s.nodeName == 'SELECT' && s.selectedIndex < 1)\r
+                       return true;\r
+\r
+               if (s.type == 'checkbox' && !s.checked)\r
+                       return true;\r
+\r
+               if (s.type == 'radio') {\r
+                       for (i=0, nl = s.form.elements; i<nl.length; i++) {\r
+                               if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)\r
+                                       return false;\r
+                       }\r
+\r
+                       return true;\r
+               }\r
+\r
+               return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);\r
+       },\r
+\r
+       isNumber : function(s, d) {\r
+               return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));\r
+       },\r
+\r
+       test : function(s, p) {\r
+               s = s.nodeType == 1 ? s.value : s;\r
+\r
+               return s == '' || new RegExp(p).test(s);\r
+       }\r
+};\r
+\r
+var AutoValidator = {\r
+       settings : {\r
+               id_cls : 'id',\r
+               int_cls : 'int',\r
+               url_cls : 'url',\r
+               number_cls : 'number',\r
+               email_cls : 'email',\r
+               size_cls : 'size',\r
+               required_cls : 'required',\r
+               invalid_cls : 'invalid',\r
+               min_cls : 'min',\r
+               max_cls : 'max'\r
+       },\r
+\r
+       init : function(s) {\r
+               var n;\r
+\r
+               for (n in s)\r
+                       this.settings[n] = s[n];\r
+       },\r
+\r
+       validate : function(f) {\r
+               var i, nl, s = this.settings, c = 0;\r
+\r
+               nl = this.tags(f, 'label');\r
+               for (i=0; i<nl.length; i++)\r
+                       this.removeClass(nl[i], s.invalid_cls);\r
+\r
+               c += this.validateElms(f, 'input');\r
+               c += this.validateElms(f, 'select');\r
+               c += this.validateElms(f, 'textarea');\r
+\r
+               return c == 3;\r
+       },\r
+\r
+       invalidate : function(n) {\r
+               this.mark(n.form, n);\r
+       },\r
+\r
+       reset : function(e) {\r
+               var t = ['label', 'input', 'select', 'textarea'];\r
+               var i, j, nl, s = this.settings;\r
+\r
+               if (e == null)\r
+                       return;\r
+\r
+               for (i=0; i<t.length; i++) {\r
+                       nl = this.tags(e.form ? e.form : e, t[i]);\r
+                       for (j=0; j<nl.length; j++)\r
+                               this.removeClass(nl[j], s.invalid_cls);\r
+               }\r
+       },\r
+\r
+       validateElms : function(f, e) {\r
+               var nl, i, n, s = this.settings, st = true, va = Validator, v;\r
+\r
+               nl = this.tags(f, e);\r
+               for (i=0; i<nl.length; i++) {\r
+                       n = nl[i];\r
+\r
+                       this.removeClass(n, s.invalid_cls);\r
+\r
+                       if (this.hasClass(n, s.required_cls) && va.isEmpty(n))\r
+                               st = this.mark(f, n);\r
+\r
+                       if (this.hasClass(n, s.number_cls) && !va.isNumber(n))\r
+                               st = this.mark(f, n);\r
+\r
+                       if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))\r
+                               st = this.mark(f, n);\r
+\r
+                       if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))\r
+                               st = this.mark(f, n);\r
+\r
+                       if (this.hasClass(n, s.email_cls) && !va.isEmail(n))\r
+                               st = this.mark(f, n);\r
+\r
+                       if (this.hasClass(n, s.size_cls) && !va.isSize(n))\r
+                               st = this.mark(f, n);\r
+\r
+                       if (this.hasClass(n, s.id_cls) && !va.isId(n))\r
+                               st = this.mark(f, n);\r
+\r
+                       if (this.hasClass(n, s.min_cls, true)) {\r
+                               v = this.getNum(n, s.min_cls);\r
+\r
+                               if (isNaN(v) || parseInt(n.value) < parseInt(v))\r
+                                       st = this.mark(f, n);\r
+                       }\r
+\r
+                       if (this.hasClass(n, s.max_cls, true)) {\r
+                               v = this.getNum(n, s.max_cls);\r
+\r
+                               if (isNaN(v) || parseInt(n.value) > parseInt(v))\r
+                                       st = this.mark(f, n);\r
+                       }\r
+               }\r
+\r
+               return st;\r
+       },\r
+\r
+       hasClass : function(n, c, d) {\r
+               return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);\r
+       },\r
+\r
+       getNum : function(n, c) {\r
+               c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];\r
+               c = c.replace(/[^0-9]/g, '');\r
+\r
+               return c;\r
+       },\r
+\r
+       addClass : function(n, c, b) {\r
+               var o = this.removeClass(n, c);\r
+               n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;\r
+       },\r
+\r
+       removeClass : function(n, c) {\r
+               c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');\r
+               return n.className = c != ' ' ? c : '';\r
+       },\r
+\r
+       tags : function(f, s) {\r
+               return f.getElementsByTagName(s);\r
+       },\r
+\r
+       mark : function(f, n) {\r
+               var s = this.settings;\r
+\r
+               this.addClass(n, s.invalid_cls);\r
+               this.markLabels(f, n, s.invalid_cls);\r
+\r
+               return false;\r
+       },\r
+\r
+       markLabels : function(f, n, ic) {\r
+               var nl, i;\r
+\r
+               nl = this.tags(f, "label");\r
+               for (i=0; i<nl.length; i++) {\r
+                       if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)\r
+                               this.addClass(nl[i], ic);\r
+               }\r
+\r
+               return null;\r
+       }\r
+};\r
index 099b70f..a47c1cd 100644 (file)
@@ -112,6 +112,27 @@ function toggleToc(objId) {
        setcookie(objId, hidelink.style.display, 1);\r
 }\r
 \r
+// toggle a div, for example "create user group" => "add privileges" section\r
+function toggleDiv(objId) {\r
+       var toc = document.getElementById(objId);\r
+       if (toc == null) return;\r
+\r
+       if (toc.style.display == 'none')\r
+       {\r
+               toc.style.display = '';\r
+               document.getElementById("toggle_image").src = "images/arrow-open.png";\r
+               document.getElementById("toggle_image").alt = "Collapse";\r
+               document.getElementById("toggle_image").title = "Collapse";\r
+       }\r
+       else\r
+       {\r
+               toc.style.display = 'none';\r
+               document.getElementById("toggle_image").src = "images/arrow-closed.png";\r
+               document.getElementById("toggle_image").alt = "Expand";\r
+               document.getElementById("toggle_image").title = "Expand";\r
+       }\r
+}\r
+\r
 // toggle content folder in side menu "content navigation"\r
 function toggleFolder(cid, expand_text, collapse_text)\r
 {\r
diff --git a/docs/include/lib/html_resource_parser.inc.php b/docs/include/lib/html_resource_parser.inc.php
new file mode 100644 (file)
index 0000000..1ef230b
--- /dev/null
@@ -0,0 +1,110 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+function get_html_resources($text) {
+       global $_course_id;
+       
+       $resources = array();
+
+       $handler = new XML_HTMLSax_Handler();
+
+       $parser = new XML_HTMLSax();
+       $parser->set_object($handler);
+       $parser->set_element_handler('openHandler','closeHandler');
+
+       $parser->parse($text);
+
+       foreach ($handler->resources as $resource) {
+               $url_parts = @parse_url($resource);
+
+               if (isset($url_parts['scheme'])) {
+                       // we don't want full urls
+                       continue;
+               }
+
+               if ((substr($resource, 0, 1) == '/')) {
+                       // we don't want absolute urls
+                       continue;
+               }
+
+               // make sure this resource exists in this course's content directory:
+               $resource_server_path = realpath(TR_CONTENT_DIR . $_course_id. '/' . $resource);
+               if (file_exists($resource_server_path) && is_file($resource_server_path)) {
+                       $resources[$resource] = $resource_server_path;
+               }
+       }
+
+       return $resources;
+}
+
+/*
+       the following resources are to be identified:
+       even if some of these can't be images, they can still be files in the content dir.
+       theoretically the only urls we wouldn't deal with would be for a <!DOCTYPE and <form>
+
+       img             => src
+       a               => href                         // ignore if href doesn't exist (ie. <a name>)
+       object  => data | classid       // probably only want data
+       applet  => classid | archive                    // whatever these two are should double check to see if it's a valid file (not a dir)
+       link    => href
+       script  => src
+       form    => action
+       input   => src
+       iframe  => src
+*/
+class XML_HTMLSax_Handler {
+       var $elements = array(  'img'    => 'src',
+                                                       'a'              => 'href',                             
+                                                       'object' =>  array('data',    'classid'),
+                                                       'applet' =>  array('classid', 'archive'),
+                                                       'link'   => 'href',
+                                                       'script' => 'src',
+                                                       'form'   => 'action',
+                                                       'input'  => 'src',
+                                                       'iframe' => 'src',
+                                                       'embed'  => 'src',
+                                                       'param'  => 'value');
+       var $resources = array();
+
+    function XML_HTMLSax_Handler() { 
+               $this->resources = array();
+       }
+
+    function openHandler(& $parser,$name,$attrs) {
+               $name = strtolower($name);
+               $attrs = array_change_key_case($attrs, CASE_LOWER);
+
+               /* check if this attribute specifies the files in different ways: (ie. java) */
+               if (is_array($this->elements[$name])) {
+                       $items = $this->elements[$name];
+
+                       foreach ($items as $item) {
+                               if ($attrs[$item] != '') {
+                                       /* some attributes allow a listing of files to include seperated by commas (ie. applet->archive). */
+                                       if (strpos($attrs[$item], ',') !== false) {
+                                               $files = explode(',', $attrs[$item]);
+                                               foreach ($files as $file) {
+                                                       $this->resources[] = trim($file);
+                                               }
+                                       } else {
+                                               $this->resources[] = $attrs[$item];
+                                       }
+                               }
+                       }
+               } else if (isset($this->elements[$name]) && ($attrs[$this->elements[$name]] != '')) {
+                       /* we know exactly which attribute contains the reference to the file. */
+                       $this->resources[] = $attrs[$this->elements[$name]];
+               }
+    }
+    function closeHandler(& $parser,$name) { }
+}
+?>
\ No newline at end of file
index e4760d4..3b54b05 100644 (file)
@@ -302,10 +302,10 @@ function AT_date($format='%Y-%M-%d', $timestamp = '', $formTR_type=TR_DATE_MYSQL
        /**
        *       Transforms text based on formatting preferences.  Original $input is also changed (passed by reference).
        *       Can be called as:
-       *       1) $output = TR_print($input, $name);
+       *       1) $output = AT_print($input, $name);
        *          echo $output;
        *
-       *       2) echo TR_print($input, $name); // prefered method
+       *       2) echo AT_print($input, $name); // prefered method
        *
        * @access       public
        * @param        string $input                   text being transformed
@@ -317,7 +317,7 @@ function AT_date($format='%Y-%M-%d', $timestamp = '', $formTR_type=TR_DATE_MYSQL
        * @see          query_bit()                             in include/vitals.inc.php
        * @author       Joel Kronenberg
        */
-       function TR_print($input, $name, $runtime_html = true) {
+       function AT_print($input, $name, $runtime_html = true) {
                global $_field_formatting;
 
                if (!isset($_field_formatting[$name])) {
diff --git a/docs/include/lib/tinymce.inc.php b/docs/include/lib/tinymce.inc.php
new file mode 100644 (file)
index 0000000..04e29cb
--- /dev/null
@@ -0,0 +1,123 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+if (!defined('TR_INCLUDE_PATH')) { exit; }
+
+function load_editor($simple = TRUE, $name = FALSE, $mode="textareas") {
+       global $_base_path, $content_base_href;
+
+        if (defined('TR_FORCE_GET_FILE') && TR_FORCE_GET_FILE) { 
+               $course_base_href = 'get.php/'; 
+       } else {  
+               $course_base_href = 'content/' . $_SESSION['course_id'] . '/'; 
+       }
+
+// Note: Some tinymce buttons are removed due to lack of accessibility for disabled.
+// They are:
+//New Document: newdocument
+//Insert Time: inserttime
+//Insert Date: insertdate
+//Preview: preview
+//toggle guidelines: visualaid
+//spellcheck: iespell
+//embed media: media
+//print: print
+//Insert Layer: insertlayer
+//move forward: moveforward
+//move backward: movebackward
+//toggle absolute positioning: absolute
+//citation: cite
+//deletion: del
+//insertion: ins
+//visual control characters on/off: visualchars
+//insert non-breaking space character: nonbreaking
+//insert predefined template: template
+//insert page break: pagebreak
+
+echo '<script language="javascript" type="text/javascript" src="'.TR_BASE_HREF.'include/jscripts/tiny_mce/tiny_mce.js"></script>
+<script language="javascript" type="text/javascript">';
+
+echo 'var ATutor = ATutor || {};
+      ATutor.tinymce = ATutor.tinymce || {};
+
+      (function () {
+';
+
+echo 'tinymce.PluginManager.load("insert_tag", "'.TR_BASE_HREF.'include/jscripts/ATutor_tiny_mce_plugins/insert_tag/editor_plugin.js");
+';
+echo 'tinymce.PluginManager.load("swap_toolbar", "'.TR_BASE_HREF.'include/jscripts/ATutor_tiny_mce_plugins/swap_toolbar/editor_plugin.js");
+';
+
+echo 'var initSettings = {';
+    if ($name) {
+        echo '  mode : "exact",';
+        echo '  elements : "'.$name.'",';
+    } else {
+        echo '  mode : "'.$mode.'",';
+    }   
+echo 'theme: "advanced",
+      relative_urls : true,
+      content_css :"'.$_base_path.'/include/lib/tinymce_styles.css",
+      convert_urls : true,
+      accessibility_warnings : true,
+      entity_encoding : "raw",
+      accessibility_focus : true,
+      plugins : "-insert_tag, -swap_toolbar, acheck, table,safari,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",
+      theme_advanced_toolbar_location : "top",
+      theme_advanced_toolbar_align : "left",
+      theme_advanced_path_location : "bottom",
+      theme_advanced_resizing : true,
+      remove_linebreaks: false,
+      plugin_insertdate_dateFormat : "%Y-%m-%d",
+      plugin_insertdate_timeFormat : "%H:%M:%S",
+      extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
+      document_base_url: "'.TR_BASE_HREF.$course_base_href.$content_base_href.'"
+    };
+
+    //these are the simple tools used on the content editor page
+    var simpleToolBars = {
+        theme_advanced_buttons1 : "swap_toolbar_complex,|,bold,italic,underline,|,justifyleft,justifycenter,justifyright,|,formatselect,fontselect,fontsizeselect,|,forecolor,backcolor,|,pasteword,link,unlink,|,acheck",
+        theme_advanced_buttons2 : "",
+        theme_advanced_buttons3 : "",
+        theme_advanced_buttons4 : ""
+    };
+    
+    //these are the more complex tools used on the content editor page
+    var complexToolBars = {
+        theme_advanced_buttons1 : "swap_toolbar_simple,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
+        theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,ltr,rtl,blockquote,|,forecolor,backcolor,|,sub,sup,|,tablecontrols",
+        theme_advanced_buttons3 : "cut,copy,paste,pastetext,pasteword,|,link,unlink,anchor,image,|,abbr,acronym,|,charmap,emotions,advhr,|,insert_term_tag, insert_media_tag, insert_tex_tag",
+        theme_advanced_buttons4 : "search,replace,|,removeformat,undo,redo,|,styleprops,attribs,|,acheck,|,cleanup,code,|,fullscreen ",
+    };
+
+    ATutor.tinymce.initSimple = function() {
+        tinyMCE.init(jQuery.extend({}, initSettings, simpleToolBars));
+    };
+      
+    ATutor.tinymce.initComplex = function() {
+        tinyMCE.init(jQuery.extend({}, initSettings, complexToolBars));
+    };
+';
+    
+    if ($simple) {
+      echo 'ATutor.tinymce.initSimple();
+      ';
+    } else {
+      echo 'ATutor.tinymce.initComplex();
+      ';
+    }
+echo '})();
+';
+echo '</script>';
+}
+
+?>
\ No newline at end of file
index 43adff4..04a987a 100644 (file)
@@ -18,7 +18,9 @@ define('TR_PRIV_USER_MANAGEMENT', 3);
 define('TR_PRIV_LANGUAGE_MANAGEMENT', 4);\r
 define('TR_PRIV_TRANSLATION', 5);\r
 define('TR_PRIV_UPDATER', 6);\r
-define('TR_PRIV_PROFILE', 7);\r
+define('TR_PRIV_MANAGE_TESTS', 7);\r
+define('TR_PRIV_MY_TESTS', 8);\r
+define('TR_PRIV_PROFILE', 9);\r
 \r
 /* constants used for menu item generation. Used in class Menu (include/classes/Menu.class.php) */\r
 define('TR_NAV_PUBLIC', 'TR_NAV_PUBLIC');  // public menus, when no user login\r
@@ -26,6 +28,7 @@ define('TR_NAV_TOP', 'TR_NAV_TOP');        // top tab menus
 \r
 global $_current_user;\r
 \r
+include_once('classes/Utility.class.php');\r
 include_once('classes/DAO/PrivilegesDAO.class.php');\r
 $priviledgesDAO = new PrivilegesDAO();\r
 \r
@@ -39,7 +42,7 @@ else
 }\r
 \r
 foreach ($rows as $row)\r
-       $privs[] = $row['privilege_id'];\r
+       $privs[$row['privilege_id']] = $row['user_requirement'];\r
 \r
 /* initialize pages accessed by public */\r
 //$_pages[TR_NAV_PUBLIC] = array('index.php' => array('parent'=>TR_NAV_PUBLIC));\r
@@ -76,7 +79,7 @@ $_pages['documentation/web_service_api.php']['title_var'] = 'web_service_api';
 $_pages['documentation/oauth_server_api.php']['title_var'] = 'oauth_server_api';\r
 \r
 // home pages\r
-if (in_array(TR_PRIV_HOME, $privs))\r
+if (array_key_exists(TR_PRIV_HOME, $privs) && Utility::authenticate($privs[TR_PRIV_HOME]))\r
 {\r
        $_pages['home/index.php']['title_var'] = 'home';\r
        $_pages['home/index.php']['parent']    = TR_NAV_PUBLIC;\r
@@ -107,7 +110,7 @@ if (in_array(TR_PRIV_HOME, $privs))
 }\r
 \r
 // system pages\r
-if (in_array(TR_PRIV_SYSTEM, $privs))\r
+if (array_key_exists(TR_PRIV_SYSTEM, $privs) && Utility::authenticate($privs[TR_PRIV_SYSTEM], false))\r
 {\r
        $_pages['system/index.php']['title_var'] = 'system';\r
        $_pages['system/index.php']['parent']    = TR_NAV_PUBLIC;\r
@@ -115,7 +118,7 @@ if (in_array(TR_PRIV_SYSTEM, $privs))
 }\r
 \r
 // user pages\r
-if (in_array(TR_PRIV_USER_MANAGEMENT, $privs))\r
+if (array_key_exists(TR_PRIV_USER_MANAGEMENT, $privs) && Utility::authenticate($privs[TR_PRIV_USER_MANAGEMENT], false))\r
 {\r
        $_pages['user/index.php']['title_var'] = 'users';\r
        $_pages['user/index.php']['parent']    = TR_NAV_TOP;\r
@@ -150,7 +153,7 @@ if (in_array(TR_PRIV_USER_MANAGEMENT, $privs))
 }\r
 \r
 // language pages\r
-if (in_array(TR_PRIV_LANGUAGE_MANAGEMENT, $privs))\r
+if (array_key_exists(TR_PRIV_LANGUAGE_MANAGEMENT, $privs) && Utility::authenticate($privs[TR_PRIV_LANGUAGE_MANAGEMENT], false))\r
 {\r
        $_pages['language/index.php']['title_var'] = 'language';\r
        $_pages['language/index.php']['parent']    = TR_NAV_TOP;\r
@@ -167,7 +170,7 @@ if (in_array(TR_PRIV_LANGUAGE_MANAGEMENT, $privs))
 }\r
 \r
 // translation\r
-if (in_array(TR_PRIV_TRANSLATION, $privs))\r
+if (array_key_exists(TR_PRIV_TRANSLATION, $privs) && Utility::authenticate($privs[TR_PRIV_TRANSLATION], false))\r
 {\r
        $_pages['translation/index.php']['title_var'] = 'translation';\r
        $_pages['translation/index.php']['parent']    = TR_NAV_TOP;\r
@@ -175,7 +178,7 @@ if (in_array(TR_PRIV_TRANSLATION, $privs))
 }\r
 \r
 // profile pages\r
-if (in_array(TR_PRIV_PROFILE, $privs))\r
+if (array_key_exists(TR_PRIV_PROFILE, $privs) && Utility::authenticate($privs[TR_PRIV_PROFILE], false))\r
 {\r
        $_pages['profile/index.php']['title_var'] = 'profile';\r
        $_pages['profile/index.php']['parent']    = TR_NAV_TOP;\r
@@ -194,7 +197,7 @@ if (in_array(TR_PRIV_PROFILE, $privs))
 }\r
 \r
 // updater pages\r
-if (in_array(TR_PRIV_UPDATER, $privs))\r
+if (array_key_exists(TR_PRIV_UPDATER, $privs) && Utility::authenticate($privs[TR_PRIV_UPDATER], false))\r
 {\r
        $_pages['updater/index.php']['title_var'] = 'updater';\r
        $_pages['updater/index.php']['parent']    = TR_NAV_TOP;\r
@@ -217,4 +220,135 @@ if (in_array(TR_PRIV_UPDATER, $privs))
        $_pages['updater/patch_delete.php']['title_var'] = 'delete_update';\r
        $_pages['updater/patch_delete.php']['parent']    = 'updater/index.php';\r
 }\r
+\r
+// "manage tests" & "my tests" pages\r
+if (array_key_exists(TR_PRIV_MY_TESTS, $privs) && Utility::authenticate($privs[TR_PRIV_MY_TESTS], false))\r
+{\r
+       $_pages['tests/take_test.php']['title_var'] = 'take_test';\r
+       $_pages['tests/take_test.php']['parent']    = 'tests/my_tests.php';\r
+       \r
+       $_pages['tests/take_test_q.php']['title_var'] = 'take_test';\r
+       $_pages['tests/take_test_q.php']['parent']    = 'tests/my_tests.php';\r
+       \r
+       $_pages['tests/test_intro.php']['title_var'] = 'take_test';\r
+       $_pages['tests/test_intro.php']['parent']    = 'tests/my_tests.php';\r
+\r
+       //student page\r
+       $_pages['tests/my_tests.php']['title_var'] = 'my_tests';\r
+       $_pages['tests/my_tests.php']['img']       = 'images/home-tests.png';\r
+       $_pages['tests/my_tests.php']['icon']       = 'images/home-tests_sm.png';       \r
+       \r
+       $_pages['tests/view_results.php']['title_var'] = 'view_results';\r
+       $_pages['tests/view_results.php']['parent']    = 'tests/my_tests.php';\r
+       $_pages['tests/view_results.php']['children']  = array(); // to create the "back to tests" link\r
+}\r
+\r
+// manage tests\r
+if (array_key_exists(TR_PRIV_MANAGE_TESTS, $privs) && Utility::authenticate($privs[TR_PRIV_MANAGE_TESTS], false))\r
+{\r
+       $_pages['tests/index.php']['title_var'] = 'manage_tests';\r
+       $_pages['tests/index.php']['parent']    = TR_NAV_TOP;\r
+       $_pages['tests/index.php']['guide']     = 'TR_HELP_TESTS_SURVEYS';\r
+       $_pages['tests/index.php']['children']  = array('tests/create_test.php', 'tests/question_db.php', 'tests/question_cats.php');\r
+       \r
+       $_pages['tests/create_test.php']['title_var'] = 'create_test';\r
+       $_pages['tests/create_test.php']['parent']    = 'tests/index.php';\r
+       $_pages['tests/create_test.php']['guide']     = 'TR_HELP_CREATE_TEST';\r
+       \r
+       $_pages['tests/import_test.php']['title_var'] = 'import_test';\r
+       $_pages['tests/import_test.php']['parent']    = 'tests/index.php';\r
+       \r
+       $_pages['tests/question_import.php']['title_var'] = 'import_question';\r
+       $_pages['tests/question_import.php']['parent']    = 'tests/index.php';\r
+       \r
+       $_pages['tests/question_db.php']['title_var'] = 'question_database';\r
+       $_pages['tests/question_db.php']['parent']    = 'tests/index.php';\r
+       $_pages['tests/question_db.php']['guide']     = 'TR_HELP_QUESTION_DB';\r
+       \r
+       $_pages['tests/question_cats.php']['title_var'] = 'question_categories';\r
+       $_pages['tests/question_cats.php']['parent']    = 'tests/index.php';\r
+       $_pages['tests/question_cats.php']['children']  = array('tests/question_cats_manage.php');\r
+       $_pages['tests/question_cats.php']['guide']     = 'TR_HELP_QUESTION_CATEGORIES';\r
+       \r
+       $_pages['tests/question_cats_manage.php']['title_var'] = 'create_category';\r
+       $_pages['tests/question_cats_manage.php']['parent']    = 'tests/question_cats.php';\r
+       \r
+       $_pages['tests/question_cats_delete.php']['title_var'] = 'delete_category';\r
+       $_pages['tests/question_cats_delete.php']['parent']    = 'tests/question_cats.php';\r
+       \r
+       $_pages['tests/edit_test.php']['title_var'] = 'edit_test';\r
+       $_pages['tests/edit_test.php']['parent']    = 'tests/index.php';\r
+       $_pages['tests/edit_test.php']['guide']     = 'TR_HELP_CREATE_TEST';\r
+       \r
+       $_pages['tests/preview.php']['title_var'] = 'preview_questions';\r
+       $_pages['tests/preview.php']['parent']    = 'tests/index.php';\r
+       $_pages['tests/preview.php']['guide']     = 'TR_HELP_PREVIEW';\r
+       \r
+       $_pages['tests/preview_question.php']['title_var'] = 'preview';\r
+       $_pages['tests/preview_question.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/results.php']['title_var'] = 'submissions';\r
+       $_pages['tests/results.php']['parent']    = 'tests/index.php';\r
+       \r
+       $_pages['tests/results_all.php']['guide'] = 'TR_HELP_STUDENT_SUBMISSIONS';\r
+       \r
+       //$_pages['tests/results_all_quest.php']['title_var']  =  _AT('question')." "._AT('statistics');\r
+       //$_pages['tests/results_all_quest.php']['parent'] = 'tests/index.php';\r
+       $_pages['tests/results_all_quest.php']['guide']     = 'TR_HELP_TEST_STATISTICS';\r
+       \r
+       $_pages['tests/delete_test.php']['title_var'] = 'delete_test';\r
+       $_pages['tests/delete_test.php']['parent']    = 'tests/index.php';\r
+       \r
+       // test questions\r
+       $_pages['tests/create_question_truefalse.php']['title_var'] = 'create_new_question';\r
+       $_pages['tests/create_question_truefalse.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/create_question_multichoice.php']['title_var'] = 'create_new_question';\r
+       $_pages['tests/create_question_multichoice.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/create_question_multianswer.php']['title_var'] = 'create_new_question';\r
+       $_pages['tests/create_question_multianswer.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/create_question_long.php']['title_var'] = 'create_new_question';\r
+       $_pages['tests/create_question_long.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/create_question_likert.php']['title_var'] = 'create_new_question';\r
+       $_pages['tests/create_question_likert.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/create_question_matching.php']['title_var'] = 'create_new_question';\r
+       $_pages['tests/create_question_matching.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/create_question_matchingdd.php']['title_var'] = 'create_new_question';\r
+       $_pages['tests/create_question_matchingdd.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/create_question_ordering.php']['title_var'] = 'create_new_question';\r
+       $_pages['tests/create_question_ordering.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/edit_question_truefalse.php']['title_var'] = 'edit_question';\r
+       $_pages['tests/edit_question_truefalse.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/edit_question_multichoice.php']['title_var'] = 'edit_question';\r
+       $_pages['tests/edit_question_multichoice.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/edit_question_multianswer.php']['title_var'] = 'edit_question';\r
+       $_pages['tests/edit_question_multianswer.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/edit_question_long.php']['title_var'] = 'edit_question';\r
+       $_pages['tests/edit_question_long.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/edit_question_likert.php']['title_var'] = 'edit_question';\r
+       $_pages['tests/edit_question_likert.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/edit_question_matching.php']['title_var'] = 'edit_question';\r
+       $_pages['tests/edit_question_matching.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/edit_question_matchingdd.php']['title_var'] = 'edit_question';\r
+       $_pages['tests/edit_question_matchingdd.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/edit_question_ordering.php']['title_var'] = 'edit_question';\r
+       $_pages['tests/edit_question_ordering.php']['parent']    = 'tests/question_db.php';\r
+       \r
+       $_pages['tests/delete_question.php']['title_var'] = 'delete';\r
+       $_pages['tests/delete_question.php']['parent'] = 'tests/question_db.php';\r
+}\r
 ?>
\ No newline at end of file
index a4404c7..a8c731a 100644 (file)
@@ -198,10 +198,7 @@ if (isset($_SESSION['user_id']) && $_SESSION['user_id'] > 0)
 }
 /***** end of initialize user instance *****/
 
-/*** 9. register pages based on user's priviledge ***/
-require_once(TR_INCLUDE_PATH.'page_constants.inc.php');
-
-/* 10. initialize course information if $course_id or $cid is set 
+/* 9. initialize course information if $course_id or $cid is set 
  * This section generates global variables: 
  * $_content_id if set, 
  * $_course_id if set or $cid is set
@@ -262,6 +259,9 @@ if ($_course_id > 0)
        $_sequence_links = $contentManager->generateSequenceCrumbs($_content_id);
 }
 
+/*** 10. register pages based on user's priviledge ***/
+require_once(TR_INCLUDE_PATH.'page_constants.inc.php');
+
 /**
  * This function is used for printing variables for debugging.
  * @access  public
index 5d1161d..b67d3e5 100644 (file)
@@ -285,58 +285,11 @@ CREATE TABLE `tests` (
   `test_id` mediumint(8) unsigned NOT NULL auto_increment,\r
   `course_id` mediumint(8) unsigned NOT NULL default '0',\r
   `title` VARCHAR(255) NOT NULL ,\r
-  `format` tinyint(4) NOT NULL default '0',\r
-  `start_date` datetime NOT NULL default '0000-00-00 00:00:00',\r
-  `end_date` datetime NOT NULL default '0000-00-00 00:00:00',\r
-  `randomize_order` tinyint(4) NOT NULL default '0',\r
-  `num_questions` tinyint(3) unsigned NOT NULL default '0',\r
-  `instructions` TEXT ,\r
-  `content_id` mediumint(8) NOT NULL default '0',\r
-  `result_release` tinyint(4) unsigned NOT NULL default '0',\r
-  `random` tinyint(4) unsigned NOT NULL default '0',\r
-  `difficulty` tinyint(4) unsigned NOT NULL default '0',\r
-  `num_takes` tinyint(4) unsigned NOT NULL default '0',\r
-  `anonymous` tinyint(4) NOT NULL default '0',\r
-  `out_of` varchar(4) NOT NULL default '',\r
-  `guests` TINYINT NOT NULL DEFAULT '0',\r
-  `display` TINYINT NOT NULL DEFAULT '0',\r
   `description` TEXT,\r
-  `passscore` MEDIUMINT NOT NULL default '0',\r
-  `passpercent` MEDIUMINT NOT NULL default '0',\r
-  `passfeedback` TEXT,\r
-  `failfeedback` TEXT,\r
-  `show_guest_form` TINYINT(1) UNSIGNED NOT NULL default '0',\r
   PRIMARY KEY  (`test_id`)\r
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;\r
 \r
 \r
-# --------------------------------------------------------\r
-# Table structure for table `tests_answers`\r
-# since 0.1\r
-\r
-CREATE TABLE `tests_answers` (\r
-  `result_id` mediumint(8) unsigned NOT NULL default '0',\r
-  `question_id` mediumint(8) unsigned NOT NULL default '0',\r
-  `member_id` mediumint(8) unsigned NOT NULL default '0',\r
-  `answer` TEXT ,\r
-  `score` varchar(5) NOT NULL default '',\r
-  `notes` TEXT ,\r
-  PRIMARY KEY  (`result_id`,`question_id`,`member_id`)\r
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;\r
-\r
-\r
-# --------------------------------------------------------\r
-# Table structure for table `tests_groups`\r
-# since 0.1\r
-\r
-CREATE TABLE `tests_groups` (\r
-  `test_id` MEDIUMINT UNSIGNED NOT NULL default '0',\r
-  `group_id` MEDIUMINT UNSIGNED NOT NULL default '0',\r
-  PRIMARY KEY (`test_id`,`group_id`),\r
-  KEY `test_id` (`test_id`)\r
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;\r
-\r
-\r
 # --------------------------------------------------------\r
 # Table structure for table `tests_questions`\r
 # since 0.1\r
@@ -409,23 +362,6 @@ CREATE TABLE `tests_questions_categories` (
   KEY `course_id` (`course_id`)\r
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;\r
 \r
-# --------------------------------------------------------\r
-# Table structure for table `tests_results`\r
-# since 0.1\r
-\r
-CREATE TABLE `tests_results` (\r
-  `result_id` mediumint(8) unsigned NOT NULL auto_increment,\r
-  `test_id` mediumint(8) unsigned NOT NULL default '0',\r
-  `member_id` VARCHAR(10) NOT NULL default '',\r
-  `date_taken` TIMESTAMP NOT NULL,\r
-  `final_score` char(5) NOT NULL default '',\r
-  `status` TINYINT NOT NULL DEFAULT '0',\r
-  `end_time` TIMESTAMP NOT NULL ,\r
-  `max_pos` TINYINT UNSIGNED NOT NULL DEFAULT '0',\r
-  PRIMARY KEY  (`result_id`),\r
-  KEY `test_id` (`test_id`)\r
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;\r
-\r
 # --------------------------------------------------------\r
 # Table structure for table `themes`\r
 # since 0.1\r
@@ -456,6 +392,14 @@ CREATE TABLE `users` (
   `create_date` datetime NOT NULL,\r
   `last_login` datetime,\r
   `preferences` text,\r
+  `is_author` tinyint(3) NOT NULL default '0',\r
+  `organization` varchar(100),\r
+  `phone` varchar(30),\r
+  `address` varchar(100),\r
+  `city` varchar(100),\r
+  `province` varchar(100),\r
+  `country` varchar(30),\r
+  `postal_code` varchar(10),\r
   PRIMARY KEY  (`user_id`)\r
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;\r
 \r
@@ -491,6 +435,7 @@ CREATE TABLE `user_groups` (
 CREATE TABLE `user_group_privilege` (\r
   `user_group_id` mediumint(8) unsigned NOT NULL,\r
   `privilege_id` mediumint(8) unsigned NOT NULL,\r
+  `user_requirement` mediumint(8) unsigned NOT NULL default '0',\r
   PRIMARY KEY  (`user_group_id`, `privilege_id`)\r
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;\r
 \r
@@ -1074,25 +1019,29 @@ INSERT INTO `privileges` (`privilege_id`, `title_var`, `description`, `create_da
 INSERT INTO `privileges` (`privilege_id`, `title_var`, `description`, `create_date`, `link`, `menu_sequence`, `open_to_public`) VALUES (4, 'language', 'Language management: Create, edit, delete, enable, disable languages.', NOW(), 'language/index.php', 40, 0);\r
 INSERT INTO `privileges` (`privilege_id`, `title_var`, `description`, `create_date`, `link`, `menu_sequence`, `open_to_public`) VALUES (5, 'translation', 'Translation: Translate all Transformable terms into other languages.', NOW(), 'translation/index.php', 50, 0);\r
 INSERT INTO `privileges` (`privilege_id`, `title_var`, `description`, `create_date`, `link`, `menu_sequence`, `open_to_public`) VALUES (6, 'updater', 'Updater: Install, create, edit updates.', NOW(), 'updater/index.php', 60, 0);\r
-INSERT INTO `privileges` (`privilege_id`, `title_var`, `description`, `create_date`, `link`, `menu_sequence`, `open_to_public`) VALUES (7, 'profile', 'Profile management: Edit profile, change password or email.', NOW(), 'profile/index.php', 70, 0);\r
+INSERT INTO `privileges` (`privilege_id`, `title_var`, `description`, `create_date`, `link`, `menu_sequence`, `open_to_public`) VALUES (7, 'manage_tests', 'Tests management: Create, edit, delete test questions and tests.', NOW(), 'tests/index.php?_course_id={COURSE_ID}', 70, 0);\r
+INSERT INTO `privileges` (`privilege_id`, `title_var`, `description`, `create_date`, `link`, `menu_sequence`, `open_to_public`) VALUES (8, 'my_tests', 'My Tests: Take available test and view test results.', NOW(), 'tests/my_tests.php', 80, 0);\r
+INSERT INTO `privileges` (`privilege_id`, `title_var`, `description`, `create_date`, `link`, `menu_sequence`, `open_to_public`) VALUES (9, 'profile', 'Profile management: Edit profile, change password or email.', NOW(), 'profile/index.php', 90, 0);\r
 \r
 INSERT INTO `user_groups` (`user_group_id`, `title`, `description`, `create_date`) VALUES (1, 'Administrator', 'Administrate users, user groups, languages and updates.', now());\r
 INSERT INTO `user_groups` (`user_group_id`, `title`, `description`, `create_date`) VALUES (2, 'User', 'Regular user.', now());\r
 INSERT INTO `user_groups` (`user_group_id`, `title`, `description`, `create_date`) VALUES (3, 'Translator', 'Translate Transformable terms into a foreign lanugage.', now());\r
 \r
-INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`) VALUES (1, 1);\r
-INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`) VALUES (1, 2);\r
-INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`) VALUES (1, 3);\r
-INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`) VALUES (1, 4);\r
-INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`) VALUES (1, 5);\r
-INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`) VALUES (1, 6);\r
-INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`) VALUES (1, 7);\r
-INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`) VALUES (2, 1);\r
-INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`) VALUES (2, 7);\r
-INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`) VALUES (3, 1);\r
-INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`) VALUES (3, 4);\r
-INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`) VALUES (3, 5);\r
-INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`) VALUES (3, 7);\r
+INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`, `user_requirement`) VALUES (1, 1, 0);\r
+INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`, `user_requirement`) VALUES (1, 2, 0);\r
+INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`, `user_requirement`) VALUES (1, 3, 0);\r
+INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`, `user_requirement`) VALUES (1, 4, 0);\r
+INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`, `user_requirement`) VALUES (1, 5, 0);\r
+INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`, `user_requirement`) VALUES (1, 6, 0);\r
+INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`, `user_requirement`) VALUES (1, 9, 0);\r
+INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`, `user_requirement`) VALUES (2, 1, 0);\r
+INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`, `user_requirement`) VALUES (2, 7, 2);\r
+INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`, `user_requirement`) VALUES (2, 8, 3);\r
+INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`, `user_requirement`) VALUES (2, 9, 0);\r
+INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`, `user_requirement`) VALUES (3, 1, 0);\r
+INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`, `user_requirement`) VALUES (3, 4, 0);\r
+INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`, `user_requirement`) VALUES (3, 5, 0);\r
+INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`, `user_requirement`) VALUES (3, 9, 0);\r
 \r
 # insert default atutor account\r
 INSERT INTO `users` (`user_id`, `login`, `password`, `user_group_id`, `first_name`, `last_name`, `web_service_id`, `status`, `create_date`) VALUES (1, 'ATutor', '0cbab2aec26a53b0107487d43b1b8eb29384ad10', 2, 'ATutor', 'ATutor', '90c3cd6f656739969847f3a99ac0f3c7', 1, now());\r
diff --git a/docs/tests/add_test_questions.php b/docs/tests/add_test_questions.php
new file mode 100644 (file)
index 0000000..5b44ab6
--- /dev/null
@@ -0,0 +1,39 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+define('TR_INCLUDE_PATH', '../include/');\r
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');\r
+require_once(TR_INCLUDE_PATH.'../tests/classes/testQuestions.class.php');\r
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');\r
+\r
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);\r
+\r
+if (isset($_GET['submit_create'])) {\r
+       header('Location: create_question_'.$_GET['question_type'].'.php');\r
+       exit;\r
+}\r
+\r
+$_pages['tests/questions.php?tid='.$_GET['tid']]['title_var']    = 'questions';\r
+$_pages['tests/questions.php?tid='.$_GET['tid']]['parent']   = 'tests/index.php';\r
+$_pages['tests/questions.php?tid='.$_GET['tid']]['children'] = array('tests/add_test_questions.php');\r
+\r
+$_pages['tests/add_test_questions.php']['title_var']    = 'add_questions';\r
+$_pages['tests/add_test_questions.php']['parent']   = 'tests/questions.php?tid='.$_GET['tid'];\r
+\r
+require_once(TR_INCLUDE_PATH.'header.inc.php');\r
+?>\r
+\r
+<?php $tid = intval($_GET['tid']); ?>\r
+\r
+<?php require_once(TR_INCLUDE_PATH.'../tests/html/tests_questions.inc.php'); ?>\r
+\r
+<?php require_once(TR_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/docs/tests/add_test_questions_confirm.php b/docs/tests/add_test_questions_confirm.php
new file mode 100644 (file)
index 0000000..2cdc80b
--- /dev/null
@@ -0,0 +1,95 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+$page = 'tests';
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+
+$tid = intval($_POST['tid']);
+
+$_pages['tests/questions.php?tid='.$tid]['title_var']    = 'questions';
+$_pages['tests/questions.php?tid='.$tid]['parent']   = 'tests/index.php';
+$_pages['tests/questions.php?tid='.$tid]['children'] = array('tests/add_test_questions.php?tid='.$tid);
+
+$_pages['tests/add_test_questions.php?tid='.$tid]['title_var']  = 'add_questions';
+$_pages['tests/add_test_questions.php?tid='.$tid]['parent'] = 'tests/questions.php?tid='.$tid;
+
+$_pages['tests/add_test_questions_confirm.php']['title_var'] = 'add_questions';
+$_pages['tests/add_test_questions_confirm.php']['parent']    = 'tests/questions.php?tid='.$tid;
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: questions.php?tid='.$tid);
+       exit;
+} else if (isset($_POST['submit_yes'])) {
+       //get order
+       $sql = "SELECT MAX(ordering) AS max_ordering FROM ".TABLE_PREFIX."tests_questions_assoc WHERE test_id=".$tid;
+       $result = mysql_query($sql, $db);
+       $order  = mysql_fetch_assoc($result);
+       $order = $order['max_ordering'];
+
+       $sql = "REPLACE INTO ".TABLE_PREFIX."tests_questions_assoc VALUES ";
+       foreach ($_POST['questions'] as $question) {
+               $order++;
+               $question = intval($question);
+               $sql .= '('.$tid.', '.$question.', 0, '.$order.', 0),';
+       }
+       $sql = substr($sql, 0, -1);
+       $result = mysql_query($sql, $db);
+
+       $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+       header('Location: questions.php?tid='.$tid);
+       exit;
+} else if (isset($_POST['submit_no'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: add_test_questions.php?tid='.$tid);
+       exit;
+}
+
+if (!is_array($_POST['questions']) || !count($_POST['questions'])) {
+       $msg->addError('NO_QUESTIONS_SELECTED');
+       header('Location: add_test_questions.php?tid='.$tid);
+       require_once(TR_INCLUDE_PATH.'footer.inc.php');
+       exit;
+}
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+foreach ($_POST['questions'] as $id => $cTR_array) {
+       foreach ($cTR_array as $idx => $q) {
+               $_POST['questions'][$id][$idx] = intval($q);
+       }
+}
+foreach ($_POST['questions'] as $cTR_array) {
+       $questions .= addslashes(implode(',',$cTR_array)).',';
+}
+
+$questions = substr($questions, 0, -1);
+
+$sql = "SELECT question, question_id FROM ".TABLE_PREFIX."tests_questions WHERE question_id IN ($questions) AND course_id=$_SESSION[course_id] ORDER BY question";
+$result = mysql_query($sql, $db);
+
+$questions = '';
+while ($row = mysql_fetch_assoc($result)) {
+       $questions .= '<li>'.htmlspecialchars($row['question']).'</li>';
+       $questions_array['questions['.$row['question_id'].']'] = $row['question_id'];
+}
+$questions_array['tid'] = $_POST['tid'];
+$msg->addConfirm(array('ADD_TEST_QUESTIONS', $questions), $questions_array);
+
+$msg->printConfirm();
+?>
+
+<?php require_once(TR_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/docs/tests/classes/TestsUtility.class.php b/docs/tests/classes/TestsUtility.class.php
new file mode 100644 (file)
index 0000000..6bf1f1e
--- /dev/null
@@ -0,0 +1,71 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+/**\r
+* Tests Utility functions \r
+* @access      public\r
+* @author      Cindy Qi Li\r
+*/\r
+\r
+if (!defined('TR_INCLUDE_PATH')) exit;\r
+\r
+class TestsUtility {\r
+\r
+       /**\r
+       * This function prints the drop down list box for question categories\r
+       * @access  public\r
+       * @param   categoryID\r
+       * @author  Cindy Qi Li\r
+       */\r
+       public static function printQuestionCatsInDropDown($categoryID = 0) {   \r
+               global $_course_id;\r
+               \r
+               require_once(TR_INCLUDE_PATH."classes/DAO/TestsQuestionsCategoriesDAO.class.php");\r
+       \r
+               echo '<option value="0"';\r
+               if ($categoryID == 0) {\r
+                       echo ' selected="selected"';\r
+               }\r
+               echo '>'._AT('cats_uncategorized').'</option>' . "\n";\r
+       \r
+               $testsQuestionsCategoriesDAO = new TestsQuestionsCategoriesDAO();\r
+               $rows = $testsQuestionsCategoriesDAO->getByCourseID($_course_id);\r
+\r
+               if (is_array($rows)) {\r
+                       foreach ($rows as $row) {\r
+                               echo '<option value="'.$row['category_id'].'"';\r
+                               if ($row['category_id'] == $categoryID) {\r
+                                       echo ' selected="selected"';\r
+                               }\r
+                               echo '>'.$row['title'].'</option>'."\n";\r
+                       }\r
+               }\r
+       }\r
+       \r
+       /**\r
+       * This function prints the link to open up the visual editor popup page\r
+       * @access  public\r
+       * @param   area: One of the values: question\r
+       * @author  Cindy Qi Li\r
+       */\r
+       public static function printVisualEditorLink ($area) {\r
+               global $_course_id;\r
+?>\r
+       <script type="text/javascript" language="javascript">\r
+               document.writeln('<a href="#" onclick="javascript:window.open(\'<?php echo TR_BASE_HREF; ?>tests/form_editor.php?area=<?php echo $area; ?>&_course_id=<?php echo $_course_id; ?>\',\'newWin1\',\'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=640,height=480\'); return false;" style="cursor: pointer; text-decoration: none" ><?php echo _AT('use_visual_editor'); ?></a>');\r
+       </script>\r
+\r
+<?php\r
+       }\r
+       \r
+}\r
+?>
\ No newline at end of file
similarity index 81%
rename from docs/include/classes/testQuestions.class.php
rename to docs/tests/classes/testQuestions.class.php
index acddc15..94b8ce1 100644 (file)
@@ -10,7 +10,7 @@
 /* as published by the Free Software Foundation.                        */
 /************************************************************************/
 
-require_once(TR_INCLUDE_PATH.'lib/test_question_queries.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/lib/test_question_queries.inc.php');
 
 /*
  * Steps to follow when adding a new question type:
@@ -39,14 +39,14 @@ require_once(TR_INCLUDE_PATH.'lib/test_question_queries.inc.php');
  *     /tools/tests/edit_question_{PREFIX}.php
  *
  * 5 - Add those two newly created pages to 
- *     /mods/_standard/tests/module.php
+ *     /tests/module.php
  *
  * 6 - Create the following template files:
  *
- *     /themes/default/test_questions/{PREFIX}.tmpl.php
- *     /themes/default/test_questions/{PREFIX}_qti_2p1.tmpl.php
- *     /themes/default/test_questions/{PREFIX}_result.tmpl.php
- *     /themes/default/test_questions/{PREFIX}_stats.tmpl.php
+ *     /themes/default/tests/test_questions/{PREFIX}.tmpl.php
+ *     /themes/default/tests/test_questions/{PREFIX}_qti_2p1.tmpl.php
+ *     /themes/default/tests/test_questions/{PREFIX}_result.tmpl.php
+ *     /themes/default/tests/test_questions/{PREFIX}_stats.tmpl.php
  *
  * 7 - Add the new question type to qti import/export tools,
  *     Implement the following methods, which set template variables:
@@ -115,13 +115,19 @@ class TestQuestions {
  * @param      array   an array consist of all the ids of the questions in which we desired to export.
  */
 function test_question_qti_export_v2p1($question_ids) {
-       require(TR_INCLUDE_PATH.'classes/zipfile.class.php'); // for zipfile
-       require(TR_INCLUDE_PATH.'lib/html_resource_parser.inc.php'); // for get_html_resources()
-       require(TR_INCLUDE_PATH.'classes/XML/XML_HTMLSax/XML_HTMLSax.php');     // for XML_HTMLSax
+       global $_course_id;
+       
+       require_once(TR_INCLUDE_PATH.'classes/DAO/CoursesDAO.class.php');
+       require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+       require_once(TR_INCLUDE_PATH.'classes/zipfile.class.php'); // for zipfile
+       require_once(TR_INCLUDE_PATH.'lib/html_resource_parser.inc.php'); // for get_html_resources()
+       require_once(TR_INCLUDE_PATH.'classes/XML/XML_HTMLSax/XML_HTMLSax.php');        // for XML_HTMLSax
 
-       global $savant, $db, $system_courses, $languageManager;
+       global $savant, $db, $languageManager;
 
-       $course_language = $system_courses[$_SESSION['course_id']]['primary_language'];
+       $coursesDAO = new CoursesDAO();
+       $course_row = $coursesDAO->get($_course_id);
+       $course_language = $course_row['primary_language'];
        $courseLanguage =& $languageManager->getLanguage($course_language);
        $course_language_charset = $courseLanguage->getCharacterSet();
 
@@ -132,28 +138,32 @@ function test_question_qti_export_v2p1($question_ids) {
 
        asort($question_ids);
 
-       $question_ids_delim = implode(',',$question_ids);
-
-       $sql = "SELECT * FROM ".TABLE_PREFIX."tests_questions WHERE course_id=$_SESSION[course_id] AND question_id IN($question_ids_delim)";
-       $result = mysql_query($sql, $db);
-       while ($row = mysql_fetch_assoc($result)) {
-               $obj = TestQuestions::getQuestion($row['type']);
-               $xml = $obj->exportQTI($row, $course_language_charset, '2.1');
-               $local_dependencies = array();
-
-               $text_blob = implode(' ', $row);
-               $local_dependencies = get_html_resources($text_blob);
-               $dependencies = array_merge($dependencies, $local_dependencies);
-
-               $resources[] = array('href'         => 'question_'.$row['question_id'].'.xml',
-                                                        'dependencies' => array_keys($local_dependencies));
-
-               //TODO
-               $savant->assign('xml_content', $xml);
-               $savant->assign('title', $row['question']);
-               $xml = $savant->fetch('test_questions/wrapper.tmpl.php');
-
-               $zipfile->add_file($xml, 'question_'.$row['question_id'].'.xml');
+//     $question_ids_delim = implode(',',$question_ids);
+       $testsQuestionsDAO = new TestsQuestionsDAO();
+       $rows = $testsQuestionsDAO->getByQuestionIDs($question_ids);
+//     $sql = "SELECT * FROM ".TABLE_PREFIX."tests_questions WHERE course_id=$_SESSION[course_id] AND question_id IN($question_ids_delim)";
+//     $result = mysql_query($sql, $db);
+//     while ($row = mysql_fetch_assoc($result)) {
+       if (is_array($rows)) {
+               foreach ($rows as $row) {
+                       $obj = TestQuestions::getQuestion($row['type']);
+                       $xml = $obj->exportQTI($row, $course_language_charset, '2.1');
+                       $local_dependencies = array();
+       
+                       $text_blob = implode(' ', $row);
+                       $local_dependencies = get_html_resources($text_blob);
+                       $dependencies = array_merge($dependencies, $local_dependencies);
+       
+                       $resources[] = array('href'         => 'question_'.$row['question_id'].'.xml',
+                                                                'dependencies' => array_keys($local_dependencies));
+       
+                       //TODO
+                       $savant->assign('xml_content', $xml);
+                       $savant->assign('title', $row['question']);
+                       $xml = $savant->fetch('tests/test_questions/wrapper.tmpl.php');
+       
+                       $zipfile->add_file($xml, 'question_'.$row['question_id'].'.xml');
+               }
        }
 
        // add any dependency files:
@@ -165,13 +175,13 @@ function test_question_qti_export_v2p1($question_ids) {
        $savant->assign('resources', $resources);
        $savant->assign('dependencies', array_keys($dependencies));
        $savant->assign('encoding', $course_language_charset);
-       $manifest_xml = $savant->fetch('test_questions/manifest_qti_2p1.tmpl.php');
+       $manifest_xml = $savant->fetch('tests/test_questions/manifest_qti_2p1.tmpl.php');
 
        $zipfile->add_file($manifest_xml, 'imsmanifest.xml');
 
        $zipfile->close();
 
-       $filename = str_replace(array(' ', ':'), '_', $_SESSION['course_title'].'-'._AT('question_database').'-'.date('Ymd'));
+       $filename = str_replace(array(' ', ':'), '_', $course_row['title'].'-'._AT('question_database').'-'.date('Ymd'));
        $zipfile->send_file($filename);
        exit;
 }
@@ -182,13 +192,19 @@ function test_question_qti_export_v2p1($question_ids) {
  * @param      array   an array consist of all the ids of the questions in which we desired to export.
  */
 function test_question_qti_export($question_ids) {
-       require(TR_INCLUDE_PATH.'classes/zipfile.class.php'); // for zipfile
-       require(TR_INCLUDE_PATH.'lib/html_resource_parser.inc.php'); // for get_html_resources()
-       require(TR_INCLUDE_PATH.'classes/XML/XML_HTMLSax/XML_HTMLSax.php');     // for XML_HTMLSax
+       global $_course_id;
+       
+       require_once(TR_INCLUDE_PATH.'classes/DAO/CoursesDAO.class.php');
+       require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+       require_once(TR_INCLUDE_PATH.'classes/zipfile.class.php'); // for zipfile
+       require_once(TR_INCLUDE_PATH.'lib/html_resource_parser.inc.php'); // for get_html_resources()
+       require_once(TR_INCLUDE_PATH.'classes/XML/XML_HTMLSax/XML_HTMLSax.php');        // for XML_HTMLSax
 
-       global $savant, $db, $system_courses, $languageManager;
+       global $savant, $db, $languageManager;
 
-       $course_language = $system_courses[$_SESSION['course_id']]['primary_language'];
+       $coursesDAO = new CoursesDAO();
+       $course_row = $coursesDAO->get($_course_id);
+       $course_language = $course_row['primary_language'];
        $courseLanguage =& $languageManager->getLanguage($course_language);
        $course_language_charset = $courseLanguage->getCharacterSet();
 
@@ -199,31 +215,36 @@ function test_question_qti_export($question_ids) {
 
        asort($question_ids);
 
-       $question_ids_delim = implode(',',$question_ids);
-
-       $sql = "SELECT * FROM ".TABLE_PREFIX."tests_questions WHERE course_id=$_SESSION[course_id] AND question_id IN($question_ids_delim)";
-       $result = mysql_query($sql, $db);
-       while ($row = mysql_fetch_assoc($result)) {
-               $obj = TestQuestions::getQuestion($row['type']);
-               $local_xml = '';
-               $local_xml = $obj->exportQTI($row, $course_language_charset, '1.2.1');
-               $local_dependencies = array();
-
-               $text_blob = implode(' ', $row);
-               $local_dependencies = get_html_resources($text_blob);
-               $dependencies = array_merge($dependencies, $local_dependencies);
-
-//             $resources[] = array('href'         => 'question_'.$row['question_id'].'.xml',
-//                                                      'dependencies' => array_keys($local_dependencies));
-
-               $xml = $xml . "\n\n" . $local_xml;              
+//     $question_ids_delim = implode(',',$question_ids);
+
+//     $sql = "SELECT * FROM ".TABLE_PREFIX."tests_questions WHERE course_id=$_SESSION[course_id] AND question_id IN($question_ids_delim)";
+//     $result = mysql_query($sql, $db);
+//     while ($row = mysql_fetch_assoc($result)) {
+       $testsQuestionsDAO = new TestsQuestionsDAO();
+       $rows = $testsQuestionsDAO->getByQuestionIDs($question_ids);
+       if (is_array($rows)) {
+               foreach ($rows as $row) {
+                       $obj = TestQuestions::getQuestion($row['type']);
+                       $local_xml = '';
+                       $local_xml = $obj->exportQTI($row, $course_language_charset, '1.2.1');
+                       $local_dependencies = array();
+       
+                       $text_blob = implode(' ', $row);
+                       $local_dependencies = get_html_resources($text_blob);
+                       $dependencies = array_merge($dependencies, $local_dependencies);
+       
+       //              $resources[] = array('href'         => 'question_'.$row['question_id'].'.xml',
+       //                                                       'dependencies' => array_keys($local_dependencies));
+       
+                       $xml = $xml . "\n\n" . $local_xml;
+               }               
        }
        $xml = trim($xml);
 
        //TODO
        $savant->assign('xml_content', $xml);
        $savant->assign('title', $row['question']);
-       $xml = $savant->fetch('test_questions/wrapper.tmpl.php');
+       $xml = $savant->fetch('tests/test_questions/wrapper.tmpl.php');
 
        $xml_filename = 'atutor_questions.xml';
        $zipfile->add_file($xml, $xml_filename);
@@ -238,14 +259,14 @@ function test_question_qti_export($question_ids) {
        $savant->assign('dependencies', array_keys($dependencies));
        $savant->assign('encoding', $course_language_charset);
        $savant->assign('xml_filename', $xml_filename);
-//     $manifest_xml = $savant->fetch('test_questions/manifest_qti_2p1.tmpl.php');
-       $manifest_xml = $savant->fetch('test_questions/manifest_qti_1p2.tmpl.php');
+//     $manifest_xml = $savant->fetch('tests/test_questions/manifest_qti_2p1.tmpl.php');
+       $manifest_xml = $savant->fetch('tests/test_questions/manifest_qti_1p2.tmpl.php');
 
        $zipfile->add_file($manifest_xml, 'imsmanifest.xml');
 
        $zipfile->close();
 
-       $filename = str_replace(array(' ', ':'), '_', $_SESSION['course_title'].'-'._AT('question_database').'-'.date('Ymd'));
+       $filename = str_replace(array(' ', ':'), '_', $course_row['title'].'-'._AT('question_database').'-'.date('Ymd'));
        $zipfile->send_file($filename);
        exit;
 }
@@ -259,13 +280,20 @@ function test_question_qti_export($question_ids) {
  * @param      array   [OPTIONAL] list of already added files.
  */
 function test_qti_export($tid, $test_title='', $zipfile = null){
+       global $_course_id;
+       
+       require_once(TR_INCLUDE_PATH.'classes/DAO/CoursesDAO.class.php');
+       require_once(TR_INCLUDE_PATH.'classes/DAO/TestsDAO.class.php');
+       require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsAssocDAO.class.php');
        require_once(TR_INCLUDE_PATH.'classes/zipfile.class.php'); // for zipfile
        require_once(TR_INCLUDE_PATH.'classes/XML/XML_HTMLSax/XML_HTMLSax.php');        // for XML_HTMLSax
        require_once(TR_INCLUDE_PATH.'lib/html_resource_parser.inc.php'); // for get_html_resources()
-       global $savant, $db, $system_courses, $languageManager, $test_zipped_files, $test_files, $use_cc;
+       global $savant, $db, $languageManager, $test_zipped_files, $test_files, $use_cc;
        global $course_id;
 
-       $course_language = $system_courses[$_SESSION['course_id']]['primary_language'];
+       $coursesDAO = new CoursesDAO();
+       $course_row = $coursesDAO->get($_course_id);
+       $course_language = $course_row['primary_language'];
        $courseLanguage =& $languageManager->getLanguage($course_language);
        $course_language_charset = $courseLanguage->getCharacterSet();
        $imported_files;
@@ -291,35 +319,43 @@ function test_qti_export($tid, $test_title='', $zipfile = null){
 
        //TODO: Merge the following 2 sqls together.
        //Randomized or not, export all the questions that are associated with it.
-       $sql    = "SELECT TQ.question_id, TQA.weight FROM ".TABLE_PREFIX."tests_questions TQ INNER JOIN ".TABLE_PREFIX."tests_questions_assoc TQA USING (question_id) WHERE TQ.course_id=$_SESSION[course_id] AND TQA.test_id=$tid ORDER BY TQA.ordering, TQA.question_id";
-       $result = mysql_query($sql, $db);
-       $question_ids = array();
-
-       while (($question_row = mysql_fetch_assoc($result)) != false){
-               $question_ids[] = $question_row['question_id'];
-       }
-       $question_ids_delim = implode(',',$question_ids);
+//     $sql    = "SELECT TQ.question_id, TQA.weight FROM ".TABLE_PREFIX."tests_questions TQ INNER JOIN ".TABLE_PREFIX."tests_questions_assoc TQA USING (question_id) WHERE TQ.course_id=$_SESSION[course_id] AND TQA.test_id=$tid ORDER BY TQA.ordering, TQA.question_id";
+//     $result = mysql_query($sql, $db);
+//     $question_ids = array();
+//
+//     if (is_array($question_rows)){
+//             foreach ($question_rows as $question_row) $question_ids[] = $question_row['question_id'];
+//     }
+//
+//     //No questions in the test
+//     if (sizeof($question_ids)==0){
+//             return;
+//     }
+//
+//     $question_ids_delim = implode(',',$question_ids);       
+//
+//     //$sql = "SELECT * FROM ".TABLE_PREFIX."tests_questions WHERE course_id=$_SESSION[course_id] AND question_id IN($question_ids_delim)";
+//     $sql = "SELECT TQ.*, TQA.weight, TQA.test_id FROM ".TABLE_PREFIX."tests_questions TQ INNER JOIN ".TABLE_PREFIX."tests_questions_assoc TQA USING (question_id) WHERE TQA.test_id=$tid AND TQ.question_id IN($question_ids_delim) ORDER BY TQA.ordering, TQA.question_id";
+//
+//     $result = mysql_query($sql, $db);
+//     while ($row = mysql_fetch_assoc($result)) {
+       $testsQuestionsAssocDAO = new TestsQuestionsAssocDAO();
+       $question_rows = $testsQuestionsAssocDAO->getByTestID($tid);
+
+       if (!is_array($question_rows)) return;
+       else {
+               foreach ($question_rows as $row) {
+                       $obj = TestQuestions::getQuestion($row['type']);
+                       $local_xml = '';
+                       $local_xml = $obj->exportQTI($row, $course_language_charset, '1.2.1');
+                       $local_dependencies = array();
        
-       //No questions in the test
-       if (sizeof($question_ids_delim)==0){
-               return;
-       }
-
-       //$sql = "SELECT * FROM ".TABLE_PREFIX."tests_questions WHERE course_id=$_SESSION[course_id] AND question_id IN($question_ids_delim)";
-       $sql = "SELECT TQ.*, TQA.weight, TQA.test_id FROM ".TABLE_PREFIX."tests_questions TQ INNER JOIN ".TABLE_PREFIX."tests_questions_assoc TQA USING (question_id) WHERE TQA.test_id=$tid AND TQ.question_id IN($question_ids_delim) ORDER BY TQA.ordering, TQA.question_id";
-
-       $result = mysql_query($sql, $db);
-       while ($row = mysql_fetch_assoc($result)) {
-               $obj = TestQuestions::getQuestion($row['type']);
-               $local_xml = '';
-               $local_xml = $obj->exportQTI($row, $course_language_charset, '1.2.1');
-               $local_dependencies = array();
-
-               $text_blob = implode(' ', $row);
-               $local_dependencies = get_html_resources($text_blob);
-               $dependencies = array_merge($dependencies, $local_dependencies);
-
-               $xml = $xml . "\n\n" . $local_xml;
+                       $text_blob = implode(' ', $row);
+                       $local_dependencies = get_html_resources($text_blob);
+                       $dependencies = array_merge($dependencies, $local_dependencies);
+       
+                       $xml = $xml . "\n\n" . $local_xml;
+               }
        }
 
        //files that are found inside the test; used by print_organization(), to add all test files into QTI/ folder.
@@ -331,14 +367,16 @@ function test_qti_export($tid, $test_title='', $zipfile = null){
        $xml = trim($xml);
 
        //get test title
-       $sql = "SELECT title FROM ".TABLE_PREFIX."tests WHERE test_id = $tid";
-       $result = mysql_query($sql, $db);
-       $row = mysql_fetch_array($result);
-
+//     $sql = "SELECT title FROM ".TABLE_PREFIX."tests WHERE test_id = $tid";
+//     $result = mysql_query($sql, $db);
+//     $row = mysql_fetch_array($result);
+       $testsDAO = new TestsDAO();
+       $row = $testsDAO->get($tid);
+       
        //TODO: wrap around xml now
        $savant->assign('xml_content', $xml);
        $savant->assign('title', htmlspecialchars($row['title'], ENT_QUOTES, 'UTF-8'));
-       $xml = $savant->fetch('test_questions/wrapper.tmpl.php');
+       $xml = $savant->fetch('tests/test_questions/wrapper.tmpl.php');
 
        $xml_filename = 'tests_'.$tid.'.xml';
        if (!$use_cc){          
@@ -366,12 +404,12 @@ function test_qti_export($tid, $test_title='', $zipfile = null){
                $savant->assign('title', $test_title);
                $savant->assign('xml_filename', $xml_filename);
                
-               $manifest_xml = $savant->fetch('test_questions/manifest_qti_1p2.tmpl.php');
+               $manifest_xml = $savant->fetch('tests/test_questions/manifest_qti_1p2.tmpl.php');
                $zipfile->add_file($manifest_xml, 'imsmanifest.xml');
 
                $zipfile->close();
 
-               $filename = str_replace(array(' ', ':'), '_', $_SESSION['course_title'].'-'.$test_title.'-'.date('Ymd'));
+               $filename = str_replace(array(' ', ':'), '_', $course_row['title'].'-'.$test_title.'-'.date('Ymd'));
                $zipfile->send_file($filename);
                exit;
        }
@@ -486,12 +524,13 @@ function TestQuestionCounter($increment = FALSE) {
        */
        /*final public */function display($row, $response = '') {
                // print the generic question header
+               require_once(TR_INCLUDE_PATH.'../home/classes/ContentUtility.class.php');
                $this->displayHeader($row['weight']);
 
                // print the question specific template
-               $row['question'] = format_content($row['question'], 1, '');
+               $row['question'] = ContentUtility::formatContent($row['question'], 1);
                $this->assignDisplayVariables($row, $response);
-               $this->savant->display('test_questions/' . $this->sPrefix . '.tmpl.php');
+               $this->savant->display('tests/test_questions/' . $this->sPrefix . '.tmpl.php');
                
                // print the generic question footer
                $this->displayFooter();
@@ -506,7 +545,7 @@ function TestQuestionCounter($increment = FALSE) {
 
                // print the question specific template
                $this->assignDisplayResultVariables($row, $answer_row);
-               $this->savant->display('test_questions/' . $this->sPrefix . '_result.tmpl.php');
+               $this->savant->display('tests/test_questions/' . $this->sPrefix . '_result.tmpl.php');
                
                // print the generic question footer
                $this->displayFooter();
@@ -519,7 +558,7 @@ function TestQuestionCounter($increment = FALSE) {
        /*final public */function displayResultStatistics($row, $answers) {
                TestQuestionCounter(TRUE);
                $this->assignDisplayStatisticsVariables($row, $answers);
-               $this->savant->display('test_questions/' . $this->sPrefix . '_stats.tmpl.php');
+               $this->savant->display('tests/test_questions/' . $this->sPrefix . '_stats.tmpl.php');
        }
 
        /*final public */function exportQTI($row, $encoding, $version) {
@@ -530,9 +569,9 @@ function TestQuestionCounter($increment = FALSE) {
                }
                $this->assignQTIVariables($row);
                if ($version=='2.1') {
-                       $xml = $this->savant->fetch('test_questions/'. $this->sPrefix . '_qti_2p1.tmpl.php');
+                       $xml = $this->savant->fetch('tests/test_questions/'. $this->sPrefix . '_qti_2p1.tmpl.php');
                } else {        
-                       $xml = $this->savant->fetch('test_questions/'. $this->sPrefix . '_qti_1p2.tmpl.php');
+                       $xml = $this->savant->fetch('tests/test_questions/'. $this->sPrefix . '_qti_1p2.tmpl.php');
                }
                return $xml;
        }
@@ -549,14 +588,14 @@ function TestQuestionCounter($increment = FALSE) {
                $this->savant->assign('weight', $weight);
                $this->savant->assign('type',   _AT($this->sNameVar));
                $this->savant->assign('number', TestQuestionCounter());
-               $this->savant->display('test_questions/header.tmpl.php');
+               $this->savant->display('tests/test_questions/header.tmpl.php');
        }
 
        /**
        * print the question template footer
        */
        /*final private */function displayFooter() {
-               $this->savant->display('test_questions/footer.tmpl.php');
+               $this->savant->display('tests/test_questions/footer.tmpl.php');
        }
 
        /**
@@ -704,8 +743,11 @@ class OrderingQuestion extends AbstractTestQuestion {
 
        //QTI Import Ordering Question
        function importQTI($_POST){
+               global $_course_id;
+               
+               require_once(TR_INCLUDE.'classes/DAO/DAO.class.php');
                global $msg, $db;
-
+               
                if ($_POST['question'] == ''){
                        $missing_fields[] = _AT('question');
                }
@@ -747,7 +789,7 @@ class OrderingQuestion extends AbstractTestQuestion {
 //                     $_POST['question'] = $addslashes($_POST['question']);
                
                        $sql_params = array(    $_POST['category_id'], 
-                                                                       $_SESSION['course_id'],
+                                                                       $_course_id,
                                                                        $_POST['feedback'], 
                                                                        $_POST['question'], 
                                                                        $_POST['choice'][0], 
@@ -773,8 +815,10 @@ class OrderingQuestion extends AbstractTestQuestion {
 
                        $sql = vsprintf(TR_SQL_QUESTION_ORDERING, $sql_params);
 
-                       $result = mysql_query($sql, $db);
-                       if ($result==true){
+//                     $result = mysql_query($sql, $db);
+//                     if ($result==true){
+                       $dao = new DAO();
+                       if ($dao->execute($sql)) {
                                return mysql_insert_id();
                        }                       
                }
@@ -829,7 +873,8 @@ class TruefalseQuestion extends AbstracttestQuestion {
 
        //QTI Import True/False Question
        function importQTI($_POST){
-               global $msg, $db;
+               require_once(TR_INCLUDE.'classes/DAO/DAO.class.php');
+               global $msg, $db, $_course_id;
 
                if ($_POST['question'] == ''){
                        $msg->addError(array('EMPTY_FIELDS', _AT('statement')));
@@ -848,16 +893,18 @@ class TruefalseQuestion extends AbstracttestQuestion {
 
 
                        $sql_params = array(    $_POST['category_id'], 
-                                                                       $_SESSION['course_id'],
+                                                                       $_course_id,
                                                                        $_POST['feedback'], 
                                                                        $_POST['question'], 
                                                                        $_POST['answer']);
 
                        $sql = vsprintf(TR_SQL_QUESTION_TRUEFALSE, $sql_params);
-                       $result = mysql_query($sql, $db);
-                       if ($result==true){
+//                     $result = mysql_query($sql, $db);
+//                     if ($result==true){
+                       $dao = new DAO();
+                       if ($dao->execute($sql)) {      
                                return mysql_insert_id();
-                       }                       
+                       }
                }
        }
 }
@@ -926,7 +973,8 @@ class LikertQuestion extends AbstracttestQuestion {
 
        //QTI Import Likert Question
        function importQTI($_POST){
-               global $msg, $db;
+               require_once(TR_INCLUDE.'classes/DAO/DAO.class.php');
+               global $msg, $db, $_course_id;
 //             $_POST = $this->_POST; 
 
                $empty_fields = array();
@@ -960,7 +1008,7 @@ class LikertQuestion extends AbstracttestQuestion {
                        }
 
                        $sql_params = array(    $_POST['category_id'], 
-                                                                       $_SESSION['course_id'],
+                                                                       $_course_id,
                                                                        $_POST['feedback'], 
                                                                        $_POST['question'], 
                                                                        $_POST['choice'][0], 
@@ -985,8 +1033,10 @@ class LikertQuestion extends AbstracttestQuestion {
                                                                        $_POST['answer'][9]);
 
                        $sql = vsprintf(TR_SQL_QUESTION_LIKERT, $sql_params);
-                       $result = mysql_query($sql, $db);
-                       if ($result==true){
+//                     $result = mysql_query($sql, $db);
+//                     if ($result==true){
+                       $dao = new DAO();
+                       if ($dao->execute($sql)) {
                                return mysql_insert_id();
                        }
                }
@@ -1035,7 +1085,8 @@ class LongQuestion extends AbstracttestQuestion {
 
        //QTI Import Open end/long Question
        function importQTI($_POST){
-               global $msg, $db;
+               require_once(TR_INCLUDE.'classes/DAO/DAO.class.php');
+               global $msg, $db, $_course_id;
 //             $_POST = $this->_POST; 
 
                if ($_POST['question'] == ''){
@@ -1051,15 +1102,17 @@ class LongQuestion extends AbstracttestQuestion {
                        }
 
                        $sql_params = array(    $_POST['category_id'], 
-                                                                       $_SESSION['course_id'],
+                                                                       $_course_id,
                                                                        $_POST['feedback'], 
                                                                        $_POST['question'], 
                                                                        $_POST['property']);
 
                        $sql = vsprintf(TR_SQL_QUESTION_LONG, $sql_params);
 
-                       $result = mysql_query($sql, $db);
-                       if ($result==true){
+//                     $result = mysql_query($sql, $db);
+//                     if ($result==true){
+                       $dao = new DAO();
+                       if ($dao->execute($sql)) {
                                return mysql_insert_id();
                        }
                }
@@ -1191,7 +1244,8 @@ class MatchingQuestion extends AbstracttestQuestion {
 
        //QTI Import Matching Question
        function importQTI($_POST){
-               global $msg, $db;
+               require_once(TR_INCLUDE.'classes/DAO/DAO.class.php');
+               global $msg, $db, $_course_id;
 //             $_POST = $this->_POST; 
 
                if (!is_array($_POST['answer'])){
@@ -1221,7 +1275,7 @@ class MatchingQuestion extends AbstracttestQuestion {
 //                     $_POST['instructions'] = $addslashes($_POST['instructions']);
                
                        $sql_params = array(    $_POST['category_id'], 
-                                                                       $_SESSION['course_id'],
+                                                                       $_course_id,
                                                                        $_POST['feedback'], 
                                                                        $_POST['question'], 
                                                                        $_POST['groups'][0], 
@@ -1257,8 +1311,10 @@ class MatchingQuestion extends AbstracttestQuestion {
 
                        $sql = vsprintf(TR_SQL_QUESTION_MATCHINGDD, $sql_params);
 
-                       $result = mysql_query($sql, $db);
-                       if ($result==true){
+//                     $result = mysql_query($sql, $db);
+//                     if ($result==true){
+                       $dao = new DAO();
+                       if ($dao->execute($sql)) {
                                return mysql_insert_id();
                        }
                }
@@ -1361,7 +1417,8 @@ class MultichoiceQuestion extends AbstracttestQuestion {
 
        //QTI Import Multiple Choice Question
        function importQTI($_POST){
-               global $msg, $db;
+               require_once(TR_INCLUDE.'classes/DAO/DAO.class.php');
+               global $msg, $db, $_course_id;
 //             $_POST = $this->_POST; 
                if ($_POST['question'] == ''){
                        $msg->addError(array('EMPTY_FIELDS', _AT('question')));
@@ -1382,7 +1439,7 @@ class MultichoiceQuestion extends AbstracttestQuestion {
                        }
                
                        $sql_params = array(    $_POST['category_id'], 
-                                                                       $_SESSION['course_id'],
+                                                                       $_course_id,
                                                                        $_POST['feedback'], 
                                                                        $_POST['question'], 
                                                                        $_POST['choice'][0], 
@@ -1407,8 +1464,10 @@ class MultichoiceQuestion extends AbstracttestQuestion {
                                                                        $answers[9]);
 
                        $sql = vsprintf(TR_SQL_QUESTION_MULTI, $sql_params);
-                       $result = mysql_query($sql, $db);
-                       if ($result==true){
+//                     $result = mysql_query($sql, $db);
+//                     if ($result==true){
+                       $dao = new DAO();
+                       if ($dao->execute($sql)) {
                                return mysql_insert_id();
                        }
                }
@@ -1457,7 +1516,8 @@ class MultianswerQuestion extends MultichoiceQuestion {
 
        //QTI Import multianswer Question
        function importQTI($_POST){
-               global $msg, $db;
+               require_once(TR_INCLUDE.'classes/DAO/DAO.class.php');
+               global $msg, $db, $_course_id;
 //             $_POST = $this->_POST; 
 
                if ($_POST['question'] == ''){
@@ -1517,7 +1577,7 @@ class MultianswerQuestion extends MultichoiceQuestion {
 //                             $_POST['question'] = $addslashes($_POST['question']);
 
                                $sql_params = array(    $_POST['category_id'], 
-                                                                               $_SESSION['course_id'],
+                                                                               $_course_id,
                                                                                $_POST['feedback'], 
                                                                                $_POST['question'], 
                                                                                $_POST['choice'][0], 
@@ -1543,8 +1603,10 @@ class MultianswerQuestion extends MultichoiceQuestion {
 
                                $sql = vsprintf(TR_SQL_QUESTION_MULTIANSWER, $sql_params);
 
-                               $result = mysql_query($sql, $db);
-                               if ($result==true){
+//                             $result = mysql_query($sql, $db);
+//                             if ($result==true){
+                               $dao = new DAO();
+                               if ($dao->execute($sql)) {
                                        return mysql_insert_id();
                                }
                        }
diff --git a/docs/tests/create_question_likert.php b/docs/tests/create_question_likert.php
new file mode 100644 (file)
index 0000000..f79b188
--- /dev/null
@@ -0,0 +1,124 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/lib/likert_presets.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/lib/test_question_queries.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+
+$testsQuestionsDAO = new TestsQuestionsDAO();
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: question_db.php?_course_id='.$_course_id);
+       exit;
+} else if (isset($_POST['submit'])) {
+       $_POST['question']    = trim($_POST['question']);
+       $_POST['category_id'] = intval($_POST['category_id']);
+
+       $empty_fields = array();
+       if ($_POST['question'] == ''){
+               $empty_fields[] = _AT('question');
+       }
+       if ($_POST['choice'][0] == '') {
+               $empty_fields[] = _AT('choice').' 1';
+       }
+
+       if ($_POST['choice'][1] == '') {
+               $empty_fields[] = _AT('choice').' 2';
+       }
+
+       if (!empty($empty_fields)) {
+               $msg->addError(array('EMPTY_FIELDS', implode(', ', $empty_fields)));
+       }
+
+       if (!$msg->containsErrors()) {
+               $_POST['feedback']   = '';
+               $_POST['question']   = $addslashes($_POST['question']);
+
+               for ($i=0; $i<10; $i++) {
+                       $_POST['choice'][$i] = $addslashes(trim($_POST['choice'][$i]));
+                       $_POST['answer'][$i] = intval($_POST['answer'][$i]);
+
+                       if ($_POST['choice'][$i] == '') {
+                               /* an empty option can't be correct */
+                               $_POST['answer'][$i] = 0;
+                       }
+               }
+               
+               $sql_params = array(    $_POST['category_id'], 
+                                                               $_course_id,
+                                                               $_POST['feedback'], 
+                                                               $_POST['question'], 
+                                                               $_POST['choice'][0], 
+                                                               $_POST['choice'][1], 
+                                                               $_POST['choice'][2], 
+                                                               $_POST['choice'][3], 
+                                                               $_POST['choice'][4], 
+                                                               $_POST['choice'][5], 
+                                                               $_POST['choice'][6], 
+                                                               $_POST['choice'][7], 
+                                                               $_POST['choice'][8], 
+                                                               $_POST['choice'][9], 
+                                                               $_POST['answer'][0], 
+                                                               $_POST['answer'][1], 
+                                                               $_POST['answer'][2], 
+                                                               $_POST['answer'][3], 
+                                                               $_POST['answer'][4], 
+                                                               $_POST['answer'][5], 
+                                                               $_POST['answer'][6], 
+                                                               $_POST['answer'][7], 
+                                                               $_POST['answer'][8], 
+                                                               $_POST['answer'][9]);
+
+               $sql = vsprintf(TR_SQL_QUESTION_LIKERT, $sql_params);
+               if ($testsQuestionsDAO->execute($sql)) {
+                       $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+                       header('Location: question_db.php?_course_id='.$_course_id);
+                       exit;
+               }
+               else {
+                       $msg->addError('DB_NOT_UPDATED');
+               }
+       }
+} else if (isset($_POST['preset'])) {
+       // load preset
+       $_POST['preset_num'] = intval($_POST['preset_num']);
+
+       if (isset($_likert_preset[$_POST['preset_num']])) {
+               $_POST['choice'] = $_likert_preset[$_POST['preset_num']];
+       } else if ($_POST['preset_num']) {
+               $row = $testsQuestionsDAO->get($_POST[preset_num]);
+               if (isset($row)) {
+                       for ($i=0; $i<10; $i++) {
+                               $_POST['choice'][$i] = $row['choice_' . $i];
+                       }
+               }
+       }
+}
+
+global $onload;
+$onload = 'document.form.category_id.focus();';
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$savant->assign('likert_preset', $_likert_preset);
+$savant->assign('testsQuestionsDAO', $testsQuestionsDAO);
+$savant->assign('course_id', $_course_id);
+$savant->display('tests/create_edit_question_likert.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php');  ?>
\ No newline at end of file
diff --git a/docs/tests/create_question_long.php b/docs/tests/create_question_long.php
new file mode 100644 (file)
index 0000000..d4fb2e5
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/lib/test_question_queries.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+require_once(TR_INCLUDE_PATH.'../tests/lib/test_result_functions.inc.php');
+$testsQuestionsDAO = new TestsQuestionsDAO();
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: question_db.php?_course_id='.$_course_id);
+       exit;
+} else if ($_POST['submit']) {
+       $_POST['feedback']    = trim($_POST['feedback']);
+       $_POST['question']    = trim($_POST['question']);
+       $_POST['category_id'] = intval($_POST['category_id']);
+       $_POST['properties']  = intval($_POST['properties']);
+
+       if ($_POST['question'] == ''){
+               $msg->addError(array('EMPTY_FIELDS', _AT('question')));
+       }
+
+       if (!$msg->containsErrors()) {
+               $_POST['feedback'] = $addslashes($_POST['feedback']);
+               $_POST['question'] = $addslashes($_POST['question']);
+
+               $sql_params = array(    $_POST['category_id'], 
+                                                               $_course_id,
+                                                               $_POST['feedback'], 
+                                                               $_POST['question'], 
+                                                               $_POST['properties']);
+
+               $sql = vsprintf(TR_SQL_QUESTION_LONG, $sql_params);     
+               if ($testsQuestionsDAO->execute($sql))
+               {
+                       $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+                       header('Location: question_db.php?_course_id='.$_course_id);
+                       exit;
+               }
+       }
+}
+
+$onload = 'document.form.category_id.focus();';
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+if (!isset($_POST['properties'])) {
+       $_POST['properties'] = 1;
+}
+
+$savant->assign('course_id', $_course_id);
+$savant->display('tests/create_edit_question_long.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php'); 
+?>
\ No newline at end of file
diff --git a/docs/tests/create_question_matching.php b/docs/tests/create_question_matching.php
new file mode 100644 (file)
index 0000000..a1eee4a
--- /dev/null
@@ -0,0 +1,108 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/lib/test_question_queries.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+require_once(TR_INCLUDE_PATH.'../tests/lib/test_result_functions.inc.php');
+$testsQuestionsDAO = new TestsQuestionsDAO();
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: question_db.php');
+       exit;
+} else if ($_POST['submit']) {
+       $_POST['feedback']    = trim($_POST['feedback']);
+       $_POST['instructions'] = trim($_POST['instructions']);
+       $_POST['category_id'] = intval($_POST['category_id']);
+
+       for ($i = 0 ; $i < 10; $i++) {
+               $_POST['question'][$i]        = $addslashes(trim($_POST['question'][$i]));
+               $_POST['question_answer'][$i] = (int) $_POST['question_answer'][$i];
+               $_POST['answer'][$i]          = $addslashes(trim($_POST['answer'][$i]));
+       }
+
+       if (!$_POST['question'][0] 
+               || !$_POST['question'][1] 
+               || !$_POST['answer'][0] 
+               || !$_POST['answer'][1]) {
+
+               $msg->addError('QUESTION_EMPTY');
+       }
+       
+
+       if (!$msg->containsErrors()) {
+               $_POST['feedback']     = $addslashes($_POST['feedback']);
+               $_POST['instructions'] = $addslashes($_POST['instructions']);
+               
+               $sql_params = array(    $_POST['category_id'], 
+                                                               $_course_id,
+                                                               $_POST['feedback'], 
+                                                               $_POST['instructions'], 
+                                                               $_POST['question'][0],
+                                                               $_POST['question'][1],
+                                                               $_POST['question'][2],
+                                                               $_POST['question'][3],
+                                                               $_POST['question'][4],
+                                                               $_POST['question'][5],
+                                                               $_POST['question'][6],
+                                                               $_POST['question'][7],
+                                                               $_POST['question'][8],
+                                                               $_POST['question'][9],
+                                                               $_POST['question_answer'][0], 
+                                                               $_POST['question_answer'][1], 
+                                                               $_POST['question_answer'][2], 
+                                                               $_POST['question_answer'][3], 
+                                                               $_POST['question_answer'][4], 
+                                                               $_POST['question_answer'][5], 
+                                                               $_POST['question_answer'][6], 
+                                                               $_POST['question_answer'][7], 
+                                                               $_POST['question_answer'][8], 
+                                                               $_POST['question_answer'][9], 
+                                                               $_POST['answer'][0], 
+                                                               $_POST['answer'][1], 
+                                                               $_POST['answer'][2], 
+                                                               $_POST['answer'][3], 
+                                                               $_POST['answer'][4], 
+                                                               $_POST['answer'][5], 
+                                                               $_POST['answer'][6], 
+                                                               $_POST['answer'][7], 
+                                                               $_POST['answer'][8], 
+                                                               $_POST['answer'][9]);
+
+               $sql = vsprintf(TR_SQL_QUESTION_MATCHING, $sql_params); 
+               if ($testsQuestionsDAO->execute($sql)) {
+                       $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+                       header('Location: question_db.php?_course_id='.$_course_id);
+                       exit;
+               }
+       }
+}
+
+// for matching test questions
+$_letters = array(_AT('a'), _AT('b'), _AT('c'), _AT('d'), _AT('e'), _AT('f'), _AT('g'), _AT('h'), _AT('i'), _AT('j'));
+
+$onload = 'document.form.category_id.focus();';
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$savant->assign('letters', $_letters);
+$savant->assign('course_id', $_course_id);
+$savant->display('tests/create_edit_question_matching.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/docs/tests/create_question_matchingdd.php b/docs/tests/create_question_matchingdd.php
new file mode 100644 (file)
index 0000000..8a1dc85
--- /dev/null
@@ -0,0 +1,109 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/lib/test_question_queries.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+$testsQuestionsDAO = new TestsQuestionsDAO();
+//require_once(TR_INCLUDE_PATH.'../tests/lib/test_result_functions.inc.php');
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: question_db.php?_course_id='.$_course_id);
+       exit;
+} else if ($_POST['submit']) {
+       $_POST['feedback']    = trim($_POST['feedback']);
+       $_POST['instructions'] = trim($_POST['instructions']);
+       $_POST['category_id'] = intval($_POST['category_id']);
+
+       for ($i = 0 ; $i < 10; $i++) {
+               $_POST['question'][$i]        = $addslashes(trim($_POST['question'][$i]));
+               $_POST['question_answer'][$i] = (int) $_POST['question_answer'][$i];
+               $_POST['answer'][$i]          = $addslashes(trim($_POST['answer'][$i]));
+       }
+
+       if (!$_POST['question'][0] 
+               || !$_POST['question'][1] 
+               || !$_POST['answer'][0] 
+               || !$_POST['answer'][1]) {
+
+               $msg->addError('QUESTION_EMPTY');
+       }
+       
+
+       if (!$msg->containsErrors()) {
+               $_POST['feedback']     = $addslashes($_POST['feedback']);
+               $_POST['instructions'] = $addslashes($_POST['instructions']);
+       
+               $sql_params = array(    $_POST['category_id'], 
+                                                               $_course_id,
+                                                               $_POST['feedback'], 
+                                                               $_POST['instructions'], 
+                                                               $_POST['question'][0], 
+                                                               $_POST['question'][1], 
+                                                               $_POST['question'][2], 
+                                                               $_POST['question'][3], 
+                                                               $_POST['question'][4], 
+                                                               $_POST['question'][5], 
+                                                               $_POST['question'][6], 
+                                                               $_POST['question'][7], 
+                                                               $_POST['question'][8], 
+                                                               $_POST['question'][9], 
+                                                               $_POST['question_answer'][0], 
+                                                               $_POST['question_answer'][1], 
+                                                               $_POST['question_answer'][2], 
+                                                               $_POST['question_answer'][3], 
+                                                               $_POST['question_answer'][4], 
+                                                               $_POST['question_answer'][5], 
+                                                               $_POST['question_answer'][6], 
+                                                               $_POST['question_answer'][7], 
+                                                               $_POST['question_answer'][8], 
+                                                               $_POST['question_answer'][9],
+                                                               $_POST['answer'][0], 
+                                                               $_POST['answer'][1], 
+                                                               $_POST['answer'][2], 
+                                                               $_POST['answer'][3], 
+                                                               $_POST['answer'][4], 
+                                                               $_POST['answer'][5], 
+                                                               $_POST['answer'][6], 
+                                                               $_POST['answer'][7], 
+                                                               $_POST['answer'][8], 
+                                                               $_POST['answer'][9]);
+
+               $sql = vsprintf(TR_SQL_QUESTION_MATCHINGDD, $sql_params);
+
+               if ($testsQuestionsDAO->execute($sql)) {
+                       $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+                       header('Location: question_db.php?_course_id='.$_course_id);
+                       exit;
+               }
+       }
+}
+
+// for matching test questions
+$_letters = array(_AT('a'), _AT('b'), _AT('c'), _AT('d'), _AT('e'), _AT('f'), _AT('g'), _AT('h'), _AT('i'), _AT('j'));
+
+$onload = 'document.form.category_id.focus();';
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$savant->assign('letters', $_letters);
+$savant->assign('course_id', $_course_id);
+$savant->display('tests/create_edit_question_matchingdd.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/docs/tests/create_question_multianswer.php b/docs/tests/create_question_multianswer.php
new file mode 100644 (file)
index 0000000..c080685
--- /dev/null
@@ -0,0 +1,133 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/lib/test_question_queries.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+$testsQuestionsDAO = new TestsQuestionsDAO();
+
+if (isset($_POST['cancel']) || isset($_POST['submit_no'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: question_db.php?_course_id='.$_course_id);
+       exit;
+} else if ($_POST['submit'] || $_POST['submit_yes']) {
+       $_POST['required'] = intval($_POST['required']);
+       $_POST['feedback'] = trim($_POST['feedback']);
+       $_POST['question'] = trim($_POST['question']);
+       $_POST['category_id'] = intval($_POST['category_id']);
+
+       if ($_POST['question'] == ''){
+               $msg->addError(array('EMPTY_FIELDS', _AT('question')));
+       }
+               
+       if (!$msg->containsErrors()) {
+               $choice_new = array(); // stores the non-blank choices
+               $answer_new = array(); // stores the associated "answer" for the choices
+               for ($i=0; $i<10; $i++) {
+                       /**
+                        * Db defined it to be 255 length, chop strings off it it's less than that
+                        * @harris
+                        */
+                       $_POST['choice'][$i] = Utility::validateLength($_POST['choice'][$i], 255);
+                       $_POST['choice'][$i] = $addslashes(trim($_POST['choice'][$i]));
+                       $_POST['answer'][$i] = intval($_POST['answer'][$i]);
+
+                       if ($_POST['choice'][$i] == '') {
+                               /* an empty option can't be correct */
+                               $_POST['answer'][$i] = 0;
+                       } else {
+                               /* filter out empty choices/ remove gaps */
+                               $choice_new[] = $_POST['choice'][$i];
+                               $answer_new[] = $_POST['answer'][$i];
+
+                               if ($_POST['answer'][$i] != 0)
+                                       $has_answer = TRUE;
+                       }
+               }
+                       
+               if ($has_answer != TRUE && !$_POST['submit_yes']) {
+       
+                       $hidden_vars['required']    = htmlspecialchars($_POST['required']);
+                       $hidden_vars['feedback']    = htmlspecialchars($_POST['feedback']);
+                       $hidden_vars['question']    = htmlspecialchars($_POST['question']);
+                       $hidden_vars['category_id'] = htmlspecialchars($_POST['category_id']);
+
+                       for ($i = 0; $i < count($choice_new); $i++) {
+                               $hidden_vars['answer['.$i.']'] = htmlspecialchars($answer_new[$i]);
+                               $hidden_vars['choice['.$i.']'] = htmlspecialchars($choice_new[$i]);
+                       }
+
+                       $msg->addConfirm('NO_ANSWER', $hidden_vars);
+               } else {
+               
+                       //add slahes throughout - does that fix it?
+                       $_POST['answer'] = $answer_new;
+                       $_POST['choice'] = $choice_new;
+                       $_POST['answer'] = array_pad($_POST['answer'], 10, 0);
+                       $_POST['choice'] = array_pad($_POST['choice'], 10, '');
+               
+                       $_POST['feedback'] = $addslashes($_POST['feedback']);
+                       $_POST['question'] = $addslashes($_POST['question']);
+
+                       $sql_params = array(    $_POST['category_id'], 
+                                                                       $_course_id,
+                                                                       $_POST['feedback'], 
+                                                                       $_POST['question'], 
+                                                                       $_POST['choice'][0], 
+                                                                       $_POST['choice'][1], 
+                                                                       $_POST['choice'][2], 
+                                                                       $_POST['choice'][3], 
+                                                                       $_POST['choice'][4], 
+                                                                       $_POST['choice'][5], 
+                                                                       $_POST['choice'][6], 
+                                                                       $_POST['choice'][7], 
+                                                                       $_POST['choice'][8], 
+                                                                       $_POST['choice'][9], 
+                                                                       $_POST['answer'][0], 
+                                                                       $_POST['answer'][1], 
+                                                                       $_POST['answer'][2], 
+                                                                       $_POST['answer'][3], 
+                                                                       $_POST['answer'][4], 
+                                                                       $_POST['answer'][5], 
+                                                                       $_POST['answer'][6], 
+                                                                       $_POST['answer'][7], 
+                                                                       $_POST['answer'][8], 
+                                                                       $_POST['answer'][9]);
+                       $sql = vsprintf(TR_SQL_QUESTION_MULTIANSWER, $sql_params);
+
+                       if ($testsQuestionsDAO->execute($sql)) {
+                               $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+                               header('Location: question_db.php?_course_id='.$_course_id);
+                               exit;
+                       }
+               }
+       }
+}
+
+$onload = 'document.form.category_id.focus();';
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$msg->printConfirm();
+
+$savant->assign('qid', $qid);
+$savant->assign('tid', $_REQUEST['tid']);
+$savant->assign('course_id', $_course_id);
+$savant->display('tests/create_edit_question_multianswer.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/docs/tests/create_question_multichoice.php b/docs/tests/create_question_multichoice.php
new file mode 100644 (file)
index 0000000..de9c8b6
--- /dev/null
@@ -0,0 +1,95 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/lib/test_question_queries.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+$testsQuestionsDAO = new TestsQuestionsDAO();
+
+if (isset($_POST['cancel']) || isset($_POST['submit_no'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: question_db.php?_course_id='.$_course_id);
+       exit;
+} else if (isset($_POST['submit'])) {
+       $_POST['required'] = intval($_POST['required']);
+       $_POST['feedback'] = trim($_POST['feedback']);
+       $_POST['question'] = trim($_POST['question']);
+       $_POST['category_id'] = intval($_POST['category_id']);
+       $_POST['answer']      = intval($_POST['answer']);
+
+       if ($_POST['question'] == ''){
+               $msg->addError(array('EMPTY_FIELDS', _AT('question')));
+       }
+               
+       if (!$msg->containsErrors()) {
+               for ($i=0; $i<10; $i++) {
+                       $_POST['choice'][$i] = $addslashes(trim($_POST['choice'][$i]));
+               }
+
+               $answers = array_fill(0, 10, 0);
+               $answers[$_POST['answer']] = 1;
+
+               $_POST['feedback']   = $addslashes($_POST['feedback']);
+               $_POST['question']   = $addslashes($_POST['question']);
+
+               $sql_params = array(    $_POST['category_id'], 
+                                                               $_course_id,
+                                                               $_POST['feedback'], 
+                                                               $_POST['question'], 
+                                                               $_POST['choice'][0], 
+                                                               $_POST['choice'][1], 
+                                                               $_POST['choice'][2], 
+                                                               $_POST['choice'][3], 
+                                                               $_POST['choice'][4], 
+                                                               $_POST['choice'][5], 
+                                                               $_POST['choice'][6], 
+                                                               $_POST['choice'][7], 
+                                                               $_POST['choice'][8], 
+                                                               $_POST['choice'][9], 
+                                                               $answers[0], 
+                                                               $answers[1], 
+                                                               $answers[2], 
+                                                               $answers[3], 
+                                                               $answers[4], 
+                                                               $answers[5], 
+                                                               $answers[6], 
+                                                               $answers[7], 
+                                                               $answers[8], 
+                                                               $answers[9]);
+               $sql = vsprintf(TR_SQL_QUESTION_MULTI, $sql_params);
+               
+               if ($testsQuestionsDAO->execute($sql)) {
+                       $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+                       header('Location: question_db.php?_course_id='.$_course_id);
+                       exit;
+               }
+       }
+} else {
+       $_POST['answer'] = 0;
+}
+
+$onload = 'document.form.category_id.focus();';
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$msg->printConfirm();
+
+$savant->assign('course_id', $_course_id);
+$savant->display('tests/create_edit_question_multichoice.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/docs/tests/create_question_ordering.php b/docs/tests/create_question_ordering.php
new file mode 100644 (file)
index 0000000..b7d7fa4
--- /dev/null
@@ -0,0 +1,118 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/lib/test_question_queries.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+$testsQuestionsDAO = new TestsQuestionsDAO();
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: question_db.php?_course_id='.$_course_id);
+       exit;
+} else if ($_POST['submit']) {
+       $missing_fields = array();
+
+       $_POST['feedback']    = trim($_POST['feedback']);
+       $_POST['question']    = trim($_POST['question']);
+       $_POST['category_id'] = intval($_POST['category_id']);
+
+       if ($_POST['question'] == ''){
+               $missing_fields[] = _AT('question');
+       }
+
+       if (trim($_POST['choice'][0]) == '') {
+               $missing_fields[] = _AT('item').' 1';
+       }
+       if (trim($_POST['choice'][1]) == '') {
+               $missing_fields[] = _AT('item').' 2';
+       }
+
+       if ($missing_fields) {
+               $missing_fields = implode(', ', $missing_fields);
+               $msg->addError(array('EMPTY_FIELDS', $missing_fields));
+       }
+
+       if (!$msg->containsErrors()) {
+               $choice_new = array(); // stores the non-blank choices
+               $answer_new = array(); // stores the non-blank answers
+               $order = 0; // order count
+               for ($i=0; $i<10; $i++) {
+                       /**
+                        * Db defined it to be 255 length, chop strings off it it's less than that
+                        * @harris
+                        */
+                       $_POST['choice'][$i] = Utility::validateLength($_POST['choice'][$i], 255);
+                       $_POST['choice'][$i] = $addslashes(trim($_POST['choice'][$i]));
+
+                       if ($_POST['choice'][$i] != '') {
+                               /* filter out empty choices/ remove gaps */
+                               $choice_new[] = $_POST['choice'][$i];
+                               $answer_new[] = $order++;
+                       }
+               }
+
+               $_POST['choice']   = array_pad($choice_new, 10, '');
+               $answer_new        = array_pad($answer_new, 10, 0);
+               $_POST['feedback'] = $addslashes($_POST['feedback']);
+               $_POST['question'] = $addslashes($_POST['question']);
+       
+               $sql_params = array(    $_POST['category_id'], 
+                                                               $_course_id,
+                                                               $_POST['feedback'], 
+                                                               $_POST['question'], 
+                                                               $_POST['choice'][0], 
+                                                               $_POST['choice'][1], 
+                                                               $_POST['choice'][2], 
+                                                               $_POST['choice'][3], 
+                                                               $_POST['choice'][4], 
+                                                               $_POST['choice'][5], 
+                                                               $_POST['choice'][6], 
+                                                               $_POST['choice'][7], 
+                                                               $_POST['choice'][8], 
+                                                               $_POST['choice'][9], 
+                                                               $answer_new[0], 
+                                                               $answer_new[1], 
+                                                               $answer_new[2], 
+                                                               $answer_new[3], 
+                                                               $answer_new[4], 
+                                                               $answer_new[5], 
+                                                               $answer_new[6], 
+                                                               $answer_new[7], 
+                                                               $answer_new[8], 
+                                                               $answer_new[9]);
+               $sql = vsprintf(TR_SQL_QUESTION_ORDERING, $sql_params);
+
+               if ($testsQuestionsDAO->execute($sql)) {
+                       $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+                       header('Location: question_db.php?_course_id='.$_course_id);
+                       exit;
+               }
+               else
+                       $msg->addError('DB_NOT_UPDATED');
+       }
+}
+
+$onload = 'document.form.category_id.focus();';
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$savant->assign('course_id', $_course_id);
+$savant->display('tests/create_edit_question_ordering.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/docs/tests/create_question_truefalse.php b/docs/tests/create_question_truefalse.php
new file mode 100644 (file)
index 0000000..2cc61d3
--- /dev/null
@@ -0,0 +1,71 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/lib/test_question_queries.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+$testsQuestionsDAO = new TestsQuestionsDAO();
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: question_db.php?_course_id='.$_course_id);
+       exit;
+} else if ($_POST['submit']) {
+       $_POST['required']     = 1; //intval($_POST['required']);
+       $_POST['feedback']     = trim($_POST['feedback']);
+       $_POST['question']     = trim($_POST['question']);
+       $_POST['category_id']  = intval($_POST['category_id']);
+       $_POST['answer']       = intval($_POST['answer']);
+
+       if ($_POST['question'] == ''){
+               $msg->addError(array('EMPTY_FIELDS', _AT('statement')));
+       }
+
+       if (!$msg->containsErrors()) {
+               $_POST['feedback'] = $addslashes($_POST['feedback']);
+               $_POST['question'] = $addslashes($_POST['question']);
+
+               /*
+               $sql = 'SELECT content_id FROM '.TABLE_PREFIX."tests WHERE test_id=$_POST[tid]";
+               $result = mysql_query($sql, $db);                       
+               $row = mysql_fetch_assoc($result);
+               */
+
+               $sql_params = array(    $_POST['category_id'], 
+                                                               $_course_id,
+                                                               $_POST['feedback'], 
+                                                               $_POST['question'], 
+                                                               $_POST['answer']);
+
+               $sql = vsprintf(TR_SQL_QUESTION_TRUEFALSE, $sql_params);
+               if ($testsQuestionsDAO->execute($sql)) {
+                       $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+                       header('Location: question_db.php?_course_id='.$_course_id);
+               }
+               else
+                       $msg->addError('DB_NOT_UPDATED');
+       }
+}
+
+$onload = 'document.form.category_id.focus();';
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$savant->assign('course_id', $_course_id);
+$savant->display('tests/create_edit_question_truefalse.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/docs/tests/create_test.php b/docs/tests/create_test.php
new file mode 100644 (file)
index 0000000..2dec6b0
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+//$page = 'tests';
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+
+$test_type = 'normal';
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: index.php?_course_id='.$_course_id);
+       exit;
+} else if (isset($_POST['submit'])) {
+       $testsDAO = new TestsDAO();
+       
+       if ($testsDAO->Create($_course_id, $_POST['title'], $_POST['description']))
+       {
+               $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+               header('Location: index.php?_course_id='.$_course_id);
+               exit;
+       }
+}
+
+$onload = 'document.form.title.focus();';
+
+$savant->assign('course_id', $_course_id);
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+$msg->printErrors();
+
+$savant->display('tests/create_edit_test.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php'); 
+
+?>
\ No newline at end of file
diff --git a/docs/tests/dd.php b/docs/tests/dd.php
new file mode 100644 (file)
index 0000000..1fec8b9
--- /dev/null
@@ -0,0 +1,219 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+
+if (defined('TR_FORCE_GET_FILE') && TR_FORCE_GET_FILE) {
+       $content_base_href = 'get.php/';
+} else {
+       $content_base_href = 'content/' . $_SESSION['course_id'] . '/';
+}
+// Verify that we may access this question
+if (!isset($_SESSION['dd_question_ids']) || !is_array($_SESSION['dd_question_ids']) || !isset($_SESSION['dd_question_ids'][$_GET['qid']])) {
+       // Just exit as we're in an IFRAME
+       exit;
+}
+// Clean up tidily
+unset($_SESSION['dd_question_ids'][$_GET['qid']]);
+if (count($_SESSION['dd_question_ids']) == 0) {
+       unset($_SESSION['dd_question_ids']);
+}
+session_write_close();
+$_GET['qid'] = intval($_GET['qid']);
+$sql = "SELECT * FROM ".TABLE_PREFIX."tests_questions WHERE question_id=$_GET[qid]";
+$result = mysql_query($sql, $db);
+$row = mysql_fetch_assoc($result);
+
+$_letters = array(_AT('A'), _AT('B'), _AT('C'), _AT('D'), _AT('E'), _AT('F'), _AT('G'), _AT('H'), _AT('I'), _AT('J'));
+$_colours = array('#FF9900', '#00FF00', '#0000FF', '#F23AA3', '#9999CC', '#990026', '#0099CC', '#22C921', '#007D48', '#00248F');
+
+$num_options = 0;
+for ($i=0; $i < 10; $i++) {
+       if ($row['option_'. $i] != '') {
+               $num_options++;
+       }
+}
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html lang="<?php echo $_SESSION['lang']; ?>">
+<head>
+       <title><?php echo SITE_NAME; ?> : <?php echo AT_print($row['question'], 'tests_questions.question'); ?></title>
+       <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $myLang->getCharacterSet(); ?>" />
+       <meta name="Generator" content="Transformable - Copyright 2010 by http://atutor.ca" />
+       <base href="<?php echo TR_BASE_HREF . $content_base_href; ?>" />
+       <script type="text/javascript" src="<?php echo TR_BASE_HREF; ?>include/jscripts/jquery.js"></script>
+       <script type="text/javascript" src="<?php echo TR_BASE_HREF; ?>include/jscripts/interface.js"></script>
+       <script type="text/javascript" src="<?php echo TR_BASE_HREF; ?>include/jscripts/wz_jsgraphics.js"></script>
+       <link rel="stylesheet" href="<?php echo TR_BASE_HREF; ?>themes/default/styles.css" type="text/css" />
+<style type="text/css">
+* {
+       margin: 0px;
+       padding: 0px;
+}
+body {
+       background-color: #fdfdfd;
+}
+option {
+       padding-right: 5px;
+}
+li {
+       padding: 5px;
+       border: 1px solid #ccc;
+       margin: 8px;
+}
+li.question {
+       width: 180px;
+       overflow: auto;
+}
+li.question:hover {
+       cursor: move;
+}
+li.answer {
+       width: 180px;
+       overflow: auto;
+       padding: 8px;
+       margin: 8px;
+}
+.dropactive {
+       background-color: #fc9;
+}
+.drophover {
+       background-color: #ffc;
+}
+</style>
+</head>
+<body>
+
+<?php $response = explode('|', $_GET['response']); ?>
+
+<?php for ($i=0; $i < 10; $i++): ?>
+       <?php if ($row['choice_'. $i] != ''): ?>
+               <div id="container<?php echo $i; ?>" style="position: absolute; top: 0px; left: 0px; width: 100%"></div>
+       <?php endif; ?>
+<?php endfor; ?>
+
+<form method="get">
+       <ul style="position: absolute; top: 10px; left: 5px" id="q">
+               <?php for ($i=0; $i < 10; $i++): ?>
+                       <?php if ($row['choice_'. $i] != ''): ?>
+                               <li class="question" id="q<?php echo $i; ?>" value="<?php echo $i; ?>">
+                                       <select name="s<?php echo $i; ?>" onchange="selectLine(this.value, '<?php echo $i; ?>');" id="s<?php echo $i; ?>">
+                                               <option value="-1">-</option>
+                                               <?php for ($j=0; $j < $num_options; $j++): ?>
+                                                       <option value="<?php echo $j; ?>" <?php if($response[$i] == $j): ?>selected="selected"<?php endif; ?>><?php echo $_letters[$j]; ?></option>
+                                               <?php endfor; ?>
+                                       </select>
+                               
+                               <?php echo $row['choice_'.$i]; ?></li>
+                       <?php endif; ?>
+               <?php endfor; ?>
+       </ul>
+
+       <ol style="position: absolute; list-style-type: upper-alpha; top: 10px; left: 310px" id="a">
+               <?php for ($i=0; $i < 10; $i++): ?>
+                       <?php if ($row['option_'. $i] != ''): ?>
+                               <li class="answer" id="a<?php echo $i; ?>" value="<?php echo $i; ?>"><?php echo $_letters[$i]; ?>. <?php echo $row['option_'.$i]; ?></li>
+                       <?php endif; ?>
+               <?php endfor; ?>
+       </ol>
+</form>
+<script type="text/javascript">
+// <!--
+if($.browser.msie) {
+       var padding = 8;
+} else {
+       var padding = 15;
+}
+var jg = Array(10);
+<?php for ($i=0; $i < 10; $i++): ?>
+       <?php if ($row['choice_'. $i] != ''): ?>
+               jg[<?php echo $i; ?>] = new jsGraphics("container<?php echo $i; ?>");
+               jg[<?php echo $i; ?>].setStroke(3);
+               jg[<?php echo $i; ?>].setColor("<?php echo $_colours[$i]; ?>");
+       <?php endif; ?>
+<?php endfor; ?>
+
+var container_html = $("#container0").html();
+
+$(document).ready(
+       function() {
+       
+               $('#q>li').Draggable(
+                       {
+                               containment: "document",
+                               zIndex:         1000,
+                               ghosting:       true,
+                               opacity:        1,
+                               revert:     true,
+                               fx: 0 // doesn't update select menu in FF if > 0
+                       }
+               ); // end draggable
+
+               $('#a>li').Droppable(
+                       {
+                               accept : 'question', 
+                               activeclass: 'dropactive', 
+                               hoverclass:     'drophover',
+                               tolerance: "pointer",
+                               ondrop: function (drag)  {
+                                       var lx = drag.offsetLeft + $("#" + drag.id).width() + padding;
+                                       var ly = drag.offsetTop  + $("#" + drag.id).height()/2 + 10;
+                                       var rx = this.offsetLeft + 310;
+                                       var ry = this.offsetTop  + $("#" + this.id).height()/2 + 10;
+
+                                       document.getElementById('s' + drag.value).selectedIndex =  this.value + 1;
+
+                                       window.top.document.getElementById("<?php echo $_GET['qid']; ?>q" + drag.value).value = this.value;
+
+                                       $("#container" + drag.value).html(container_html);
+
+                                       jg[drag.value].drawLine(lx, ly , rx, ry );
+                                       jg[drag.value].paint();
+
+                                       return true;
+                               }
+                       }
+               ); // end droppable
+
+        parent.iframeSetHeight(<?php echo $_GET['qid']; ?>, Math.max($("#q").height(), $("#a").height()));
+               <?php foreach ($response as $id => $value): ?>
+               selectLine(<?php echo $value; ?>, <?php echo $id; ?>);
+               <?php endforeach; ?>
+       }
+)
+
+function selectLine(value, id) {
+       if (value == -1) {
+               window.top.document.getElementById("<?php echo $_GET['qid']; ?>q" + id).value = "-1";
+               $("#container" + id).html(container_html);
+
+               return true;
+       }
+
+       var lx = document.getElementById("q" + id).offsetLeft + $("#q" + id).width() + padding;
+       var ly = document.getElementById("q" + id).offsetTop  + $("#q" + id).height()/2 + 10;
+       var rx = document.getElementById("a" + value).offsetLeft + 310;
+       var ry = document.getElementById("a" + value).offsetTop + $("#a" + value).height()/2 + 10;
+
+       window.top.document.getElementById("<?php echo $_GET['qid']; ?>q" + id).value = value;
+
+       $("#container" + id).html(container_html);
+       jg[id].drawLine(lx, ly , rx, ry );
+       jg[id].paint();
+
+       return true;
+}
+// -->
+</script>
+
+</body>
\ No newline at end of file
diff --git a/docs/tests/delete_question.php b/docs/tests/delete_question.php
new file mode 100644 (file)
index 0000000..69a0cbc
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsAssocDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+$testsQuestionsDAO = new TestsQuestionsDAO();
+$testsQuestionsAssocDAO = new TestsQuestionsAssocDAO();
+
+$tid = intval($_REQUEST['tid']);
+
+if (isset($_POST['submit_no'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: question_db.php?_course_id='.$_course_id);
+       exit;
+} else if (isset($_POST['submit_yes'])) {
+       $_POST['qid'] = explode(',', $_POST['qid']);
+
+       foreach ($_POST['qid'] as $id) {
+               $id = intval($id);
+
+               if ($testsQuestionsDAO->Delete($id)) $testsQuestionsAssocDAO->DeleteByQuestionID($id);
+       }
+
+       $msg->addFeedback('QUESTION_DELETED');
+       header('Location: question_db.php?_course_id='.$_course_id);
+       exit;
+} /* else: */
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$these_questions= explode(",", $_REQUEST['qid']);
+
+foreach($these_questions as $this_question){
+       $this_question = intval($this_question);
+       $row = $testsQuestionsDAO->get($this_question);
+       $confirm .= "<li>".$row['question']."</li>";
+}
+
+$confirm = array('DELETE', $confirm);
+$hidden_vars['qid'] = $_REQUEST['qid'];
+$hidden_vars['_course_id'] = $_course_id;
+
+$msg->addConfirm($confirm, $hidden_vars);
+$msg->printConfirm();
+
+require_once(TR_INCLUDE_PATH.'footer.inc.php');
+?>
\ No newline at end of file
diff --git a/docs/tests/delete_result.php b/docs/tests/delete_result.php
new file mode 100644 (file)
index 0000000..b427f5a
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+
+$tid = intval($_REQUEST['tid']);
+$rids = explode(',', $_REQUEST['rid']);
+foreach ($rids as $k => $id) {
+       $rids[$k] = intval($id);
+}
+$rid = implode(',', $rids);
+
+// Check that the user deletes submissions in his own test; if not, exit like authenticate()
+$sql   = "SELECT count(*) AS cnt FROM ".TABLE_PREFIX."tests_results R LEFT JOIN ".TABLE_PREFIX."tests USING (test_id) WHERE result_id IN ($rid) AND course_id = $_SESSION[course_id] AND R.test_id = $tid";
+
+$result        = mysql_query($sql, $db);
+$row = mysql_fetch_array($result);
+if ($row['cnt'] < count($rids)) {
+       exit;
+}
+
+if (isset($_POST['submit_no'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: '.TR_BASE_HREF.'tests/results.php?tid='.$tid);
+       exit;
+
+} else if (isset($_POST['submit_yes'])) {
+       $sql    = "DELETE FROM ".TABLE_PREFIX."tests_answers WHERE result_id IN ($rid)";
+       $result = mysql_query($sql, $db);
+
+       $sql    = "DELETE FROM ".TABLE_PREFIX."tests_results WHERE result_id IN ($rid)";
+       $result = mysql_query($sql, $db);
+               
+       $msg->addFeedback('RESULT_DELETED');
+       header('Location: '.TR_BASE_HREF.'tests/results.php?tid='.$tid);
+       exit;
+} 
+
+$_pages['tests/delete_result.php']['title_var']  = 'delete_results';
+$_pages['tests/delete_result.php']['parent'] = 'tests/results.php?tid='.$tid;
+
+$_pages['tests/results.php?tid='.$tid]['title_var'] = 'submissions';
+$_pages['tests/results.php?tid='.$tid]['parent'] = 'tests/index.php';
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+unset($hidden_vars);
+$hidden_vars['tid'] = $tid;
+$hidden_vars['rid'] = $rid;
+$msg->addConfirm(array('DELETE', _AT('submissions') .': <strong>'. count($rids) .'</strong>'), $hidden_vars);
+
+$msg->printConfirm();
+
+require_once(TR_INCLUDE_PATH.'footer.inc.php');
+?>
\ No newline at end of file
diff --git a/docs/tests/delete_test.php b/docs/tests/delete_test.php
new file mode 100644 (file)
index 0000000..36e4908
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+$page = 'tests';
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+       
+       if (isset($_POST['submit_no'])) {
+               $msg->addFeedback('CANCELLED');
+               header('Location: index.php');
+               exit;
+       } else if (isset($_POST['submit_yes'])) {
+               
+               $tid = intval($_POST['tid']);
+
+               $sql    = "DELETE FROM ".TABLE_PREFIX."tests WHERE test_id=$tid AND course_id=$_SESSION[course_id]";
+               $result = mysql_query($sql, $db);
+
+               if (mysql_affected_rows($db) == 1) {
+                       $sql    = "DELETE FROM ".TABLE_PREFIX."tests_questions_assoc WHERE test_id=$tid";
+                       $result = mysql_query($sql, $db);
+
+                       //delete test content association as well
+                       $sql    = "DELETE FROM ".TABLE_PREFIX."content_tests_assoc WHERE test_id=$tid";
+                       $result = mysql_query($sql, $db);
+
+                       /* it has to delete the results as well... */
+                       $sql    = "SELECT result_id FROM ".TABLE_PREFIX."tests_results WHERE test_id=$tid";
+                       $result = mysql_query($sql, $db);
+                       if ($row = mysql_fetch_array($result)) {
+                               $result_list = '('.$row['result_id'];
+
+                               while ($row = mysql_fetch_array($result)) {
+                                       $result_list .= ','.$row['result_id'];
+                               }
+                               $result_list .= ')';
+                       }
+
+                       if ($result_list != '') {
+                               $sql    = "DELETE FROM ".TABLE_PREFIX."tests_answers WHERE result_id IN $result_list";
+                               $result = mysql_query($sql, $db);
+
+
+                               $sql    = "DELETE FROM ".TABLE_PREFIX."tests_results WHERE test_id=$tid";
+                               $result = mysql_query($sql, $db);
+                       }
+               }
+
+               $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+               header('Location: '.TR_BASE_HREF.'tests/index.php');
+               exit;
+
+       } /* else: */
+
+       require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+       $_GET['tid'] = intval($_GET['tid']);
+
+       $sql    = "SELECT title FROM ".TABLE_PREFIX."tests WHERE test_id=$_GET[tid] AND course_id=$_SESSION[course_id]";
+       $result = mysql_query($sql, $db);
+       $row    = mysql_fetch_array($result);
+
+       unset($hidden_vars);
+       $hidden_vars['tid'] = $_GET['tid'];
+
+       $msg->addConfirm(array('DELETE_TEST', $row['title']), $hidden_vars);
+       $msg->printConfirm();
+
+       require_once(TR_INCLUDE_PATH.'footer.inc.php');
+?>
\ No newline at end of file
diff --git a/docs/tests/edit_question_likert.php b/docs/tests/edit_question_likert.php
new file mode 100644 (file)
index 0000000..1e51911
--- /dev/null
@@ -0,0 +1,146 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/lib/likert_presets.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+$testsQuestionsDAO = new TestsQuestionsDAO();
+
+$qid = intval($_GET['qid']);
+if ($qid == 0){
+       $qid = intval($_POST['qid']);
+}
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       if ($_POST['tid']) {
+               header('Location: questions.php?tid='.$_POST['tid'].'&_course_id='.$_course_id);                        
+       } else {
+               header('Location: question_db.php?_course_id='.$_course_id);
+       }
+       exit;
+} else if (isset($_POST['submit'])) {
+       $_POST['question']    = trim($_POST['question']);
+       $_POST['category_id'] = intval($_POST['category_id']);
+       $_POST['alignment']   = intval($_POST['alignment']);
+
+       $empty_fields = array();
+       if ($_POST['question'] == ''){
+               $empty_fields[] = _AT('question');
+       }
+       if ($_POST['choice'][0] == '') {
+               $empty_fields[] = _AT('choice').' 1';
+       }
+
+       if ($_POST['choice'][1] == '') {
+               $empty_fields[] = _AT('choice').' 2';
+       }
+
+       if (!empty($empty_fields)) {
+               $msg->addError(array('EMPTY_FIELDS', implode(', ', $empty_fields)));
+       }
+
+       if (!$msg->containsErrors()) {
+               $_POST['question'] = $addslashes($_POST['question']);
+
+               for ($i=0; $i<10; $i++) {
+                       $_POST['choice'][$i] = $addslashes(trim($_POST['choice'][$i]));
+                       $_POST['answer'][$i] = intval($_POST['answer'][$i]);
+
+                       if ($_POST['choice'][$i] == '') {
+                               /* an empty option can't be correct */
+                               $_POST['answer'][$i] = 0;
+                       }
+               }               
+               $sql    = "UPDATE ".TABLE_PREFIX."tests_questions SET
+                       category_id=$_POST[category_id],
+                       feedback='',
+                       question='$_POST[question]',
+                       choice_0='{$_POST[choice][0]}',
+                       choice_1='{$_POST[choice][1]}',
+                       choice_2='{$_POST[choice][2]}',
+                       choice_3='{$_POST[choice][3]}',
+                       choice_4='{$_POST[choice][4]}',
+                       choice_5='{$_POST[choice][5]}',
+                       choice_6='{$_POST[choice][6]}',
+                       choice_7='{$_POST[choice][7]}',
+                       choice_8='{$_POST[choice][8]}',
+                       choice_9='{$_POST[choice][9]}',
+                       answer_0={$_POST[answer][0]},
+                       answer_1={$_POST[answer][1]},
+                       answer_2={$_POST[answer][2]},
+                       answer_3={$_POST[answer][3]},
+                       answer_4={$_POST[answer][4]},
+                       answer_5={$_POST[answer][5]},
+                       answer_6={$_POST[answer][6]},
+                       answer_7={$_POST[answer][7]},
+                       answer_8={$_POST[answer][8]},
+                       answer_9={$_POST[answer][9]}
+                       WHERE question_id=$_POST[qid]";
+               $testsQuestionsDAO->execute($sql);
+
+               $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+               if ($_POST['tid']) {
+                       header('Location: questions.php?tid='.$_POST['tid'].'&_course_id='.$_course_id);                        
+               } else {
+                       header('Location: question_db.php?_course_id='.$_course_id);
+               }
+               exit;
+       }
+} else if (isset($_POST['preset'])) {
+       // load preset
+       $_POST['preset_num'] = intval($_POST['preset_num']);
+
+       if (isset($_likert_preset[$_POST['preset_num']])) {
+               $_POST['choice'] = $_likert_preset[$_POST['preset_num']];
+       } else if ($_POST['preset_num']) {
+               if ($row = $testsQuestionsDAO->get($_POST['preset_num'])){
+                       for ($i=0; $i<10; $i++) {
+                               $_POST['choice'][$i] = $row['choice_' . $i];
+                       }
+               }
+       }
+} else {
+       if (!($row = $testsQuestionsDAO->get($qid))){
+               require_once(TR_INCLUDE_PATH.'header.inc.php');
+               $msg->printErrors('ITEM_NOT_FOUND');
+               require (TR_INCLUDE_PATH.'footer.inc.php');
+               exit;
+       }
+       
+       $_POST['question']              = $row['question'];
+       $_POST['category_id']   = $row['category_id'];
+
+       for ($i=0; $i<10; $i++) {
+               $_POST['choice'][$i] = $row['choice_'.$i];
+       }
+}
+
+global $onload;
+$onload = 'document.form.category_id.focus();';
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$savant->assign('qid', $qid);
+$savant->assign('tid', $_REQUEST['tid']);
+$savant->assign('likert_preset', $_likert_preset);
+$savant->assign('testsQuestionsDAO', $testsQuestionsDAO);
+$savant->assign('course_id', $_course_id);
+$savant->display('tests/create_edit_question_likert.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php');  ?>
\ No newline at end of file
diff --git a/docs/tests/edit_question_long.php b/docs/tests/edit_question_long.php
new file mode 100644 (file)
index 0000000..872d996
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+$testsQuestionsDAO = new TestsQuestionsDAO();
+
+require_once(TR_INCLUDE_PATH.'../tests/lib/test_result_functions.inc.php');
+
+$qid = intval($_GET['qid']);
+if ($qid == 0){
+       $qid = intval($_POST['qid']);
+}
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       if ($_POST['tid']) {
+               header('Location: questions.php?tid='.$_POST['tid'].'&_course_id='.$_course_id);                        
+       } else {
+               header('Location: question_db.php?_course_id='.$_course_id);
+       }
+       exit;
+} else if (isset($_POST['submit'])) {
+       $_POST['feedback']    = trim($_POST['feedback']);
+       $_POST['question']    = trim($_POST['question']);
+       $_POST['category_id'] = intval($_POST['category_id']);
+       $_POST['properties']  = intval($_POST['properties']);
+
+       if ($_POST['question'] == ''){
+               $msg->addError(array('EMPTY_FIELDS', _AT('question')));
+       }
+
+       if (!$msg->containsErrors()) {
+               $_POST['question'] = $addslashes($_POST['question']);
+               $_POST['feedback'] = $addslashes($_POST['feedback']);
+
+               $sql = "UPDATE ".TABLE_PREFIX."tests_questions SET      category_id=$_POST[category_id],
+                       feedback='$_POST[feedback]',
+                       question='$_POST[question]',
+                       properties=$_POST[properties]
+               WHERE question_id=$_POST[qid]";
+
+               $testsQuestionsDAO->execute($sql);
+
+               $msg->addFeedback('QUESTION_UPDATED');
+               if ($_POST['tid']) {
+                       header('Location: questions.php?tid='.$_POST['tid'].'&_course_id='.$_course_id);                        
+               } else {
+                       header('Location: question_db.php?_course_id='.$_course_id);
+               }
+               exit;
+       }
+}
+
+if (!isset($_POST['submit'])) {
+       if (!($row = $testsQuestionsDAO->get($qid))){
+               $msg->printErrors('ITEM_NOT_FOUND');
+               require (TR_INCLUDE_PATH.'footer.inc.php');
+               exit;
+       }
+
+       $_POST  = $row;
+}
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$msg->printErrors();
+
+$savant->assign('qid', $qid);
+$savant->assign('tid', $_REQUEST['tid']);
+$savant->assign('course_id', $_course_id);
+$savant->display('tests/create_edit_question_long.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php'); 
+?>
\ No newline at end of file
diff --git a/docs/tests/edit_question_matching.php b/docs/tests/edit_question_matching.php
new file mode 100644 (file)
index 0000000..a9c7e63
--- /dev/null
@@ -0,0 +1,141 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/lib/likert_presets.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+$testsQuestionsDAO = new TestsQuestionsDAO();
+
+require_once(TR_INCLUDE_PATH.'../tests/lib/test_result_functions.inc.php');
+
+// for matching test questions
+$_letters = array(_AT('a'), _AT('b'), _AT('c'), _AT('d'), _AT('e'), _AT('f'), _AT('g'), _AT('h'), _AT('i'), _AT('j'));
+
+$qid = intval($_GET['qid']);
+if ($qid == 0){
+       $qid = intval($_POST['qid']);
+}
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       if ($_POST['tid']) {
+               header('Location: questions.php?tid='.$_POST['tid'].'&_course_id='.$_course_id);                        
+       } else {
+               header('Location: question_db.php?_course_id='.$_course_id);
+       }
+       exit;
+} else if (isset($_POST['submit'])) {
+       $_POST['tid']          = intval($_POST['tid']);
+       $_POST['qid']          = intval($_POST['qid']);
+       $_POST['feedback']     = trim($_POST['feedback']);
+       $_POST['instructions'] = trim($_POST['instructions']);
+       $_POST['category_id']  = intval($_POST['category_id']);
+
+       for ($i = 0 ; $i < 10; $i++) {
+               $_POST['question'][$i]        = $addslashes(trim($_POST['question'][$i]));
+               $_POST['question_answer'][$i] = (int) $_POST['question_answer'][$i];
+               $_POST['answer'][$i]          = $addslashes(trim($_POST['answer'][$i]));
+       }
+
+       if (!$_POST['question'][0] 
+               || !$_POST['question'][1] 
+               || !$_POST['answer'][0] 
+               || !$_POST['answer'][1]) {
+
+               $msg->addError('QUESTION_EMPTY');
+       }
+
+       if (!$msg->containsErrors()) {
+               $_POST['feedback']     = $addslashes($_POST['feedback']);
+               $_POST['instructions'] = $addslashes($_POST['instructions']);
+               
+               $sql    = "UPDATE ".TABLE_PREFIX."tests_questions SET
+                       category_id=$_POST[category_id],
+                       feedback='$_POST[feedback]',
+                       question='$_POST[instructions]',
+                       choice_0='{$_POST[question][0]}',
+                       choice_1='{$_POST[question][1]}',
+                       choice_2='{$_POST[question][2]}',
+                       choice_3='{$_POST[question][3]}',
+                       choice_4='{$_POST[question][4]}',
+                       choice_5='{$_POST[question][5]}',
+                       choice_6='{$_POST[question][6]}',
+                       choice_7='{$_POST[question][7]}',
+                       choice_8='{$_POST[question][8]}',
+                       choice_9='{$_POST[question][9]}',
+                       answer_0={$_POST[question_answer][0]},
+                       answer_1={$_POST[question_answer][1]},
+                       answer_2={$_POST[question_answer][2]},
+                       answer_3={$_POST[question_answer][3]},
+                       answer_4={$_POST[question_answer][4]},
+                       answer_5={$_POST[question_answer][5]},
+                       answer_6={$_POST[question_answer][6]},
+                       answer_7={$_POST[question_answer][7]},
+                       answer_8={$_POST[question_answer][8]},
+                       answer_9={$_POST[question_answer][9]},
+                       option_0='{$_POST[answer][0]}',
+                       option_1='{$_POST[answer][1]}',
+                       option_2='{$_POST[answer][2]}',
+                       option_3='{$_POST[answer][3]}',
+                       option_4='{$_POST[answer][4]}',
+                       option_5='{$_POST[answer][5]}',
+                       option_6='{$_POST[answer][6]}',
+                       option_7='{$_POST[answer][7]}',
+                       option_8='{$_POST[answer][8]}',
+                       option_9='{$_POST[answer][9]}'
+
+                       WHERE question_id=$_POST[qid]";
+               
+               if ($testsQuestionsDAO->execute($sql)) {
+                       $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+                       if ($_POST['tid']) {
+                               header('Location: questions.php?tid='.$_POST['tid'].'&_course_id='.$_course_id);                        
+                       } else {
+                               header('Location: question_db.php?_course_id='.$_course_id);
+                       }
+                       exit;
+               }
+       }
+} else {
+       if (!($row = $testsQuestionsDAO->get($qid))){
+               require_once(TR_INCLUDE_PATH.'header.inc.php');
+               $msg->printErrors('ITEM_NOT_FOUND');
+               require (TR_INCLUDE_PATH.'footer.inc.php');
+               exit;
+       }
+       $_POST['feedback']              = $row['feedback'];
+       $_POST['instructions']  = $row['question'];
+       $_POST['category_id']   = $row['category_id'];
+
+       for ($i=0; $i<10; $i++) {
+               $_POST['question'][$i]        = $row['choice_'.$i];
+               $_POST['question_answer'][$i] = $row['answer_'.$i];
+               $_POST['answer'][$i]          = $row['option_'.$i];
+       }
+}
+
+$onload = 'document.form.category_id.focus();';
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$savant->assign('qid', $qid);
+$savant->assign('tid', $_REQUEST['tid']);
+$savant->assign('letters', $_letters);
+$savant->assign('course_id', $_course_id);
+$savant->display('tests/create_edit_question_matching.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php');  ?>
\ No newline at end of file
diff --git a/docs/tests/edit_question_matchingdd.php b/docs/tests/edit_question_matchingdd.php
new file mode 100644 (file)
index 0000000..f5ba09b
--- /dev/null
@@ -0,0 +1,139 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+//require_once(TR_INCLUDE_PATH.'../tests/lib/likert_presets.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+$testsQuestionsDAO = new TestsQuestionsDAO();
+
+// for matching test questions
+$_letters = array(_AT('a'), _AT('b'), _AT('c'), _AT('d'), _AT('e'), _AT('f'), _AT('g'), _AT('h'), _AT('i'), _AT('j'));
+
+$qid = intval($_GET['qid']);
+if ($qid == 0){
+       $qid = intval($_POST['qid']);
+}
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       if ($_POST['tid']) {
+               header('Location: questions.php?tid='.$_POST['tid'].'&_course_id='.$_course_id);                        
+       } else {
+               header('Location: question_db.php?_course_id='.$_course_id);
+       }
+       exit;
+} else if (isset($_POST['submit'])) {
+       $_POST['tid']          = intval($_POST['tid']);
+       $_POST['qid']          = intval($_POST['qid']);
+       $_POST['feedback']     = trim($_POST['feedback']);
+       $_POST['instructions'] = trim($_POST['instructions']);
+       $_POST['category_id']  = intval($_POST['category_id']);
+
+       for ($i = 0 ; $i < 10; $i++) {
+               $_POST['question'][$i]        = $addslashes(trim($_POST['question'][$i]));
+               $_POST['question_answer'][$i] = (int) $_POST['question_answer'][$i];
+               $_POST['answer'][$i]          = $addslashes(trim($_POST['answer'][$i]));
+       }
+
+       if (!$_POST['question'][0] 
+               || !$_POST['question'][1] 
+               || !$_POST['answer'][0] 
+               || !$_POST['answer'][1]) {
+
+               $msg->addError('QUESTION_EMPTY');
+       }
+
+       if (!$msg->containsErrors()) {
+               $_POST['feedback']     = $addslashes($_POST['feedback']);
+               $_POST['instructions'] = $addslashes($_POST['instructions']);
+               
+               $sql    = "UPDATE ".TABLE_PREFIX."tests_questions SET
+                       category_id=$_POST[category_id],
+                       feedback='$_POST[feedback]',
+                       question='$_POST[instructions]',
+                       choice_0='{$_POST[question][0]}',
+                       choice_1='{$_POST[question][1]}',
+                       choice_2='{$_POST[question][2]}',
+                       choice_3='{$_POST[question][3]}',
+                       choice_4='{$_POST[question][4]}',
+                       choice_5='{$_POST[question][5]}',
+                       choice_6='{$_POST[question][6]}',
+                       choice_7='{$_POST[question][7]}',
+                       choice_8='{$_POST[question][8]}',
+                       choice_9='{$_POST[question][9]}',
+                       answer_0={$_POST[question_answer][0]},
+                       answer_1={$_POST[question_answer][1]},
+                       answer_2={$_POST[question_answer][2]},
+                       answer_3={$_POST[question_answer][3]},
+                       answer_4={$_POST[question_answer][4]},
+                       answer_5={$_POST[question_answer][5]},
+                       answer_6={$_POST[question_answer][6]},
+                       answer_7={$_POST[question_answer][7]},
+                       answer_8={$_POST[question_answer][8]},
+                       answer_9={$_POST[question_answer][9]},
+                       option_0='{$_POST[answer][0]}',
+                       option_1='{$_POST[answer][1]}',
+                       option_2='{$_POST[answer][2]}',
+                       option_3='{$_POST[answer][3]}',
+                       option_4='{$_POST[answer][4]}',
+                       option_5='{$_POST[answer][5]}',
+                       option_6='{$_POST[answer][6]}',
+                       option_7='{$_POST[answer][7]}',
+                       option_8='{$_POST[answer][8]}',
+                       option_9='{$_POST[answer][9]}'
+
+                       WHERE question_id=$_POST[qid]";
+               if ($testsQuestionsDAO->execute($sql)) {
+                       $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+                       if ($_POST['tid']) {
+                               header('Location: questions.php?tid='.$_POST['tid'].'&_course_id='.$_course_id);                        
+                       } else {
+                               header('Location: question_db.php?_course_id='.$_course_id);
+                       }
+                       exit;
+               }
+       }
+} else {
+       if (!($row = $testsQuestionsDAO->get($qid))){
+               require_once(TR_INCLUDE_PATH.'header.inc.php');
+               $msg->printErrors('ITEM_NOT_FOUND');
+               require (TR_INCLUDE_PATH.'footer.inc.php');
+               exit;
+       }
+       $_POST['feedback']              = $row['feedback'];
+       $_POST['instructions']  = $row['question'];
+       $_POST['category_id']   = $row['category_id'];
+
+       for ($i=0; $i<10; $i++) {
+               $_POST['question'][$i]        = $row['choice_'.$i];
+               $_POST['question_answer'][$i] = $row['answer_'.$i];
+               $_POST['answer'][$i]          = $row['option_'.$i];
+       }
+       
+}
+$onload = 'document.form.category_id.focus();';
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$savant->assign('qid', $qid);
+$savant->assign('tid', $_REQUEST['tid']);
+$savant->assign('letters', $_letters);
+$savant->assign('course_id', $_course_id);
+$savant->display('tests/create_edit_question_matchingdd.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php');  ?>
\ No newline at end of file
diff --git a/docs/tests/edit_question_multianswer.php b/docs/tests/edit_question_multianswer.php
new file mode 100644 (file)
index 0000000..2bf9518
--- /dev/null
@@ -0,0 +1,148 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+$testsQuestionsDAO = new TestsQuestionsDAO();
+
+require_once(TR_INCLUDE_PATH.'../tests/lib/test_result_functions.inc.php');
+
+$qid = intval($_GET['qid']);
+if ($qid == 0){
+       $qid = intval($_POST['qid']);
+}
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       if ($_POST['tid']) {
+               header('Location: questions.php?tid='.$_POST['tid'].'&_course_id='.$_course_id);                        
+       } else {
+               header('Location: question_db.php?_course_id='.$_course_id);
+       }
+       exit;
+} else if (isset($_POST['submit'])) {
+       $_POST['feedback'] = trim($_POST['feedback']);
+       $_POST['question'] = trim($_POST['question']);
+       $_POST['tid']      = intval($_POST['tid']);
+       $_POST['qid']      = intval($_POST['qid']);
+       $_POST['weight']   = intval($_POST['weight']);
+
+       if ($_POST['question'] == ''){
+               $msg->addError(array('EMPTY_FIELDS', _AT('question')));
+       }
+
+       if (!$msg->containsErrors()) {
+               $choice_new = array(); // stores the non-blank choices
+               $answer_new = array(); // stores the associated "answer" for the choices
+
+               for ($i=0; $i<10; $i++) {
+                       $_POST['choice'][$i] = $addslashes(trim($_POST['choice'][$i]));
+                       /**
+                        * Db defined it to be 255 length, chop strings off it it's less than that
+                        * @harris
+                        */
+                       $_POST['choice'][$i] = Utility::validateLength($_POST['choice'][$i], 255);
+                       $_POST['answer'][$i] = intval($_POST['answer'][$i]);
+
+                       if ($_POST['choice'][$i] == '') {
+                               /* an empty option can't be correct */
+                               $_POST['answer'][$i] = 0;
+                       } else {
+                               /* filter out empty choices/ remove gaps */
+                               $choice_new[] = $_POST['choice'][$i];
+                               $answer_new[] = $_POST['answer'][$i];
+                       }
+               }
+
+               $_POST['answer'] = $answer_new;
+               $_POST['choice'] = $choice_new;
+               $_POST['answer'] = array_pad($_POST['answer'], 10, 0);
+               $_POST['choice'] = array_pad($_POST['choice'], 10, '');
+
+               $_POST['feedback']   = $addslashes($_POST['feedback']);
+               $_POST['question']   = $addslashes($_POST['question']);
+
+               $sql    = "UPDATE ".TABLE_PREFIX."tests_questions SET
+            category_id=$_POST[category_id],
+                   feedback='$_POST[feedback]',
+                       question='$_POST[question]',
+                       choice_0='{$_POST[choice][0]}',
+                       choice_1='{$_POST[choice][1]}',
+                       choice_2='{$_POST[choice][2]}',
+                       choice_3='{$_POST[choice][3]}',
+                       choice_4='{$_POST[choice][4]}',
+                       choice_5='{$_POST[choice][5]}',
+                       choice_6='{$_POST[choice][6]}',
+                       choice_7='{$_POST[choice][7]}',
+                       choice_8='{$_POST[choice][8]}',
+                       choice_9='{$_POST[choice][9]}',
+                       answer_0={$_POST[answer][0]},
+                       answer_1={$_POST[answer][1]},
+                       answer_2={$_POST[answer][2]},
+                       answer_3={$_POST[answer][3]},
+                       answer_4={$_POST[answer][4]},
+                       answer_5={$_POST[answer][5]},
+                       answer_6={$_POST[answer][6]},
+                       answer_7={$_POST[answer][7]},
+                       answer_8={$_POST[answer][8]},
+                       answer_9={$_POST[answer][9]}
+                       WHERE question_id=$_POST[qid]";
+
+               if ($testsQuestionsDAO->execute($sql)) {
+                       $msg->addFeedback('QUESTION_UPDATED');
+                       if ($_POST['tid']) {
+                               header('Location: questions.php?tid='.$_POST['tid'].'&_course_id='.$_course_id);                        
+                       } else {
+                               header('Location: question_db.php?_course_id='.$_course_id);
+                       }
+                       exit;
+               }
+               else
+               {
+                       $msg->addError('DB_NOT_UPDATED');
+               }
+       }
+}
+
+if (!isset($_POST['submit'])) {
+       if (!($row = $testsQuestionsDAO->get($qid))){
+               require_once(TR_INCLUDE_PATH.'header.inc.php');
+               $msg->printErrors('ITEM_NOT_FOUND');
+               require (TR_INCLUDE_PATH.'footer.inc.php');
+               exit;
+       }
+       $_POST['category_id'] = $row['category_id'];
+       $_POST['feedback']        = $row['feedback'];
+       $_POST['weight']          = $row['weight'];
+       $_POST['question']        = $row['question'];
+
+       for ($i=0; $i<10; $i++) {
+               $_POST['choice'][$i] = $row['choice_'.$i];
+               $_POST['answer'][$i] = $row['answer_'.$i];
+       }
+}
+
+$onload = 'document.form.category_id.focus();';
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$savant->assign('qid', $qid);
+$savant->assign('tid', $_REQUEST['tid']);
+$savant->assign('course_id', $_course_id);
+$savant->display('tests/create_edit_question_multianswer.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/docs/tests/edit_question_multichoice.php b/docs/tests/edit_question_multichoice.php
new file mode 100644 (file)
index 0000000..1518363
--- /dev/null
@@ -0,0 +1,127 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+$testsQuestionsDAO = new TestsQuestionsDAO();
+
+$qid = intval($_GET['qid']);
+if ($qid == 0){
+       $qid = intval($_POST['qid']);
+}
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       if ($_POST['tid']) {
+               header('Location: questions.php?tid='.$_POST['tid'].'&_course_id='.$_course_id);                        
+       } else {
+               header('Location: question_db.php?_course_id='.$_course_id);
+       }
+       exit;
+} else if (isset($_POST['submit'])) {
+       $_POST['feedback'] = trim($_POST['feedback']);
+       $_POST['question'] = trim($_POST['question']);
+       $_POST['tid']      = intval($_POST['tid']);
+       $_POST['qid']      = intval($_POST['qid']);
+       $_POST['weight']   = intval($_POST['weight']);
+       $_POST['answer']   = intval($_POST['answer']);
+
+       if ($_POST['question'] == ''){
+               $msg->addError(array('EMPTY_FIELDS', _AT('question')));
+       }
+
+       if (!$msg->containsErrors()) {
+               $answers    = array_fill(0, 10, 0);
+               $answers[$_POST['answer']] = 1;
+
+               for ($i=0; $i<10; $i++) {
+                       $_POST['choice'][$i] = $addslashes(trim($_POST['choice'][$i]));
+               }
+
+               $_POST['feedback']   = $addslashes($_POST['feedback']);
+               $_POST['question']   = $addslashes($_POST['question']);
+
+               $sql    = "UPDATE ".TABLE_PREFIX."tests_questions SET
+            category_id=$_POST[category_id],
+                   feedback='$_POST[feedback]',
+                       question='$_POST[question]',
+                       choice_0='{$_POST[choice][0]}',
+                       choice_1='{$_POST[choice][1]}',
+                       choice_2='{$_POST[choice][2]}',
+                       choice_3='{$_POST[choice][3]}',
+                       choice_4='{$_POST[choice][4]}',
+                       choice_5='{$_POST[choice][5]}',
+                       choice_6='{$_POST[choice][6]}',
+                       choice_7='{$_POST[choice][7]}',
+                       choice_8='{$_POST[choice][8]}',
+                       choice_9='{$_POST[choice][9]}',
+                       answer_0={$answers[0]},
+                       answer_1={$answers[1]},
+                       answer_2={$answers[2]},
+                       answer_3={$answers[3]},
+                       answer_4={$answers[4]},
+                       answer_5={$answers[5]},
+                       answer_6={$answers[6]},
+                       answer_7={$answers[7]},
+                       answer_8={$answers[8]},
+                       answer_9={$answers[9]}
+
+                       WHERE question_id=$_POST[qid]";
+
+               if ($testsQuestionsDAO->execute($sql)) {
+                       $msg->addFeedback('QUESTION_UPDATED');
+                       if ($_POST['tid']) {
+                               header('Location: questions.php?tid='.$_POST['tid'].'&_course_id='.$_course_id);                        
+                       } else {
+                               header('Location: question_db.php?_course_id='.$_course_id);
+                       }
+                       exit;
+               }
+               else
+                       $msg->addError('DB_NOT_UPDATED');
+       }
+}
+
+if (!isset($_POST['submit'])) {
+       if (!($row = $testsQuestionsDAO->get($qid))){
+               require_once(TR_INCLUDE_PATH.'header.inc.php');
+               $msg->printErrors('ITEM_NOT_FOUND');
+               require (TR_INCLUDE_PATH.'footer.inc.php');
+               exit;
+       }
+       $_POST['category_id'] = $row['category_id'];
+       $_POST['feedback']        = $row['feedback'];
+       $_POST['weight']          = $row['weight'];
+       $_POST['question']        = $row['question'];
+
+       for ($i=0; $i<10; $i++) {
+               $_POST['choice'][$i] = $row['choice_'.$i];
+               $_POST['answer'][$i] = $row['answer_'.$i];
+       }
+}
+
+$onload = 'document.form.category_id.focus();';
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$savant->assign('qid', $qid);
+$savant->assign('tid', $_REQUEST['tid']);
+$savant->assign('course_id', $_course_id);
+$savant->display('tests/create_edit_question_multichoice.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php'); 
+?>
\ No newline at end of file
diff --git a/docs/tests/edit_question_ordering.php b/docs/tests/edit_question_ordering.php
new file mode 100644 (file)
index 0000000..c3f526f
--- /dev/null
@@ -0,0 +1,148 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+$testsQuestionsDAO = new TestsQuestionsDAO();
+
+$qid = intval($_GET['qid']);
+if ($qid == 0){
+       $qid = intval($_POST['qid']);
+}
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       if ($_POST['tid']) {
+               header('Location: questions.php?tid='.$_POST['tid'].'&_course_id='.$_course_id);                        
+       } else {
+               header('Location: question_db.php?_course_id='.$_course_id);
+       }
+       exit;
+} else if (isset($_POST['submit'])) {
+       $missing_fields = array();
+
+       $_POST['feedback']    = trim($_POST['feedback']);
+       $_POST['question']    = trim($_POST['question']);
+       $_POST['category_id'] = intval($_POST['category_id']);
+
+       if ($_POST['question'] == ''){
+               $missing_fields[] = _AT('question');
+       }
+
+       if (trim($_POST['choice'][0]) == '') {
+               $missing_fields[] = _AT('item').' 1';
+       }
+       if (trim($_POST['choice'][1]) == '') {
+               $missing_fields[] = _AT('item').' 2';
+       }
+
+       if ($missing_fields) {
+               $missing_fields = implode(', ', $missing_fields);
+               $msg->addError(array('EMPTY_FIELDS', $missing_fields));
+       }
+       if (!$msg->containsErrors()) {
+               $_POST['question'] = $addslashes($_POST['question']);
+               $_POST['feedback'] = $addslashes($_POST['feedback']);
+
+               $choice_new = array(); // stores the non-blank choices
+               $answer_new = array(); // stores the non-blank answers
+               $order = 0; // order count
+               for ($i=0; $i<10; $i++) {
+                       /**
+                        * Db defined it to be 255 length, chop strings off it it's less than that
+                        * @harris
+                        */
+                       $_POST['choice'][$i] = Utility::validateLength($_POST['choice'][$i], 255);
+                       $_POST['choice'][$i] = $addslashes(trim($_POST['choice'][$i]));
+
+                       if ($_POST['choice'][$i] != '') {
+                               /* filter out empty choices/ remove gaps */
+                               $choice_new[] = $_POST['choice'][$i];
+                               $answer_new[] = $order++;
+                       }
+               }
+               
+               $_POST['choice']   = array_pad($choice_new, 10, '');
+               $answer_new        = array_pad($answer_new, 10, 0);
+
+               $sql    = "UPDATE ".TABLE_PREFIX."tests_questions SET
+                       category_id=$_POST[category_id],
+                       feedback='$_POST[feedback]',
+                       question='$_POST[question]',
+                       choice_0='{$_POST[choice][0]}',
+                       choice_1='{$_POST[choice][1]}',
+                       choice_2='{$_POST[choice][2]}',
+                       choice_3='{$_POST[choice][3]}',
+                       choice_4='{$_POST[choice][4]}',
+                       choice_5='{$_POST[choice][5]}',
+                       choice_6='{$_POST[choice][6]}',
+                       choice_7='{$_POST[choice][7]}',
+                       choice_8='{$_POST[choice][8]}',
+                       choice_9='{$_POST[choice][9]}',
+                       answer_0=$answer_new[0],
+                       answer_0=$answer_new[1],
+                       answer_0=$answer_new[2],
+                       answer_0=$answer_new[3],
+                       answer_0=$answer_new[4],
+                       answer_0=$answer_new[5],
+                       answer_0=$answer_new[6],
+                       answer_0=$answer_new[7],
+                       answer_0=$answer_new[8],
+                       answer_0=$answer_new[9]
+
+                       WHERE question_id=$_POST[qid]";
+               
+               if ($testsQuestionsDAO->execute($sql)) {
+                       $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+                       if ($_POST['tid']) {
+                               header('Location: questions.php?tid='.$_POST['tid'].'&_course_id='.$_course_id);                        
+                       } else {
+                               header('Location: question_db.php?_course_id='.$_course_id);
+                       }
+                       exit;
+               }
+               else
+                       $msg->addError('DB_NOT_UPDATED');
+       }
+} else {
+       if (!($row = $testsQuestionsDAO->get($qid))){
+               require_once(TR_INCLUDE_PATH.'header.inc.php');
+               $msg->printErrors('ITEM_NOT_FOUND');
+               require (TR_INCLUDE_PATH.'footer.inc.php');
+               exit;
+       }
+
+       $_POST['required']              = $row['required'];
+       $_POST['question']              = $row['question'];
+       $_POST['category_id']   = $row['category_id'];
+       $_POST['feedback']              = $row['feedback'];
+
+       for ($i=0; $i<10; $i++) {
+               $_POST['choice'][$i] = $row['choice_'.$i];
+       }
+}
+
+$onload = 'document.form.category_id.focus();';
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$savant->assign('qid', $qid);
+$savant->assign('tid', $_REQUEST['tid']);
+$savant->assign('course_id', $_course_id);
+$savant->display('tests/create_edit_question_ordering.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php');  ?>
\ No newline at end of file
diff --git a/docs/tests/edit_question_truefalse.php b/docs/tests/edit_question_truefalse.php
new file mode 100644 (file)
index 0000000..a92bd1b
--- /dev/null
@@ -0,0 +1,115 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+$page = 'tests';
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+$testsQuestionsDAO = new TestsQuestionsDAO();
+
+$qid = intval($_GET['qid']);
+if ($qid == 0){
+       $qid = intval($_POST['qid']);
+}
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       if ($_POST['tid']) {
+               header('Location: questions.php?tid='.$_POST['tid'].'&_course_id='.$_course_id);                        
+       } else {
+               header('Location: question_db.php?_course_id='.$_course_id);
+       }
+       exit;
+} else if (isset($_POST['submit'])) {
+
+       $_POST['question'] = trim($_POST['question']);
+
+       if ($_POST['question'] == ''){
+               $msg->addError(array('EMPTY_FIELDS', _AT('statement')));
+       }
+
+       if (!$msg->containsErrors()) {
+               $_POST['feedback']    = $addslashes(trim($_POST['feedback']));
+               $_POST['question']    = $addslashes($_POST['question']);
+               $_POST['qid']         = intval($_POST['qid']);
+               $_POST['category_id'] = intval($_POST['category_id']);
+               $_POST['answer']      = intval($_POST['answer']);
+
+               $sql    = "UPDATE ".TABLE_PREFIX."tests_questions SET   category_id=$_POST[category_id],
+                       feedback='$_POST[feedback]',
+                       question='$_POST[question]',
+                       answer_0={$_POST[answer]}
+                       WHERE question_id=$_POST[qid]";
+
+               if ($testsQuestionsDAO->execute($sql)) {
+                       $msg->addFeedback('QUESTION_UPDATED');
+                       if ($_POST['tid']) {
+                               header('Location: questions.php?tid='.$_POST['tid'].'&_course_id='.$_course_id);                        
+                       } else {
+                               header('Location: question_db.php?_course_id='.$_course_id);
+                       }
+                       exit;
+               }
+               else
+                       $msg->addError('DB_NOT_UPDATED');
+       }
+}
+
+if (!$_POST['submit']) {
+       if (!($row = $testsQuestionsDAO->get($qid))){
+               $msg->printErrors('ITEM_NOT_FOUND');
+               require (TR_INCLUDE_PATH.'footer.inc.php');
+               exit;
+       }
+
+       $_POST  = $row;
+}
+
+if ($_POST['answer'] == '') {
+       if ($_POST['answer_0'] == 1) {
+               $ans_yes = ' checked="checked"';
+       } else if ($_POST['answer_0'] == 2){
+               $ans_no  = ' checked="checked"';
+       } else if ($_POST['answer_0'] == 3) {
+               $ans_yes1 = ' checked="checked"';
+       } else {
+               $ans_no1  = ' checked="checked"';
+       }
+} else {
+       if ($_POST['answer'] == 1) {
+               $ans_yes = ' checked="checked"';
+       } else if($_POST['answer'] == 2){
+               $ans_no  = ' checked="checked"';
+       } else if ($_POST['answer'] == 3) {
+               $ans_yes1 = ' checked="checked"';
+       } else {
+               $ans_no1  = ' checked="checked"';
+       }
+}
+
+$onload = 'document.form.category_id.focus();';
+
+require_once(TR_INCLUDE_PATH.'header.inc.php'); 
+
+$savant->assign('qid', $qid);
+$savant->assign('tid', $_REQUEST['tid']);
+$savant->assign('ans_yes', $ans_yes);
+$savant->assign('ans_no', $ans_no);
+$savant->assign('course_id', $_course_id);
+$savant->display('tests/create_edit_question_truefalse.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/docs/tests/edit_test.php b/docs/tests/edit_test.php
new file mode 100644 (file)
index 0000000..bece1c9
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+$page = 'tests';
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+
+$tid = intval($_REQUEST['tid']);
+$testsDAO = new TestsDAO();
+$row = $testsDAO->get($tid);
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: index.php?_course_id='.$_course_id);
+       exit;
+} else if (isset($_POST['submit'])) {
+       if ($testsDAO->Update($_POST['tid'], $_POST['title'], $_POST['description']))
+       {
+               $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');             
+               header('Location: index.php?_course_id='.$_course_id);
+               exit;
+       }
+}
+
+$onload = 'document.form.title.focus();';
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+$msg->printErrors();
+
+$savant->assign('course_id', $_course_id);
+$savant->assign('tid', $tid);
+$savant->assign('row', $row);
+
+$savant->display('tests/create_edit_test.tmpl.php');
+
+require (TR_INCLUDE_PATH.'footer.inc.php'); 
+
+?>
\ No newline at end of file
diff --git a/docs/tests/export_test.php b/docs/tests/export_test.php
new file mode 100644 (file)
index 0000000..e9a9857
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/classes/testQuestions.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+
+$tid = intval($_GET['tid']);
+
+/* Retrieve the content_id of this test */
+$sql = "SELECT title, random, num_questions, instructions FROM ".TABLE_PREFIX."tests WHERE test_id=$tid";
+$result        = mysql_query($sql, $db); 
+if (!($test_row = mysql_fetch_assoc($result))) {
+       $msg->addError('ITEM_NOT_FOUND');
+       header(url_rewrite('tests/index.php', TR_PRETTY_URL_IS_HEADER));
+       exit;
+}
+
+//export
+test_qti_export($tid, $test_row['title']);
+?>
\ No newline at end of file
diff --git a/docs/tests/form_editor.php b/docs/tests/form_editor.php
new file mode 100644 (file)
index 0000000..62f38d3
--- /dev/null
@@ -0,0 +1,121 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+$page = 'form_editor';\r
+define('TR_INCLUDE_PATH', '../include/');\r
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');\r
+require_once(TR_INCLUDE_PATH.'lib/tinymce.inc.php');\r
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');\r
+\r
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);\r
+\r
+$area = $_GET['area'];\r
+$number = null;\r
+\r
+$parts = explode('_', $area, 2);\r
+if (is_numeric($parts[1])) {\r
+       $parts[1]++;\r
+       $title = _AT($parts[0]) . ' ' . $parts[1];\r
+} else {\r
+       $title = _AT($area);\r
+}\r
+\r
+$onload = 'onload="init();"';\r
+\r
+global $myLang;\r
+global $page;\r
+global $savant;\r
+global $errors, $onload;\r
+global $_user_location;\r
+global $_base_path;\r
+global $contentManager;\r
+global $_section;\r
+global $addslashes;\r
+\r
+if (defined('TR_FORCE_GET_FILE') && TR_FORCE_GET_FILE) {\r
+       $_tmp_base_href = TR_BASE_HREF . 'get.php/';\r
+} else {\r
+       $_tmp_base_href = 'content/' . $_SESSION['course_id'] . '/';\r
+}\r
+\r
+?>\r
+\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html lang="en">\r
+<head>\r
+       <title><?php echo _AT('form_editor'); ?></title>\r
+\r
+       <link rel="stylesheet" href="<?php echo $_base_path.'themes/'.$_SESSION['prefs']['PREF_THEME']; ?>/styles.css" type="text/css" />\r
+       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+       <base href="<?php echo TR_BASE_HREF; ?>" />\r
+       <script src="<?php echo $_base_path; ?>include/jscripts/infusion/InfusionAll.js" type="text/javascript"></script>\r
+</head>\r
+\r
+<body <?php echo $onload; ?> >\r
+\r
+<script type="text/javascript"><!--\r
+function init() {\r
+       tinyMCE.activeEditor.setContent(window.opener.document.getElementById("<?php echo $area; ?>"). value);\r
+}\r
+//--></script>\r
+\r
+<?php load_editor(); ?>\r
+\r
+\r
+<div align="right"><br /><a href="javascript:window.close()"><?php echo _AT('close_window'); ?></a></div>\r
+<form name="form">\r
+       <table cellspacing="1" cellpadding="0" width="99%" border="0" class="bodyline" align="center" summary="">\r
+               <tr>\r
+                       <th class="cyan"><?php echo $title; ?></th>\r
+               </tr>\r
+               <tr>\r
+                       <td colspan="2" valign="top" align="left" class="row1">\r
+                               <table cellspacing="0" cellpadding="0" width="98%" border="0" summary="">\r
+                               <tr>\r
+                                       <td class="row1" align="left">  \r
+                                               <textarea name="body_text" id="body_text" rows="15" class="formfield" style="width: 99%;"></textarea>\r
+                                       </td>\r
+                               </tr>\r
+                               </table>\r
+                       </td>\r
+               </tr>\r
+               <tr>\r
+                       <td height="1" class="row2" colspan="2"></td>\r
+               </tr>\r
+               <tr>\r
+                       <td colspan="2" valign="top" align="center" class="row1">\r
+                               <input type="button" name="paste"  value="<?php echo _AT('paste');  ?>" class="button" onclick="javascript:insertTo('<?php echo $area; ?>');" />\r
+                       </td>\r
+               </tr>\r
+       </table>\r
+</form>\r
+<br />\r
+\r
+\r
+<script type="text/javascript">\r
+<!--\r
+function insertTo(field) {\r
+               if (window.opener.document.getElementById(field)) {\r
+                       //use the following if we want to apply absolute path.  -harris.\r
+                       //window.opener.document.getElementById(field).value = tinyMCE.activeEditor.getContent({format : 'raw'});\r
+                       window.opener.document.getElementById(field).value = tinyMCE.activeEditor.getContent();\r
+               }\r
+}\r
+-->\r
+</script>\r
+\r
+\r
+<iframe src="<?php echo $_base_path; ?>mods/_core/file_manager/index.php?framed=1<?php echo SEP; ?>popup=1" name="filemanager" width="98%" height="480">\r
+</iframe>\r
+\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/docs/tests/html/tests_questions.inc.php b/docs/tests/html/tests_questions.inc.php
new file mode 100644 (file)
index 0000000..a479f84
--- /dev/null
@@ -0,0 +1,185 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+if (!defined('TR_INCLUDE_PATH')) { exit; }\r
+\r
+global $_course_id;\r
+\r
+if (isset($_GET['reset_filter'])) {\r
+       unset($_GET['category_id']);\r
+}\r
+if (!isset($_GET['category_id'])) {\r
+       // Suppress warnings\r
+       $_GET['category_id'] = -1;\r
+}\r
+//require_once(TR_INCLUDE_PATH.'../tests/lib/test_result_functions.inc.php');\r
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');\r
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsCategoriesDAO.class.php');\r
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');\r
+require_once(TR_INCLUDE_PATH.'../tests/classes/TestsUtility.class.php');\r
+\r
+$testsQuestionsDAO = new TestsQuestionsDAO();\r
+$testsQuestionsCategoriesDAO = new TestsQuestionsCategoriesDAO();\r
+\r
+$cats = array();\r
+if ($_GET['category_id'] >= 0) {\r
+       $row = $testsQuestionsCategoriesDAO->get($_GET[category_id]);\r
+//     $sql    = "SELECT * FROM ".TABLE_PREFIX."tests_questions_categories WHERE course_id=$_SESSION[course_id] AND category_id=$_GET[category_id] ORDER BY title";\r
+} else {\r
+       $rows = $testsQuestionsCategoriesDAO->getByCourseID($_course_id);\r
+//     $sql    = "SELECT * FROM ".TABLE_PREFIX."tests_questions_categories WHERE course_id=$_SESSION[course_id] ORDER BY title";\r
+}\r
+\r
+//$result      = mysql_query($sql, $db);\r
+if ($_GET['category_id'] <= 0) {\r
+       $cats[] = array('title' => _AT('cats_uncategorized'), 'category_id' => 0);\r
+}\r
+\r
+if (is_array($rows)) {\r
+       foreach ($rows as $row) $cats[] = $row;\r
+}\r
+else if (isset($row)) {\r
+       $cats[] = $row;\r
+}\r
+\r
+       $cols = 3;\r
+?>\r
+\r
+       <div class="input-form" style="width:90%;">\r
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('category'); ?></legend>\r
+       <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">\r
+               <input type="hidden" name="tid" value="<?php echo $tid; ?>" />\r
+               <input type="hidden" name="_course_id" value="<?php echo $_course_id; ?>" />\r
+               <div class="row">\r
+                       <label for="cats"><?php echo _AT('category'); ?></label><br />\r
+                       <select name="category_id" id="cats">\r
+                               <option value="-1"><?php echo _AT('cats_all'); ?></option>\r
+                               <?php TestsUtility::printQuestionCatsInDropDown($_GET['category_id']); ?>\r
+                       </select>\r
+               </div>\r
+               <div class="row buttons">\r
+                       <input type="submit" name="filter" value="<?php echo _AT('filter'); ?>" />\r
+                       <input type="submit" name="reset_filter" value="<?php echo _AT('reset_filter'); ?>" />\r
+               </div>\r
+               </form>\r
+\r
+               </fieldset>\r
+       </div>\r
+\r
+<?php if ($tid): ?>\r
+       <form method="post" action="tests/add_test_questions_confirm.php" name="form">\r
+<?php else: ?>\r
+       <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>" name="form">\r
+<?php endif; ?>\r
+<input type="hidden" name="_course_id" value="<?php echo $_course_id; ?>" />\r
+<table class="data" summary="" rules="cols">\r
+<thead>\r
+<tr>\r
+       <th scope="col">&nbsp;</th>\r
+       <th scope="col"><?php echo _AT('question'); ?></th>\r
+       <th scope="col"><?php echo _AT('type'); ?></th>\r
+</tr>\r
+</thead>\r
+<tfoot>\r
+<?php if ($tid): ?>\r
+       <tr>\r
+               <td colspan="3">\r
+                       <input type="hidden" name="tid" value="<?php echo $tid; ?>" />\r
+                       <input type="submit" name="submit" value="<?php echo _AT('add_to_test_survey'); ?>" accesskey="s" />\r
+                       <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />\r
+               </td>\r
+       </tr>\r
+<?php else: ?>\r
+       <tr>\r
+               <td colspan="3">\r
+                       <input type="submit" name="edit" value="<?php echo _AT('edit'); ?>" /> \r
+                       <input type="submit" name="preview" value="<?php echo _AT('preview'); ?>" />\r
+                       <input type="submit" name="export" value="<?php echo _AT('export'); ?>" />\r
+                       <select name='qti_export_version' >\r
+                               <option selected='selected' value='1.2.1'>QTI 1.2.1</option>\r
+                               <option value='2.1'>QTI 2.1</option>\r
+                       </select>\r
+                       <input type="submit" name="delete" value="<?php echo _AT('delete'); ?>" />\r
+               </td>\r
+       </tr>\r
+<?php endif; ?>\r
+</tfoot>\r
+<tbody>\r
+<?php\r
+\r
+$question_flag = FALSE;\r
+\r
+//output categories\r
+foreach ($cats as $cat) {\r
+       //ouput questions\r
+//     $sql    = "SELECT * FROM ".TABLE_PREFIX."tests_questions WHERE course_id=$_SESSION[course_id] AND category_id=".$cat['category_id']." ORDER BY question";\r
+//     $result = mysql_query($sql, $db);\r
+//     if ($row = mysql_fetch_assoc($result)) {\r
+       $rows = $testsQuestionsDAO->getByCourseIDAndCategoryID($_course_id, $cat['category_id']);\r
+//     debug($cat);debug($rows);\r
+       if (is_array($rows)) {\r
+               $question_flag = TRUE;\r
+               echo '<tr>';\r
+               echo '<th colspan="'.$cols.'">';\r
+\r
+               echo '<input type="checkbox" name="cat'.$cat['category_id'].'" id="cat'.$cat['category_id'].'" onclick="javascript:selectCat('.$cat['category_id'].', this);" /><label for="cat'.$cat['category_id'].'">'.$cat['title'].'</label>';\r
+               echo '</th>';\r
+               echo '</tr>';\r
+\r
+               foreach ($rows as $row) {\r
+                       echo '<tr onmousedown="document.form[\'q' . $row['question_id'] . '\'].checked = !document.form[\'q' . $row['question_id'] . '\'].checked; togglerowhighlight(this, \'q'.$row['question_id'].'\');" id="rq'.$row['question_id'].'">';\r
+                       echo '<td>';\r
+                       echo '<input type="checkbox" value="'.$row['question_id'].'|'.$row['type'].'" name="questions['.$cat['category_id'].'][]" id="q'.$row['question_id'].'" onmouseup="this.checked=!this.checked" /></td>';\r
+                       echo '<td>';\r
+                       echo '<a title="'.htmlentities($row[question], ENT_QUOTES, 'UTF-8').'">';\r
+                       echo AT_print(htmlentities(Utility::validateLength($row['question'], 100, 1), ENT_QUOTES, 'UTF-8'), 'tests_questions.question');\r
+                       echo '</a>';\r
+                       echo '</td>';\r
+                       echo '<td>';\r
+                       $o = TestQuestions::getQuestion($row['type']);\r
+                       $o->printName();\r
+                                       \r
+                       echo '</td>';\r
+                       \r
+                       echo '</tr>';\r
+               }\r
+       } \r
+}  \r
+if (!$question_flag) {\r
+       echo '<tr><td colspan="'.$cols.'">'._AT('none_found').'</td></tr>';\r
+}\r
+?>\r
+</tbody>\r
+</table>\r
+</form>\r
+\r
+<script language="javascript" type="text/javascript">\r
+// <!--\r
+       function selectCat(catID, cat) {\r
+               for (var i=0;i<document.form.elements.length;i++) {\r
+                       var e = document.form.elements[i];\r
+                       if ((e.name == 'questions[' + catID + '][]') && (e.type=='checkbox')) {\r
+                               e.checked = cat.checked;\r
+                               togglerowhighlight(document.getElementById("r" + e.id), e.id);\r
+                       }\r
+               }\r
+       }\r
+       \r
+function togglerowhighlight(obj, boxid) {\r
+       if (document.getElementById(boxid).checked) {\r
+               obj.className = 'selected';\r
+       } else {\r
+               obj.className = '';\r
+       }\r
+}\r
+// -->\r
+</script>\r
diff --git a/docs/tests/import_test.php b/docs/tests/import_test.php
new file mode 100644 (file)
index 0000000..a0d18ca
--- /dev/null
@@ -0,0 +1,344 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'lib/qti.inc.php'); 
+require_once(TR_INCLUDE_PATH.'lib/pclzip.lib.php');
+require_once(TR_INCLUDE_PATH.'lib/pclzip_callback.lib.php');
+require_once(TR_INCLUDE_PATH.'classes/QTI/QTIImport.class.php');
+require_once(TR_INCLUDE_PATH.'classes/FileUtility.class.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/CoursesDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsAssocDAO.class.php');
+
+global $_course_id;
+
+/* to avoid timing out on large files */
+@set_time_limit(0);
+$_SESSION['done'] = 1;
+
+$element_path = array();
+$character_data = '';
+$test_title = '';
+$resource_num = 0;
+$qids = array();       //store all the question ids that's being inserted into the db by this import
+$overwrite = false;    //files will not be overwrite and prompt
+
+/* handle get */
+if (isset($_POST['submit_yes'])){
+       $overwrite = true;
+} elseif (isset($_POST['submit_no'])){
+       $msg->addFeedback('IMPORT_CANCELLED');
+       header('Location: index.php?_course_id='.$_course_id);
+       exit;
+}
+
+/* functions */
+/* called at the start of en element */
+/* builds the $path array which is the path from the root to the current element */
+function startElement($parser, $name, $attrs) {
+       global $attributes, $element_path, $resource_num;
+       //save attributes.
+       switch($name) {
+               case 'resource':
+                       $attributes[$name.$resource_num]['identifier'] = $attrs['identifier'];
+                       $attributes[$name.$resource_num]['href'] = $attrs['href'];
+                       $attributes[$name.$resource_num]['type'] = $attrs['type'];
+                       $resource_num++;
+                       break;
+               case 'file':
+                       if(in_array('resource', $element_path)){
+                               $attributes['resource'.($resource_num-1)]['file'][] = $attrs['href'];
+                       }
+                       break;
+               case 'dependency':
+                       if(in_array('resource', $element_path)){
+                               $attributes['resource'.($resource_num-1)]['dependency'][] = $attrs['identifierref'];
+                       }
+                       break;
+
+       }
+       array_push($element_path, $name);               
+}
+
+/* called when an element ends */
+/* removed the current element from the $path */
+function endElement($parser, $name) {
+       global $element_path, $test_title, $character_data;
+       switch($name) {
+               case 'title':
+                       if (in_array('organization', $element_path)){
+                               $test_title = $character_data;
+                       }
+       }
+       $character_data = '';
+       array_pop($element_path);
+}
+
+/* called when there is character data within elements */
+/* constructs the $items array using the last entry in $path as the parent element */
+function characterData($parser, $data){
+       global $character_data;
+       if (trim($data)!=''){
+               $character_data .= preg_replace('/[\t\0\x0B]*/', '', $data);
+       }
+}
+
+//If overwrite hasn't been set to true, then the file has not been exported and still in the cache.
+//otherwise, the zip file is extracted but has not been deleted (due to the confirmation).
+if (!$overwrite){
+       if (!isset($_POST['submit_import'])) {
+               /* just a catch all */
+               
+               $errors = array('FILE_MAX_SIZE', ini_get('post_max_size'));
+               $msg->addError($errors);
+
+               header('Location: index.php?_course_id='.$_course_id);
+               exit;
+       } 
+
+
+       //Handles import
+       /*
+       if (isset($_POST['url']) && ($_POST['url'] != 'http://') ) {
+               if ($content = @file_get_contents($_POST['url'])) {
+
+                       // save file to /content/
+                       $filename = substr(time(), -6). '.zip';
+                       $full_filename = TR_CONTENT_DIR . $filename;
+
+                       if (!$fp = fopen($full_filename, 'w+b')) {
+                               echo "Cannot open file ($filename)";
+                               exit;
+                       }
+
+                       if (fwrite($fp, $content, strlen($content) ) === FALSE) {
+                               echo "Cannot write to file ($filename)";
+                               exit;
+                       }
+                       fclose($fp);
+               }       
+               $_FILES['file']['name']     = $filename;
+               $_FILES['file']['tmp_name'] = $full_filename;
+               $_FILES['file']['size']     = strlen($content);
+               unset($content);
+               $url_parts = pathinfo($_POST['url']);
+               $package_base_name_url = $url_parts['basename'];
+       }
+       */
+       $ext = pathinfo($_FILES['file']['name']);
+       $ext = $ext['extension'];
+
+       if ($ext != 'zip') {
+               $msg->addError('IMPORTDIR_IMS_NOTVALID');
+       } else if ($_FILES['file']['error'] == 1) {
+               $errors = array('FILE_MAX_SIZE', ini_get('upload_max_filesize'));
+               $msg->addError($errors);
+       } else if ( !$_FILES['file']['name'] || (!is_uploaded_file($_FILES['file']['tmp_name']) && !$_POST['url'])) {
+               $msg->addError('FILE_NOT_SELECTED');
+       } else if ($_FILES['file']['size'] == 0) {
+               $msg->addError('IMPORTFILE_EMPTY');
+       } 
+}
+
+if ($msg->containsErrors()) {
+//     if (isset($_GET['tile'])) {
+//             header('Location: '.$_base_path.'tile/index.php');
+//     } else {
+               header('Location: index.php?_course_id='.$_course_id);
+//     }
+       exit;
+}
+
+/* check if ../content/import/ exists */
+$import_path = TR_CONTENT_DIR . 'import/';
+$content_path = TR_CONTENT_DIR;
+
+if (!is_dir($import_path)) {
+       if (!@mkdir($import_path, 0700)) {
+               $msg->addError('IMPORTDIR_FAILED');
+       }
+}
+
+$import_path .= $_course_id.'/';
+if (!$overwrite){
+       if (is_dir($import_path)) {
+               FileUtility::clr_dir($import_path);
+       }
+
+       if (!@mkdir($import_path, 0700)) {
+               $msg->addError('IMPORTDIR_FAILED');
+       }
+
+       /* extract the entire archive into TR_COURSE_CONTENT . import/$course using the call back function to filter out php files */
+       error_reporting(0);
+       $archive = new PclZip($_FILES['file']['tmp_name']);
+       if ($archive->extract(  PCLZIP_OPT_PATH,        $import_path,
+                                                       PCLZIP_CB_PRE_EXTRACT,  'preImportCallBack') == 0) {
+               $msg->addError('IMPORT_FAILED');
+               echo 'Error : '.$archive->errorInfo(true);
+               FileUtility::clr_dir($import_path);
+               header('Location: question_db.php?_course_id='.$_course_id);
+               exit;
+       }
+       error_reporting(TR_ERROR_REPORTING);
+}
+/* get the course's max_quota */
+$coursesDAO = new CoursesDAO();
+$q_row = $coursesDAO->get($_course_id);
+
+if ($q_row['max_quota'] == TR_COURSESIZE_UNLIMITED) return;
+else $zip_size_limit = $MaxCourseSize;
+
+$totalBytes   = FileUtility::dirsize($import_path);
+
+$total_after  = $zip_size_limit - $totalBytes;
+
+if (is_dir(TR_CONTENT_DIR . $course_id.'/')) 
+{
+       $course_total = FileUtility::dirsize(TR_CONTENT_DIR . $course_id.'/');
+       $total_after  -= $course_total;
+}
+
+if ($total_after < 0) {
+       /* remove the content dir, since there's no space for it */
+       $errors = array('NO_CONTENT_SPACE', number_format(-1*($total_after/TR_KBYTE_SIZE), 2 ) );
+       $msg->addError($errors);
+       
+       // Clean up import path and inserted course row
+       FileUtility::clr_dir($import_path);
+
+       header('Location: index.php?_course_id='.$_course_id);
+       exit;
+}
+
+$ims_manifest_xml = @file_get_contents($import_path.'imsmanifest.xml');
+
+if ($ims_manifest_xml === false) {
+       $msg->addError('NO_IMSMANIFEST');
+
+       if (file_exists($import_path . 'atutor_backup_version')) {
+               $msg->addError('NO_IMS_BACKUP');
+       }
+
+       FileUtility::clr_dir($import_path);
+
+//     if (isset($_GET['tile'])) {
+//             header('Location: '.$_base_path.'tile/index.php');
+//     } else {
+               header('Location: index.php?_course_id='.$_course_id);
+//     }
+       exit;
+}
+
+$xml_parser = xml_parser_create();
+
+xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false); /* conform to W3C specs */
+xml_set_element_handler($xml_parser, 'startElement', 'endElement');
+xml_set_character_data_handler($xml_parser, 'characterData');
+
+if (!xml_parse($xml_parser, $ims_manifest_xml, true)) {
+       die(sprintf("XML error: %s at line %d",
+                               xml_error_string(xml_get_error_code($xml_parser)),
+                               xml_get_current_line_number($xml_parser)));
+}
+
+xml_parser_free($xml_parser);
+
+//assign folder names
+//if (!$package_base_name){
+//     $package_base_name = substr($_FILES['file']['name'], 0, -4);
+//}
+
+//$package_base_name = strtolower($package_base_name);
+//$package_base_name = str_replace(array('\'', '"', ' ', '|', '\\', '/', '<', '>', ':'), '_' , $package_base_name);
+//$package_base_name = preg_replace("/[^A-Za-z0-9._\-]/", '', $package_base_name);
+
+//if (is_dir(TR_CONTENT_DIR . $_SESSION['course_id'].'/'.$package_base_name)) {
+//     echo 'Already exist: Quitting.  (Need better msg here)';
+//     exit;
+//     $package_base_name .= '_'.date('ymdHis');
+//}
+
+if ($package_base_path) {
+       $package_base_path = implode('/', $package_base_path);
+}
+
+//debug($attributes);
+//Dependency handling
+//$media_items = array();
+$xml_items = array();
+//foreach($attributes as $resource=>$attrs){
+//     if ($attrs['type'] != 'webcontent'){
+//             $media_items[$attrs['identifier']] = $attrs['file'];
+//     }
+//}
+
+//Check if the files exist, if so, warn the user.
+$existing_files = isQTIFileExist($attributes);
+//debug($existing_files);
+if (!$overwrite && !empty($existing_files)){
+       $existing_files = implode('<br/>', $existing_files);
+       require_once(TR_INCLUDE_PATH.'header.inc.php');
+//     $msg->addConfirm(array('MEDIA_FILE_EXISTED', $existing_files));
+//     $msg->printConfirm();
+       echo '<form action="" method="POST">';
+       echo '<div class="input-form">';
+       echo '<div class="row">';
+       $msg->printInfos(array('MEDIA_FILE_EXISTED', $existing_files));
+       echo '</div>';
+       echo '<div class="row buttons">';
+       echo '<input type="submit" class="" name="submit_yes" value="'._AT('yes').'"/>';
+       echo '<input type="submit" class="" name="submit_no" value="'._AT('no').'"/>';
+       echo '<input type="hidden" name="submit_import" value="submit_import" />';
+       ECHO '<input type="hidden" name="url" value="'.$_POST['url'].'" />';
+       echo '</div></div>';
+       echo '</form>';
+       require (TR_INCLUDE_PATH.'footer.inc.php');
+
+       exit;
+}
+
+//Get the XML file out and start importing them into our database.
+//TODO: See question_import.php 287-289.
+$qti_import = new QTIImport($import_path);
+$qids = $qti_import->importQuestions($attributes);
+
+//import test
+$tid = $qti_import->importTest();
+
+//associate question and tests
+foreach ($qids as $order=>$qid){
+       if (isset($qti_import->weights[$order])){
+               $weight = round($qti_import->weights[$order]);
+       } else {
+               $weight = 0;
+       }
+       $new_order = $order + 1;
+//     $sql = "INSERT INTO " . TABLE_PREFIX . "tests_questions_assoc" . 
+//                     "(test_id, question_id, weight, ordering, required) " .
+//                     "VALUES ($tid, $qid, $weight, $new_order, 0)";
+//     $result = mysql_query($sql, $db);
+       $testsQuestionsAssocDAO = new TestsQuestionsAssocDAO();
+       $testsQuestionsAssocDAO->Create($tid, $qid, $weight, $new_order, 0);
+}
+//debug('imported test');
+if (!$msg->containsErrors()) {
+       $msg->addFeedback('IMPORT_SUCCEEDED');
+}
+
+//clear directory
+FileUtility::clr_dir(TR_CONTENT_DIR . 'import/'.$_course_id);
+
+header('Location: index.php?_course_id='.$_course_id);
+exit;
+?>
\ No newline at end of file
diff --git a/docs/tests/index.php b/docs/tests/index.php
new file mode 100644 (file)
index 0000000..4dc198c
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+$page = 'tests';
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsDAO.class.php');
+
+global $_course_id;
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+
+if (isset($_GET['edit'], $_GET['id'])) {
+       header('Location: edit_test.php?tid='.$_GET['id'].'&_course_id='.$_course_id);
+       exit;
+} else if (isset($_GET['preview'], $_GET['id'])) {
+       header('Location: preview.php?tid='.$_GET['id'].'_course_id='.$_course_id);
+       exit;
+} else if (isset($_GET['questions'], $_GET['id'])) {
+       header('Location: questions.php?tid='.$_GET['id'].'_course_id='.$_course_id);
+       exit;
+} else if (isset($_GET['submissions'], $_GET['id'])) {
+       header('Location: results.php?tid='.$_GET['id'].'_course_id='.$_course_id);
+       exit;
+} else if (isset($_GET['statistics'], $_GET['id'])) {
+       header('Location: results_all_quest.php?tid='.$_GET['id'].'_course_id='.$_course_id);
+       exit;
+} else if (isset($_GET['delete'], $_GET['id'])) {
+       header('Location: delete_test.php?tid='.$_GET['id'].'_course_id='.$_course_id);
+       exit;
+} else if (isset($_GET['export'], $_GET['id'])){
+       header('Location: export_test.php?tid='.$_GET['id'].'_course_id='.$_course_id);
+} else if (isset($_GET['edit']) 
+               || isset($_GET['preview']) 
+               || isset($_GET['questions']) 
+               || isset($_GET['submissions']) 
+               || isset($_GET['statistics']) 
+               || isset($_GET['delete'])
+               || isset($_GET['export'])) {
+
+       $msg->addError('NO_ITEM_SELECTED');
+}
+
+$testsDAO = new TestsDAO();
+/* get a list of all the tests we have, and links to create, edit, delete, preview */
+$rows = $testsDAO->getByCourseID($_course_id);
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$savant->assign('course_id', $_course_id);
+$savant->assign('rows', $rows);
+
+$savant->display('tests/index.tmpl.php');
+
+require_once(TR_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/docs/tests/lib/likert_presets.inc.php b/docs/tests/lib/likert_presets.inc.php
new file mode 100644 (file)
index 0000000..b266c13
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+if (!defined('TR_INCLUDE_PATH')) { exit; }
+
+$_likert_preset = array();
+
+$_likert_preset[] = array(_AT('lk_always'),_AT('lk_very_frequently'),_AT('lk_occasionally'),_AT('lk_rarely'),_AT('lk_very_rarely'),_AT('lk_never'));
+
+$_likert_preset[] = array(_AT('lk_excellent'),_AT('lk_very_good'),_AT('lk_good'),_AT('lk_fair'),_AT('lk_poor'),_AT('lk_very_poor'));
+
+$_likert_preset[] = array(_AT('lk_strongly_agree'),_AT('lk_agree'),_AT('lk_undecided'),_AT('lk_disagree'),_AT('lk_strongly_disagree'));
+
+$_likert_preset[] = array(_AT('lk_very_important'),_AT('lk_important'),_AT('lk_mod_important'),_AT('lk_little_importance'),_AT('lk_unimportant'));
+
+
+?>
\ No newline at end of file
diff --git a/docs/tests/lib/test_question_queries.inc.php b/docs/tests/lib/test_question_queries.inc.php
new file mode 100644 (file)
index 0000000..f06b0bb
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+//Question for multiple choice.
+define('TR_SQL_QUESTION_MULTI', "INSERT INTO ".TABLE_PREFIX."tests_questions VALUES (  NULL, %d, %d, 1, '%s', '%s', 
+                                                       '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 
+                                                       %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, 
+                                                       '', '', '', '', '', '', '', '', '', '', 5, 0)");
+
+//Question for True/False
+define('TR_SQL_QUESTION_TRUEFALSE', "INSERT INTO ".TABLE_PREFIX."tests_questions VALUES (      NULL, %d, %d, 2, '%s', '%s', 
+                                                       '', '', '', '', '', '', '', '', '', '', 
+                                                       %s, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+                                                       '', '', '', '', '', '', '', '', '', '', 5, 0)");
+
+
+//Question for Open ended
+define('TR_SQL_QUESTION_LONG', "INSERT INTO ".TABLE_PREFIX."tests_questions VALUES (   NULL, %d, %d, 3, '%s', '%s', 
+                                                       '', '', '', '', '', '', '', '', '', '', 
+                                                       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+                                                       '', '', '', '', '', '', '', '', '', '', %s, 0)");
+
+//Question for Likert
+define('TR_SQL_QUESTION_LIKERT', "INSERT INTO ".TABLE_PREFIX."tests_questions VALUES ( NULL, %d, %d, 4, '%s', '%s', 
+                                                       '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 
+                                                       %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, 
+                                                       '', '', '', '', '', '', '', '', '', '', 0, 0)");
+
+//Question for Ordering
+define('TR_SQL_QUESTION_ORDERING', "INSERT INTO ".TABLE_PREFIX."tests_questions VALUES (       NULL, %d, %d, 6, '%s', '%s', 
+                                                       '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 
+                                                       %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, 
+                                                       '', '', '', '', '', '', '', '', '', '', 0, 0)");
+
+//Question for MultiAnswer
+define('TR_SQL_QUESTION_MULTIANSWER', "INSERT INTO ".TABLE_PREFIX."tests_questions VALUES (    NULL, %d, %d, 7, '%s', '%s', 
+                                                       '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 
+                                                       %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, 
+                                                       '', '', '', '', '', '', '', '', '', '', 0, 0)");
+
+//Question for Matching Simple
+define('TR_SQL_QUESTION_MATCHING', "INSERT INTO ".TABLE_PREFIX."tests_questions VALUES (       NULL, %d, %d, 5, '%s', '%s', 
+                                                       '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 
+                                                       %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, 
+                                                       '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 0, 0)");
+
+//Question for Matching Graphical
+define('TR_SQL_QUESTION_MATCHINGDD', "INSERT INTO ".TABLE_PREFIX."tests_questions VALUES (     NULL, %d, %d, 8, '%s', '%s', 
+                                                       '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 
+                                                       %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, 
+                                                       '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 0, 0)");
+
+define('TR_SQL_TEST', "INSERT INTO ".TABLE_PREFIX."tests " .
+                                          "(test_id,
+                                        course_id,
+                                        title,
+                                        description,
+                                        `format`,
+                                        start_date,
+                                        end_date,
+                                        randomize_order,
+                                        num_questions,
+                                        instructions,
+                                        content_id,
+                                        passscore,
+                                        passpercent,
+                                        passfeedback,
+                                        failfeedback,
+                                        result_release,
+                                        random,
+                                        difficulty,
+                                        num_takes,
+                                        anonymous,
+                                        out_of,
+                                        guests,
+                                        display) " .
+                                          "VALUES 
+                                               (NULL, %d, '%s', '%s', %d, '%s', '%s', %d, %d, '%s', %d, %d, %d, '%s', '%s', %s, %d, %d, %d, %s, '', %d, %d)");
+
+?>
\ No newline at end of file
similarity index 87%
rename from docs/home/lib/test_result_functions.inc.php
rename to docs/tests/lib/test_result_functions.inc.php
index 711e4b6..5777733 100644 (file)
@@ -1,18 +1,16 @@
 <?php
-/****************************************************************/
-/* ATutor                                                                                                              */
-/****************************************************************/
-/* Copyright (c) 2002-2008 by Greg Gay & Joel Kronenberg        */
-/* Adaptive Technology Resource Centre / University of Toronto  */
-/* http://atutor.ca                                                                                            */
-/*                                                              */
-/* This program is free software. You can redistribute it and/or*/
-/* modify it under the terms of the GNU General Public License  */
-/* as published by the Free Software Foundation.                               */
-/****************************************************************/
-// $Id: test_result_functions.inc.php 8901 2009-11-11 19:10:19Z cindy $
-
-if (!defined('AT_INCLUDE_PATH')) { exit; }
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+if (!defined('TR_INCLUDE_PATH')) { exit; }
 
 // if a valid user, then can come from the DB, otherwise
 // this might come from _POST or even _SESSION
@@ -109,7 +107,7 @@ function get_total_weight($tid, $num_questions = null) {
 
 // returns T/F whether or not this member can view this test:
 function authenticate_test($tid) {
-       if (authenticate(AT_PRIV_ADMIN, AT_PRIV_RETURN)) {
+       if (authenticate(TR_PRIV_ADMIN, TR_PRIV_RETURN)) {
                return TRUE;
        }
        if (!$_SESSION['enroll']) {
@@ -139,11 +137,11 @@ function authenticate_test($tid) {
        }
 
        //Check assistants privileges
-       $sql = "SELECT privileges FROM at_course_enrollment a WHERE member_id=$_SESSION[member_id] AND course_id=$_SESSION[course_id]";
+       $sql = "SELECT privileges FROM TR_course_enrollment a WHERE member_id=$_SESSION[member_id] AND course_id=$_SESSION[course_id]";
        $result = mysql_query($sql, $db);
        if ($result){
                list($privileges) = mysql_fetch_array($result);
-               if (query_bit($privileges, AT_PRIV_GROUPS) && query_bit($privileges, AT_PRIV_TESTS)){
+               if (query_bit($privileges, TR_PRIV_GROUPS) && query_bit($privileges, TR_PRIV_TESTS)){
                        return TRUE;
                }
 
@@ -152,12 +150,12 @@ function authenticate_test($tid) {
        return FALSE;
 }
 
-function print_question_cats($cat_id = 0) {    
+function print_question_cats($cTR_id = 0) {    
 
        global $db;
 
        echo '<option value="0"';
-       if ($cat_id == 0) {
+       if ($cTR_id == 0) {
                echo ' selected="selected"';
        }
        echo '>'._AT('cats_uncategorized').'</option>' . "\n";
@@ -167,7 +165,7 @@ function print_question_cats($cat_id = 0) {
 
        while ($row = mysql_fetch_array($result)) {
                echo '<option value="'.$row['category_id'].'"';
-               if ($row['category_id'] == $cat_id) {
+               if ($row['category_id'] == $cTR_id) {
                        echo ' selected="selected"';
                }
                echo '>'.$row['title'].'</option>'."\n";
@@ -177,7 +175,7 @@ function print_question_cats($cat_id = 0) {
 function print_VE ($area) {
 ?>
        <script type="text/javascript" language="javascript">
-               document.writeln('<a href="#" onclick="javascript:window.open(\'<?php echo AT_BASE_HREF; ?>tools/tests/form_editor.php?area=<?php echo $area; ?>\',\'newWin1\',\'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=640,height=480\'); return false;" style="cursor: pointer; text-decoration: none" ><?php echo _AT('use_visual_editor'); ?></a>');
+               document.writeln('<a href="#" onclick="javascript:window.open(\'<?php echo TR_BASE_HREF; ?>tests/form_editor.php?area=<?php echo $area; ?>\',\'newWin1\',\'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=640,height=480\'); return false;" style="cursor: pointer; text-decoration: none" ><?php echo _AT('use_visual_editor'); ?></a>');
        </script>
 
 <?php
diff --git a/docs/tests/my_tests.php b/docs/tests/my_tests.php
new file mode 100644 (file)
index 0000000..01554d7
--- /dev/null
@@ -0,0 +1,173 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/lib/test_result_functions.inc.php');
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$sql   = "SELECT T.*, UNIX_TIMESTAMP(T.start_date) AS us, UNIX_TIMESTAMP(T.end_date) AS ue, COUNT(Q.weight) AS numquestions FROM ".TABLE_PREFIX."tests T, ".TABLE_PREFIX."tests_questions_assoc Q WHERE Q.test_id=T.test_id AND T.course_id=$_SESSION[course_id] GROUP BY T.test_id ORDER BY T.start_date, T.title";
+$result        = mysql_query($sql, $db);
+
+?>
+<table class="data static" summary="" rules="cols">
+<thead>
+<tr>
+       <th scope="col"><?php echo _AT('title');      ?></th>
+       <th scope="col"><?php echo _AT('status');     ?></th>
+       <th scope="col"><?php echo _AT('start_date'); ?></th>
+       <th scope="col"><?php echo _AT('end_date');   ?></th>
+       <th scope="col"><?php echo _AT('attempts');   ?></th>
+</tr>
+</thead>
+<tbody>
+
+<?php
+$count = 0;
+while ($row = mysql_fetch_assoc($result)) {
+       // this code hides tests from the user if they are not enrolled.
+       if (!$row['guests'] && !authenticate_test($row['test_id'])) {
+               continue;
+       }
+
+       $count++;
+       echo '<tr>';
+       echo '<td>';
+       $sql = "SELECT COUNT(test_id) AS cnt FROM ".TABLE_PREFIX."tests_results WHERE status=1 AND test_id=".$row['test_id']." AND member_id='".$_SESSION['member_id']."'";
+
+       $takes_result= mysql_query($sql, $db);
+       $takes = mysql_fetch_assoc($takes_result);
+       if ( ($row['us'] <= time() && $row['ue'] >= time()) && 
+          ( ($row['num_takes'] == TR_TESTS_TAKE_UNLIMITED) || ($takes['cnt'] < $row['num_takes']) )  ) {
+               echo '<strong><a href="'.url_rewrite('tests/test_intro.php?tid='.$row['test_id']).'">'.AT_print($row['title'], 'tests.title').'</a></strong>';
+       } else {
+               echo '<small class="bigspacer">'.AT_print($row['title'], 'tests.title').'';
+       }
+       echo '</td><td>';
+       if ( ($row['us'] <= time()) && ($row['ue'] >= time() ) ) {
+               echo '<em><strong>'._AT('ongoing').'</strong></em>';
+       } else if ($row['ue'] < time() ) {
+               echo '<em>'._AT('expired').'</em>';
+       } else if ($row['us'] > time() ) {
+               echo '<em>'._AT('pending').'</em>';
+       }
+       
+       $startend_date_long_format=_AT('startend_date_long_format');
+       echo '</td>';
+
+       echo '<td>'.TR_date($startend_date_long_format, $row['start_date']).'</td>';
+       echo '<td>'.TR_date($startend_date_long_format, $row['end_date']).'</td>';
+
+       if ($row['num_takes'] == TR_TESTS_TAKE_UNLIMITED) {
+               echo '<td>'.$takes['cnt'].'/'._AT('unlimited').'</td>';
+       } else  {
+               echo '<td>'.$takes['cnt'].'/'.$row['num_takes'].'</td>';
+       }
+
+/*
+       if ($row['random']) {
+               echo '<td>'.$row['num_questions'].'</td>';
+               echo '<td>'.$row['out_of'].'</td>';
+       } else {
+               echo '<td>'.$row['numquestions'].'</td>';
+               if ($row['out_of'] > 0) {
+                       echo '<td>'.$row['out_of'].'</td>';
+               } else {
+                       echo '<td><em>'._AT('na').'</em></td>';
+               }
+       }                       
+*/
+       echo '</tr>';
+
+}
+if (!$count) {
+       echo '<tr><td colspan="7">'._AT('none_found').'</td></tr>';
+}
+?>
+       </tbody>
+</table>
+<br />
+
+<?php if (!$_SESSION['enroll']): ?>
+       <?php require_once(TR_INCLUDE_PATH.'footer.inc.php'); ?>
+       <?php exit; ?>
+<?php endif; ?>
+<h4><?php echo _AT('completed_tests'); ?></h4><br />
+<table class="data static" summary="" rules="cols">
+<thead>
+<tr>
+       <th scope="col"><?php echo _AT('title');      ?></th>
+       <th scope="col"><?php echo _AT('date_taken'); ?></th>
+       <th scope="col"><?php echo _AT('time_spent'); ?></th>
+       <th scope="col"><?php echo _AT('mark');       ?></th>
+       <th scope="col"><?php echo _AT('submission'); ?></th>
+</tr>
+</thead>
+<tbody>
+<?php
+
+
+$sql   = "SELECT T.*, R.*, (UNIX_TIMESTAMP(R.end_time) - UNIX_TIMESTAMP(R.date_taken)) AS diff FROM ".TABLE_PREFIX."tests T, ".TABLE_PREFIX."tests_results R, ".TABLE_PREFIX."tests_questions_assoc Q WHERE R.status=1 AND Q.test_id=T.test_id AND R.member_id=$_SESSION[member_id] AND R.test_id=T.test_id AND T.course_id=$_SESSION[course_id] GROUP BY R.result_id ORDER BY R.date_taken DESC";
+
+$result        = mysql_query($sql, $db);
+$num_results = mysql_num_rows($result);
+
+if ($row = mysql_fetch_assoc($result)) {
+       $this_course_id=0;
+
+       do {
+               echo '<tr>';
+               echo '<td><strong>'.AT_print($row['title'], 'tests.title').'</strong></td>';
+               echo '<td>'.TR_date($startend_date_long_format, $row['date_taken']).'</td>';
+               echo '<td>'.get_human_time($row['diff']).'</td>';
+               echo '<td>';
+
+               if ($row['out_of'] == 0) {
+                       echo _AT('na');
+               } elseif ($row['final_score'] == '') {
+                       echo _AT('unmarked');
+               } elseif (($row['final_score'] != '') && ($row['result_release']==TR_RELEASE_NEVER)) {
+                       echo _AT('unreleased');
+               } else {
+                       if ($row['random']) {
+                               $out_of = get_random_outof($row['test_id'], $row['result_id']);
+                       } else {
+                               $out_of = $row['out_of'];
+                       }
+
+                       echo '<strong>'.$row['final_score'].'</strong>/'.$out_of;
+               }
+               echo '</td>';
+
+               echo '<td>';
+
+               if ( ($row['result_release']==TR_RELEASE_IMMEDIATE) || (($row['final_score'] != '') && ($row['result_release']==TR_RELEASE_MARKED)) ) {
+                       echo '<a href="tests/view_results.php?tid='.$row['test_id'].SEP.'rid='.$row['result_id'].'">'._AT('view_results').'</a>';
+               } else {
+                       echo '<em>'._AT('no_results_yet').'</em>';
+               }
+               
+               echo '</td>';
+               echo '</tr>';
+       } while ($row = mysql_fetch_assoc($result));
+} else {
+       echo '<tr><td colspan="4">'._AT('none_found').'</td></tr>';
+}
+?>
+</tbody>
+</table>
+
+<?php 
+       $_SESSION['last_visited_page'] = $server_protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
+       require_once(TR_INCLUDE_PATH.'footer.inc.php'); 
+?>
diff --git a/docs/tests/preview.php b/docs/tests/preview.php
new file mode 100644 (file)
index 0000000..0405577
--- /dev/null
@@ -0,0 +1,141 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/classes/testQuestions.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+$_letters = array(_AT('A'), _AT('B'), _AT('C'), _AT('D'), _AT('E'), _AT('F'), _AT('G'), _AT('H'), _AT('I'), _AT('J'));
+
+if ($_POST['back']) {
+       header('Location: index.php');
+       exit;
+} 
+
+if (defined('TR_FORCE_GET_FILE') && TR_FORCE_GET_FILE) {
+       $content_base_href = 'get.php/';
+} else {
+       $content_base_href = 'content/' . $_SESSION['course_id'] . '/';
+}
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$tid = intval($_GET['tid']);
+
+/* Retrieve the content_id of this test */
+$sql = "SELECT title, random, num_questions, instructions FROM ".TABLE_PREFIX."tests WHERE test_id=$tid";
+$result        = mysql_query($sql, $db); 
+if (!($test_row = mysql_fetch_assoc($result))) {
+       $msg->printErrors('ITEM_NOT_FOUND');
+       require (TR_INCLUDE_PATH.'footer.inc.php');
+       exit;
+}
+$num_questions = $test_row['num_questions'];
+$rand_err = false;
+
+if ($row['random']) {
+       /* !NOTE! this is a really awful way of randomizing questions !NOTE! */
+
+       /* Retrieve 'num_questions' question_id randomly choosed from  
+       those who are related to this content_id*/
+       $sql    = "SELECT question_id FROM ".TABLE_PREFIX."tests_questions_assoc WHERE test_id=$tid";
+       $result = mysql_query($sql, $db); 
+       $i = 0;
+       $row2 = mysql_fetch_assoc($result);
+       /* Store all related question in cr_questions */
+       while ($row2['question_id'] != '') {
+               $cr_questions[$i] = $row2['question_id'];
+               $row2 = mysql_fetch_assoc($result);
+               $i++;
+       }
+       if ($i < $num_questions) {
+               /* this if-statement is misleading. */
+               /* one should still be able to preview a test before all its questions have been added. */
+               /* ie. preview as questions are added. */
+               /* bug # 0000615 */
+               $rand_err = true;
+       } else {
+               /* Randomly choose only 'num_question' question */
+               $random_idx = rand(0, $i-1);
+               $random_id_string = $cr_questions[$random_idx];
+               $j = 0;
+               $extracted[$j] = $random_idx;
+               $j++;
+               $num_questions--;
+               while ($num_questions > 0) {
+                       $done = false;
+                       while (!$done) {
+                               $random_idx = rand(0, $i-1);
+                               $done = true;
+                               for ($k=0;$k<$j;$k++) {
+                                       if ($extracted[$k]== $random_idx) {
+                                               $done = false;
+                                               break;
+                                       }
+                               }
+                       }
+                       $extracted[$j] = $random_idx;
+                       $j++;
+                       $random_id_string = $random_id_string.','.$cr_questions[$random_idx];
+                       $num_questions--;
+               }
+               $sql = "SELECT TQ.*, TQA.* FROM ".TABLE_PREFIX."tests_questions TQ INNER JOIN ".TABLE_PREFIX."tests_questions_assoc TQA USING (question_id) WHERE TQ.course_id=$_SESSION[course_id] AND TQA.test_id=$tid AND TQA.question_id IN ($random_id_string) ORDER BY TQA.ordering, TQA.question_id";
+       }
+} else {
+       $sql    = "SELECT TQ.*, TQA.* FROM ".TABLE_PREFIX."tests_questions TQ INNER JOIN ".TABLE_PREFIX."tests_questions_assoc TQA USING (question_id) WHERE TQ.course_id=$_SESSION[course_id] AND TQA.test_id=$tid ORDER BY TQA.ordering, TQA.question_id";
+}
+$result        = mysql_query($sql, $db);
+$count = 1;
+echo '<form method="post" action="'.$_SERVER['PHP_SELF'].'" name="preview">';
+
+if (($row = mysql_fetch_assoc($result)) && !$rand_err) {
+       ?>
+       <div class="input-form" style="width:80%">
+       <div class="row"><h2><?php echo $test_row['title']; ?></h2></div>
+
+
+       <?php if ($test_row['instructions'] != ''): ?>
+               <div style="background-color: #f3f3f3; padding: 5px 10px; margin: 0px; border-top: 1px solid">
+                       <strong><?php echo _AT('instructions'); ?></strong>
+               </div>
+               <div class="row" style="padding-bottom: 20px"><?php echo $test_row['instructions']; ?></div>
+       <?php endif; ?>
+       
+       <?php
+       do {
+               $o = TestQuestions::getQuestion($row['type']);
+               $o->display($row);
+       } while ($row = mysql_fetch_assoc($result));
+       ?>
+       <div class="row buttons">
+               <input type="submit" value="<?php echo _AT('back'); ?>" name="back" />
+       </div>
+
+       </div>
+       </form>
+<script type="text/javascript">
+//<!--
+function iframeSetHeight(id, height) {
+       document.getElementById("qframe" + id).style.height = (height + 20) + "px";
+}
+//-->
+</script>
+<?php
+} else {
+       $msg->printErrors('NO_QUESTIONS');
+}
+
+
+require_once(TR_INCLUDE_PATH.'footer.inc.php');
+?>
\ No newline at end of file
diff --git a/docs/tests/preview_question.php b/docs/tests/preview_question.php
new file mode 100644 (file)
index 0000000..c2f7030
--- /dev/null
@@ -0,0 +1,63 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+define('TR_INCLUDE_PATH', '../include/');\r
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');\r
+require_once(TR_INCLUDE_PATH.'../tests/classes/testQuestions.class.php');\r
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');\r
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');\r
+\r
+global $_course_id;\r
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);\r
+$testsQuestionsDAO = new TestsQuestionsDAO();\r
+\r
+$_letters = array(_AT('A'), _AT('B'), _AT('C'), _AT('D'), _AT('E'), _AT('F'), _AT('G'), _AT('H'), _AT('I'), _AT('J'));\r
+\r
+if (isset($_GET['submit'])) {\r
+       header('Location: '.TR_BASE_HREF.'tests/question_db.php?_course_id='.$_course_id);\r
+       exit;\r
+}\r
+\r
+if (defined('TR_FORCE_GET_FILE') && TR_FORCE_GET_FILE) {\r
+       $content_base_href = 'get.php/';\r
+} else {\r
+       $content_base_href = 'content/' . $_SESSION['course_id'] . '/';\r
+}\r
+\r
+require_once(TR_INCLUDE_PATH.'header.inc.php');\r
+\r
+$qids = explode(',', $_GET['qid']);\r
+$rows = $testsQuestionsDAO->getByQuestionIDs($qids);\r
+?>\r
+\r
+<form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">\r
+<input type="hidden" name="_course_id" value="<?php echo $_course_id; ?>" />
+<div class="input-form">\r
+       <?php\r
+       if (is_array($rows)) {\r
+               foreach ($rows as $row) {\r
+                       $obj = TestQuestions::getQuestion($row['type']);\r
+                       $obj->display($row);\r
+               }\r
+       }\r
+       ?>\r
+       <div class="row buttons"><input type="submit" name="submit" value="<?php echo _AT('back'); ?>"/></div>\r
+</div>\r
+</form>\r
+<script type="text/javascript">\r
+//<!--\r
+function iframeSetHeight(id, height) {\r
+       document.getElementById("qframe" + id).style.height = (height + 30) + "px";\r
+}\r
+//-->\r
+</script>\r
+<?php require_once(TR_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/docs/tests/question_cats.php b/docs/tests/question_cats.php
new file mode 100644 (file)
index 0000000..ab22d07
--- /dev/null
@@ -0,0 +1,45 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+$page = 'tests';\r
+define('TR_INCLUDE_PATH', '../include/');\r
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');\r
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsCategoriesDAO.class.php');\r
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');\r
+\r
+global $_course_id, $msg;\r
+\r
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);\r
+\r
+if (isset($_POST['edit'], $_POST['category'])) {\r
+//     debug('question_cats_manage.php?catid='.$_POST['category'].'&_course_id='.$_course_id);exit;\r
+       header('Location: question_cats_manage.php?catid='.$_POST['category'].'&_course_id='.$_course_id);\r
+       exit;\r
+} else if (isset($_POST['delete'], $_POST['category'])) {\r
+       header('Location: question_cats_delete.php?catid='.$_POST['category'].'&_course_id='.$_course_id);\r
+       exit;\r
+} else if (!empty($_POST)) {\r
+       $msg->addError('NO_ITEM_SELECTED');\r
+}\r
+\r
+require_once(TR_INCLUDE_PATH.'header.inc.php');\r
+\r
+$testsQuestionsCategories = new TestsQuestionsCategoriesDAO();\r
+$rows = $testsQuestionsCategories->getByCourseID($_course_id);\r
+\r
+$savant->assign('course_id', $_course_id);\r
+$savant->assign('rows', $rows);\r
+$savant->assign('msg', $msg);\r
+\r
+$savant->display('tests/question_cats.tmpl.php');\r
+\r
+require_once(TR_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/docs/tests/question_cats_delete.php b/docs/tests/question_cats_delete.php
new file mode 100644 (file)
index 0000000..b1f28be
--- /dev/null
@@ -0,0 +1,65 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+$page = 'tests';\r
+define('TR_INCLUDE_PATH', '../include/');\r
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');\r
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsCategoriesDAO.class.php');\r
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsDAO.class.php');\r
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');\r
+\r
+global $_course_id;\r
+\r
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);\r
+\r
+$testsQuestionsCategoriesDAO = new TestsQuestionsCategoriesDAO();\r
+\r
+if (isset($_POST['submit_yes'])) {\r
+       $_POST['catid'] = intval($_POST['catid']);\r
+\r
+       $testsQuestionsDAO = new TestsQuestionsDAO();\r
+       //remove category\r
+       if ($testsQuestionsCategoriesDAO->Delete($_POST['catid']) && $testsQuestionsDAO->UpdateField($_POST['catid'], 'category_id', 0))\r
+       {\r
+               //set all qestions that use this category to have category=0\r
+               $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');\r
+               header('Location: '.TR_BASE_HREF.'tests/question_cats.php?_course_id='.$_course_id);\r
+               exit;\r
+       }\r
+\r
+} else if (isset($_POST['submit_no'])) {\r
+       $msg->addFeedback('CANCELLED');\r
+       header('Location: '.TR_BASE_HREF.'tests/question_cats.php?_course_id='.$_course_id);\r
+       exit;\r
+} else if (!isset($_GET['catid'])) {\r
+       require_once(TR_INCLUDE_PATH.'header.inc.php');\r
+       $msg->addError('ITEM_NOT_FOUND');\r
+       $msg->printErrors();\r
+       require_once(TR_INCLUDE_PATH.'footer.inc.php');\r
+       exit;\r
+} \r
+\r
+require_once(TR_INCLUDE_PATH.'header.inc.php');\r
+\r
+$_GET['catid'] = intval($_GET['catid']);\r
+\r
+$row = $testsQuestionsCategoriesDAO->get($_GET['catid']);\r
+\r
+$hidden_vars['catid'] = $_GET['catid'];\r
+$hidden_vars['_course_id'] = $_course_id;\r
+\r
+$msg->addConfirm(array('DELETE_TEST_CATEGORY', $row['title']), $hidden_vars);\r
+       \r
+$msg->printConfirm();\r
+\r
+require_once(TR_INCLUDE_PATH.'footer.inc.php');\r
+?>
\ No newline at end of file
diff --git a/docs/tests/question_cats_manage.php b/docs/tests/question_cats_manage.php
new file mode 100644 (file)
index 0000000..bbbda9d
--- /dev/null
@@ -0,0 +1,76 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+$page = 'tests';\r
+define('TR_INCLUDE_PATH', '../include/');\r
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');\r
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsCategoriesDAO.class.php');\r
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');\r
+\r
+global $_course_id;\r
+\r
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);\r
+\r
+$testsQuestionsCategoriesDAO = new TestsQuestionsCategoriesDAO();\r
+\r
+if (isset($_POST['cancel'])) {\r
+       $msg->addFeedback('CANCELLED');\r
+       header('Location: question_cats.php');\r
+       exit;\r
+} else if (isset($_POST['submit'])) {\r
+\r
+       $_POST['title'] = trim($_POST['title']);\r
+\r
+       if (!empty($_POST['title']) && !isset($_POST['catid'])) {\r
+               if ($testsQuestionsCategoriesDAO->Create($_course_id, $_POST['title']))\r
+               {\r
+                       $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');\r
+                       header('Location: question_cats.php?_course_id='.$_course_id);\r
+                       exit;\r
+               }\r
+       } else if (!empty($_POST['title']) && isset($_POST['catid']))  {\r
+               if ($testsQuestionsCategoriesDAO->Update($_POST['catid'], $_POST['title']))\r
+               {\r
+                       $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');\r
+                       header('Location: question_cats.php?_course_id='.$_course_id);\r
+                       exit;\r
+               }\r
+       } else {\r
+               $msg->addError(array('EMPTY_FIELDS', _AT('title')));\r
+       }\r
+}\r
+\r
+if (isset($_GET['catid'])) {\r
+       $row = $testsQuestionsCategoriesDAO->get($_GET['catid']);\r
+       $_POST['title'] = $row['title'];\r
+}\r
+\r
+$onload = "document.form.title.focus();";\r
+require_once(TR_INCLUDE_PATH.'header.inc.php');\r
+\r
+$msg->printErrors();\r
+\r
+if (isset($_GET['catid'])) \r
+{\r
+       $savant->assign('catid', $_GET['catid']);\r
+       $savant->assign('title', _AT('manage_category'));\r
+}\r
+else \r
+{\r
+       $savant->assign('title', _AT('create_category'));\r
+}\r
+$savant->assign('course_id', $_course_id);\r
+$savant->display('tests/question_cats_manage.tmpl.php');\r
+\r
+require_once(TR_INCLUDE_PATH.'footer.inc.php'); \r
+\r
+?>
\ No newline at end of file
diff --git a/docs/tests/question_db.php b/docs/tests/question_db.php
new file mode 100644 (file)
index 0000000..7de7e66
--- /dev/null
@@ -0,0 +1,105 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/classes/testQuestions.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+
+// converts array entries to ints
+function intval_array ( & $value, $key) { $value = (int) $value; }
+
+if ( (isset($_GET['edit']) || isset($_GET['delete']) || isset($_GET['export']) || isset($_GET['preview']) || isset($_GET['add'])) && !isset($_GET['questions'])){
+       $msg->addError('NO_ITEM_SELECTED');
+} else if (isset($_GET['submit_create'], $_GET['question_type'])) {
+       header('Location: '.TR_BASE_HREF.'tests/create_question_'.$addslashes($_GET['question_type']).'.php?_course_id='.$_course_id);
+       exit;
+} else if (isset($_GET['edit'])) {
+       $id  = current($_GET['questions']);
+       $num_selected = count($id);
+
+       if ($num_selected == 1) {
+               $ids = explode('|', $id[0], 2);
+               $o = TestQuestions::getQuestion($ids[1]);
+               if ($name = $o->getPrefix()) {
+                       header('Location: '.TR_BASE_HREF.'tests/edit_question_'.$name.'.php?qid='.intval($ids[0]).'&_course_id='.$_course_id);
+                       exit;
+               } else {
+                       header('Location: '.TR_BASE_HREF.'tests/index.php?_course_id='.$_course_id);
+                       exit;
+               }
+       } else {
+               $msg->addError('SELECT_ONE_ITEM');
+       }
+
+} else if (isset($_GET['delete'])) {
+       $id  = current($_GET['questions']);
+       $ids = array();
+       foreach ($_GET['questions'] as $category_questions) {
+               $ids = array_merge($ids, $category_questions);
+       }
+
+       array_walk($ids, 'intval_array');
+       $ids = implode(',',$ids);
+
+       header('Location: '.TR_BASE_HREF.'tests/delete_question.php?qid='.$ids.'&_course_id='.$_course_id);
+       exit;
+} else if (isset($_GET['preview'])) {
+       $ids = array();
+       foreach ($_GET['questions'] as $category_questions) {
+               $ids = array_merge($ids, $category_questions);
+       }
+
+       array_walk($ids, 'intval_array');
+       $ids = implode(',',$ids);
+
+       header('Location: '.TR_BASE_HREF.'tests/preview_question.php?qid='.$ids.'&_course_id='.$_course_id);
+       exit;
+} else if (isset($_GET['add'])) {
+       $id  = current($_GET['questions']);
+       $ids = explode('|', $id[0], 2);
+} else if (isset($_GET['export'])) {
+       $ids = array();
+       foreach ($_GET['questions'] as $category_questions) {
+               $ids = array_merge($ids, $category_questions);
+       }
+
+       array_walk($ids, 'intval_array');
+
+       if ($_GET['qti_export_version']=='2.1'){
+               test_question_qti_export_v2p1($ids);
+       } else {
+               test_question_qti_export($ids);
+       }
+
+       exit;
+}
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$savant->assign('course_id', $_course_id);
+$savant->assign('tid', $tid);
+$savant->assign('questions', TestQuestions::getQuestionPrefixNames());
+
+$savant->display('tests/question_db_top.tmpl.php');
+
+$tid = 0; 
+
+require_once(TR_INCLUDE_PATH.'../tests/html/tests_questions.inc.php'); 
+
+require_once(TR_INCLUDE_PATH.'footer.inc.php'); 
+
+?>
\ No newline at end of file
diff --git a/docs/tests/question_import.php b/docs/tests/question_import.php
new file mode 100644 (file)
index 0000000..17193ba
--- /dev/null
@@ -0,0 +1,315 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../mods/_core/file_manager/filemanager.inc.php'); /* for clr_dir() and preImportCallBack and dirsize() */
+require_once(TR_INCLUDE_PATH.'../mods/imsqti/lib/qti.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/pclzip.lib.php');
+//require_once(TR_INCLUDE_PATH.'classes/QTI/QTIParser.class.php');     
+require_once(TR_INCLUDE_PATH.'../mods/imsqti/classes/QTIImport.class.php');
+
+/* to avoid timing out on large files */
+@set_time_limit(0);
+$_SESSION['done'] = 1;
+
+$element_path = array();
+$character_data = '';
+$resource_num = 0;
+$overwrite = false;
+
+/* handle get */
+if (isset($_POST['submit_yes'])){
+       $overwrite = true;
+} elseif (isset($_POST['submit_no'])){
+       $msg->addFeedback('IMPORT_CANCELLED');
+       header('Location: question_db.php');
+       exit;
+}
+
+/* functions */
+/* called at the start of en element */
+/* builds the $path array which is the path from the root to the current element */
+function startElement($parser, $name, $attrs) {
+       global $attributes, $element_path, $resource_num;
+       //save attributes.
+       switch($name) {
+               case 'resource':
+                       $attributes[$name.$resource_num]['identifier'] = $attrs['identifier'];
+                       $attributes[$name.$resource_num]['href'] = $attrs['href'];
+                       $attributes[$name.$resource_num]['type'] = $attrs['type'];
+                       $resource_num++;
+                       break;
+               case 'file':
+                       if(in_array('resource', $element_path)){
+                               $attributes['resource'.($resource_num-1)]['file'][] = $attrs['href'];
+                       }
+                       break;
+               case 'dependency':
+                       if(in_array('resource', $element_path)){
+                               $attributes['resource'.($resource_num-1)]['dependency'][] = $attrs['identifierref'];
+                       }
+                       break;
+
+       }
+       array_push($element_path, $name);               
+}
+
+/* called when an element ends */
+/* removed the current element from the $path */
+function endElement($parser, $name) {
+       global $element_path;
+       array_pop($element_path);
+}
+
+/* called when there is character data within elements */
+/* constructs the $items array using the last entry in $path as the parent element */
+function characterData($parser, $data){
+       global $character_data;
+       if (trim($data)!=''){
+               $character_data .= preg_replace('/[\t\0\x0B]*/', '', $data);
+       }
+}
+
+//If overwrite hasn't been set to true, then the file has not been exported and still in the cache.
+//otherwise, the zip file is extracted but has not been deleted (due to the confirmation).
+if (!$overwrite){
+       if (!isset($_POST['submit_import'])) {
+               /* just a catch all */
+               
+               $errors = array('FILE_MAX_SIZE', ini_get('post_max_size'));
+               $msg->addError($errors);
+
+               header('Location: ./question_db.php');
+               exit;
+       } 
+
+
+       //Handles import
+       /*
+       if (isset($_POST['url']) && ($_POST['url'] != 'http://') ) {
+               if ($content = @file_get_contents($_POST['url'])) {
+
+                       // save file to /content/
+                       $filename = substr(time(), -6). '.zip';
+                       $full_filename = TR_CONTENT_DIR . $filename;
+
+                       if (!$fp = fopen($full_filename, 'w+b')) {
+                               echo "Cannot open file ($filename)";
+                               exit;
+                       }
+
+                       if (fwrite($fp, $content, strlen($content) ) === FALSE) {
+                               echo "Cannot write to file ($filename)";
+                               exit;
+                       }
+                       fclose($fp);
+               }       
+               $_FILES['file']['name']     = $filename;
+               $_FILES['file']['tmp_name'] = $full_filename;
+               $_FILES['file']['size']     = strlen($content);
+               unset($content);
+               $url_parts = pathinfo($_POST['url']);
+               $package_base_name_url = $url_parts['basename'];
+       }
+       */
+       $ext = pathinfo($_FILES['file']['name']);
+       $ext = $ext['extension'];
+
+       if ($ext != 'zip') {
+               $msg->addError('IMPORTDIR_IMS_NOTVALID');
+       } else if ($_FILES['file']['error'] == 1) {
+               $errors = array('FILE_MAX_SIZE', ini_get('upload_max_filesize'));
+               $msg->addError($errors);
+       } else if ( !$_FILES['file']['name'] || (!is_uploaded_file($_FILES['file']['tmp_name']) && !$_POST['url'])) {
+               $msg->addError('FILE_NOT_SELECTED');
+       } else if ($_FILES['file']['size'] == 0) {
+               $msg->addError('IMPORTFILE_EMPTY');
+       } 
+}
+
+if ($msg->containsErrors()) {
+       if (isset($_GET['tile'])) {
+               header('Location: '.$_base_path.'tile/index.php');
+       } else {
+               header('Location: question_db.php');
+       }
+       exit;
+}
+
+/* check if ../content/import/ exists */
+$import_path = TR_CONTENT_DIR . 'import/';
+$content_path = TR_CONTENT_DIR;
+
+if (!is_dir($import_path)) {
+       if (!@mkdir($import_path, 0700)) {
+               $msg->addError('IMPORTDIR_FAILED');
+       }
+}
+
+$import_path .= $_SESSION['course_id'].'/';
+if (!$overwrite){
+       if (is_dir($import_path)) {
+               clr_dir($import_path);
+       }
+
+       if (!@mkdir($import_path, 0700)) {
+               $msg->addError('IMPORTDIR_FAILED');
+       }
+
+       /* extract the entire archive into TR_COURSE_CONTENT . import/$course using the call back function to filter out php files */
+       error_reporting(0);
+       $archive = new PclZip($_FILES['file']['tmp_name']);
+       if ($archive->extract(  PCLZIP_OPT_PATH,        $import_path,
+                                                       PCLZIP_CB_PRE_EXTRACT,  'preImportCallBack') == 0) {
+               $msg->addError('IMPORT_FAILED');
+               echo 'Error : '.$archive->errorInfo(true);
+               clr_dir($import_path);
+               header('Location: question_db.php');
+               exit;
+       }
+       error_reporting(TR_ERROR_REPORTING);
+}
+
+/* get the course's max_quota */
+$sql   = "SELECT max_quota FROM ".TABLE_PREFIX."courses WHERE course_id=$_SESSION[course_id]";
+$result = mysql_query($sql, $db);
+$q_row = mysql_fetch_assoc($result);
+
+if ($q_row['max_quota'] != TR_COURSESIZE_UNLIMITED) {
+
+       if ($q_row['max_quota'] == TR_COURSESIZE_DEFAULT) {
+               $q_row['max_quota'] = $MaxCourseSize;
+       }
+       $totalBytes   = dirsize($import_path);
+       $course_total = dirsize(TR_CONTENT_DIR . $_SESSION['course_id'].'/');
+       $total_after  = $q_row['max_quota'] - $course_total - $totalBytes + $MaxCourseFloat;
+
+       if ($total_after < 0) {
+               /* remove the content dir, since there's no space for it */
+               $errors = array('NO_CONTENT_SPACE', number_format(-1*($total_after/TR_KBYTE_SIZE), 2 ) );
+               $msg->addError($errors);
+               
+               clr_dir($import_path);
+
+               if (isset($_GET['tile'])) {
+                       header('Location: '.$_base_path.'tile/index.php');
+               } else {
+                       header('Location: question_db.php');
+               }
+               exit;
+       }
+}
+
+$ims_manifest_xml = @file_get_contents($import_path.'imsmanifest.xml');
+
+if ($ims_manifest_xml === false) {
+       $msg->addError('NO_IMSMANIFEST');
+
+       if (file_exists($import_path . 'atutor_backup_version')) {
+               $msg->addError('NO_IMS_BACKUP');
+       }
+
+       clr_dir($import_path);
+
+       if (isset($_GET['tile'])) {
+               header('Location: '.$_base_path.'tile/index.php');
+       } else {
+               header('Location: question_db.php');
+       }
+       exit;
+}
+
+$xml_parser = xml_parser_create();
+
+xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false); /* conform to W3C specs */
+xml_set_element_handler($xml_parser, 'startElement', 'endElement');
+xml_set_character_data_handler($xml_parser, 'characterData');
+
+if (!xml_parse($xml_parser, $ims_manifest_xml, true)) {
+       die(sprintf("XML error: %s at line %d",
+                               xml_error_string(xml_get_error_code($xml_parser)),
+                               xml_get_current_line_number($xml_parser)));
+}
+
+xml_parser_free($xml_parser);
+
+//assign folder names
+//if (!$package_base_name){
+//     $package_base_name = substr($_FILES['file']['name'], 0, -4);
+//}
+
+//$package_base_name = strtolower($package_base_name);
+//$package_base_name = str_replace(array('\'', '"', ' ', '|', '\\', '/', '<', '>', ':'), '_' , $package_base_name);
+//$package_base_name = preg_replace("/[^A-Za-z0-9._\-]/", '', $package_base_name);
+
+//if (is_dir(TR_CONTENT_DIR . $_SESSION['course_id'].'/'.$package_base_name)) {
+//     echo 'Already exist: Quitting.  (Need better msg here)';
+//     exit;
+//     $package_base_name .= '_'.date('ymdHis');
+//}
+
+if ($package_base_path) {
+       $package_base_path = implode('/', $package_base_path);
+}
+
+//Dependency handling
+//$media_items = array();
+$xml_items = array();
+//foreach($attributes as $resource=>$attrs){
+//     if ($attrs['type'] != 'webcontent'){
+//             $media_items[$attrs['identifier']] = $attrs['file'];
+//     }
+//}
+
+//Check if the files exist, if so, warn the user.
+$existing_files = isQTIFileExist($attributes);
+//debug($existing_files);
+if (!$overwrite && !empty($existing_files)){
+       $existing_files = implode('<br/>', $existing_files);
+       require_once(TR_INCLUDE_PATH.'header.inc.php');
+//     $msg->addConfirm(array('MEDIA_FILE_EXISTED', $existing_files));
+//     $msg->printConfirm();
+       echo '<form action="" method="POST">';
+       echo '<div class="input-form">';
+       echo '<div class="row">';
+       $msg->printInfos(array('MEDIA_FILE_EXISTED', $existing_files));
+       echo '</div>';
+       echo '<div class="row buttons">';
+       echo '<input type="submit" class="" name="submit_yes" value="'._AT('yes').'"/>';
+       echo '<input type="submit" class="" name="submit_no" value="'._AT('no').'"/>';
+       echo '<input type="hidden" name="submit_import" value="submit_import" />';
+       ECHO '<input type="hidden" name="url" value="'.$_POST['url'].'" />';
+       echo '</div></div>';
+       echo '</form>';
+       require (TR_INCLUDE_PATH.'footer.inc.php');
+
+       exit;
+}
+
+
+//Get the XML file out and start importing them into our database.
+//TODO:        import_test.php shares approx. the same code as below, just that import_test.php has 
+//             an extra line of code that uses a stack to remember the question #.  Might want to 
+//             create a function for this.
+$qti_import = new QTIImport($import_path);
+$qti_import->importQuestions($attributes);
+
+//debug('done');
+clr_dir(TR_CONTENT_DIR . 'import/'.$_SESSION['course_id']);
+if (!$msg->containsErrors()) {
+       $msg->addFeedback('IMPORT_SUCCEEDED');
+}
+
+header('Location: question_db.php');
+exit;
+?>
\ No newline at end of file
diff --git a/docs/tests/question_remove.php b/docs/tests/question_remove.php
new file mode 100644 (file)
index 0000000..7b446ce
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+$page = 'tests';
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+
+$tid = intval($_REQUEST['tid']);
+$qid = intval($_REQUEST['qid']);
+
+if (isset($_POST['submit_no'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: questions.php?tid=' . $tid);
+       exit;
+} else if (isset($_POST['submit_yes'])) {
+       $sql    = "DELETE FROM ".TABLE_PREFIX."tests_questions_assoc WHERE question_id=$qid AND test_id=$tid";
+       $result = mysql_query($sql, $db);
+               
+       $msg->addFeedback('QUESTION_REMOVED');
+       header('Location: questions.php?tid=' . $tid);
+       exit;
+
+} /* else: */
+
+$_pages['tests/questions.php?tid='.$_GET['tid']]['title_var']    = 'questions';
+$_pages['tests/questions.php?tid='.$_GET['tid']]['parent']   = 'tests/index.php';
+$_pages['tests/questions.php?tid='.$_GET['tid']]['children'] = array('tests/add_test_questions.php?tid='.$_GET['tid']);
+
+$_pages['tests/add_test_questions.php?tid='.$_GET['tid']]['title_var']    = 'add_questions';
+$_pages['tests/add_test_questions.php?tid='.$_GET['tid']]['parent']   = 'tests/questions.php?tid='.$_GET['tid'];
+
+$_pages['tests/question_remove.php']['title_var'] = 'remove_question';
+$_pages['tests/question_remove.php']['parent']    = 'tests/questions.php?tid='.$_GET['tid'];
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+unset($hidden_vars);
+$hidden_vars['qid'] = $_GET['qid'];
+$hidden_vars['tid'] = $_GET['tid'];
+$msg->addConfirm('REMOVE_TEST_QUESTION', $hidden_vars);
+
+$msg->printConfirm();
+
+require_once(TR_INCLUDE_PATH.'footer.inc.php');
+?>
\ No newline at end of file
diff --git a/docs/tests/questions.php b/docs/tests/questions.php
new file mode 100644 (file)
index 0000000..f521e6c
--- /dev/null
@@ -0,0 +1,255 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+$page = 'tests';
+define('TR_INCLUDE_PATH', '../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../tests/classes/testQuestions.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+
+$_pages['tests/questions.php']['title_var']    = 'questions';
+$_pages['tests/questions.php']['parent']   = 'tests/index.php';
+$_pages['tests/questions.php']['children'] = array('tests/add_test_questions.php?tid='.$_GET['tid']);
+
+$_pages['tests/add_test_questions.php?tid='.$_GET['tid']]['title_var']    = 'add_questions';
+$_pages['tests/add_test_questions.php?tid='.$_GET['tid']]['parent']   = 'tests/questions.php?tid='.$_GET['tid'];
+
+$_pages['tests/questions.php']['guide']    = 'instructor/?p=add_questions.php';
+
+
+$tid = intval($_REQUEST['tid']);
+
+if (isset($_POST['submit'])) {
+       $sql    = "SELECT test_id, random, num_questions FROM ".TABLE_PREFIX."tests WHERE test_id=$tid AND course_id=$_SESSION[course_id]";
+       $result = mysql_query($sql, $db);
+       if (!($row = mysql_fetch_assoc($result))) { exit; }
+
+       // #1760
+       // for each question that isn't required
+       if ($row['random']) {
+               foreach ($_POST['weight'] as $qid => $weight) {
+                       if ($_POST['required'][$qid]) { continue; }
+                       if (!$current_weight) { $current_weight = $weight; }
+
+                       if ($current_weight != $weight) {
+                               // the weights aren't the same.
+                               $msg->addError('RAND_TEST_Q_WEIGHT');
+                               break;
+                       }
+               }
+       }
+
+       if (!$msg->containsErrors()) {
+               //update the weights & order
+               $total_weight = 0;
+               $total_required_weight = 0;
+               $total_required_num = 0;
+               $optional_weight = 0;
+               $count = 1;
+               foreach ($_POST['weight'] as $qid => $weight) {
+                       $qid    = intval($qid);
+                       $weight = intval($weight);
+                       if ($_POST['required'][$qid]) {
+                               $required = 1;
+                       } else {
+                               $required = 0;
+                       }
+
+                       if ($row['random']) {
+                               if ($required) {
+                                       $total_required_weight += $weight;
+                                       $total_required_num++;
+                               } else {
+                                       $optional_weight = $weight; // what each optional question weights.
+                               }
+                       } else {
+                               $total_weight += $weight; // not random, so just sum the weights
+                       }
+                               
+                       if (!$row['random']) {
+                               $orders = $_POST['ordering'];
+                               asort($orders);
+                               $orders = array_keys($orders);
+
+                               foreach ($orders as $k => $id)
+                                       $orders[$k] = intval($id);
+                                       
+                               $orders = array_flip($orders);
+                               $sql    = "UPDATE ".TABLE_PREFIX."tests_questions_assoc SET weight=$weight, required=$required, ordering=".($orders[$qid]+1)." WHERE question_id=$qid AND test_id=".$tid;
+                       } else {
+                               $sql    = "UPDATE ".TABLE_PREFIX."tests_questions_assoc SET weight=$weight, required=$required, ordering=$count WHERE question_id=$qid AND test_id=".$tid;
+                       }
+
+                       $result = mysql_query($sql, $db);
+                       $count++;
+               }
+
+               $num_questions_sql = '';
+               if ($row['random']) {
+                       $row['num_questions'] -= $total_required_num;
+                       if ($row['num_questions'] > 0) {
+                               // how much do the optional questions add up to: (assume they all weight the same)
+                               $total_weight = $total_required_weight + $optional_weight * $row['num_questions'];
+                       } else {
+                               $total_weight = $total_required_weight; // there are no more optional questions
+                               $num_questions_sql = ', num_questions='.$total_required_num;
+                       }
+               }
+
+
+               $sql    = "UPDATE ".TABLE_PREFIX."tests SET out_of='$total_weight' $num_questions_sql WHERE test_id=$tid";
+               $result = mysql_query($sql, $db);
+
+               $total_weight = 0;
+               $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+               header('Location: '.$_SERVER['PHP_SELF'] .'?tid='.$tid);
+               exit;
+       }
+}
+
+require_once(TR_INCLUDE_PATH.'header.inc.php');
+
+$sql   = "SELECT title, random FROM ".TABLE_PREFIX."tests WHERE test_id=$tid";
+$result        = mysql_query($sql, $db);
+$row   = mysql_fetch_assoc($result);
+echo '<h3>'._AT('questions_for').' '.AT_print($row['title'], 'tests.title').'</h3>';
+$random = $row['random'];
+
+$sql   = "SELECT count(*) as cnt FROM ".TABLE_PREFIX."tests_questions_assoc QA, ".TABLE_PREFIX."tests_questions Q WHERE QA.test_id=$tid AND QA.weight=0 AND QA.question_id=Q.question_id AND Q.type<>4";
+$result        = mysql_query($sql, $db);
+$row = mysql_fetch_array($result);
+if ($row['cnt']) {
+       $msg->printWarnings('QUESTION_WEIGHT');
+}
+
+$msg->printAll();
+
+$sql   = "SELECT * FROM ".TABLE_PREFIX."tests_questions Q, ".TABLE_PREFIX."tests_questions_assoc TQ WHERE Q.course_id=$_SESSION[course_id] AND Q.question_id=TQ.question_id AND TQ.test_id=$tid ORDER BY TQ.ordering";
+$result        = mysql_query($sql, $db);
+
+?>
+<form action="<?php echo $_SERVER['PHP_SELF']; ?>?tid=<?php echo $tid; ?>" method="post" name="form">
+<input type="hidden" name="tid" value="<?php echo $tid; ?>" />
+<table class="data static" summary="" rules="rows">
+<thead>
+<tr>
+       <th scope="col"><?php echo _AT('num');      ?></th>
+       <th scope="col"><?php echo _AT('points');   ?></th>
+       <th scope="col"><?php echo _AT('order'); ?></th>
+       <th scope="col"><?php echo _AT('question'); ?></th>
+       <th scope="col"><?php echo _AT('type');     ?></th>
+       <th scope="col"><?php echo _AT('category'); ?></th>
+       <?php if ($random): ?>
+               <th scope="col"><?php echo _AT('required'); ?></th>
+       <?php endif; ?>
+       <th scope="col">&nbsp;</th>
+</tr>
+</thead>
+<?php
+if ($row = mysql_fetch_assoc($result)) {
+       $sql    = "SELECT title, category_id FROM ".TABLE_PREFIX."tests_questions_categories WHERE course_id=".$_SESSION['course_id'];
+       $cTR_result     = mysql_query($sql, $db);
+       $cats    = array();
+       $cats[0] = _AT('cats_uncategorized');
+       while ($cTR_row = mysql_fetch_assoc($cTR_result)) {
+               $cats[$cTR_row['category_id']] = $cTR_row['title'];
+       }
+
+       do {
+               $count++;
+               echo '<tr>';
+               echo '<td class="row1" align="center"><strong>'.$count.'</strong></td>';
+               echo '<td class="row1" align="center">';
+               
+               if (isset($_POST['submit'])) {
+                       $row['weight'] = $_POST['weight'][$row['question_id']];
+                       $row['required'] = (isset($_POST['required'][$row['question_id']]) ? 1 : 0);
+               }
+
+               if ($row['type'] == 4) {
+                       echo ''._AT('na').'';
+                       echo '<input type="hidden" value="0" name="weight['.$row['question_id'].']" />';
+               } else {
+                       echo '<input type="text" value="'.$row['weight'].'" name="weight['.$row['question_id'].']" size="2" />';
+               }
+               echo '</td>';
+
+               if ($random) {
+                       echo '<td class="row1" align="center">'._AT('na').'</td>';
+               } else {
+                       echo '<td class="row1" align="center"><input type="text" name="ordering['.$row['question_id'].']" value="'.$row['ordering'].'" size="2" /></td>';
+               }
+
+               echo '<td class="row1">';
+               if ($strlen($row['question']) > 45) {
+                       echo htmlspecialchars(AT_print($substr($row['question'], 0, 43), 'tests_questions.question'), ENT_COMPAT, "UTF-8") . '...';
+               } else {
+                       echo AT_print(htmlspecialchars($row['question'], ENT_COMPAT, "UTF-8"), 'tests_questions.question');
+               }
+
+               echo '</td>';
+               echo '<td nowrap="nowrap">';
+               $o = TestQuestions::getQuestion($row['type']);
+               echo $o->printName();
+               echo '</td>';
+
+               $link = 'tests/edit_question_'.$o->getPrefix().'.php?tid='.$tid.SEP.'qid='.$row['question_id'];
+
+               echo '<td align="center">'.$cats[$row['category_id']].'</td>';
+
+               if ($random) {
+                       echo '<td align="center" nowrap="nowrap"><input type="checkbox" name="required['.$row['question_id'].']" value="1"';
+                       if ($row['required']) {
+                               echo ' checked="checked"';
+                       }
+                       echo ' id="q'.$row['question_id'].'" /><label for="q'.$row['question_id'].'">'._AT('required').'</label></td>';
+               }
+
+               echo '<td nowrap="nowrap">';
+               echo '<a href="' . $link . '">' . _AT('edit').'</a> | ';
+               echo '<a href="tests/question_remove.php?tid=' . $tid . SEP . 'qid=' . $row['question_id'] . '">' . _AT('remove') . '</a>';
+               echo '</td>';
+
+               echo '</tr>';
+       } while ($row = mysql_fetch_assoc($result));
+
+       //total weight
+       echo '<tfoot>';
+       echo '<tr><td>&nbsp;</td>';
+       echo '<td colspan="';
+       if ($random) {
+               echo 7;
+       } else {
+               echo 6;
+       }
+
+       echo '" align="left" nowrap="nowrap">';
+       echo '<input type="submit" value="'._AT('update').'" name="submit" /> </td>';
+       echo '</tr>';
+       echo '</tfoot>';
+} else {
+       echo '<tr><td colspan="';
+       if ($random) {
+               echo 7;
+       } else {
+               echo 6;
+       }
+
+       echo '" >'._AT('none_found').'</td></tr>';
+}
+
+echo '</table><br /></form>';
+
+require_once(TR_INCLUDE_PATH.'footer.inc.php');
+?>
\ No newline at end of file
index a6883ba..e5f9637 100644 (file)
@@ -33,10 +33,10 @@ div.input-form {
        width: 95%; 
        margin-left:auto; 
        margin-right:auto;
-       /* border: thin #CCCCCC solid; */
+       border: thin #CCCCCC solid;
        margin-bottom: 20px;
        line-height:150%;
-       /* background-color: #F8F8F8; */
+       background-color: #F8F8F8;
 }
 
 div.input-form div.row {
index 7e023d8..a1e1a80 100644 (file)
@@ -21,26 +21,39 @@ $caller_url_parts = explode('/', $_SERVER['PHP_SELF']);
 $caller_script = $caller_url_parts[count($caller_url_parts)-1];
 
 // construct the caller query string
+//if (count($_GET) > 0)
+//{
+////   $url_param = '?';
+//     $counter = 0;
+//     foreach ($_GET as $param => $value)
+//     {
+//             $counter++;
+//             if ($param == 'action' || $param == 'cid') 
+//             {
+//                     $counter--;
+//                     continue;
+//             }
+//             else if ($counter > 1)
+//             {
+//                     $url_param .= '&';
+//             }
+//             $url_param .= $param.'='.urlencode($value);
+//     }
+//}
+
 if (count($_GET) > 0)
 {
-       $url_param = '?';
-       $counter = 0;
        foreach ($_GET as $param => $value)
        {
-               $counter++;
                if ($param == 'action' || $param == 'cid') 
-               {
-                       $counter--;
                        continue;
-               }
-               else if ($counter > 1)
-               {
-                       $url_param .= '&';
-               }
-               $url_param .= $param.'='.$value;
+               else
+                       $url_param .= $param.'='.urlencode($value).'&';
        }
 }
-$caller_url = $caller_script. (isset($url_param) ? $url_param.'&' : '?');
+
+$caller_url = $caller_script. (isset($url_param) ? $url_param : '?');
+$url_param = substr($url_param, 0, -1);
 
 if (isset($this->search_text)) $keywords = explode(' ', $this->search_text);
 
@@ -102,7 +115,7 @@ require(TR_INCLUDE_PATH.'header.inc.php');
       </li>                            
 <?php } // end of foreach; ?>
     </ol>
-<?php  print_paginator($this->curr_page_num, $num_results, '', RESULTS_PER_PAGE);?>
+<?php  print_paginator($this->curr_page_num, $num_results, $url_param, RESULTS_PER_PAGE);?>
   </div>
 <?php } // end of if
 else {
index 4dc63ac..cc02f0e 100644 (file)
@@ -53,6 +53,7 @@ if (!defined('TR_INCLUDE_PATH')) { exit; }
  * back_to_page              array('url', 'title')            the link back to the part of the current page, if needed.
  */
 
+include_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
 $lang_charset = "UTF-8";
 
 //Timer
@@ -118,7 +119,7 @@ $starttime = $mtime;
                
     <div id="versioninfo">
       <form target="_top" action="<?php echo TR_BASE_HREF; ?>home/search.php" method="get">
-        <input type="text" name="search_text" id="search_text" value="<?php if (isset($_GET['search_text'])) echo $_GET['search_text']; ?>" size="30" />
+        <input type="text" name="search_text" id="search_text_at_header" value="<?php if (isset($_GET['search_text'])) echo $_GET['search_text']; ?>" size="30" />
         <input type="submit" name="search" value="<?php echo _AT("search"); ?>" />
       </form>
     </div>
@@ -154,15 +155,16 @@ foreach ($this->top_level_pages as $page) {
 -->
        <!-- the sub navigation and guide -->
   <div id="sub-menu">
+    <div id="course-tools">
     <!-- guide -->
     <?php if (isset($this->guide)) {?>
-    <div>
-      <a href="<?php echo $this->guide; ?>" onclick="popup('<?php echo $this->guide; ?>'); return false;" id="guide" target="_new"><em><?php echo $this->page_title; ?></em></a>
-    </div>
+    <!-- <div> -->
+      <a href="<?php echo $this->guide; ?>" onclick="popup('<?php echo $this->guide; ?>'); return false;" id="guide" target="_new"><em><?php echo $this->page_title; ?></em></a>&nbsp;
+    <!-- </div> -->
     <?php }?>
 
        <?php if (isset($this->course_id) && $this->course_id > 0) {?>
-    <div id="course-tools">
+    <!--  <div id="course-tools">-->
       <?php if ($this->isAuthor) { // only for authors ?>
       <a href="<?php echo $this->base_path; ?>home/course/course_property.php?_course_id=<?php echo $this->course_id; ?>">
         <img src="<?php echo $this->base_path. "themes/".$this->theme."/images/course_property.png"; ?>" title="<?php echo _AT('course_property'); ?>" alt="<?php echo _AT('course_property'); ?>" border="0" />
@@ -174,19 +176,20 @@ foreach ($this->top_level_pages as $page) {
       <a href="<?php echo $this->base_path; ?>home/index.php">
         <img src="<?php echo $this->base_path. "themes/".$this->theme."/images/exit.png"; ?>" title="<?php echo _AT('exit_course'); ?>" alt="<?php echo _AT('exit_course'); ?>" border="0" />
       </a>
-    </div>
     <?php }?>
+    </div>
 
     <!-- the sub navigation -->
     <div id="sub-navigation">
       <?php if ($this->sub_menus): ?>
       <?php if (isset($this->back_to_page)): ?>
-      <a href="<?php echo $this->back_to_page['url']; ?>" id="back-to"><?php echo _AT('back_to').' '.$this->back_to_page['title']; ?></a> | 
+      <a href="<?php echo $this->back_to_page['url']; ?>" id="back-to"><?php echo '<strong>'._AT('back_to').'</strong>'.' '.$this->back_to_page['title']; ?></a> | 
       <?php endif; ?>
        
       <?php $num_pages = count($this->sub_menus); ?>
       <?php for ($i=0; $i<$num_pages; $i++): ?>
-      <?php if ($this->sub_menus[$i]['url'] == $this->current_page): ?>
+      <?php list($sub_menu_url, $param) = Utility::separateURLAndParam($this->sub_menus[$i]['url']);
+      if ($sub_menu_url == $this->current_page): ?>
       <strong><?php echo $this->sub_menus[$i]['title']; ?></strong>
       <?php else: ?>
       <a href="<?php echo $this->sub_menus[$i]['url']; ?>"><?php echo $this->sub_menus[$i]['title']; ?></a>
index fc71e51..5fc6251 100644 (file)
@@ -430,10 +430,20 @@ div#sub-navigation {
   float:left;
 }
 
+a#guide {
+  background-image: url(images/guide.jpg); 
+  background-repeat: no-repeat;
+  background-color: #e6e6e6;
+  padding: 0px 10px 2px 26px;
+/**  border: 1px solid #ccc;
+  float:right;**/
+  font-size:0.85em;
+}
+
 div#course-tools {
   float: right; 
   padding-right: 1em; 
-  text-transform: lowercase;
+  text-decoration:none;
 }
 
 div#guide {
@@ -794,16 +804,6 @@ fieldset {
   margin-bottom: 10pt;
 }
 
-a#guide {
-  background-image: url(images/guide.jpg); background-repeat: no-repeat; background-position: 0px 0px;
-  background-color: #eee;
-  padding: 2px 10px 2px 26px;
-  border: 1px solid #ccc;
-  float:right;
-  text-decoration:none;
-  font-size:0.85em;
-}
-
 div#container {
   text-align: left;
   margin: 0px auto;
@@ -876,10 +876,9 @@ ul.topnavlist li a.selected {
 fieldset.group_form{
   margin:.5em;
   border:thin #6D7B8D solid;
-     min-height: 100px;
+  min-height: 100px;
   padding:.5em;
   background-color:#F8F8F8;;
-
 }
 
 legend.group_form{
diff --git a/docs/themes/default/tests/create_edit_question_likert.tmpl.php b/docs/themes/default/tests/create_edit_question_likert.tmpl.php
new file mode 100644 (file)
index 0000000..56f3f13
--- /dev/null
@@ -0,0 +1,102 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+require_once(TR_INCLUDE_PATH.'../tests/classes/TestsUtility.class.php');\r
+?>\r
+\r
+<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">\r
+<?php if (isset($this->qid)) {?><input type="hidden" name="qid" value="<?php echo $this->qid; ?>" /><?php }?>\r
+<?php if (isset($this->tid)) {?><input type="hidden" name="tid" value="<?php echo $this->tid; ?>" /><?php }?>\r
+<input type="hidden" name="_course_id" value="<?php echo $this->course_id; ?>" />\r
+\r
+<div class="input-form">\r
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('preset_scales'); ?></legend>\r
+\r
+       <div class="row">\r
+               <select name="preset_num">\r
+                       <optgroup label="<?php echo _AT('presets'); ?>">\r
+                       <?php // presets\r
+                               foreach ($this->likert_preset as $val => $preset) {\r
+                                       echo '<option value="'.$val.'">'.$preset[0].' - '.$preset[count($preset)-1].'</option>';\r
+                               }\r
+                       //previously used\r
+                       echo '</optgroup>';\r
+\r
+                       $rows = $this->testsQuestionsDAO->getByCourseIDAndType($this->course_id, 4);\r
+                       if (is_array($rows)) {\r
+                               echo '<optgroup label="'. _AT('prev_used').'">';\r
+                               $used_choices = array();\r
+                               foreach ($rows as $row) {\r
+                                       $choices = array_slice($row, 9, 10);\r
+                                       if (in_array($choices, $used_choices)) {\r
+                                               continue;\r
+                                       }\r
+\r
+                                       $used_choices[] = $choices;\r
+\r
+                                       for ($i=0; $i<=10; $i++) {\r
+                                               if ($row['choice_'.$i] == '') {\r
+                                                       $i--;\r
+                                                       break;\r
+                                               }\r
+                                       }\r
+                                       echo '<option value="'.$row['question_id'].'">'.$row['choice_0'].' - '.$row['choice_'.$i].'</option>';\r
+                               }\r
+                               echo '</optgroup>';\r
+                       }\r
+               ?>\r
+               </select>\r
+       </div>\r
+\r
+       <div class="row buttons">\r
+               <input type="submit" name="preset" value="<?php echo _AT('set_preset'); ?>" class="button" />\r
+       </div>\r
+       </fieldset>\r
+</div>\r
+\r
+<div class="input-form">\r
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('question'); ?></legend>\r
+       <div class="row">\r
+               <label for="cats"><?php echo _AT('category'); ?></label><br />\r
+               <select name="category_id" id="cats">\r
+                       <?php TestsUtility::printQuestionCatsInDropDown($_POST['category_id']); ?>\r
+               </select>\r
+       </div>\r
+\r
+       <div class="row">\r
+               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="question"><?php echo _AT('question'); ?></label> \r
+               \r
+               <?php TestsUtility::printVisualEditorLink('question'); ?>\r
+               \r
+               <textarea id="question" cols="50" rows="6" name="question"><?php echo htmlspecialchars(stripslashes($_POST['question'])); ?></textarea>\r
+       </div>\r
+\r
+<?php\r
+       for ($i=0; $i<10; $i++) { ?>\r
+               <div class="row">\r
+                       <?php if ($i==0 || $i==1) { ?>\r
+                               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div>\r
+                       <?php } ?>\r
+\r
+                       <label for="choice_<?php echo $i; ?>">\r
+                       <?php echo _AT('choice'); ?> <?php echo ($i+1); ?></label><br />\r
+                       <input type="text" id="choice_<?php echo $i; ?>" size="40" name="choice[<?php echo $i; ?>]" value="<?php echo htmlspecialchars(stripslashes($_POST['choice'][$i])); ?>" />\r
+               </div>\r
+<?php } ?>\r
+\r
+       <div class="row buttons">\r
+               <input type="submit" value="<?php echo _AT('save'); ?>"   name="submit" accesskey="s" />\r
+               <input type="submit" value="<?php echo _AT('cancel'); ?>" name="cancel" />\r
+       </div>\r
+       </fieldset>\r
+</div>\r
+</form>\r
diff --git a/docs/themes/default/tests/create_edit_question_long.tmpl.php b/docs/themes/default/tests/create_edit_question_long.tmpl.php
new file mode 100644 (file)
index 0000000..8b7b890
--- /dev/null
@@ -0,0 +1,59 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+require_once(TR_INCLUDE_PATH.'../tests/classes/TestsUtility.class.php');\r
+?>\r
+\r
+<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">\r
+<?php if (isset($this->qid)) {?><input type="hidden" name="qid" value="<?php echo $this->qid; ?>" /><?php }?>\r
+<?php if (isset($this->tid)) {?><input type="hidden" name="tid" value="<?php echo $this->tid; ?>" /><?php }?>\r
+<input type="hidden" name="_course_id" value="<?php echo $this->course_id; ?>" />\r
+\r
+<div class="input-form">\r
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('test_open'); ?></legend>\r
+       <div class="row">\r
+               <label for="cats"><?php echo _AT('category'); ?></label>\r
+               <select name="category_id" id="cats">\r
+                       <?php TestsUtility::printQuestionCatsInDropDown($_POST['category_id']); ?>\r
+               </select>\r
+       </div>\r
+\r
+       <div class="row">\r
+               <label for="optional_feedback"><?php echo _AT('optional_feedback'); ?></label> \r
+               <?php TestsUtility::printVisualEditorLink('optional_feedback'); ?>\r
+\r
+               <textarea id="optional_feedback" cols="50" rows="3" name="feedback"><?php echo htmlspecialchars(stripslashes($_POST['feedback'])); ?></textarea>\r
+       </div>\r
+\r
+       <div class="row">\r
+               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="question"><?php echo _AT('question'); ?></label> \r
+               <?php TestsUtility::printVisualEditorLink('question'); ?>\r
+\r
+               <textarea id="question" cols="50" rows="6" name="question"><?php \r
+               echo htmlspecialchars(stripslashes($_POST['question'])); ?></textarea>\r
+       </div>\r
+       \r
+       <div class="row">\r
+               <?php echo _AT('answer_size'); ?><br />\r
+               <input type="radio" name="properties" value="1" id="az1" <?php if ($_POST['properties'] == 1) { echo 'checked="checked"'; } ?> /><label for="az1"><?php echo _AT('one_word'); ?></label><br />\r
+               <input type="radio" name="properties" value="2" id="az2" <?php if ($_POST['properties'] == 2) { echo 'checked="checked"'; } ?> /><label for="az2"><?php echo _AT('one_sentence'); ?></label><br />\r
+               <input type="radio" name="properties" value="3" id="az3" <?php if ($_POST['properties'] == 3) { echo 'checked="checked"'; } ?> /><label for="az3"><?php echo _AT('short_paragraph'); ?></label><br />\r
+               <input type="radio" name="properties" value="4" id="az4" <?php if ($_POST['properties'] == 4) { echo 'checked="checked"'; } ?> /><label for="az4"><?php echo _AT('one_page'); ?></label>\r
+       </div>\r
+\r
+       <div class="row buttons">\r
+               <input type="submit" value="<?php echo _AT('save'); ?>"   name="submit" accesskey="s" />\r
+               <input type="submit" value="<?php echo _AT('cancel'); ?>" name="cancel" />\r
+       </div>\r
+       </fieldset>\r
+</div>\r
+</form>\r
diff --git a/docs/themes/default/tests/create_edit_question_matching.tmpl.php b/docs/themes/default/tests/create_edit_question_matching.tmpl.php
new file mode 100644 (file)
index 0000000..60f9f6c
--- /dev/null
@@ -0,0 +1,93 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+require_once(TR_INCLUDE_PATH.'../tests/classes/TestsUtility.class.php');\r
+?>\r
+\r
+<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">\r
+<?php if (isset($this->qid)) {?><input type="hidden" name="qid" value="<?php echo $this->qid; ?>" /><?php }?>\r
+<?php if (isset($this->tid)) {?><input type="hidden" name="tid" value="<?php echo $this->tid; ?>" /><?php }?>\r
+<input type="hidden" name="_course_id" value="<?php echo $this->course_id; ?>" />\r
+\r
+<div class="input-form">\r
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('test_matching'); ?></legend>\r
+       <div class="row">\r
+               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="cats"><?php echo _AT('category'); ?></label><br />\r
+               <select name="category_id" id="cats">\r
+                       <?php TestsUtility::printQuestionCatsInDropDown($_POST['category_id']); ?>\r
+               </select>\r
+       </div>\r
+\r
+       <div class="row">\r
+               <label for="optional_feedback"><?php echo _AT('optional_feedback'); ?></label> \r
+               <?php TestsUtility::printVisualEditorLink('optional_feedback'); ?>\r
+\r
+               <textarea id="optional_feedback" cols="50" rows="3" name="feedback"><?php \r
+               echo htmlspecialchars(stripslashes($_POST['feedback'])); ?></textarea>\r
+       </div>\r
+\r
+       <div class="row">\r
+               <label for="instructions"><?php echo _AT('instructions'); ?></label> \r
+               <?php TestsUtility::printVisualEditorLink('instructions'); ?>\r
+               <textarea id="instructions" cols="50" rows="3" name="instructions"><?php \r
+               echo htmlspecialchars(stripslashes($_POST['instructions'])); ?></textarea>\r
+       </div>\r
+\r
+       <div class="row">\r
+               <h2><?php echo _AT('questions');?></h2>\r
+       </div>\r
+<?php for ($i=0; $i<10; $i++): ?>\r
+       <div class="row">\r
+               <?php if ($i < 2) :?>\r
+                       <div class="required" title="<?php echo _AT('required_field'); ?>">*</div>\r
+               <?php endif; ?>\r
+               <?php echo _AT('question'); ?> <?php echo ($i+1); ?>\r
+               \r
+               <?php TestsUtility::printVisualEditorLink('question_' . $i); ?>\r
+               \r
+               <br />\r
+\r
+               <select name="question_answer[<?php echo $i; ?>]">\r
+                       <option value="-1">-</option>\r
+                       <?php foreach ($this->letters as $key => $value): ?>\r
+                               <option value="<?php echo $key; ?>" <?php if (isset($_POST['question_answer']) && $key == $_POST['question_answer'][$i]) { echo 'selected="selected"'; }?>><?php echo $value; ?></option>\r
+                       <?php endforeach; ?>\r
+               </select>\r
+               \r
+               <textarea id="question_<?php echo $i; ?>" cols="50" rows="2" name="question[<?php echo $i; ?>]"><?php \r
+               echo htmlspecialchars(stripslashes($_POST['question'][$i])); ?></textarea> \r
+       </div>\r
+<?php endfor; ?>\r
+       \r
+       <div class="row">\r
+               <h2><?php echo _AT('answers');?></h2>\r
+       </div>\r
+       <?php for ($i=0; $i<10; $i++): ?>\r
+               <div class="row">\r
+                       <?php if ($i < 2) :?>\r
+                               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div>\r
+                       <?php endif; ?>\r
+                       <?php echo _AT('answer'); ?> <?php echo $this->letters[$i]; ?>\r
+                       <?php TestsUtility::printVisualEditorLink('answer' . $i); ?>\r
+                       <br />\r
+                       <textarea id="answer_<?php echo $i; ?>" cols="50" rows="2" name="answer[<?php echo $i; ?>]"><?php \r
+                       echo htmlspecialchars(stripslashes($_POST['answer'][$i])); ?></textarea>\r
+               </div>\r
+       <?php endfor; ?>\r
+\r
+       <div class="row buttons">\r
+               <input type="submit" value="<?php echo _AT('save'); ?>"   name="submit" accesskey="s" />\r
+               <input type="submit" value="<?php echo _AT('cancel'); ?>" name="cancel" />\r
+       </div>\r
+       </fieldset>\r
+</div>\r
+</form>\r
diff --git a/docs/themes/default/tests/create_edit_question_matchingdd.tmpl.php b/docs/themes/default/tests/create_edit_question_matchingdd.tmpl.php
new file mode 100644 (file)
index 0000000..ac19ef3
--- /dev/null
@@ -0,0 +1,93 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+require_once(TR_INCLUDE_PATH.'../tests/classes/TestsUtility.class.php');\r
+?>\r
+\r
+<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">\r
+<?php if (isset($this->qid)) {?><input type="hidden" name="qid" value="<?php echo $this->qid; ?>" /><?php }?>\r
+<?php if (isset($this->tid)) {?><input type="hidden" name="tid" value="<?php echo $this->tid; ?>" /><?php }?>\r
+<input type="hidden" name="_course_id" value="<?php echo $this->course_id; ?>" />\r
+\r
+<div class="input-form">\r
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('test_matchingdd'); ?></legend>\r
+       <div class="row">\r
+               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="cats"><?php echo _AT('category'); ?></label><br />\r
+               <select name="category_id" id="cats">\r
+                       <?php TestsUtility::printQuestionCatsInDropDown($_POST['category_id']); ?>\r
+               </select>\r
+       </div>\r
+\r
+       <div class="row">\r
+               <label for="optional_feedback"><?php echo _AT('optional_feedback'); ?></label> \r
+               <?php TestsUtility::printVisualEditorLink('optional_feedback'); ?>\r
+\r
+               <textarea id="optional_feedback" cols="50" rows="3" name="feedback"><?php \r
+               echo htmlspecialchars(stripslashes($_POST['feedback'])); ?></textarea>\r
+       </div>\r
+\r
+       <div class="row">\r
+               <label for="instructions"><?php echo _AT('instructions'); ?></label> \r
+               <?php TestsUtility::printVisualEditorLink('instructions'); ?>\r
+               <textarea id="instructions" cols="50" rows="3" name="instructions"><?php \r
+               echo htmlspecialchars(stripslashes($_POST['instructions'])); ?></textarea>\r
+       </div>\r
+\r
+       <div class="row">\r
+               <h2><?php echo _AT('questions');?></h2>\r
+       </div>\r
+<?php for ($i=0; $i<10; $i++): ?>\r
+       <div class="row">\r
+               <?php if ($i < 2) :?>\r
+                       <div class="required" title="<?php echo _AT('required_field'); ?>">*</div>\r
+               <?php endif; ?>\r
+               <?php echo _AT('question'); ?> <?php echo ($i+1); ?>\r
+               \r
+               <?php TestsUtility::printVisualEditorLink('question_' . $i); ?>\r
+               \r
+               <br />\r
+\r
+               <select name="question_answer[<?php echo $i; ?>]">\r
+                       <option value="-1">-</option>\r
+                       <?php foreach ($this->letters as $key => $value): ?>\r
+                               <option value="<?php echo $key; ?>" <?php if (isset($_POST['question_answer']) && $key == $_POST['question_answer'][$i]) { echo 'selected="selected"'; }?>><?php echo $value; ?></option>\r
+                       <?php endforeach; ?>\r
+               </select>\r
+               \r
+               <textarea id="question_<?php echo $i; ?>" cols="50" rows="2" name="question[<?php echo $i; ?>]"><?php \r
+               echo htmlspecialchars(stripslashes($_POST['question'][$i])); ?></textarea> \r
+       </div>\r
+<?php endfor; ?>\r
+       \r
+       <div class="row">\r
+               <h2><?php echo _AT('answers');?></h2>\r
+       </div>\r
+       <?php for ($i=0; $i<10; $i++): ?>\r
+               <div class="row">\r
+                       <?php if ($i < 2) :?>\r
+                               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div>\r
+                       <?php endif; ?>\r
+                       <?php echo _AT('answer'); ?> <?php echo $this->letters[$i]; ?>\r
+                       <?php TestsUtility::printVisualEditorLink('answer_' . $i); ?>\r
+                       <br />\r
+                       <textarea id="answer_<?php echo $i; ?>" cols="50" rows="2" name="answer[<?php echo $i; ?>]"><?php \r
+                       echo htmlspecialchars(stripslashes($_POST['answer'][$i])); ?></textarea>\r
+               </div>\r
+       <?php endfor; ?>\r
+\r
+       <div class="row buttons">\r
+               <input type="submit" value="<?php echo _AT('save'); ?>"   name="submit" accesskey="s" />\r
+               <input type="submit" value="<?php echo _AT('cancel'); ?>" name="cancel" />\r
+       </div>\r
+       </fieldset>\r
+</div>\r
+</form>\r
diff --git a/docs/themes/default/tests/create_edit_question_multianswer.tmpl.php b/docs/themes/default/tests/create_edit_question_multianswer.tmpl.php
new file mode 100644 (file)
index 0000000..2d06d6d
--- /dev/null
@@ -0,0 +1,63 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+require_once(TR_INCLUDE_PATH.'../tests/classes/TestsUtility.class.php');\r
+?>\r
+\r
+<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">\r
+<?php if (isset($this->qid)) {?><input type="hidden" name="qid" value="<?php echo $this->qid; ?>" /><?php }?>\r
+<?php if (isset($this->tid)) {?><input type="hidden" name="tid" value="<?php echo $this->tid; ?>" /><?php }?>\r
+<input type="hidden" name="_course_id" value="<?php echo $this->course_id; ?>" />\r
+\r
+<div class="input-form">\r
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('test_ma'); ?></legend>\r
+       <div class="row">\r
+               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="cats"><?php echo _AT('category'); ?></label>\r
+               <select name="category_id" id="cats">\r
+                       <?php TestsUtility::printQuestionCatsInDropDown($_POST['category_id']); ?>\r
+               </select>\r
+       </div>\r
+       \r
+       <div class="row">\r
+               <label for="optional_feedback"><?php echo _AT('optional_feedback'); ?></label> \r
+               <?php TestsUtility::printVisualEditorLink('optional_feedback'); ?>      \r
+\r
+               <textarea id="optional_feedback" cols="50" rows="3" name="feedback"><?php echo htmlspecialchars(stripslashes($_POST['feedback'])); ?></textarea>\r
+       </div>\r
+\r
+       <div class="row">\r
+               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="question"><?php echo _AT('question'); ?></label> \r
+               <?php TestsUtility::printVisualEditorLink('question'); ?>               \r
+               <textarea id="question" cols="50" rows="4" name="question"><?php \r
+                       echo htmlspecialchars(stripslashes($_POST['question'])); ?></textarea>\r
+       </div>\r
+\r
+       <?php \r
+       for ($i=0; $i<10; $i++) { ?>\r
+               <div class="row">\r
+                       <label for="choice_<?php echo $i; ?>"><?php echo _AT('choice'); ?> <?php echo ($i+1); ?></label> \r
+                       <?php TestsUtility::printVisualEditorLink('choice_'.$i); ?>                     \r
+                       <br />\r
+                       <small><input type="checkbox" name="answer[<?php echo $i; ?>]" id="answer_<?php echo $i; ?>" value="1" <?php if($_POST['answer'][$i]) { echo 'checked="checked"';} ?>><label for="answer_<?php echo $i; ?>"><?php echo _AT('correct_answer'); ?></label></small>\r
+                       \r
+\r
+                       <textarea id="choice_<?php echo $i; ?>" cols="50" rows="2" name="choice[<?php echo $i; ?>]" class="formfield"><?php echo htmlspecialchars(stripslashes($_POST['choice'][$i])); ?></textarea>\r
+               </div>\r
+       <?php } ?>\r
+\r
+       <div class="row buttons">\r
+               <input type="submit" value="<?php echo _AT('save'); ?>"   name="submit" accesskey="s" />\r
+               <input type="submit" value="<?php echo _AT('cancel'); ?>" name="cancel" />\r
+       </div>\r
+       </fieldset>\r
+</div>\r
+</form>\r
diff --git a/docs/themes/default/tests/create_edit_question_multichoice.tmpl.php b/docs/themes/default/tests/create_edit_question_multichoice.tmpl.php
new file mode 100644 (file)
index 0000000..3d123bd
--- /dev/null
@@ -0,0 +1,63 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+require_once(TR_INCLUDE_PATH.'../tests/classes/TestsUtility.class.php');\r
+?>\r
+\r
+<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">\r
+<?php if (isset($this->qid)) {?><input type="hidden" name="qid" value="<?php echo $this->qid; ?>" /><?php }?>\r
+<?php if (isset($this->tid)) {?><input type="hidden" name="tid" value="<?php echo $this->tid; ?>" /><?php }?>\r
+<input type="hidden" name="_course_id" value="<?php echo $this->course_id; ?>" />\r
+\r
+<div class="input-form">\r
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('test_mc'); ?></legend>\r
+       <div class="row">\r
+               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="cats"><?php echo _AT('category'); ?></label>\r
+               <select name="category_id" id="cats">\r
+                       <?php TestsUtility::printQuestionCatsInDropDown($_POST['category_id']); ?>\r
+               </select>\r
+       </div>\r
+       \r
+       <div class="row">\r
+               <label for="optional_feedback"><?php echo _AT('optional_feedback'); ?></label> \r
+               <?php TestsUtility::printVisualEditorLink('optional_feedback'); ?>      \r
+\r
+               <textarea id="optional_feedback" cols="50" rows="3" name="feedback"><?php echo htmlspecialchars(stripslashes($_POST['feedback'])); ?></textarea>\r
+       </div>\r
+\r
+       <div class="row">\r
+               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="question"><?php echo _AT('question'); ?></label> \r
+               <?php TestsUtility::printVisualEditorLink('question'); ?>               \r
+               <textarea id="question" cols="50" rows="4" name="question"><?php \r
+                       echo htmlspecialchars(stripslashes($_POST['question'])); ?></textarea>\r
+       </div>\r
+\r
+       <?php \r
+       for ($i=0; $i<10; $i++) { ?>\r
+               <div class="row">\r
+                       <label for="choice_<?php echo $i; ?>"><?php echo _AT('choice'); ?> <?php echo ($i+1); ?></label> \r
+                       <?php TestsUtility::printVisualEditorLink('choice_' . $i); ?>\r
+                       <br />\r
+                       <small><input type="radio" name="answer" id="answer_<?php echo $i; ?>" value="<?php echo $i; ?>" <?php if($_POST['answer'][$i]) { echo 'checked="checked"';} ?>><label for="answer_<?php echo $i; ?>"><?php echo _AT('correct_answer'); ?></label></small>\r
+                       \r
+\r
+                       <textarea id="choice_<?php echo $i; ?>" cols="50" rows="2" name="choice[<?php echo $i; ?>]" class="formfield"><?php echo htmlspecialchars(stripslashes($_POST['choice'][$i])); ?></textarea>\r
+               </div>\r
+       <?php } ?>\r
+\r
+       <div class="row buttons">\r
+               <input type="submit" value="<?php echo _AT('save'); ?>"   name="submit" accesskey="s" />\r
+               <input type="submit" value="<?php echo _AT('cancel'); ?>" name="cancel" />\r
+       </div>\r
+       </fieldset>\r
+</div>\r
+</form>\r
diff --git a/docs/themes/default/tests/create_edit_question_ordering.tmpl.php b/docs/themes/default/tests/create_edit_question_ordering.tmpl.php
new file mode 100644 (file)
index 0000000..7d4b784
--- /dev/null
@@ -0,0 +1,64 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+require_once(TR_INCLUDE_PATH.'../tests/classes/TestsUtility.class.php');\r
+?>\r
+\r
+<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">\r
+<?php if (isset($this->qid)) {?><input type="hidden" name="qid" value="<?php echo $this->qid; ?>" /><?php }?>\r
+<?php if (isset($this->tid)) {?><input type="hidden" name="tid" value="<?php echo $this->tid; ?>" /><?php }?>\r
+<input type="hidden" name="_course_id" value="<?php echo $this->course_id; ?>" />\r
+\r
+<div class="input-form">\r
+       <div class="row">\r
+               <label for="cats"><?php echo _AT('category'); ?></label><br />\r
+               <select name="category_id" id="cats">\r
+                       <?php TestsUtility::printQuestionCatsInDropDown($_POST['category_id']); ?>\r
+               </select>\r
+       </div>\r
+\r
+       <div class="row">\r
+               <label for="optional_feedback"><?php echo _AT('optional_feedback'); ?></label> \r
+               <?php TestsUtility::printVisualEditorLink('optional_feedback'); ?>\r
+\r
+               <textarea id="optional_feedback" cols="50" rows="3" name="feedback"><?php echo htmlspecialchars(stripslashes($_POST['feedback'])); ?></textarea>\r
+       </div>\r
+\r
+       <div class="row">\r
+               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="question"><?php echo _AT('question'); ?></label> \r
+               \r
+               <?php TestsUtility::printVisualEditorLink('question'); ?>\r
+               \r
+               <textarea id="question" cols="50" rows="6" name="question"><?php echo htmlspecialchars(stripslashes($_POST['question'])); ?></textarea>\r
+       </div>\r
+\r
+       <?php for ($i=0; $i<10; $i++): ?>\r
+               <div class="row">\r
+                       <?php if ($i < 2): ?>\r
+                               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div>\r
+                       <?php endif; ?> <?php echo _AT('item'); ?> <?php echo ($i+1); ?>\r
+                       \r
+                       <?php TestsUtility::printVisualEditorLink('choice_' . $i); ?>\r
+                       \r
+                       <br />\r
+       \r
+                       <textarea id="choice_<?php echo $i; ?>" cols="50" rows="2" name="choice[<?php echo $i; ?>]"><?php \r
+                       echo htmlspecialchars(stripslashes($_POST['choice'][$i])); ?></textarea> \r
+               </div>\r
+       <?php endfor; ?>\r
+\r
+       <div class="row buttons">\r
+               <input type="submit" value="<?php echo _AT('save'); ?>"   name="submit" accesskey="s" />\r
+               <input type="submit" value="<?php echo _AT('cancel'); ?>" name="cancel" />\r
+       </div>\r
+</div>\r
+</form>\r
diff --git a/docs/themes/default/tests/create_edit_question_truefalse.tmpl.php b/docs/themes/default/tests/create_edit_question_truefalse.tmpl.php
new file mode 100644 (file)
index 0000000..ba050f2
--- /dev/null
@@ -0,0 +1,54 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+require_once(TR_INCLUDE_PATH.'../tests/classes/TestsUtility.class.php');\r
+?>\r
+\r
+<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">\r
+<?php if (isset($this->qid)) {?><input type="hidden" name="qid" value="<?php echo $this->qid; ?>" /><?php }?>\r
+<?php if (isset($this->tid)) {?><input type="hidden" name="tid" value="<?php echo $this->tid; ?>" /><?php }?>\r
+<input type="hidden" name="_course_id" value="<?php echo $this->course_id; ?>" />\r
+\r
+<div class="input-form">\r
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('test_tf'); ?></legend>\r
+       <div class="row">\r
+               <label for="cats"><?php echo _AT('category'); ?></label>\r
+               <select name="category_id" id="cats">\r
+                       <?php TestsUtility::printQuestionCatsInDropDown($_POST['category_id']); ?>\r
+               </select>\r
+       </div>\r
+\r
+       <div class="row">\r
+               <label for="optional_feedback"><?php echo _AT('optional_feedback'); ?></label> \r
+               <?php TestsUtility::printVisualEditorLink('optional_feedback'); ?>\r
+               <textarea id="optional_feedback" cols="50" rows="3" name="feedback"><?php echo htmlspecialchars(stripslashes($_POST['feedback'])); ?></textarea>\r
+       </div>\r
+\r
+       <div class="row">\r
+               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="question"><?php echo _AT('statement'); ?></label> \r
+               <?php TestsUtility::printVisualEditorLink('question'); ?>       \r
+               <textarea id="question" cols="50" rows="6" name="question"><?php \r
+                       echo htmlspecialchars(stripslashes($_POST['question'])); ?></textarea>\r
+       </div>\r
+\r
+       <div class="row">\r
+               <?php echo _AT('answer'); ?><br />\r
+               <input type="radio" name="answer" value="1" id="answer1"<?php echo $this->ans_yes; ?> /><label for="answer1"><?php echo _AT('true'); ?></label>, <input type="radio" name="answer" value="2" id="answer2"<?php echo $this->ans_no; ?> /><label for="answer2"><?php echo _AT('false'); ?></label>\r
+       </div>\r
+\r
+       <div class="row buttons">\r
+               <input type="submit" value="<?php echo _AT('save'); ?>"   name="submit" accesskey="s"/>\r
+               <input type="submit" value="<?php echo _AT('cancel'); ?>" name="cancel" />\r
+       </div>\r
+       </fieldset>\r
+</div>\r
+</form>\r
diff --git a/docs/themes/default/tests/create_edit_test.tmpl.php b/docs/themes/default/tests/create_edit_test.tmpl.php
new file mode 100644 (file)
index 0000000..ad8b484
--- /dev/null
@@ -0,0 +1,36 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+?>\r
+\r
+<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">\r
+<?php if (isset($this->tid)) { ?><input type="hidden" name="tid" value="<?php echo $this->tid; ?>" /> <?php }?>\r
+<input type="hidden" name="_course_id" value="<?php echo $this->course_id; ?>" />\r
+\r
+<div class="input-form">\r
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('edit_test'); ?></legend>\r
+       <div class="row">\r
+               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="title"><?php echo _AT('title'); ?></label><br />\r
+               <input type="text" name="title" id="title" size="40" value="<?php if (isset($_POST['title'])) echo stripslashes(htmlspecialchars($_POST['title'])); else echo $this->row['title']; ?>" />\r
+       </div>\r
+       \r
+       <div class="row">\r
+               <label for="description"><?php echo _AT('test_description'); ?></label><br />\r
+               <textarea name="description" cols="35" rows="3" id="description"><?php if (isset($_POST['description'])) echo htmlspecialchars($_POST['description']); else echo $this->row['description']; ?></textarea>\r
+       </div>\r
+\r
+       <div class="row buttons">\r
+               <input type="submit" value="<?php echo _AT('save');  ?>"  name="submit" accesskey="s" />\r
+               <input type="submit" value="<?php echo _AT('cancel'); ?>" name="cancel" />\r
+       </div>\r
+       </fieldset>\r
+</div>\r
+</form>\r
diff --git a/docs/themes/default/tests/index.tmpl.php b/docs/themes/default/tests/index.tmpl.php
new file mode 100644 (file)
index 0000000..2bde8e7
--- /dev/null
@@ -0,0 +1,76 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+?>\r
+<form method="post" action="tests/import_test.php" enctype="multipart/form-data" >\r
+<input type="hidden" name="_course_id" value="<?php echo $this->course_id; ?>" />\r
+<div class="input-form" style="width: 90%">\r
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('import_test'); ?></legend>\r
+       <div class="row">\r
+               <label for="to_file"><?php echo _AT('upload_test'); ?></label><br />\r
+               <input type="file" name="file" id="to_file" />\r
+       </div>\r
+\r
+       <div class="row buttons">\r
+               <input type="submit" name="submit_import" value="<?php echo _AT('import'); ?>" />\r
+       </div>\r
+       </fieldset>\r
+</div>\r
+</form>\r
+\r
+<form name="form" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">\r
+<input type="hidden" name="_course_id" value="<?php echo $this->course_id; ?>" />\r
+<table class="data" summary="" style="width: 90%" rules="cols">\r
+<thead>\r
+<tr>\r
+       <th scope="col">&nbsp;</th>\r
+       <th scope="col"><?php echo _AT('title'); ?></th>\r
+       <th scope="col"><?php echo _AT('description'); ?></th>\r
+<!--   <th scope="col"><?php echo _AT('assigned_to');    ?></th> -->\r
+</tr>\r
+</thead>\r
+\r
+<?php if (is_array($this->rows)){?>\r
+       <tfoot>\r
+       <tr>\r
+               <td colspan="3">\r
+                       <input type="submit" name="edit" value="<?php echo _AT('edit'); ?>" />\r
+                       <input type="submit" name="preview" value="<?php echo _AT('preview'); ?>" />\r
+                       <input type="submit" name="questions" value="<?php echo _AT('questions'); ?>" />\r
+               </td>\r
+       </tr>\r
+       <tr>    \r
+               <td colspan="3" style="padding-left:38px;">\r
+                       <input type="submit" name="delete" value="<?php echo _AT('delete'); ?>" />\r
+                       <input type="submit" name="export" value="<?php echo _AT('export'); ?>" />\r
+               </td>\r
+       </tr>\r
+       </tfoot>\r
+       <tbody>\r
+\r
+       <?php foreach ($this->rows as $row) { ?>\r
+               <tr onmousedown="document.form['t<?php echo $row['test_id']; ?>'].checked = true;rowselect(this);" id="r_<?php echo $row['test_id']; ?>">\r
+                       <td><input type="radio" name="id" value="<?php echo $row['test_id']; ?>" id="t<?php echo $row['test_id']; ?>" /></td>\r
+                       <td><label for="t<?php echo $row['test_id']; ?>"><?php echo $row['title']; ?></label></td>\r
+                       <td><?php echo $row['description']; ?></td>\r
+               </tr>\r
+       <?php }} // end of if (is_array($rows)) \r
+       else { ?>\r
+       <tbody>\r
+       <tr>\r
+               <td colspan="7"><?php echo _AT('none_found'); ?></td>\r
+       </tr>\r
+<?php } // end of else ?>\r
+</tbody>\r
+</table>\r
+</form>\r
+\r
diff --git a/docs/themes/default/tests/question_cats.tmpl.php b/docs/themes/default/tests/question_cats.tmpl.php
new file mode 100644 (file)
index 0000000..95a1a00
--- /dev/null
@@ -0,0 +1,40 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+if (is_array($this->rows)) {\r
+?>\r
+       <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">\r
+       <input type="hidden" name="_course_id" value="<?php echo $this->course_id; ?>" />\r
+       <div class="input-form">\r
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('question_categories'); ?></legend>\r
+<?php  foreach ($this->rows as $row) { ?>\r
+                       <div class="row">\r
+                               <input type="radio" id="cat_<?php echo $row['category_id']; ?>" name="category" value="<?php echo $row['category_id']; ?>" />   <label for="cat_<?php echo $row['category_id']; ?>"><?php echo AT_print($row['title'], 'tests_questions_categories.title'); ?></label>\r
+                       </div>\r
+<?php \r
+               }\r
+?>\r
+               <div class="row buttons">\r
+                       <input type="submit" value="<?php echo _AT('edit'); ?>"   name="edit" />\r
+                       <input type="submit" value="<?php echo _AT('delete'); ?>" name="delete" />\r
+               </div>\r
+       </div>\r
+       </form>\r
+<?php\r
+\r
+       } else {\r
+       echo '<div class="input-form">';\r
+               $this->msg->addFeedback('NO_QUESTION_CATS');\r
+               $this->msg->printAll();\r
+       echo'</div>';\r
+       }\r
+?>\r
diff --git a/docs/themes/default/tests/question_cats_manage.tmpl.php b/docs/themes/default/tests/question_cats_manage.tmpl.php
new file mode 100644 (file)
index 0000000..004e6da
--- /dev/null
@@ -0,0 +1,34 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+?>\r
+\r
+<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">\r
+<input type="hidden" name="_course_id" value="<?php echo $this->course_id; ?>" />\r
+<?php \r
+if (isset($this->catid)) {\r
+       echo '<input type="hidden" value="'.$this->catid.'" name="catid" />';\r
+}\r
+?>\r
+<div class="input-form">\r
+       <fieldset class="group_form"><legend class="group_form"><?php echo $this->title; ?></legend>\r
+       <div class="row">\r
+               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="cat"><?php echo _AT('title'); ?></label><br />\r
+               <input type="text" name="title" id="cat" value="<?php echo htmlspecialchars($_POST['title']); ?>" />\r
+       </div>\r
+\r
+       <div class="row buttons">\r
+               <input type="submit" value="<?php echo _AT('save'); ?>"   name="submit" accesskey="s" />\r
+               <input type="submit" value="<?php echo _AT('cancel'); ?>" name="cancel" />\r
+       </div>\r
+       </fieldset>\r
+</div>\r
+</form>\r
diff --git a/docs/themes/default/tests/question_db_top.tmpl.php b/docs/themes/default/tests/question_db_top.tmpl.php
new file mode 100644 (file)
index 0000000..1a9ee8a
--- /dev/null
@@ -0,0 +1,40 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+?>\r
+<div class="input-form" width="95%">\r
+       <fieldset class="group_form" style="width:43%;float:left;height:18em;min-width:15em;margin-left:2em;"><legend class="group_form"><?php echo _AT('create_new_question'); ?></legend>\r
+               <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">\r
+                       <input type="hidden" name="tid" value="<?php echo $this->tid; ?>" />\r
+                       <input type="hidden" name="_course_id" value="<?php echo $this->course_id; ?>" />\r
+                       <label for="question"><?php echo _AT('create_new_question'); ?></label><br />\r
+                       <select name="question_type" class="dropdown" id="question" size="8">\r
+                       <?php foreach ($this->questions as $type => $name): ?>\r
+                               <option value="<?php echo $type; ?>"><?php echo $name; ?></option>\r
+                       <?php endforeach; ?>\r
+                       </select>\r
+                       <div class="row buttons">\r
+                       <input type="submit" name="submit_create" value="<?php echo _AT('create'); ?>" />\r
+                       </div>\r
+               </form>\r
+       </fieldset>\r
+\r
+       <fieldset class="group_form" style="width:43%;float:left;clear:right;height:18em;min-width:18em;"><legend class="group_form"><?php echo _AT('import_question'); ?></legend>\r
+               <form method="post" action="<?php echo 'tests/question_import.php'; ?>" enctype="multipart/form-data" > <label for="to_file"><?php echo _AT('upload_question'); ?></label><br />\r
+                       <input type="file" name="file" id="to_file" />\r
+                       <div class="row buttons">\r
+                       <input type="submit" name="submit_import" value="<?php echo _AT('import'); ?>" />\r
+                       </div>\r
+               </form>\r
+       </fieldset>\r
+\r
+</div>\r
diff --git a/docs/themes/default/tests/test_questions/footer.tmpl.php b/docs/themes/default/tests/test_questions/footer.tmpl.php
new file mode 100644 (file)
index 0000000..7f5eaa3
--- /dev/null
@@ -0,0 +1 @@
+</div>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/header.tmpl.php b/docs/themes/default/tests/test_questions/header.tmpl.php
new file mode 100644 (file)
index 0000000..d3efeb3
--- /dev/null
@@ -0,0 +1,18 @@
+<div style="background-color: #f3f3f3; padding: 5px 10px; margin: 0px; border-top: 1px solid">
+       <?php if ($this->weight): ?>
+               <div style="float: right; width: 50%; text-align: right; font-weight: bold">
+                       <?php if ($this->score=='' && $this->score !== FALSE) echo '<span style="color:red">'._AT('unmarked').'</span>'; ?>
+                       <?php if ($this->score !== FALSE && $this->question_id): ?>
+                               <input type="text" name="scores[<?php echo $this->question_id; ?>]" value="<?php echo $this->score; ?>" size="5" style="font-weight: bold; text-align: right" maxlength="5"/> / 
+                       <?php elseif ($this->score !== FALSE): ?>
+                               <?php echo $this->score; ?> /
+                       <?php endif; ?>
+                       <?php echo $this->weight; ?> <?php echo _AT('points'); ?>
+               </div>
+       <?php endif; ?>
+
+       <h3 style="color: black"><?php echo _AT('question'); ?> <?php echo $this->number; ?>: <span style="padding-left: 10px"><?php echo $this->type; ?></span></h3>
+</span>
+       </strong>
+</div>
+<div class="row" style="padding-bottom: 20px">
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/likert.tmpl.php b/docs/themes/default/tests/test_questions/likert.tmpl.php
new file mode 100644 (file)
index 0000000..270439c
--- /dev/null
@@ -0,0 +1,12 @@
+<p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>
+
+<ul style="padding: 0px; margin: 0px; list-style-type: none;">
+       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+               <li style="padding: 4px; display: inline; white-space: nowrap;">
+                       <input type="radio" name="answers[<?php echo $this->row['question_id']; ?>]" value="<?php echo $i; ?>" id="choice_<?php echo $this->row['question_id'].'_'.$i; ?>" <?php if ($this->response == $i): ?>checked="checked"<?php endif; ?>/><label for="choice_<?php echo $this->row['question_id'].'_'.$i; ?>"><?php echo AT_print($this->row['choice_'.$i], 'tests_answers.answer'); ?></label>
+               </li>
+       <?php endfor; ?>
+       <li style="padding: 4px; display: inline; white-space: nowrap;">
+               <input type="radio" name="answers[<?php echo $this->row['question_id']; ?>]" value="-1" id="choice_<?php echo $this->row['question_id']; ?>_x" <?php if ($this->response == -1): ?>checked="checked"<?php endif; ?>/><label for="choice_<?php echo $this->row['question_id']; ?>_x"><em><?php echo _AT('leave_blank'); ?></em></label>
+       </li>
+</ul>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/likert_qti_1p2.tmpl.php b/docs/themes/default/tests/test_questions/likert_qti_1p2.tmpl.php
new file mode 100644 (file)
index 0000000..3b5ef7d
--- /dev/null
@@ -0,0 +1,48 @@
+<!-- likert question (aka multiple choice with no correct answer) -->
+               <item title="Multiple choice question" ident="ITEM_<?php echo $this->row['question_id']; ?>">
+                       <itemmetadata>
+                               <qtimetadata>
+                                       <qtimetadatafield>
+                                               <fieldlabel>qmd_itemtype</fieldlabel>
+                                               <fieldentry>Logical Identifier</fieldentry>
+                                       </qtimetadatafield>
+                               </qtimetadata>
+                               <qtimetadata>
+                                       <qtimetadatafield>
+                                               <fieldlabel>qmd_questiontype</fieldlabel>
+                                               <fieldentry>Multiple-choice</fieldentry>
+                                       </qtimetadatafield>
+                               </qtimetadata>
+                       </itemmetadata>
+                       <presentation>
+                               <flow>
+                                       <material>
+                                               <mattext texttype="text/html"><?php echo $this->row['question']; ?></mattext>
+                                       </material>
+                                       <response_lid ident="RESPONSE<?php echo $this->row['question_id']; ?>" rcardinality="Single">
+                                               <render_choice shuffle="No" minnumber="1" maxnumber="1">
+                                                       <flow_label>
+                                                       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                                                               <response_label ident="Choice<?php echo $i; ?>">        
+                                                                       <material>
+                                                                               <mattext texttype="text/html"><?php echo $this->row['choice_'.$i]; ?></mattext>
+                                                                       </material>
+                                                               </response_label>
+                                                       <?php endfor; ?>
+                                                       </flow_label>
+                                               </render_choice>
+                                       </response_lid>
+                               </flow>
+                       </presentation>
+
+                       <resprocessing>
+                               <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                               <respcondition title="CorrectResponse">
+                                       <conditionvar>                                  
+                                               <varequal respident="RESPONSE<?php echo $this->row['question_id']; ?>">Choice<?php echo $i; ?></varequal>
+                                       </conditionvar>
+                                       <setvar varname="que_score" action="Set"><?php echo (isset($this->row['weight']))?$this->row['weight']:1; ?></setvar>
+                               </respcondition>
+                               <?php endfor; ?>
+                       </resprocessing>
+               </item>
diff --git a/docs/themes/default/tests/test_questions/likert_qti_2p1.tmpl.php b/docs/themes/default/tests/test_questions/likert_qti_2p1.tmpl.php
new file mode 100644 (file)
index 0000000..16b3443
--- /dev/null
@@ -0,0 +1,24 @@
+<<?php echo '?'; ?>xml version="1.0" encoding="<?php echo $this->encoding; ?>"<?php echo '?'; ?>>
+<!-- likert question (aka multiple choice with no correct answer) -->
+<assessmentItem 
+       xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1" 
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+       xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p1 imsqti_v2p1.xsd" 
+       identifier="ATUTOR-<?php echo $this->row['question_id']; ?>" 
+       title="<?php echo $this->row['question']; ?>" 
+       adaptive="false" 
+       timeDependent="false"
+       toolname="ATutor - atutor.ca"
+       toolversion="<?php echo VERSION; ?>"
+>
+
+       <itemBody>
+               <choiceInteraction responseIdentifier="RESPONSE" shuffle="false" maxChoices="1">
+                       <prompt><?php echo $this->row['question']; ?></prompt>
+                       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                               <simpleChoice identifier="Choice<?php echo $i; ?>" fixed="true"><?php echo $this->row['choice_'.$i]; ?></simpleChoice> 
+                       <?php endfor; ?>
+         </choiceInteraction>
+       </itemBody>
+
+</assessmentItem>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/likert_result.tmpl.php b/docs/themes/default/tests/test_questions/likert_result.tmpl.php
new file mode 100644 (file)
index 0000000..b60a047
--- /dev/null
@@ -0,0 +1,16 @@
+<p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>
+
+<ul style="padding: 0px; margin: 0px; list-style-type: none">
+       <?php for ($i=0; $i < 10; $i++): ?>
+               <?php if ($this->row['choice_'.$i] != ''): ?>
+                       <li style="padding: 4px; display: inline">
+                               <?php if ($this->answer == $i): ?>
+                                       <img src="<?php echo $this->base_path; ?>images/checkbox_check.gif" alt="<?php echo _AT('checked'); ?>" title="<?php echo _AT('checked'); ?>" height="13" width="13" style="vertical-align: middle" />
+                               <?php else: ?>
+                                       <img src="<?php echo $this->base_path; ?>images/checkbox_empty.gif" alt="<?php echo _AT('unchecked'); ?>" title="<?php echo _AT('unchecked'); ?>" height="13" width="13" style="vertical-align: middle" />
+                               <?php endif; ?>
+                               <?php echo AT_print($this->row['choice_'.$i], 'tests_answers.answer'); ?>
+                       </li>
+               <?php endif; ?>
+       <?php endfor; ?>
+</ul>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/likert_stats.tmpl.php b/docs/themes/default/tests/test_questions/likert_stats.tmpl.php
new file mode 100644 (file)
index 0000000..33d9b19
--- /dev/null
@@ -0,0 +1,28 @@
+<br />
+<table class="data static" summary="" style="width: 95%" rules="cols">
+<thead>
+<tr>
+       <th scope="col" width="40%"><?php echo _AT('question'); ?></th>
+       <th scope="col"><?php echo _AT('left_blank'); ?></th>
+       <th scope="col"><?php echo _AT('average'); ?></th>
+       <?php for ($i=0; $i<$this->num_choices; $i++): ?>
+               <th scope="col" title="<?php echo $this->row['choice_'.$i]; ?>"><?php echo ($i+1); ?></th>
+       <?php endfor; ?>
+</tr>
+</thead>
+<tr>
+       <td valign="top" rowspan="2"><?php echo $this->row['question']; ?></td>
+       <td align="center" width="70" valign="top"><?php echo $this->num_blanks;?> / <?php echo $this->num_results; ?></td>
+       <td align="center" width="70" valign="top"><?php echo $this->average;?> / <?php echo $this->num_choices; ?></td>
+       <?php for ($j=0; $j<$this->num_choices; $j++): ?>
+               <td align="center" valign="top"><?php echo (int) $this->answers[$j]['count']; ?> / <?php echo $this->num_results; ?></td>
+       <?php endfor; ?>
+</tr>
+<tr>
+       <td align="center"><div class="qstat_bar-border"><div class="qstat_bar-bar"><div class="qstat_bar-fill" style="height:<?php echo 100-($this->num_results ? round($this->num_blanks/$this->num_results*100) : 0); ?>%;"></div></div></div><?php echo $this->num_results ? round($this->num_blanks/$this->num_results*100) : 0; ?>%</td>
+       <td align="center"><div class="qstat_bar-border"><div class="qstat_bar-bar"><div class="qstat_bar-fill" style="height:<?php echo 100-($this->num_results ? round($this->average/$this->num_choices*100) : 0); ?>%;"></div></div></div></td>
+       <?php for ($j=0; $j<$this->num_choices; $j++): ?>
+               <td align="center" valign="top"><div class="qstat_bar-border"><div class="qstat_bar-bar"><div class="qstat_bar-fill" style="height:<?php echo 100-($this->num_results ? round($this->answers[$j]['count']/$this->num_results*100) : 0); ?>%;"></div></div></div><?php echo $this->num_results ? round($this->answers[$j]['count']/$this->num_results*100) : 0; ?>%</td>
+       <?php endfor; ?>
+</tr>
+</table>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/long.tmpl.php b/docs/themes/default/tests/test_questions/long.tmpl.php
new file mode 100644 (file)
index 0000000..bfc8ac0
--- /dev/null
@@ -0,0 +1,15 @@
+<p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>
+
+<?php if ($this->row['properties'] == 1): /* one word */ ?>
+       <input type="text" name="answers[<?php echo $this->row['question_id']; ?>]" class="formfield" size="15" value="<?php echo htmlspecialchars($this->response); ?>" />
+
+<?php elseif ($this->row['properties'] == 2): /* sentence */ ?>
+       <input type="text" name="answers[<?php echo $this->row['question_id']; ?>]" class="formfield" size="45" value="<?php echo htmlspecialchars($this->response); ?>" />
+
+<?php elseif ($this->row['properties'] == 3): /* paragraph */ ?>
+       <textarea cols="55" rows="5" name="answers[<?php echo $this->row['question_id']; ?>]" class="formfield"><?php echo htmlspecialchars($this->response); ?></textarea>
+
+<?php elseif ($this->row['properties'] == 4): /* page */ ?>
+       <textarea cols="55" rows="25" name="answers[<?php echo $this->row['question_id']; ?>]" class="formfield"><?php echo htmlspecialchars($this->response); ?></textarea>
+
+<?php endif; ?>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/long_qti_1p2.tmpl.php b/docs/themes/default/tests/test_questions/long_qti_1p2.tmpl.php
new file mode 100644 (file)
index 0000000..8ce37cc
--- /dev/null
@@ -0,0 +1,43 @@
+<!-- open ended (free text) question -->
+               <item title="Open ended question" ident="ITEM_<?php echo $this->row['question_id']; ?>">
+                       <itemmetadata>
+                               <qtimetadata>
+                                       <qtimetadatafield>
+                                               <fieldlabel>qmd_itemtype</fieldlabel>
+                                               <fieldentry>String</fieldentry>
+                                       </qtimetadatafield>
+                               </qtimetadata>
+                               <qtimetadata>
+                                       <qtimetadatafield>
+                                               <fieldlabel>qmd_questiontype</fieldlabel>
+                                               <fieldentry>FIB-string</fieldentry>
+                                       </qtimetadatafield>
+                               </qtimetadata>
+                       </itemmetadata>
+                       <presentation>
+                               <flow>
+                                       <material>
+                                               <mattext texttype="text/html"><?php echo $this->row['question']; ?></mattext>
+                                       </material>
+                                       <response_str ident="RESPONSE<?php echo $this->row['question_id']; ?>" rcardinality="Single">
+                                               <?php
+                                                       $fib_columns = 20;
+                                                       $fib_rows = 1;
+
+                                                       if ($this->row['properties'] == 1){
+                                                               $fib_columns = 5;
+                                                       } elseif ($this->row['properties'] == 2){
+                                                               $fib_rows = 1;
+                                                       } elseif ($this->row['properties'] == 3){
+                                                               $fib_rows = 3;
+                                                       } elseif ($this->row['properties'] == 4){
+                                                               $fib_rows = 8;
+                                                       } 
+                                               ?>
+                                               <render_fib rows="<?php echo $fib_rows; ?>" columns="<?php echo $fib_columns; ?>">
+                                                       <response_label ident="Choice<?php echo $i; ?>" />
+                                               </render_fib>
+                                       </response_str>
+                               </flow>
+                       </presentation>
+               </item>
diff --git a/docs/themes/default/tests/test_questions/long_qti_2p1.tmpl.php b/docs/themes/default/tests/test_questions/long_qti_2p1.tmpl.php
new file mode 100644 (file)
index 0000000..6b07f85
--- /dev/null
@@ -0,0 +1,31 @@
+<<?php echo '?'; ?>xml version="1.0" encoding="<?php echo $this->encoding; ?>"<?php echo '?'; ?>>
+<!-- open ended (free text) question -->
+<assessmentItem 
+       xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1" 
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+       xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p1 imsqti_v2p1.xsd" 
+       identifier="ATUTOR-<?php echo $this->row['question_id']; ?>" 
+       title="<?php echo $this->row['question']; ?>" 
+       adaptive="false" 
+       timeDependent="false"
+       toolname="ATutor - atutor.ca"
+       toolversion="<?php echo VERSION; ?>"
+>
+
+       <responseDeclaration identifier="RESPONSE" cardinality="single" baseType="string">
+         <?php if ($this->row['feedback']): ?>
+                 <outcomeDeclaration identifier="FEEDBACK" cardinality="single" baseType="identifier"/>
+         <?php endif; ?>
+       </responseDeclaration>
+
+
+       <itemBody>
+               <extendedTextInteraction responseIdentifier="RESPONSE">
+                       <prompt><?php echo $this->row['question']; ?></prompt>
+               </extendedTextInteraction>
+       </itemBody>
+
+       <?php if ($this->row['feedback']): ?>
+               <modalFeedback outcomeIdentifier="FEEDBACK" identifier="FEEDBACK" showHide="hide"><?php echo $this->row['feedback']; ?></modalFeedback> 
+       <?php endif; ?>
+</assessmentItem>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/long_result.tmpl.php b/docs/themes/default/tests/test_questions/long_result.tmpl.php
new file mode 100644 (file)
index 0000000..0f94261
--- /dev/null
@@ -0,0 +1,3 @@
+<p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>
+
+<p style="font-family: curior new; font-size: medium"><?php echo AT_print($this->answer, 'tests_answers.answer'); ?></p>
diff --git a/docs/themes/default/tests/test_questions/long_stats.tmpl.php b/docs/themes/default/tests/test_questions/long_stats.tmpl.php
new file mode 100644 (file)
index 0000000..fff3996
--- /dev/null
@@ -0,0 +1,21 @@
+<br/>
+<table class="data static" summary="" style="width: 95%" rules="cols">
+<thead>
+<tr>
+       <th scope="col"><?php echo _AT('question'); ?></th>
+       <th scope="col"><?php echo _AT('left_blank'); ?></th>
+       <th scope="col"><?php echo _AT('results'); ?></th>
+</tr>
+</thead>
+<tr>
+       <td><?php echo $this->row['question']; ?></td>
+       <td align="center" width="70" valign="top"><?php echo $this->num_blanks; ?> / <?php echo $this->num_results; ?></td>
+       <td align="center" valign="top">
+               <?php if ((count($this->answers) - (isset($this->answers[''])?1:0)) > 0): ?>
+                       <a href="tools/tests/results_quest_long.php?tid=<?php echo intval($_GET['tid']).SEP; ?>qid=<?php echo $this->row['question_id'].SEP.'q='.urlencode($this->row['question']); ?>"><?php echo _AT('view_responses'); ?> (<?php echo (count($this->answers) - (isset($this->answers[''])?1:0)); ?>)</a>
+               <?php else: ?>
+                       <?php echo _AT('none'); ?>              
+               <?php endif; ?>
+       </td>
+</tr>
+</table>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/manifest_qti_1p2.tmpl.php b/docs/themes/default/tests/test_questions/manifest_qti_1p2.tmpl.php
new file mode 100644 (file)
index 0000000..e14320a
--- /dev/null
@@ -0,0 +1,28 @@
+<<?php echo '?'; ?>xml version="1.0" encoding="<?php echo $this->encoding; ?>"<?php echo '?'; ?>>
+<manifest xmlns="http://www.imsglobal.org/xsd/imscp_v1p2" xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_v1p2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:imsqti="http://www.imsglobal.org/xsd/imsqti_v2p1" identifier="MANIFEST-<?php echo md5(time()); ?>" xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p2 http://www.imsglobal.org/xsd/imscp_v1p2.xsd http://www.imsglobal.org/xsd/imsmd_v1p2 http://www.imsglobal.org/xsd/imsmd_v1p2p2.xsd http://www.imsglobal.org/xsd/ims_qtilitev1p2p1.xsd">
+       <metadata>
+               <schema>IMS Question and Test Interoperability</schema>
+               <schemaversion>1.2.1</schemaversion>
+       </metadata>
+       <organizations default="">
+               <organization identifier="<?php echo 'ATUTOR_'.md5($this->title); ?>" structure="hierarchical">
+                       <title><?php echo $this->title; ?></title>
+                       <item identifier="ITEM1" identifierref="RESOURCE1">
+                               <title><?php echo $this->title; ?></title>
+                       </item>
+               </organization>
+       </organizations>
+       <resources>
+               <?php
+               //Respondus only supports type imsqti_xmlv1p1, qti 2.0 can use imsqti_item_xmlv1p1 as each individual items
+               ?>
+               <resource identifier="RESOURCE1" type="imsqti_xmlv1p1" href="<?php echo $this->xml_filename; ?>">
+                       <metadata/>
+                       <file href="<?php echo $this->xml_filename; ?>"/>
+                       <!-- dependancies go here -->
+               <?php foreach ($this->dependencies as $dependency_href): ?>
+                       <file href="resources/<?php echo $dependency_href; ?>"/>
+               <?php endforeach; ?>
+               </resource>
+       </resources>
+</manifest>
diff --git a/docs/themes/default/tests/test_questions/manifest_qti_2p1.tmpl.php b/docs/themes/default/tests/test_questions/manifest_qti_2p1.tmpl.php
new file mode 100644 (file)
index 0000000..4b196f4
--- /dev/null
@@ -0,0 +1,29 @@
+<<?php echo '?'; ?>xml version="1.0" encoding="<?php echo $this->encoding; ?>"<?php echo '?'; ?>>
+<manifest xmlns="http://www.imsglobal.org/xsd/imscp_v1p2" xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_v1p2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:imsqti="http://www.imsglobal.org/xsd/imsqti_v2p1" identifier="MANIFEST-<?php echo md5(time()); ?>" xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p2 http://www.imsglobal.org/xsd/imscp_v1p2.xsd http://www.imsglobal.org/xsd/imsmd_v1p2 http://www.imsglobal.org/xsd/imsmd_v1p2p2.xsd http://www.imsglobal.org/xsd/imsqti_v2p1 http://www.imsglobal.org/xsd/imsqti_v2p1.xsd">
+       <metadata>
+               <schema>IMS Content</schema>
+               <schemaversion>1.2</schemaversion>
+       </metadata>
+
+       <organizations/>
+
+       <resources>
+               <?php foreach ($this->resources as $resource): ?>
+                       <resource identifier="RES-<?php echo md5($resource['href']); ?>" type="imsqti_item_xmlv2p1" href="<?php echo $resource['href']; ?>">
+                               <metadata/>
+                               <file href="<?php echo $resource['href']; ?>"/>
+                               <?php foreach ($resource['dependencies'] as $dependency_href): ?>
+                                       <dependency identifierref="<?php echo md5($dependency_href); ?>"/>
+                               <?php endforeach; ?>
+                       </resource>
+               <?php endforeach; ?>
+
+               <!-- dependancies go here -->
+               <?php foreach ($this->dependencies as $dependency_href): ?>
+                       <resource identifier="<?php echo md5($dependency_href); ?>" type="webcontent">
+                               <metadata/>
+                               <file href="resources/<?php echo $dependency_href; ?>"/>
+                       </resource>
+               <?php endforeach; ?>
+       </resources>
+</manifest>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/matching.tmpl.new.php b/docs/themes/default/tests/test_questions/matching.tmpl.new.php
new file mode 100644 (file)
index 0000000..78ccfdd
--- /dev/null
@@ -0,0 +1,28 @@
+<p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>
+
+<table style="width: 100%">
+<tr>
+       <td valign="top">
+               <ul style="padding: 0px; margin: 0px; list-style-type: none">
+                       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                               <li style="padding: 4px">
+                               <select name="answers[<?php echo $this->row['question_id']; ?>][<?php echo $i; ?>]">
+                                       <option value="-1" <?php if ('' === $this->response[$i] || -1 == $this->response[$i]): ?>selected="selected"<?php endif; ?>>-</option>
+                                       <?php for ($j=0; $j < $this->num_options; $j++): ?>
+                                               <option value="<?php echo $j; ?>" <?php if (is_numeric($this->response[$i]) && $j == $this->response[$i]): ?>selected="selected"<?php endif; ?>><?php echo $this->letters[$j]; ?></option>
+                                       <?php endfor; ?>
+                               </select>
+                               <?php echo AT_print($this->row['choice_'. $i], 'tests_questions.choice_'.$i); ?>
+                               </li>
+                       <?php endfor; ?>
+               </ul>
+       </td>
+       <td valign="top">
+               <ul style="list-style-type: none; margin: 0px; padding: 0px">
+                       <?php for ($i=0; $i < $this->num_options; $i++): ?>
+                               <li style="padding: 4px"><?php echo $this->letters[$i]; ?>. <?php echo AT_print($this->row['option_'. $i], 'tests_questions.option_'.$i); ?></li>
+                       <?php endfor; ?>
+               </ul>
+       </td>
+</tr>
+</table>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/matching.tmpl.php b/docs/themes/default/tests/test_questions/matching.tmpl.php
new file mode 100644 (file)
index 0000000..78ccfdd
--- /dev/null
@@ -0,0 +1,28 @@
+<p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>
+
+<table style="width: 100%">
+<tr>
+       <td valign="top">
+               <ul style="padding: 0px; margin: 0px; list-style-type: none">
+                       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                               <li style="padding: 4px">
+                               <select name="answers[<?php echo $this->row['question_id']; ?>][<?php echo $i; ?>]">
+                                       <option value="-1" <?php if ('' === $this->response[$i] || -1 == $this->response[$i]): ?>selected="selected"<?php endif; ?>>-</option>
+                                       <?php for ($j=0; $j < $this->num_options; $j++): ?>
+                                               <option value="<?php echo $j; ?>" <?php if (is_numeric($this->response[$i]) && $j == $this->response[$i]): ?>selected="selected"<?php endif; ?>><?php echo $this->letters[$j]; ?></option>
+                                       <?php endfor; ?>
+                               </select>
+                               <?php echo AT_print($this->row['choice_'. $i], 'tests_questions.choice_'.$i); ?>
+                               </li>
+                       <?php endfor; ?>
+               </ul>
+       </td>
+       <td valign="top">
+               <ul style="list-style-type: none; margin: 0px; padding: 0px">
+                       <?php for ($i=0; $i < $this->num_options; $i++): ?>
+                               <li style="padding: 4px"><?php echo $this->letters[$i]; ?>. <?php echo AT_print($this->row['option_'. $i], 'tests_questions.option_'.$i); ?></li>
+                       <?php endfor; ?>
+               </ul>
+       </td>
+</tr>
+</table>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/matching_qti_1p2.tmpl.php b/docs/themes/default/tests/test_questions/matching_qti_1p2.tmpl.php
new file mode 100644 (file)
index 0000000..7aad2c5
--- /dev/null
@@ -0,0 +1,67 @@
+<!-- matching question with partial marks -->
+               <item title="Mathcing question" ident="ITEM_<?php echo $this->row['question_id']; ?>">
+                       <itemmetadata>
+                               <qmd_itemtype>Matching</qmd_itemtype>
+                               <qtimetadata>
+                                       <qtimetadatafield>
+                                               <fieldlabel>qmd_itemtype</fieldlabel>
+                                               <fieldentry>Logical Groups</fieldentry>
+                                       </qtimetadatafield>
+                               </qtimetadata>
+                       </itemmetadata>
+                       <presentation>                          
+                               <flow>
+                                       <material>
+                                               <mattext texttype="text/html"><?php echo $this->row['question']; ?></mattext>
+                                       </material>
+                                       <?php for ($i=0; $i < $this->num_choices; $i++): ?>             
+                                       <response_grp ident="RESPONSE-<?php echo md5($this->row['question_id'].$i); ?>" rcardinality="Multiple">
+                                               <material>
+                                                       <mattext texttype="text/html"><?php echo $this->row['choice_'.$i]; ?></mattext>
+                                               </material>
+                                               <render_choice shuffle="No">
+                                               <?php for ($j=0; $j < $this->num_options; $j++): ?>
+                                                       <response_label ident="Option<?php echo $j; ?>">        
+                                                               <flow_mat>
+                                                                       <material>
+                                                                               <mattext texttype="text/html"><?php echo $this->row['option_'.$j]; ?></mattext>
+                                                                       </material>
+                                                               </flow_mat>
+                                                       </response_label>
+                                               <?php endfor; ?>
+                                               </render_choice>
+                                       </response_grp>
+                                       <?php endfor; ?>
+                               </flow>
+                       </presentation>
+
+
+                       <resprocessing>
+                               <outcomes>
+                                       <decvar/>
+                               </outcomes>
+                       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                               <?php if ($this->row['answer_'.$i] > -1): ?>
+                               <respcondition title="CorrectResponse">
+                                       <conditionvar>                                          
+                                               <varequal respident="RESPONSE-<?php echo md5($this->row['question_id'].$i); ?>">Option<?php echo $this->row['answer_'.$i]; ?></varequal>
+                                       </conditionvar>
+                                       <setvar varname="Respondus_Correct" action="Add"><?php echo (isset($this->row['weight']))?$this->row['weight']:1; ?></setvar>
+                               </respcondition>
+                               <?php endif; ?>
+                       <?php endfor; ?>
+                       </resprocessing>
+               <?php if ($this->row['feedback']): ?>
+                       <itemfeedback ident="FEEDBACK" view="All">
+                               <solution>
+                                       <solutionmaterial>
+                                               <flow_mat>
+                                                       <material>
+                                                               <mattext texttype="text/html"><?php echo $this->row['feedback']; ?></mattext>
+                                                       </material>
+                                               </flow_mat>
+                                       </solutionmaterial>
+                               </solution>
+                       </itemfeedback>
+               <?php endif; ?>
+               </item>
diff --git a/docs/themes/default/tests/test_questions/matching_qti_2p1.tmpl.php b/docs/themes/default/tests/test_questions/matching_qti_2p1.tmpl.php
new file mode 100644 (file)
index 0000000..cb4ce1c
--- /dev/null
@@ -0,0 +1,54 @@
+<<?php echo '?'; ?>xml version="1.0" encoding="<?php echo $this->encoding; ?>"<?php echo '?'; ?>>
+<!-- matching question with partial marks -->
+<assessmentItem 
+       xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1" 
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+       xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p1 imsqti_v2p1.xsd" 
+       identifier="ATUTOR-<?php echo $this->row['question_id']; ?>" 
+       title="<?php echo $this->row['question']; ?>" 
+       adaptive="false" 
+       timeDependent="false"
+       toolname="ATutor - atutor.ca"
+       toolversion="<?php echo VERSION; ?>"
+>
+       <responseDeclaration identifier="RESPONSE" cardinality="multiple" baseType="directedPair">
+               <correctResponse>
+                       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                               <?php if ($this->row['answer_'.$i] > -1): ?>
+                                       <value>Choice<?php echo $i; ?> Option<?php echo $this->row['answer_'.$i]; ?></value>
+                               <?php endif; ?>
+                       <?php endfor; ?>
+               </correctResponse>
+               <mapping lowerBound="0" defaultValue="0">
+                       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                               <?php if ($this->row['answer_'.$i] > -1): ?>
+                                       <mapEntry mapKey="Choice<?php echo $i; ?> Option<?php echo $this->row['answer_'.$i]; ?>" mappedValue="1"/>
+                               <?php endif; ?>
+                       <?php endfor; ?>
+               </mapping>
+         <?php if ($this->row['feedback']): ?>
+                 <outcomeDeclaration identifier="FEEDBACK" cardinality="multiple" baseType="identifier"/>
+         <?php endif; ?>
+       </responseDeclaration>
+
+       <itemBody>
+               <associateInteraction responseIdentifier="RESPONSE" shuffle="true" maxAssociations="<?php echo $this->num_choices; ?>">
+                       <prompt><?php echo $this->row['question']; ?></prompt>
+                       <simpleMatchSet>
+                               <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                                       <simpleAssociableChoice identifier="Choice<?php echo $i; ?>" matchMax="1"><?php echo $this->row['choice_'.$i]; ?></simpleAssociableChoice>
+                               <?php endfor; ?>
+                       </simpleMatchSet>
+
+                       <simpleMatchSet>
+                               <?php for ($i=0; $i < $this->num_options; $i++): ?>
+                                       <simpleAssociableChoice identifier="Option<?php echo $i; ?>" matchMax="<?php echo $this->num_choices; ?>"><?php echo $this->row['option_'.$i]; ?></simpleAssociableChoice>
+                               <?php endfor; ?>
+                       </simpleMatchSet>
+               </associateInteraction>
+       </itemBody>
+
+       <?php if ($this->row['feedback']): ?>
+               <modalFeedback outcomeIdentifier="FEEDBACK" identifier="FEEDBACK" showHide="hide"><?php echo $this->row['feedback']; ?></modalFeedback> 
+       <?php endif; ?>
+</assessmentItem>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/matching_result.tmpl.php b/docs/themes/default/tests/test_questions/matching_result.tmpl.php
new file mode 100644 (file)
index 0000000..24a51e3
--- /dev/null
@@ -0,0 +1,37 @@
+<p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>
+
+<table style="width: 100%">
+<tr>
+       <td valign="top">
+               <ul style="padding: 0px; margin: 0px; list-style-type: none">
+                       <?php for ($i=0; $i < 10; $i++): ?>
+                               <?php if ($this->row['choice_'. $i] != ''): ?>
+                                       <li style="padding: 4px">
+                                               <?php if ($this->row['answer_'.$i] == $this->answers[$i]): ?>
+                                                       <img src="<?php echo $this->base_path; ?>images/checkmark.gif" alt="<?php echo _AT('correct_answer'); ?>" title="<?php echo _AT('correct_answer'); ?>" height="16" width="16" style="vertical-align: middle" />
+                                               <?php else: ?>
+                                                       <img src="<?php echo $this->base_path; ?>images/x.gif" alt="<?php echo _AT('wrong_answer'); ?>" title="<?php echo _AT('wrong_answer'); ?>" height="16" width="16" style="vertical-align: middle" />
+                                                       <?php if ($this->row['answer_'.$i] >= 0): ?>
+                                                               (<?php echo $this->letters[$this->row['answer_'.$i]]; ?>)
+                                                       <?php endif; ?>
+                                               <?php endif; ?>
+                                               <?php if ($this->answers[$i] != '' && $this->answers[$i] >= 0): ?>
+                                                       <?php echo $this->letters[$this->answers[$i]]; ?>.
+                                               <?php else: ?>
+                                                       -.
+                                               <?php endif; ?>
+                                               <?php echo $this->row['choice_'. $i]; ?>
+                                       </li>
+                               <?php endif; ?>
+                       <?php endfor; ?>
+               </ul>
+       </td>
+       <td valign="top">
+               <ul style="list-style-type: none; margin: 0px; padding: 0px">
+                       <?php for ($i=0; $i < $this->num_options; $i++): ?>
+                               <li style="padding: 4px"><?php echo $this->letters[$i]; ?>. <?php echo $this->row['option_'. $i]; ?></li>
+                       <?php endfor; ?>
+               </ul>
+       </td>
+</tr>
+</table>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/matching_stats.tmpl.php b/docs/themes/default/tests/test_questions/matching_stats.tmpl.php
new file mode 100644 (file)
index 0000000..36aeca1
--- /dev/null
@@ -0,0 +1,23 @@
+<br/>
+<table class="data static" summary="" style="width: 95%" rules="cols">
+<thead>
+<tr>
+       <th scope="col" width="40%"><?php echo _AT('question'); ?></th>
+       <?php for ($i=0; $i< $this->num_choices; $i++): ?>
+               <?php $this->row['choice_'.$i] = validate_length($this->row['choice_'.$i], 15, VALIDATE_LENGTH_FOR_DISPLAY); ?>
+               <th scope="col"><?php echo htmlspecialchars($this->row['choice_'.$i], ENT_COMPAT, "UTF-8"); ?></th>
+       <?php endfor; ?>
+</tr>
+</thead>
+<tr>
+       <td valign="top" rowspan="2"><?php echo $this->row['question']; ?></td>
+       <?php for ($j=0; $j<$this->num_choices; $j++): ?>
+               <td align="center" valign="top"><?php echo (int) $this->answers[$j]['count']; ?> / <?php echo $this->num_results; ?></td>
+       <?php endfor; ?>
+</tr>
+<tr>
+       <?php for ($j=0; $j<$this->num_choices; $j++): ?>
+               <td align="center" valign="top"><div class="qstat_bar-border"><div class="qstat_bar-bar"><div class="qstat_bar-fill" style="height:<?php echo 100-($this->num_results ? round($this->answers[$j]['count']/$this->num_results*100) : 0); ?>%;"></div></div></div><?php echo $this->num_results ? round($this->answers[$j]['count']/$this->num_results*100) : 0; ?>%</td>
+       <?php endfor; ?>
+</tr>
+</table>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/matchingdd.tmpl.php b/docs/themes/default/tests/test_questions/matchingdd.tmpl.php
new file mode 100644 (file)
index 0000000..db589ff
--- /dev/null
@@ -0,0 +1,9 @@
+<p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>
+
+<?php $tmp_response = implode('|', $this->response); ?>
+<?php $_SESSION['dd_question_ids'][$this->row['question_id']] = 1; ?>
+
+<?php for ($i=0; $i < $this->num_choices; $i++): ?>
+       <input type="hidden" name="answers[<?php echo $this->row['question_id']; ?>][<?php echo $i; ?>]" id="<?php echo $this->row['question_id']; ?>q<?php echo $i; ?>" value="<?php echo $this->response[$i]; ?>"/>
+<?php endfor; ?>
+<iframe id="qframe<?php echo $this->row['question_id']; ?>" src="<?php echo $this->base_href; ?>mods/_standard/tests/dd.php?qid=<?php echo $this->row['question_id'].SEP; ?>response=<?php echo $tmp_response; ?>" height="200" width="100%" frameborder="0"></iframe>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/matchingdd_qti_1p2.tmpl.php b/docs/themes/default/tests/test_questions/matchingdd_qti_1p2.tmpl.php
new file mode 100644 (file)
index 0000000..06585b1
--- /dev/null
@@ -0,0 +1 @@
+<?php require('matching_qti_1p2.tmpl.php'); ?>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/matchingdd_qti_2p1.tmpl.php b/docs/themes/default/tests/test_questions/matchingdd_qti_2p1.tmpl.php
new file mode 100644 (file)
index 0000000..dff8d9b
--- /dev/null
@@ -0,0 +1 @@
+<?php require('matching_qti_2p1.tmpl.php'); ?>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/matchingdd_result.tmpl.php b/docs/themes/default/tests/test_questions/matchingdd_result.tmpl.php
new file mode 100644 (file)
index 0000000..0054a6d
--- /dev/null
@@ -0,0 +1 @@
+<?php require('matching_result.tmpl.php'); ?>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/matchingdd_stats.tmpl.php b/docs/themes/default/tests/test_questions/matchingdd_stats.tmpl.php
new file mode 100644 (file)
index 0000000..2006efd
--- /dev/null
@@ -0,0 +1 @@
+<?php require('matching_stats.tmpl.php'); ?>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/multianswer.tmpl.php b/docs/themes/default/tests/test_questions/multianswer.tmpl.php
new file mode 100644 (file)
index 0000000..01ce9af
--- /dev/null
@@ -0,0 +1,10 @@
+<p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>
+
+<input type="hidden" name="answers[<?php echo $this->row['question_id']; ?>][]" value="-1" />
+
+<ul style="padding: 0px; margin: 0px; list-style-type: none">
+       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+               <li style="padding: 4px">
+                       <input type="checkbox" name="answers[<?php echo $this->row['question_id']; ?>][]" value="<?php echo $i; ?>" id="choice_<?php echo $this->row['question_id'].'_'.$i; ?>" <?php if (in_array($i, $this->response)): ?>checked="checked"<?php endif; ?>/><label for="choice_<?php echo $this->row['question_id'].'_'.$i; ?>"><?php echo AT_print($this->row['choice_'.$i], 'tests_questions.choice_'.$i); ?></label>
+       <?php endfor; ?>
+</ul>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/multianswer_qti_1p2.tmpl.php b/docs/themes/default/tests/test_questions/multianswer_qti_1p2.tmpl.php
new file mode 100644 (file)
index 0000000..32c1a4f
--- /dev/null
@@ -0,0 +1,65 @@
+<!-- multi answer multiple choice question with partial marks -->
+               <item title="Multiple answer question" ident="ITEM_<?php echo $this->row['question_id']; ?>">
+                       <itemmetadata>
+                               <qtimetadata>
+                                       <qtimetadatafield>
+                                               <fieldlabel>qmd_itemtype</fieldlabel>
+                                               <fieldentry>Logical Identifier</fieldentry>
+                                       </qtimetadatafield>
+                               </qtimetadata>
+                               <qtimetadata>
+                                       <qtimetadatafield>
+                                               <fieldlabel>qmd_questiontype</fieldlabel>
+                                               <fieldentry>Multiple-response</fieldentry>
+                                       </qtimetadatafield>
+                               </qtimetadata>
+                       </itemmetadata>
+                       <presentation>
+                               <flow>
+                                       <material>
+                                               <mattext texttype="text/html"><?php echo $this->row['question']; ?></mattext>
+                                       </material>
+                                       <response_lid ident="RESPONSE<?php echo $this->row['question_id']; ?>" rcardinality="Multiple">
+                                               <render_choice shuffle="No">
+                                               <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                                                       <response_label ident="Choice<?php echo $i; ?>">
+                                                               <flow_mat>
+                                                                       <material>
+                                                                               <mattext texttype="text/html"><?php echo $this->row['choice_'.$i]; ?></mattext>
+                                                                       </material>
+                                                               </flow_mat>
+                                                       </response_label>
+                                                       <?php endfor; ?>
+                                               </render_choice>
+                                       </response_lid>
+                               </flow>
+                       </presentation>
+                       <resprocessing>
+                               <outcomes>
+                                       <decvar/>
+                               </outcomes>
+                       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                               <?php if ($this->row['answer_'.$i]): ?>
+                               <respcondition title="CorrectResponse">
+                                       <conditionvar>                                          
+                                               <varequal respident="RESPONSE<?php echo $this->row['question_id']; ?>">Choice<?php echo $i; ?></varequal>
+                                       </conditionvar>
+                                       <setvar varname="Respondus_Correct" action="Add"><?php echo (isset($this->row['weight']))?$this->row['weight']:1; ?></setvar>
+                               </respcondition>
+                               <?php endif; ?>
+                       <?php endfor; ?>
+                       </resprocessing>
+               <?php if ($this->row['feedback']): ?>
+                       <itemfeedback ident="FEEDBACK" view="All">
+                               <solution>
+                                       <solutionmaterial>
+                                               <flow_mat>
+                                                       <material>
+                                                               <mattext texttype="text/html"><?php echo $this->row['feedback']; ?></mattext>
+                                                       </material>
+                                               </flow_mat>
+                                       </solutionmaterial>
+                               </solution>
+                       </itemfeedback>
+               <?php endif; ?>
+               </item>
diff --git a/docs/themes/default/tests/test_questions/multianswer_qti_2p1.tmpl.php b/docs/themes/default/tests/test_questions/multianswer_qti_2p1.tmpl.php
new file mode 100644 (file)
index 0000000..857e242
--- /dev/null
@@ -0,0 +1,46 @@
+<<?php echo '?'; ?>xml version="1.0" encoding="<?php echo $this->encoding; ?>"<?php echo '?'; ?>>
+<!-- multi answer multiple choice question with partial marks -->
+<assessmentItem 
+       xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1" 
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+       xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p1 imsqti_v2p1.xsd" 
+       identifier="ATUTOR-<?php echo $this->row['question_id']; ?>" 
+       title="<?php echo $this->row['question']; ?>" 
+       adaptive="false" 
+       timeDependent="false"
+       toolname="ATutor - atutor.ca"
+       toolversion="<?php echo VERSION; ?>"
+>
+       <responseDeclaration identifier="RESPONSE" cardinality="multiple" baseType="identifier">
+         <correctResponse>
+               <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                       <?php if ($this->row['answer_'.$i]): ?>
+                               <value>Choice<?php echo $i; ?></value>
+                       <?php endif; ?>
+               <?php endfor; ?>
+         </correctResponse>
+         <mapping lowerBound="0" upperBound="<?php echo $this->num_correct; ?>" defaultValue="0">
+               <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                       <?php if ($this->row['answer_'.$i]): ?>
+                               <mapEntry mapKey="Choice<?php echo $i; ?>" mappedValue="1"/>
+                       <?php endif; ?>
+               <?php endfor; ?>
+               </mapping>
+         <?php if ($this->row['feedback']): ?>
+                 <outcomeDeclaration identifier="FEEDBACK" cardinality="multiple" baseType="identifier"/>
+         <?php endif; ?>
+       </responseDeclaration>
+
+       <itemBody>
+               <choiceInteraction responseIdentifier="RESPONSE" shuffle="false" maxChoices="0">
+                       <prompt><?php echo $this->row['question']; ?></prompt>
+                       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                               <simpleChoice identifier="Choice<?php echo $i; ?>" fixed="false"><?php echo $this->row['choice_'.$i]; ?></simpleChoice> 
+                       <?php endfor; ?>
+         </choiceInteraction>
+       </itemBody>
+
+       <?php if ($this->row['feedback']): ?>
+               <modalFeedback outcomeIdentifier="FEEDBACK" identifier="FEEDBACK" showHide="hide"><?php echo $this->row['feedback']; ?></modalFeedback> 
+       <?php endif; ?>
+</assessmentItem>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/multianswer_result.tmpl.php b/docs/themes/default/tests/test_questions/multianswer_result.tmpl.php
new file mode 100644 (file)
index 0000000..d520321
--- /dev/null
@@ -0,0 +1 @@
+<?php require('multichoice_result.tmpl.php'); ?>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/multianswer_stats.tmpl.php b/docs/themes/default/tests/test_questions/multianswer_stats.tmpl.php
new file mode 100644 (file)
index 0000000..140367f
--- /dev/null
@@ -0,0 +1 @@
+<?php require('multichoice_stats.tmpl.php'); ?>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/multichoice.tmpl.php b/docs/themes/default/tests/test_questions/multichoice.tmpl.php
new file mode 100644 (file)
index 0000000..3ef3ebd
--- /dev/null
@@ -0,0 +1,13 @@
+<p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>
+
+<ul style="padding: 0px; margin: 0px; list-style-type: none">
+       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+               <li style="padding: 4px">
+                       <input type="radio" name="answers[<?php echo $this->row['question_id']; ?>]" value="<?php echo $i; ?>" id="choice_<?php echo $this->row['question_id'].'_'.$i; ?>" <?php 
+                       //Multiple choice will always have just 1 choice, thus the response is always in the array of $this->response[0]
+                       if (is_numeric($this->response[0]) && $i == $this->response[0]): ?>checked="checked"<?php endif; ?>/><label for="choice_<?php echo $this->row['question_id'].'_'.$i; ?>"><?php echo AT_print($this->row['choice_'.$i], 'tests_questions.choice_'.$i); ?></label>
+       <?php endfor; ?>
+       <li style="padding: 4px">
+               <input type="radio" name="answers[<?php echo $this->row['question_id']; ?>]" value="-1" id="choice_<?php echo $this->row['question_id']; ?>'_x" <?php if (is_numeric($this->response[0]) && -1 == $this->response[0]): ?>checked="checked"<?php endif; ?> /><label for="choice_<?php echo $this->row['question_id']; ?>'_x"><em><?php echo _AT('leave_blank'); ?></em></label>
+       </li>
+</ul>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/multichoice_qti_1p2.tmpl.php b/docs/themes/default/tests/test_questions/multichoice_qti_1p2.tmpl.php
new file mode 100644 (file)
index 0000000..4c4c473
--- /dev/null
@@ -0,0 +1,65 @@
+<!-- single answer multiple choice question -->
+               <item title="Multiple choice question" ident="ITEM_<?php echo $this->row['question_id']; ?>">
+                       <itemmetadata>
+                               <qtimetadata>
+                                       <qtimetadatafield>
+                                               <fieldlabel>qmd_itemtype</fieldlabel>
+                                               <fieldentry>Logical Identifier</fieldentry>
+                                       </qtimetadatafield>
+                               </qtimetadata>
+                               <qtimetadata>
+                                       <qtimetadatafield>
+                                               <fieldlabel>qmd_questiontype</fieldlabel>
+                                               <fieldentry>Multiple-choice</fieldentry>
+                                       </qtimetadatafield>
+                               </qtimetadata>
+                       </itemmetadata>
+                       <presentation>
+                               <flow>
+                                       <material>
+                                               <mattext texttype="text/html"><?php echo $this->row['question']; ?></mattext>
+                                       </material>
+                                       <response_lid ident="RESPONSE<?php echo $this->row['question_id']; ?>" rcardinality="Single">
+                                               <render_choice shuffle="No" minnumber="1" maxnumber="1">
+                                               <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                                                       <response_label ident="Choice<?php echo $i; ?>">
+                                                               <flow_mat>
+                                                                       <material>
+                                                                               <mattext texttype="text/html"><?php echo $this->row['choice_'.$i]; ?></mattext>
+                                                                       </material>
+                                                               </flow_mat>
+                                                       </response_label>
+                                               <?php endfor; ?>
+                                               </render_choice>
+                                       </response_lid>
+                               </flow>
+                       </presentation>
+                       <resprocessing>
+                               <outcomes>
+                                       <decvar/>
+                               </outcomes>
+                               <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                                       <?php if ($this->row['answer_'.$i]): ?>
+                               <respcondition title="CorrectResponse">
+                                       <conditionvar>                                          
+                                               <varequal respident="RESPONSE<?php echo $this->row['question_id']; ?>">Choice<?php echo $i; ?></varequal>
+                                       </conditionvar>
+                                       <setvar varname="que_score" action="Set"><?php echo (isset($this->row['weight']))?$this->row['weight']:1; ?></setvar>
+                               </respcondition>
+                                       <?php endif; ?>
+                               <?php endfor; ?>                                                
+                       </resprocessing>
+               <?php if ($this->row['feedback']): ?>
+                       <itemfeedback ident="FEEDBACK" view="All">
+                               <solution>
+                                       <solutionmaterial>
+                                               <flow_mat>
+                                                       <material>
+                                                               <mattext texttype="text/html"><?php echo $this->row['feedback']; ?></mattext>
+                                                       </material>
+                                               </flow_mat>
+                                       </solutionmaterial>
+                               </solution>
+                       </itemfeedback>
+               <?php endif; ?>
+               </item>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/multichoice_qti_2p1.tmpl.php b/docs/themes/default/tests/test_questions/multichoice_qti_2p1.tmpl.php
new file mode 100644 (file)
index 0000000..624201c
--- /dev/null
@@ -0,0 +1,39 @@
+<<?php echo '?'; ?>xml version="1.0" encoding="<?php echo $this->encoding; ?>"<?php echo '?'; ?>>
+<!-- single answer multiple choice question -->
+<assessmentItem 
+       xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1" 
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+       xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p1 imsqti_v2p1.xsd" 
+       identifier="ATUTOR-<?php echo $this->row['question_id']; ?>" 
+       title="<?php echo $this->row['question']; ?>" 
+       adaptive="false" 
+       timeDependent="false"
+       toolname="ATutor - atutor.ca"
+       toolversion="<?php echo VERSION; ?>"
+>
+       <responseDeclaration identifier="RESPONSE" cardinality="single" baseType="identifier">
+         <correctResponse>
+               <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                       <?php if ($this->row['answer_'.$i]): ?>
+                               <value>Choice<?php echo $i; ?></value>
+                       <?php endif; ?>
+               <?php endfor; ?>
+         </correctResponse>
+         <?php if ($this->row['feedback']): ?>
+                 <outcomeDeclaration identifier="FEEDBACK" cardinality="single" baseType="identifier"/>
+         <?php endif; ?>
+       </responseDeclaration>
+
+       <itemBody>
+               <choiceInteraction responseIdentifier="RESPONSE" shuffle="false" maxChoices="1">
+                       <prompt><?php echo $this->row['question']; ?></prompt>
+                       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                               <simpleChoice identifier="Choice<?php echo $i; ?>" fixed="false"><?php echo $this->row['choice_'.$i]; ?></simpleChoice> 
+                       <?php endfor; ?>
+         </choiceInteraction>
+       </itemBody>
+
+       <?php if ($this->row['feedback']): ?>
+               <modalFeedback outcomeIdentifier="FEEDBACK" identifier="FEEDBACK" showHide="hide"><?php echo $this->row['feedback']; ?></modalFeedback> 
+       <?php endif; ?>
+</assessmentItem>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/multichoice_result.tmpl.php b/docs/themes/default/tests/test_questions/multichoice_result.tmpl.php
new file mode 100644 (file)
index 0000000..9273c58
--- /dev/null
@@ -0,0 +1,23 @@
+<p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>
+
+<ul style="padding: 0px; margin: 0px; list-style-type: none">
+       <?php for ($i=0; $i < 10; $i++): ?>
+               <?php if ($this->row['choice_'.$i] != ''): ?>
+                       <li style="padding: 4px">
+                               <?php if (($this->row['answer_'.$i] == 1) && in_array($i, $this->answers)): ?>
+                                       <img src="<?php echo $this->base_path; ?>images/checkmark.gif" alt="<?php echo _AT('correct_answer'); ?>" title="<?php echo _AT('correct_answer'); ?>" height="16" width="16" style="vertical-align: middle" />
+                               <?php elseif (($this->row['weight'] > 0) && (($this->row['answer_'.$i] == 0) || in_array($i, $this->answers))): ?>
+                                       <img src="<?php echo $this->base_path; ?>images/x.gif" alt="<?php echo _AT('wrong_answer'); ?>" title="<?php echo _AT('wrong_answer'); ?>" height="16" width="16" style="vertical-align: middle" />
+                               <?php else: ?>
+                                       <img src="<?php echo $this->base_path; ?>images/clr.gif" alt="" title="" height="16" width="16" style="vertical-align: middle" />
+                               <?php endif; ?>
+
+                               <?php if (in_array($i, $this->answers)): ?>
+                                       <img src="<?php echo $this->base_path; ?>images/checkbox_check.gif" alt="<?php echo _AT('checked'); ?>" title="<?php echo _AT('checked'); ?>" height="13" width="13" style="vertical-align: middle" />
+                               <?php else: ?>
+                                       <img src="<?php echo $this->base_path; ?>images/checkbox_empty.gif" alt="<?php echo _AT('unchecked'); ?>" title="<?php echo _AT('unchecked'); ?>" height="13" width="13" style="vertical-align: middle" />
+                               <?php endif; ?>
+                               <?php echo AT_print($this->row['choice_'.$i], 'tests_questions.choice_'.$i); ?>
+               <?php endif; ?>
+       <?php endfor; ?>
+</ul>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/multichoice_stats.tmpl.php b/docs/themes/default/tests/test_questions/multichoice_stats.tmpl.php
new file mode 100644 (file)
index 0000000..0504fa1
--- /dev/null
@@ -0,0 +1,30 @@
+<br />
+<table class="data static" summary="" style="width: 95%" rules="cols">
+<thead>
+<tr>
+       <th scope="col" width="40%"><?php echo _AT('question'); ?></th>
+       <th scope="col" nowrap="nowrap"><?php echo _AT('left_blank'); ?></th>
+       <?php for ($i=0; $i<$this->num_choices; $i++): ?>
+               <?php $this->row['choice_'.$i] = validate_length($this->row['choice_'.$i], 15, VALIDATE_LENGTH_FOR_DISPLAY); ?>
+               <?php if ($this->row['answer_'.$i]): ?>
+                       <th scope="col"><?php echo htmlspecialchars($this->row['choice_'.$i]); ?><img src="images/checkmark.gif" alt="" /></th>
+               <?php else: ?>
+                       <th scope="col"><?php echo htmlspecialchars($this->row['choice_'.$i], ENT_COMPAT, "UTF-8"); ?></th>
+               <?php endif; ?>
+       <?php endfor; ?>
+</tr>
+</thead>
+<tr>
+       <td valign="top" rowspan="2"><?php echo $this->row['question']; ?></td>
+       <td align="center" valign="top"><?php echo $this->num_blanks; ?> / <?php echo $this->num_results; ?></td>
+       <?php for ($j=0; $j< $this->num_choices; $j++): ?>
+               <td align="center" valign="top"><?php echo (int) $this->answers[$j]['count']; ?> / <?php echo $this->num_results; ?></td>
+       <?php endfor; ?>
+</tr>
+<tr>
+       <td align="center"><div class="qstat_bar-border"><div class="qstat_bar-bar"><div class="qstat_bar-fill" style="height:<?php echo 100-($this->num_results ? round($this->num_blanks/$this->num_results*100) : 0); ?>%;"></div></div></div><?php echo $this->num_results ? round($this->num_blanks/$this->num_results*100) : 0; ?>%</td>
+       <?php for ($j=0; $j< $this->num_choices; $j++): ?>
+               <td align="center" valign="top"><div class="qstat_bar-border"><div class="qstat_bar-bar"><div class="qstat_bar-fill" style="height:<?php echo 100-($this->num_results ? round($this->answers[$j]['count']/$this->num_results*100) : 0); ?>%;"></div></div></div><?php echo $this->num_results ? round($this->answers[$j]['count']/$this->num_results*100) : 0; ?>%</td>
+       <?php endfor; ?>
+</tr>
+</table>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/ordering.tmpl.php b/docs/themes/default/tests/test_questions/ordering.tmpl.php
new file mode 100644 (file)
index 0000000..b7fdfcf
--- /dev/null
@@ -0,0 +1,14 @@
+<p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>
+
+<ul style="padding: 0px; margin: 0px; list-style-type: none">
+       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+               <li style="padding: 4px">
+               <select name="answers[<?php echo $this->row['question_id']; ?>][<?php echo $i; ?>]" id="choice_<?php echo $this->row['question_id'].'_'.$i; ?>" />
+                       <option value="-1">-</option>
+                       <?php for ($j=0; $j < $this->num_choices; $j++): ?>
+                               <option value="<?php echo $j; ?>"<?php if (is_numeric($this->response[$i]) && $j == $this->response[$i]): ?>selected="selected"<?php endif; ?>><?php echo ($j+1); ?></option>
+                       <?php endfor; ?>
+               </select> <label for="choice_<?php echo $this->row['question_id'].'_'.$i; ?>"><?php echo AT_print($this->row['choice_'.$i], 'tests_questions.choice_'.$i); ?></label>
+               </li>
+       <?php endfor; ?>
+</ul>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/ordering_qti_1p2.tmpl.php b/docs/themes/default/tests/test_questions/ordering_qti_1p2.tmpl.php
new file mode 100644 (file)
index 0000000..4eb43c8
--- /dev/null
@@ -0,0 +1,57 @@
+<!-- ordering question -->
+               <item title="Ordering question" ident="ITEM_<?php echo $this->row['question_id']; ?>">
+                       <itemmetadata>
+                               <qtimetadata>
+                                       <qtimetadatafield>
+                                               <fieldlabel>qmd_itemtype</fieldlabel>
+                                               <fieldentry>Logical Identifier</fieldentry>
+                                       </qtimetadatafield>
+                               </qtimetadata>
+                       </itemmetadata>
+                       <presentation>
+                               <flow>
+                                       <material>
+                                               <mattext texttype="text/html"><?php echo $this->row['question']; ?></mattext>
+                                       </material>
+                                       <response_lid ident="RESPONSE<?php echo $this->row['question_id']; ?>" rcardinality="Ordered">
+                                               <render_choice shuffle="Yes" minnumber="<?php echo $this->num_choices;?>" maxnumber="<?php echo $this->num_choices;?>">
+                                                       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                                                       <response_label ident="Choice<?php echo $i; ?>">        
+                                                               <flow_mat>
+                                                                       <material>
+                                                                               <mattext texttype="text/html"><?php echo $this->row['choice_'.$i]; ?></mattext>
+                                                                       </material>
+                                                               </flow_mat>
+                                                       </response_label>
+                                                       <?php endfor; ?>
+                                               </render_choice>
+                                       </response_lid>
+                               </flow>
+                       </presentation>
+                       <resprocessing>
+                               <outcomes>
+                                       <decvar/>
+                               </outcomes>
+                               <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                               <respcondition title="CorrectResponse">
+                                       <conditionvar>                                  
+                                               <varequal respident="RESPONSE<?php echo $this->row['question_id']; ?>">Choice<?php echo $i; ?></varequal>
+                                       </conditionvar>
+                                       <setvar varname="Respondus_Correct" action="Add"><?php echo (isset($this->row['weight']))?$this->row['weight']/$this->num_choices:1; ?></setvar>
+                               </respcondition>
+                               <?php endfor; ?>
+                       </resprocessing>
+               <?php if ($this->row['feedback']): ?>
+                       <itemfeedback ident="FEEDBACK" view="All">
+                               <solution>
+                                       <solutionmaterial>
+                                               <flow_mat>
+                                                       <material>
+                                                               <mattext texttype="text/html"><?php echo $this->row['feedback']; ?></mattext>
+                                                       </material>
+                                               </flow_mat>
+                                       </solutionmaterial>
+                               </solution>
+                       </itemfeedback>
+               <?php endif; ?>
+               </item>
diff --git a/docs/themes/default/tests/test_questions/ordering_qti_2p1.tmpl.php b/docs/themes/default/tests/test_questions/ordering_qti_2p1.tmpl.php
new file mode 100644 (file)
index 0000000..82a9614
--- /dev/null
@@ -0,0 +1,37 @@
+<<?php echo '?'; ?>xml version="1.0" encoding="<?php echo $this->encoding; ?>"<?php echo '?'; ?>>
+<!-- ordering question -->
+<assessmentItem 
+       xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1" 
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+       xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p1 imsqti_v2p1.xsd" 
+       identifier="ATUTOR-<?php echo $this->row['question_id']; ?>" 
+       title="<?php echo $this->row['question']; ?>" 
+       adaptive="false" 
+       timeDependent="false"
+       toolname="ATutor - atutor.ca"
+       toolversion="<?php echo VERSION; ?>"
+>
+
+       <responseDeclaration identifier="RESPONSE" cardinality="ordered" baseType="identifier">
+               <correctResponse>
+               <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                       <value>Choice<?php echo $i; ?></value>
+               <?php endfor; ?>
+               </correctResponse>
+         <?php if ($this->row['feedback']): ?>
+                 <outcomeDeclaration identifier="FEEDBACK" cardinality="multiple" baseType="identifier"/>
+         <?php endif; ?>
+       </responseDeclaration>
+
+       <itemBody>
+               <orderInteraction responseIdentifier="RESPONSE" shuffle="true">
+                       <prompt><?php echo $this->row['question']; ?></prompt>
+                       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+                               <simpleChoice identifier="Choice<?php echo $i; ?>" fixed="false"><?php echo $this->row['choice_'.$i]; ?></simpleChoice> 
+                       <?php endfor; ?>
+               </orderInteraction>
+       </itemBody>
+       <?php if ($this->row['feedback']): ?>
+               <modalFeedback outcomeIdentifier="FEEDBACK" identifier="FEEDBACK<?php echo $this->row['question_id'];?>" showHide="hide"><?php echo $this->row['feedback']; ?></modalFeedback> 
+       <?php endif; ?>
+</assessmentItem>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/ordering_result.tmpl.php b/docs/themes/default/tests/test_questions/ordering_result.tmpl.php
new file mode 100644 (file)
index 0000000..91257c1
--- /dev/null
@@ -0,0 +1,14 @@
+<p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>
+
+<ol style="margin: 0px; padding: 0px">
+       <?php for ($i=0; $i < $this->num_choices; $i++): ?>
+               <li style="padding: 4px; list-style: none">
+                       <?php if ($i == $this->answers[$i]): ?>
+                               <img src="<?php echo $this->base_path; ?>images/checkmark.gif" alt="<?php echo _AT('correct_answer'); ?>" title="<?php echo _AT('correct_answer'); ?>" height="16" width="16" style="vertical-align: middle" />
+                       <?php else: ?>
+                               <img src="<?php echo $this->base_path; ?>images/x.gif" alt="<?php echo _AT('wrong_answer'); ?>" title="<?php echo _AT('wrong_answer'); ?>" height="16" width="16" style="vertical-align: middle" />
+                       <?php endif; ?>
+                       <?php echo ($i+1); ?>. <?php echo AT_print($this->row['choice_'.$i], 'tests_questions.choice_'.$i); ?>
+               </li>
+       <?php endfor; ?>
+</ol>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/ordering_stats.tmpl.php b/docs/themes/default/tests/test_questions/ordering_stats.tmpl.php
new file mode 100644 (file)
index 0000000..a3e3a26
--- /dev/null
@@ -0,0 +1,23 @@
+<br/>
+<table class="data static" summary="" style="width: 95%" rules="cols">
+<thead>
+<tr>
+       <th scope="col" width="40%"><?php echo _AT('question'); ?></th>
+       <?php for ($i=0; $i<$this->num_choices; $i++): ?>
+               <?php $this->row['choice_'.$i] = validate_length($this->row['choice_'.$i], 15, VALIDATE_LENGTH_FOR_DISPLAY); ?>
+               <th scope="col"><?php echo htmlspecialchars($this->row['choice_'.$i], ENT_COMPAT, "UTF-8"); ?></th>
+       <?php endfor; ?>
+</tr>
+</thead>
+<tr>
+       <td valign="top" rowspan="2"><?php echo $this->row['question']; ?></td>
+       <?php for ($j=0; $j<$this->num_choices; $j++): ?>
+               <td align="center" valign="top"><?php echo (int) $this->answers[$j]; ?> / <?php echo $this->num_results; ?></td>
+       <?php endfor; ?>
+</tr>
+<tr>
+       <?php for ($j=0; $j<$this->num_choices; $j++): ?>
+               <td align="center" valign="top"><div class="qstat_bar-border"><div class="qstat_bar-bar"><div class="qstat_bar-fill" style="height:<?php echo 100-($this->num_results ? round($this->answers[$j]/$this->num_results*100) : 0); ?>%;"></div></div></div><?php echo $this->num_results ? round($this->answers[$j]/$this->num_results*100) : 0; ?>%</td>
+       <?php endfor; ?>
+</tr>
+</table>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/truefalse.tmpl.php b/docs/themes/default/tests/test_questions/truefalse.tmpl.php
new file mode 100644 (file)
index 0000000..62c7b73
--- /dev/null
@@ -0,0 +1,7 @@
+<p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>
+
+<p><input type="radio" name="answers[<?php echo $this->row['question_id']; ?>]" value="1" id="choice_<?php echo $this->row['question_id']; ?>_0" <?php if ($this->response == 1):?>checked="checked"<?php endif; ?>/><label for="choice_<?php echo $this->row['question_id']; ?>_0"><?php echo _AT('true'); ?></label></p>
+
+<p><input type="radio" name="answers[<?php echo $this->row['question_id']; ?>]" value="2" id="choice_<?php echo $this->row['question_id']; ?>_1" <?php if ($this->response == 2):?>checked="checked"<?php endif; ?>/><label for="choice_<?php echo $this->row['question_id']; ?>_1"><?php echo _AT('false'); ?></label></p>
+
+<p><input type="radio" name="answers[<?php echo $this->row['question_id']; ?>]" value="-1" id="choice_<?php echo $this->row['question_id']; ?>_x" <?php if ($this->response < 1):?>checked="checked"<?php endif; ?>/><label for="choice_<?php echo $this->row['question_id']; ?>_x"><em><?php echo _AT('leave_blank'); ?></em></label></p>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/truefalse_qti_1p2.tmpl.php b/docs/themes/default/tests/test_questions/truefalse_qti_1p2.tmpl.php
new file mode 100644 (file)
index 0000000..329f87b
--- /dev/null
@@ -0,0 +1,74 @@
+<!-- true or false question (aka multiple choice with two choices) -->
+               <item title="True or False question" ident="ITEM_<?php echo $this->row['question_id']; ?>">
+                       <itemmetadata>
+                               <qtimetadata>
+                                       <qtimetadatafield>
+                                               <fieldlabel>qmd_itemtype</fieldlabel>
+                                               <fieldentry>Logical Identifier</fieldentry>
+                                       </qtimetadatafield>
+                               </qtimetadata>
+                               <qtimetadata>
+                                       <qtimetadatafield>
+                                               <fieldlabel>qmd_questiontype</fieldlabel>
+                                               <fieldentry>True/false</fieldentry>
+                                       </qtimetadatafield>
+                               </qtimetadata>
+                       </itemmetadata>
+                       <presentation>
+                               <flow>
+                                       <material>
+                                               <mattext texttype="text/html"><?php echo $this->row['question']; ?></mattext>
+                                       </material>
+                                       <response_lid ident="RESPONSE<?php echo $this->row['question_id']; ?>" rcardinality="Single">
+                                               <render_choice shuffle="No">
+                                                       <response_label ident="ChoiceT">        
+                                                               <flow_mat>
+                                                                       <material>
+                                                                               <mattext texttype="text/html"><?php echo _AT('true'); ?></mattext>
+                                                                       </material>
+                                                               </flow_mat>
+                                                       </response_label>
+                                                       <response_label ident="ChoiceF">        
+                                                               <flow_mat>
+                                                                       <material>
+                                                                               <mattext texttype="text/html"><?php echo _AT('false'); ?></mattext>
+                                                                       </material>
+                                                               </flow_mat>
+                                                       </response_label>
+                                               </render_choice>
+                                       </response_lid>
+                               </flow>
+                       </presentation>
+                       <resprocessing>
+                               <outcomes>
+                                       <decvar/>
+                               </outcomes>
+                               <respcondition title="CorrectResponse">
+                                       <conditionvar>
+                                               <varequal respident="RESPONSE<?php echo $this->row['question_id']; ?>">
+                                                       <?php 
+                                                               if ($this->row['answer_0'] == 1) {
+                                                                       echo 'ChoiceT'; 
+                                                               } else {
+                                                                       echo 'ChoiceF';
+                                                               }
+                                                       ?>
+                                               </varequal>
+                                       </conditionvar>
+                                       <setvar varname="que_score" action="Set"><?php echo (isset($this->row['weight']))?$this->row['weight']:1; ?></setvar>
+                               </respcondition>
+                       </resprocessing>
+               <?php if ($this->row['feedback']): ?>
+                       <itemfeedback ident="FEEDBACK" view="All">
+                               <solution>
+                                       <solutionmaterial>
+                                               <flow_mat>
+                                                       <material>
+                                                               <mattext texttype="text/html"><?php echo $this->row['feedback']; ?></mattext>
+                                                       </material>
+                                               </flow_mat>
+                                       </solutionmaterial>
+                               </solution>
+                       </itemfeedback>
+               <?php endif; ?>
+               </item>
diff --git a/docs/themes/default/tests/test_questions/truefalse_qti_2p1.tmpl.php b/docs/themes/default/tests/test_questions/truefalse_qti_2p1.tmpl.php
new file mode 100644 (file)
index 0000000..94d386c
--- /dev/null
@@ -0,0 +1,38 @@
+<<?php echo '?'; ?>xml version="1.0" encoding="<?php echo $this->encoding; ?>"<?php echo '?'; ?>>
+<!-- true or false question (aka multiple choice with two choices) -->
+<assessmentItem 
+       xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1" 
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+       xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p1 imsqti_v2p1.xsd" 
+       identifier="ATUTOR-<?php echo $this->row['question_id']; ?>" 
+       title="<?php echo $this->row['question']; ?>" 
+       adaptive="false" 
+       timeDependent="false"
+       toolname="ATutor - atutor.ca"
+       toolversion="<?php echo VERSION; ?>"
+>
+       <responseDeclaration identifier="RESPONSE" cardinality="single" baseType="identifier">
+         <correctResponse>
+               <?php if ($this->row['answer_0'] == 1): ?>
+                       <value>ChoiceT</value>
+               <?php else: ?>
+                       <value>ChoiceF</value>
+               <?php endif; ?>
+         </correctResponse>
+         <?php if ($this->row['feedback']): ?>
+                 <outcomeDeclaration identifier="FEEDBACK" cardinality="single" baseType="identifier"/>
+         <?php endif; ?>
+       </responseDeclaration>
+
+       <itemBody>
+               <choiceInteraction responseIdentifier="RESPONSE<?php echo $this->row['question_id']; ?>" shuffle="false" maxChoices="1">
+                       <prompt><?php echo $this->row['question']; ?></prompt>
+                       <simpleChoice identifier="ChoiceT" fixed="true"><?php echo _AT('true'); ?></simpleChoice> 
+                       <simpleChoice identifier="ChoiceF" fixed="true"><?php echo _AT('false'); ?></simpleChoice> 
+         </choiceInteraction>
+       </itemBody>
+
+       <?php if ($this->row['feedback']): ?>
+               <modalFeedback outcomeIdentifier="FEEDBACK" identifier="FEEDBACK" showHide="hide"><?php echo $this->row['feedback']; ?></modalFeedback> 
+       <?php endif; ?>
+</assessmentItem>
\ No newline at end of file
diff --git a/docs/themes/default/tests/test_questions/truefalse_result.tmpl.php b/docs/themes/default/tests/test_questions/truefalse_result.tmpl.php
new file mode 100644 (file)
index 0000000..535a63c
--- /dev/null
@@ -0,0 +1,36 @@
+<p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>
+
+<p>
+       <?php if (($this->row['answer_0'] == 1) && ($this->answers == 1)): ?>
+               <img src="<?php echo $this->base_path; ?>images/checkmark.gif" alt="<?php echo _AT('correct_answer'); ?>" title="<?php echo _AT('correct_answer'); ?>" height="16" width="16" style="vertical-align: middle" />
+       <?php elseif ($this->row['answer_0'] == 2 && $this->answers == 1): ?>
+               <img src="<?php echo $this->base_path; ?>images/x.gif" alt="<?php echo _AT('wrong_answer'); ?>" title="<?php echo _AT('wrong_answer'); ?>" height="16" width="16" style="vertical-align: middle" />
+       <?php else: ?>
+               <img src="<?php echo $this->base_path; ?>images/clr.gif" alt="" title="" height="16" width="16" style="vertical-align: middle" />
+       <?php endif; ?>
+
+       <?php if ($this->answers == 1): ?>
+               <img src="<?php echo $this->base_path; ?>images/checkbox_check.gif" alt="<?php echo _AT('checked'); ?>" title="<?php echo _AT('checked'); ?>" height="13" width="13" style="vertical-align: middle" />
+       <?php else: ?>
+               <img src="<?php echo $this->base_path; ?>images/checkbox_empty.gif" alt="<?php echo _AT('unchecked'); ?>" title="<?php echo _AT('unchecked'); ?>" height="13" width="13" style="vertical-align: middle" />
+       <?php endif; ?>
+
+       <?php echo _AT('true'); ?>
+</p>
+
+<p>
+       <?php if (($this->row['answer_0'] == 2) && ($this->answers == 2)): ?>
+               <img src="<?php echo $this->base_path; ?>images/checkmark.gif" alt="<?php echo _AT('correct_answer'); ?>" title="<?php echo _AT('correct_answer'); ?>" height="16" width="16" style="vertical-align: middle" />
+       <?php elseif ($this->row['answer_0'] == 1 && $this->answers == 2): ?>
+               <img src="<?php echo $this->base_path; ?>images/x.gif" alt="<?php echo _AT('wrong_answer'); ?>" title="<?php echo _AT('wrong_answer'); ?>" height="16" width="16" style="vertical-align: middle" />
+       <?php else: ?>
+               <img src="<?php echo $this->base_path; ?>images/clr.gif" alt="" title="" height="16" width="16" style="vertical-align: middle" />
+       <?php endif; ?>
+
+       <?php if ($this->answers == 2): ?>
+               <img src="<?php echo $this->base_path; ?>images/checkbox_check.gif" alt="<?php echo _AT('checked'); ?>" title="<?php echo _AT('checked'); ?>" height="13" width="13" style="vertical-align: middle" />
+       <?php else: ?>
+               <img src="<?php echo $this->base_path; ?>images/checkbox_empty.gif" alt="<?php echo _AT('unchecked'); ?>" title="<?php echo _AT('unchecked'); ?>" height="13" width="13" style="vertical-align: middle" />
+       <?php endif; ?>
+       <?php echo _AT('false'); ?>
+</p>
diff --git a/docs/themes/default/tests/test_questions/truefalse_stats.tmpl.php b/docs/themes/default/tests/test_questions/truefalse_stats.tmpl.php
new file mode 100644 (file)
index 0000000..7a58d5f
--- /dev/null
@@ -0,0 +1,31 @@
+<br />
+<table class="data static" summary="" style="width: 95%" rules="cols">
+<thead>
+<tr>
+       <th scope="col" width="40%"><?php echo _AT('question'); ?></th>
+       <th scope="col" nowrap="nowrap"><?php echo _AT('left_blank'); ?></th>
+<?php if ($this->row['answer_0'] == 1): ?>
+       <th scope="col"><?php echo _AT('true'); ?><img src="images/checkmark.gif" alt="Correct checkmark" /></th>
+       <th scope="col"><?php echo _AT('false'); ?></th>
+<?php elseif ($this->row['answer_0'] == 2): ?>
+       <th scope="col"><?php echo _AT('true'); ?></th>
+       <th scope="col"><?php echo _AT('false'); ?><img src="images/checkmark.gif" alt="Correct checkmark" /></th>
+<?php else: ?>
+       <th scope="col"><?php echo _AT('true'); ?></th>
+       <th scope="col"><?php echo _AT('false'); ?></th>
+<?php endif; ?>
+</tr>
+</thead>
+<tr>
+       <td valign="top" rowspan="2"><?php echo $this->row['question']; ?></td>
+       <td align="center" valign="top"><?php echo $this->num_blanks; ?> / <?php echo $this->num_results; ?></td>
+       <td align="center" valign="top"><?php echo $this->num_true; ?> / <?php echo $this->num_results; ?></td>
+       <td align="center" valign="top"><?php echo $this->num_false; ?> / <?php echo $this->num_results; ?></td>
+</tr>
+<tr>
+       <td align="center" valign="top"><div class="qstat_bar-border"><div class="qstat_bar-bar"><div class="qstat_bar-fill" style="height:<?php echo 100-($this->num_results ? round($this->num_blanks/$this->num_results*100) : 0); ?>%;"></div></div></div><?php echo $this->num_results ? round($this->num_blanks/$this->num_results*100) : 0; ?>%</td>
+       <td align="center" valign="top"><div class="qstat_bar-border"><div class="qstat_bar-bar"><div class="qstat_bar-fill" style="height:<?php echo 100-($this->num_results ? round($this->num_true/$this->num_results*100) : 0); ?>%;"></div></div></div><?php echo $this->num_results ? round($this->num_true/$this->num_results*100) : 0; ?>%</td>
+  <td align="center" valign="top"><div class="qstat_bar-border"><div class="qstat_bar-bar"><div class="qstat_bar-fill" style="height:<?php echo 100-($this->num_results ? round($this->num_false/$this->num_results*100) : 0); ?>%;"></div></div></div><?php echo $this->num_results ? round($this->num_false/$this->num_results*100) : 0; ?>%</td>
+</tr>
+</table>
+
diff --git a/docs/themes/default/tests/test_questions/wrapper.tmpl.php b/docs/themes/default/tests/test_questions/wrapper.tmpl.php
new file mode 100644 (file)
index 0000000..50228b5
--- /dev/null
@@ -0,0 +1,15 @@
+<<?php echo '?'; ?>xml version="1.0" encoding="<?php echo $this->encoding; ?>"<?php echo '?'; ?>>
+
+<questestinterop 
+       xmlns="http://www.imsglobal.org/xsd/ims_qtiasiv1p2"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+       <assessment title="<?php echo $this->title; ?>" ident="<?php echo md5($this->tid); ?>">
+               <section ident="ATUTOR-<?php echo $this->row['question_id']; ?>" title="<?php echo $this->title; ?>">
+
+               <?php echo $this->xml_content; ?>
+
+               </section>
+       </assessment>
+
+</questestinterop>
index 1633de3..f0e4af5 100644 (file)
@@ -65,6 +65,7 @@ include(TR_INCLUDE_PATH.'header.inc.php');
                        <tr>\r
                                <th align="left"><input type="checkbox" value="<?php echo _AT('select_all'); ?>" id="all_del" title="<?php echo _AT('select_all'); ?>" name="selectall_delprivileges" onclick="CheckAll('del_privileges_id[]','selectall_delprivileges');" /></th>\r
                                <th><?php echo _AT('privileges'); ?></th>\r
+                               <th><?php echo _AT('user_requirement'); ?></th>\r
                        </tr>\r
                        </thead>\r
                        \r
@@ -78,13 +79,27 @@ include(TR_INCLUDE_PATH.'header.inc.php');
 \r
                        <tbody>\r
        <?php foreach ($this->privs_rows as $privs_row) { ?>\r
-                       <tr onmousedown="document.input_form['del_privileges_<?php echo $privs_row['privilege_id']; ?>'].checked = !document.input_form['del_privileges_<?php echo $privs_row['privilege_id']; ?>'].checked; togglerowhighlight(this, 'del_privileges_<?php echo $privs_row['privilege_id']; ?>');" \r
-                           onkeydown="document.input_form['del_privileges_<?php echo $privs_row['privilege_id']; ?>'].checked = !document.input_form['del_privileges_<?php echo $privs_row['privilege_id']; ?>'].checked; togglerowhighlight(this, 'del_privileges_<?php echo $privs_row['privilege_id']; ?>');"\r
-                           id="rdel_privileges_<?php echo $privs_row['privilege_id']; ?>">\r
-                               <td><input type="checkbox" name="del_privileges_id[]" value="<?php echo $privs_row['privilege_id']; ?>" id="del_privileges_<?php echo $privs_row['privilege_id']; ?>" \r
+                       <tr id="rdel_privileges_<?php echo $privs_row['privilege_id']; ?>">\r
+                               <td onmousedown="document.input_form['del_privileges_<?php echo $privs_row['privilege_id']; ?>'].checked = !document.input_form['del_privileges_<?php echo $privs_row['privilege_id']; ?>'].checked; togglerowhighlight(document.getElementById('rdel_privileges_<?php echo $privs_row['privilege_id']; ?>'), 'del_privileges_<?php echo $privs_row['privilege_id']; ?>');" \r
+                           onkeydown="document.input_form['del_privileges_<?php echo $privs_row['privilege_id']; ?>'].checked = !document.input_form['del_privileges_<?php echo $privs_row['privilege_id']; ?>'].checked; togglerowhighlight(document.getElementById('rdel_privileges_<?php echo $privs_row['privilege_id']; ?>'), 'del_privileges_<?php echo $privs_row['privilege_id']; ?>');">\r
+                               <input type="checkbox" name="del_privileges_id[]" value="<?php echo $privs_row['privilege_id']; ?>" id="del_privileges_<?php echo $privs_row['privilege_id']; ?>" \r
                                           onmouseup="this.checked=!this.checked" onkeyup="this.checked=!this.checked" \r
-                                          <?php if (is_array($_POST['del_privileges_id']) && in_array($privs_row['privilege_id'], $_POST['del_privileges_id'])) echo 'checked="checked"';?> /></td>\r
-                               <td><label for="del_privileges_<?php echo $privs_row['privilege_id']; ?>"><?php echo $privs_row['description']; ?></label></td>\r
+                                          <?php if (is_array($_POST['del_privileges_id']) && in_array($privs_row['privilege_id'], $_POST['del_privileges_id'])) echo 'checked="checked"';?> />\r
+                               </td>\r
+\r
+                               <td onmousedown="document.input_form['del_privileges_<?php echo $privs_row['privilege_id']; ?>'].checked = !document.input_form['del_privileges_<?php echo $privs_row['privilege_id']; ?>'].checked; togglerowhighlight(document.getElementById('rdel_privileges_<?php echo $privs_row['privilege_id']; ?>'), 'del_privileges_<?php echo $privs_row['privilege_id']; ?>');" \r
+                           onkeydown="document.input_form['del_privileges_<?php echo $privs_row['privilege_id']; ?>'].checked = !document.input_form['del_privileges_<?php echo $privs_row['privilege_id']; ?>'].checked; togglerowhighlight(document.getElementById('rdel_privileges_<?php echo $privs_row['privilege_id']; ?>'), 'del_privileges_<?php echo $privs_row['privilege_id']; ?>');">\r
+                                       <label for="del_privileges_<?php echo $privs_row['privilege_id']; ?>"><?php echo $privs_row['description']; ?></label>\r
+                               </td>\r
+\r
+                               <td>\r
+                               <select name="user_requirement[<?php echo $privs_row['privilege_id']; ?>]" id="user_requirement">\r
+                                       <option value="0" <?php if ((!isset($_POST["user_requirement"][$privs_row['privilege_id']]) && $privs_row['user_requirement'] == 0) || $_POST["user_requirement"][$privs_row['privilege_id']] == 0) echo ' selected="selected"';?>><?php echo _AT('none'); ?></option>\r
+                                       <option value="<?php echo TR_PRIV_ISAUTHOR; ?>" <?php if ((!isset($_POST["user_requirement"][$privs_row['privilege_id']]) && $privs_row['user_requirement'] == TR_PRIV_ISAUTHOR) || $_POST["user_requirement"][$privs_row['privilege_id']] == TR_PRIV_ISAUTHOR) echo ' selected="selected"';?>><?php echo _AT('must_be_author'); ?></option>\r
+                                       <option value="<?php echo TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE; ?>" <?php if ((!isset($_POST["user_requirement"][$privs_row['privilege_id']]) && $privs_row['user_requirement'] == TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE) || $_POST["user_requirement"][$privs_row['privilege_id']] == TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE) echo ' selected="selected"';?>><?php echo _AT('must_be_author_of_course'); ?></option>\r
+                                       <option value="<?php echo TR_PRIV_IN_A_COURSE; ?>" <?php if ((!isset($_POST["user_requirement"][$privs_row['privilege_id']]) && $privs_row['user_requirement'] == TR_PRIV_IN_A_COURSE) || $_POST["user_requirement"][$privs_row['privilege_id']] == TR_PRIV_IN_A_COURSE) echo ' selected="selected"';?>><?php echo _AT('must_in_course'); ?></option>\r
+                               </select>\r
+                               </td>\r
                        </tr>\r
        <?php } // end of foreach?>\r
                        </tbody>\r
@@ -95,7 +110,7 @@ include(TR_INCLUDE_PATH.'header.inc.php');
        <div class="row">\r
                <h2>\r
                        <img src="images/arrow-closed.png" alt="<?php echo _AT("expand_add_privileges"); ?>" title="<?php echo _AT("expand_add_privileges"); ?>" id="toggle_image" border="0" />\r
-                       <a href="javascript:toggleToc('div_add_privs')"><?php echo _AT("add_privileges"); ?></a>\r
+                       <a href="javascript:toggleDiv('div_add_privs')"><?php echo _AT("add_privileges"); ?></a>\r
                </h2>\r
        </div>\r
        \r
index 2ce0d41..8af40a5 100644 (file)
@@ -55,15 +55,24 @@ else if (isset($_POST['save']))
                                               \r
                if (!$msg->containsErrors())\r
                {\r
+                       $userGroupPrivilegeDAO = new UserGroupPrivilegeDAO();\r
                        // add checks\r
                        if (is_array($_POST['add_privileges_id'])) \r
                        {\r
-                               $userGroupPrivilegeDAO = new UserGroupPrivilegeDAO();\r
-\r
                                foreach ($_POST['add_privileges_id'] as $add_priv_id)\r
                                        $userGroupPrivilegeDAO->Create($id, $add_priv_id);\r
                        }\r
                        \r
+                       if (is_array($_POST['user_requirement']))\r
+                       {\r
+                               foreach ($_POST['user_requirement'] as $priv_id => $user_requirement)\r
+                               {\r
+                                       $user_group_priv_row = $userGroupPrivilegeDAO->Get($id, $priv_id);\r
+                                       if ($user_group_priv_row && $user_group_priv_row['user_requirement'] <> $user_requirement)\r
+                                               $userGroupPrivilegeDAO->UpdateField($id, $priv_id, 'user_requirement', $user_requirement);\r
+                               }\r
+                       }\r
+                       \r
                        $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');\r
                        header('Location: user_group.php');\r
                        exit;\r