<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[26876] trunk: TinyMCE 4.0.12, first run.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/26876">26876</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2013-12-28 23:52:04 +0000 (Sat, 28 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See <a href="http://core.trac.wordpress.org/ticket/24067">#24067</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkGruntfilejs">trunk/Gruntfile.js</a></li>
<li><a href="#trunksrcwpadmincsswpadmincss">trunk/src/wp-admin/css/wp-admin.css</a></li>
<li><a href="#trunksrcwpadmineditformadvancedphp">trunk/src/wp-admin/edit-form-advanced.php</a></li>
<li><a href="#trunksrcwpadminincludesajaxactionsphp">trunk/src/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunksrcwpadminjseditorjs">trunk/src/wp-admin/js/editor.js</a></li>
<li><a href="#trunksrcwpadminjsmediauploadjs">trunk/src/wp-admin/js/media-upload.js</a></li>
<li><a href="#trunksrcwpadminjspostjs">trunk/src/wp-admin/js/post.js</a></li>
<li><a href="#trunksrcwpadminjswpfullscreenjs">trunk/src/wp-admin/js/wp-fullscreen.js</a></li>
<li><a href="#trunksrcwpincludesclasswpeditorphp">trunk/src/wp-includes/class-wp-editor.php</a></li>
<li><a href="#trunksrcwpincludescsseditorcss">trunk/src/wp-includes/css/editor.css</a></li>
<li><a href="#trunksrcwpincludesjsautosavejs">trunk/src/wp-includes/js/autosave.js</a></li>
<li><a href="#trunksrcwpincludesjsmediaeditorjs">trunk/src/wp-includes/js/media-editor.js</a></li>
<li><a href="#trunksrcwpincludesjsquicktagsjs">trunk/src/wp-includes/js/quicktags.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcelangswplangsenjs">trunk/src/wp-includes/js/tinymce/langs/wp-langs-en.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsmediamoxieplayerswf">trunk/src/wp-includes/js/tinymce/plugins/media/moxieplayer.swf</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsspellcheckerconfigphp">trunk/src/wp-includes/js/tinymce/plugins/spellchecker/config.php</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsspellcheckerrpcphp">trunk/src/wp-includes/js/tinymce/plugins/spellchecker/rpc.php</a></li>
<li><a href="#trunksrcwpincludesjstinymcetiny_mce_popupjs">trunk/src/wp-includes/js/tinymce/tiny_mce_popup.js</a></li>
<li><a href="#trunksrcwpincludesjstinymceutilseditable_selectsjs">trunk/src/wp-includes/js/tinymce/utils/editable_selects.js</a></li>
<li><a href="#trunksrcwpincludesjstinymceutilsform_utilsjs">trunk/src/wp-includes/js/tinymce/utils/form_utils.js</a></li>
<li><a href="#trunksrcwpincludesjstinymceutilsmctabsjs">trunk/src/wp-includes/js/tinymce/utils/mctabs.js</a></li>
<li><a href="#trunksrcwpincludesjstinymceutilsvalidatejs">trunk/src/wp-includes/js/tinymce/utils/validate.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcewpmcehelpphp">trunk/src/wp-includes/js/tinymce/wp-mce-help.php</a></li>
<li><a href="#trunksrcwpincludesjswplinkjs">trunk/src/wp-includes/js/wplink.js</a></li>
<li><a href="#trunksrcwpincludesscriptloaderphp">trunk/src/wp-includes/script-loader.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/src/wp-includes/js/tinymce/plugins/charmap/</li>
<li><a href="#trunksrcwpincludesjstinymcepluginscharmappluginjs">trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginscharmappluginminjs">trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.min.js</a></li>
<li>trunk/src/wp-includes/js/tinymce/plugins/compat3x/</li>
<li>trunk/src/wp-includes/js/tinymce/plugins/compat3x/css/</li>
<li><a href="#trunksrcwpincludesjstinymcepluginscompat3xcssdialogcss">trunk/src/wp-includes/js/tinymce/plugins/compat3x/css/dialog.css</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginscompat3xpluginjs">trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginscompat3xpluginminjs">trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.min.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsdirectionalitypluginjs">trunk/src/wp-includes/js/tinymce/plugins/directionality/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsdirectionalitypluginminjs">trunk/src/wp-includes/js/tinymce/plugins/directionality/plugin.min.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsfullscreenpluginjs">trunk/src/wp-includes/js/tinymce/plugins/fullscreen/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsfullscreenpluginminjs">trunk/src/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js</a></li>
<li>trunk/src/wp-includes/js/tinymce/plugins/image/</li>
<li><a href="#trunksrcwpincludesjstinymcepluginsimagepluginjs">trunk/src/wp-includes/js/tinymce/plugins/image/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsimagepluginminjs">trunk/src/wp-includes/js/tinymce/plugins/image/plugin.min.js</a></li>
<li>trunk/src/wp-includes/js/tinymce/plugins/link/</li>
<li><a href="#trunksrcwpincludesjstinymcepluginslinkpluginjs">trunk/src/wp-includes/js/tinymce/plugins/link/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginslinkpluginminjs">trunk/src/wp-includes/js/tinymce/plugins/link/plugin.min.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsmediapluginjs">trunk/src/wp-includes/js/tinymce/plugins/media/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsmediapluginminjs">trunk/src/wp-includes/js/tinymce/plugins/media/plugin.min.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginspastepluginjs">trunk/src/wp-includes/js/tinymce/plugins/paste/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginspastepluginminjs">trunk/src/wp-includes/js/tinymce/plugins/paste/plugin.min.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsspellcheckerpluginjs">trunk/src/wp-includes/js/tinymce/plugins/spellchecker/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsspellcheckerpluginminjs">trunk/src/wp-includes/js/tinymce/plugins/spellchecker/plugin.min.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginstabfocuspluginjs">trunk/src/wp-includes/js/tinymce/plugins/tabfocus/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginstabfocuspluginminjs">trunk/src/wp-includes/js/tinymce/plugins/tabfocus/plugin.min.js</a></li>
<li>trunk/src/wp-includes/js/tinymce/plugins/textcolor/</li>
<li><a href="#trunksrcwpincludesjstinymcepluginstextcolorpluginjs">trunk/src/wp-includes/js/tinymce/plugins/textcolor/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginstextcolorpluginminjs">trunk/src/wp-includes/js/tinymce/plugins/textcolor/plugin.min.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswordpresspluginjs">trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpdialogspluginjs">trunk/src/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpeditimagepluginjs">trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpfullscreenpluginjs">trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpgallerypluginjs">trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswplinkpluginjs">trunk/src/wp-includes/js/tinymce/plugins/wplink/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpviewpluginjs">trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js</a></li>
<li>trunk/src/wp-includes/js/tinymce/skins/</li>
<li>trunk/src/wp-includes/js/tinymce/skins/lightgray/</li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgraycontentinlinemincss">trunk/src/wp-includes/js/tinymce/skins/lightgray/content.inline.min.css</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgraycontentmincss">trunk/src/wp-includes/js/tinymce/skins/lightgray/content.min.css</a></li>
<li>trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/</li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayfontsreadmemd">trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/readme.md</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayfontstinymcesmalleot">trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.eot</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayfontstinymcesmallsvg">trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.svg</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayfontstinymcesmallttf">trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayfontstinymcesmallwoff">trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.woff</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayfontstinymceeot">trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.eot</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayfontstinymcesvg">trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.svg</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayfontstinymcettf">trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.ttf</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayfontstinymcewoff">trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.woff</a></li>
<li>trunk/src/wp-includes/js/tinymce/skins/lightgray/img/</li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayimganchorgif">trunk/src/wp-includes/js/tinymce/skins/lightgray/img/anchor.gif</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayimgloadergif">trunk/src/wp-includes/js/tinymce/skins/lightgray/img/loader.gif</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayimgobjectgif">trunk/src/wp-includes/js/tinymce/skins/lightgray/img/object.gif</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayimgtransgif">trunk/src/wp-includes/js/tinymce/skins/lightgray/img/trans.gif</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayimgwlinegif">trunk/src/wp-includes/js/tinymce/skins/lightgray/img/wline.gif</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayskinie7mincss">trunk/src/wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayskinmincss">trunk/src/wp-includes/js/tinymce/skins/lightgray/skin.min.css</a></li>
<li>trunk/src/wp-includes/js/tinymce/skins/wordpress/</li>
<li>trunk/src/wp-includes/js/tinymce/skins/wordpress/images/</li>
<li><a href="#trunksrcwpincludesjstinymceskinswordpressimagesembeddedpng">trunk/src/wp-includes/js/tinymce/skins/wordpress/images/embedded.png</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinswordpressimagesgallery2xpng">trunk/src/wp-includes/js/tinymce/skins/wordpress/images/gallery-2x.png</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinswordpressimagesgallerypng">trunk/src/wp-includes/js/tinymce/skins/wordpress/images/gallery.png</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinswordpresswpcontentcss">trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css</a></li>
<li>trunk/src/wp-includes/js/tinymce/themes/modern/</li>
<li><a href="#trunksrcwpincludesjstinymcethemesmodernthemejs">trunk/src/wp-includes/js/tinymce/themes/modern/theme.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcethemesmodernthememinjs">trunk/src/wp-includes/js/tinymce/themes/modern/theme.min.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcetinymcejs">trunk/src/wp-includes/js/tinymce/tinymce.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcetinymceminjs">trunk/src/wp-includes/js/tinymce/tinymce.min.js</a></li>
<li><a href="#trunksrcwpincludesjswpdialogjs">trunk/src/wp-includes/js/wpdialog.js</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesjstinymcelangswplangsphp">trunk/src/wp-includes/js/tinymce/langs/wp-langs.php</a></li>
<li><a href="#trunksrcwpincludesjstinymcemark_loaded_srcjs">trunk/src/wp-includes/js/tinymce/mark_loaded_src.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsdirectionalityeditor_pluginjs">trunk/src/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsdirectionalityeditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/directionality/editor_plugin_src.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsfullscreeneditor_pluginjs">trunk/src/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsfullscreeneditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin_src.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsfullscreenfullscreenhtm">trunk/src/wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm</a></li>
<li>trunk/src/wp-includes/js/tinymce/plugins/inlinepopups/</li>
<li>trunk/src/wp-includes/js/tinymce/plugins/media/css/</li>
<li><a href="#trunksrcwpincludesjstinymcepluginsmediaeditor_pluginjs">trunk/src/wp-includes/js/tinymce/plugins/media/editor_plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsmediaeditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/media/editor_plugin_src.js</a></li>
<li>trunk/src/wp-includes/js/tinymce/plugins/media/js/</li>
<li><a href="#trunksrcwpincludesjstinymcepluginsmediamediahtm">trunk/src/wp-includes/js/tinymce/plugins/media/media.htm</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginspasteeditor_pluginjs">trunk/src/wp-includes/js/tinymce/plugins/paste/editor_plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginspasteeditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/paste/editor_plugin_src.js</a></li>
<li>trunk/src/wp-includes/js/tinymce/plugins/paste/js/</li>
<li><a href="#trunksrcwpincludesjstinymcepluginspastepastetexthtm">trunk/src/wp-includes/js/tinymce/plugins/paste/pastetext.htm</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginspastepastewordhtm">trunk/src/wp-includes/js/tinymce/plugins/paste/pasteword.htm</a></li>
<li>trunk/src/wp-includes/js/tinymce/plugins/spellchecker/css/</li>
<li><a href="#trunksrcwpincludesjstinymcepluginsspellcheckereditor_pluginjs">trunk/src/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginsspellcheckereditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin_src.js</a></li>
<li>trunk/src/wp-includes/js/tinymce/plugins/spellchecker/img/</li>
<li><a href="#trunksrcwpincludesjstinymcepluginstabfocuseditor_pluginjs">trunk/src/wp-includes/js/tinymce/plugins/tabfocus/editor_plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginstabfocuseditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/tabfocus/editor_plugin_src.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswordpresseditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js</a></li>
<li>trunk/src/wp-includes/js/tinymce/plugins/wordpress/img/</li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpdialogseditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin_src.js</a></li>
<li>trunk/src/wp-includes/js/tinymce/plugins/wpdialogs/js/</li>
<li>trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/css/</li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpeditimageeditimagehtml">trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpeditimageeditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js</a></li>
<li>trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/img/</li>
<li>trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/js/</li>
<li>trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/css/</li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpfullscreeneditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpgalleryeditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin_src.js</a></li>
<li>trunk/src/wp-includes/js/tinymce/plugins/wpgallery/img/</li>
<li><a href="#trunksrcwpincludesjstinymcepluginswplinkeditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/wplink/editor_plugin_src.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpvieweditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/wpview/editor_plugin_src.js</a></li>
<li>trunk/src/wp-includes/js/tinymce/themes/advanced/</li>
<li><a href="#trunksrcwpincludesjstinymcetiny_mcejs">trunk/src/wp-includes/js/tinymce/tiny_mce.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcewptinymceschemajs">trunk/src/wp-includes/js/tinymce/wp-tinymce-schema.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkGruntfilejs"></a>
<div class="modfile"><h4>Modified: trunk/Gruntfile.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Gruntfile.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/Gruntfile.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -17,13 +17,7 @@
</span><span class="cx"> cwd: BUILD_DIR,
</span><span class="cx"> src: []
</span><span class="cx"> },
</span><del>- tinymce: {
- src: [
- '<%= concat.tinymce.dest %>',
- BUILD_DIR + 'wp-includes/js/tinymce/wp-tinymce-schema.min.js',
- BUILD_DIR + 'wp-includes/js/tinymce/mark_loaded.js'
- ]
- },
</del><ins>+ tinymce: ['<%= concat.tinymce.dest %>'],
</ins><span class="cx"> qunit: ['tests/qunit/compiled.html']
</span><span class="cx"> },
</span><span class="cx"> copy: {
</span><span class="lines">@@ -191,9 +185,8 @@
</span><span class="cx"> 'wp-includes/js/mediaelement/wp-mediaelement.js',
</span><span class="cx"> 'wp-includes/js/plupload/handlers.js',
</span><span class="cx"> 'wp-includes/js/plupload/wp-plupload.js',
</span><del>- 'wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js',
- 'wp-includes/js/tinymce/plugins/wp*/editor_plugin_src.js',
- 'wp-includes/js/tinymce/mark_loaded_src.js',
</del><ins>+ 'wp-includes/js/tinymce/plugins/wordpress/plugin.js',
+ 'wp-includes/js/tinymce/plugins/wp*/plugin.js',
</ins><span class="cx"> // Third party scripts
</span><span class="cx"> '!wp-admin/js/farbtastic.js',
</span><span class="cx"> '!wp-admin/js/iris.min.js',
</span><span class="lines">@@ -262,8 +255,9 @@
</span><span class="cx"> 'wp-includes/js/*.js',
</span><span class="cx"> 'wp-includes/js/plupload/handlers.js',
</span><span class="cx"> 'wp-includes/js/plupload/wp-plupload.js',
</span><del>- 'wp-includes/js/tinymce/plugins/wp*/js/*.js',
- 'wp-includes/js/tinymce/wp-tinymce-schema.js',
</del><ins>+ 'wp-includes/js/tinymce/plugins/wordpress/plugin.js',
+ 'wp-includes/js/tinymce/plugins/wp*/plugin.js',
+
</ins><span class="cx"> // Exceptions
</span><span class="cx"> '!wp-admin/js/custom-header.js', // Why? We should minify this.
</span><span class="cx"> '!wp-admin/js/farbtastic.js',
</span><span class="lines">@@ -271,26 +265,8 @@
</span><span class="cx"> '!wp-includes/js/backbone.min.js',
</span><span class="cx"> '!wp-includes/js/swfobject.js',
</span><span class="cx"> '!wp-includes/js/underscore.min.js',
</span><del>- '!wp-includes/js/zxcvbn.min.js',
- // Hard-coded in editimage.html
- '!wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js'
</del><ins>+ '!wp-includes/js/zxcvbn.min.js'
</ins><span class="cx"> ]
</span><del>- },
- tinymce: {
- expand: true,
- cwd: SOURCE_DIR,
- dest: BUILD_DIR,
- src: [
- 'wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js',
- 'wp-includes/js/tinymce/plugins/wp*/editor_plugin_src.js',
- 'wp-includes/js/tinymce/mark_loaded_src.js'
- ],
- // TinyMCE plugins use a nonstandard naming scheme: plugin files are named
- // `editor_plugin_src.js`, and are compressed into `editor_plugin.js`.
- rename: function(destBase, destPath) {
- destPath = destPath.replace(/_src.js$/, '.js');
- return path.join(destBase || '', destPath);
- }
</del><span class="cx"> }
</span><span class="cx"> },
</span><span class="cx"> concat: {
</span><span class="lines">@@ -302,11 +278,9 @@
</span><span class="cx"> }
</span><span class="cx"> },
</span><span class="cx"> src: [
</span><del>- BUILD_DIR + 'wp-includes/js/tinymce/tiny_mce.js',
- BUILD_DIR + 'wp-includes/js/tinymce/wp-tinymce-schema.min.js',
- BUILD_DIR + 'wp-includes/js/tinymce/themes/advanced/editor_template.js',
- BUILD_DIR + 'wp-includes/js/tinymce/plugins/*/editor_plugin.js',
- BUILD_DIR + 'wp-includes/js/tinymce/mark_loaded.js'
</del><ins>+ BUILD_DIR + 'wp-includes/js/tinymce/tinymce.min.js',
+ BUILD_DIR + 'wp-includes/js/tinymce/themes/modern/theme.min.js',
+ BUILD_DIR + 'wp-includes/js/tinymce/plugins/*/plugin.min.js'
</ins><span class="cx"> ],
</span><span class="cx"> dest: BUILD_DIR + 'wp-includes/js/tinymce/wp-tinymce.js'
</span><span class="cx"> }
</span><span class="lines">@@ -370,7 +344,7 @@
</span><span class="cx">
</span><span class="cx"> // Build task.
</span><span class="cx"> grunt.registerTask('build', ['clean:all', 'copy:all', 'cssmin:core', 'colors', 'rtl', 'cssmin:rtl', 'cssmin:colors',
</span><del>- 'uglify:core', 'uglify:tinymce', 'concat:tinymce', 'compress:tinymce', 'clean:tinymce']);
</del><ins>+ 'uglify:core', 'concat:tinymce', 'compress:tinymce', 'clean:tinymce']);
</ins><span class="cx">
</span><span class="cx"> // Testing tasks.
</span><span class="cx"> grunt.registerMultiTask('phpunit', 'Runs PHPUnit tests, including the ajax and multisite tests.', function() {
</span><span class="lines">@@ -383,6 +357,7 @@
</span><span class="cx">
</span><span class="cx"> grunt.registerTask('qunit:compiled', 'Runs QUnit tests on compiled as well as uncompiled scripts.',
</span><span class="cx"> ['build', 'copy:qunit', 'qunit']);
</span><ins>+
</ins><span class="cx"> grunt.registerTask('test', 'Runs all QUnit and PHPUnit tasks.', ['qunit:compiled', 'phpunit']);
</span><span class="cx">
</span><span class="cx"> // Default task.
</span></span></pre></div>
<a id="trunksrcwpadmincsswpadmincss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/css/wp-admin.css (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/css/wp-admin.css 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-admin/css/wp-admin.css 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -4315,7 +4315,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .autosave-info {
</span><del>- padding: 2px 15px;
</del><ins>+ padding: 2px;
</ins><span class="cx"> text-align: right;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4323,43 +4323,20 @@
</span><span class="cx"> border: none;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#content-resize-handle,
-#post-body .wp_themeSkin .mceStatusbar a.mceResize {
</del><ins>+#content-resize-handle {
</ins><span class="cx"> background: transparent url('../images/resize.gif') no-repeat scroll right bottom;
</span><span class="cx"> width: 12px;
</span><del>- height: 12px;
- cursor: se-resize;
</del><ins>+ cursor: n-resize;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.rtl #content-resize-handle,
-.rtl #post-body .wp_themeSkin .mceStatusbar a.mceResize {
- background: transparent url('../images/resize-rtl.gif') no-repeat scroll right bottom;
</del><ins>+.rtl #content-resize-handle {
+ background: transparent url('../images/resize-rtl.gif') no-repeat scroll left bottom;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-#post-body .wp_themeSkin .mceStatusbar a.mceResize {
- bottom: 3px;
- position: absolute;
- right: 3px;
-}
-
-#post-body .postarea .wp_themeSkin .mceStatusbar a.mceResize {
- bottom: -20px;
-}
-
-#content-resize-handle {
- position: absolute;
- right: 3px;
- bottom: -20px;
-}
-
</del><span class="cx"> .press-this #content-resize-handle {
</span><span class="cx"> bottom: 2px;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.tmce-active #content-resize-handle {
- display: none;
-}
-
</del><span class="cx"> #wp-word-count {
</span><span class="cx"> display: block;
</span><span class="cx"> padding: 2px 10px;
</span></span></pre></div>
<a id="trunksrcwpadmineditformadvancedphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/edit-form-advanced.php (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/edit-form-advanced.php 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-admin/edit-form-advanced.php 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -483,6 +483,9 @@
</span><span class="cx"> 'dfw' => true,
</span><span class="cx"> 'tabfocus_elements' => 'insert-media-button,save-post',
</span><span class="cx"> 'editor_height' => 360,
</span><ins>+ 'tinymce' => array(
+ 'resize' => false,
+ ),
</ins><span class="cx"> ) ); ?>
</span><span class="cx"> <table id="post-status-info" cellspacing="0"><tbody><tr>
</span><span class="cx"> <td id="wp-word-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td>
</span><span class="lines">@@ -499,6 +502,7 @@
</span><span class="cx"> echo '</span>';
</span><span class="cx"> } ?>
</span><span class="cx"> </td>
</span><ins>+ <td id="content-resize-handle" class="hide-if-no-js"><br /></td>
</ins><span class="cx"> </tr></tbody></table>
</span><span class="cx">
</span><span class="cx"> </div>
</span></span></pre></div>
<a id="trunksrcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/includes/ajax-actions.php (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/includes/ajax-actions.php 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-admin/includes/ajax-actions.php 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1787,16 +1787,8 @@
</span><span class="cx">
</span><span class="cx"> $post_id = edit_post();
</span><span class="cx">
</span><del>- if ( is_wp_error($post_id) ) {
- if ( $post_id->get_error_message() )
- $message = $post_id->get_error_message();
- else
- $message = __('Save failed');
-
- echo json_encode( array( 'message' => $message, 'last_edited' => '' ) );
- wp_die();
- } else {
- $message = __('Saved.');
</del><ins>+ if ( is_wp_error( $post_id ) ) {
+ wp_send_json_error();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ( $post ) {
</span><span class="lines">@@ -1807,15 +1799,14 @@
</span><span class="cx"> $last_time = date_i18n( get_option('time_format') );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ( $last_id = get_post_meta($post_id, '_edit_last', true) ) {
- $last_user = get_userdata($last_id);
</del><ins>+ if ( $last_id = get_post_meta( $post_id, '_edit_last', true ) ) {
+ $last_user = get_userdata( $last_id );
</ins><span class="cx"> $last_edited = sprintf( __('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), $last_date, $last_time );
</span><span class="cx"> } else {
</span><span class="cx"> $last_edited = sprintf( __('Last edited on %1$s at %2$s'), $last_date, $last_time );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- echo json_encode( array( 'message' => $message, 'last_edited' => $last_edited ) );
- wp_die();
</del><ins>+ wp_send_json_success( array( 'last_edited' => $last_edited ) );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function wp_ajax_wp_remove_post_lock() {
</span><span class="lines">@@ -1839,9 +1830,9 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 3.3.0
</span><span class="cx"> *
</span><del>- * @param int $interval The interval in seconds the post lock duration should last, plus 5 seconds. Default 120.
</del><ins>+ * @param int $interval The interval in seconds the post lock duration should last, plus 5 seconds. Default 150.
</ins><span class="cx"> */
</span><del>- $new_lock = ( time() - apply_filters( 'wp_check_post_lock_window', 120 ) + 5 ) . ':' . $active_lock[1];
</del><ins>+ $new_lock = ( time() - apply_filters( 'wp_check_post_lock_window', 150 ) + 5 ) . ':' . $active_lock[1];
</ins><span class="cx"> update_post_meta( $post_id, '_edit_lock', $new_lock, implode( ':', $active_lock ) );
</span><span class="cx"> wp_die( 1 );
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunksrcwpadminjseditorjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/js/editor.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/editor.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-admin/js/editor.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -13,15 +13,15 @@
</span><span class="cx">
</span><span class="cx"> // mode can be 'html', 'tmce', or 'toggle'; 'html' is used for the 'Text' editor tab.
</span><span class="cx"> go: function( id, mode ) {
</span><del>- var t = this, ed, wrap_id, txtarea_el,
- dom = tinymce.DOM;
</del><ins>+ var t = this, ed, wrap_id, txtarea_el, editorHeight, toolbarHeight,
+ DOM = tinymce.DOM; //DOMUtils outside the editor iframe
</ins><span class="cx">
</span><span class="cx"> id = id || 'content';
</span><span class="cx"> mode = mode || 'toggle';
</span><span class="cx">
</span><span class="cx"> ed = tinymce.get( id );
</span><span class="cx"> wrap_id = 'wp-' + id + '-wrap';
</span><del>- txtarea_el = dom.get( id );
</del><ins>+ txtarea_el = DOM.get( id );
</ins><span class="cx">
</span><span class="cx"> if ( 'toggle' === mode ) {
</span><span class="cx"> if ( ed && ! ed.isHidden() ) {
</span><span class="lines">@@ -31,6 +31,20 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ function getToolbarHeight() {
+ var height;
+
+ try {
+ height = DOM.getSize( DOM.select( '.mce-toolbar-grp', ed.getContainer() )[0] );
+ } catch(e){}
+
+ if ( height && height.h && height.h > 10 && height.h < 100 ) {
+ return height.h;
+ }
+
+ return 0;
+ }
+
</ins><span class="cx"> if ( 'tmce' === mode || 'tinymce' === mode ) {
</span><span class="cx"> if ( ed && ! ed.isHidden() ) {
</span><span class="cx"> return false;
</span><span class="lines">@@ -40,19 +54,32 @@
</span><span class="cx"> QTags.closeAllTags( id );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ editorHeight = txtarea_el ? parseInt( txtarea_el.style.height, 10 ) : 0;
+
</ins><span class="cx"> if ( tinyMCEPreInit.mceInit[ id ] && tinyMCEPreInit.mceInit[ id ].wpautop ) {
</span><span class="cx"> txtarea_el.value = t.wpautop( txtarea_el.value );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ( ed ) {
</span><span class="cx"> ed.show();
</span><ins>+
+ if ( editorHeight && ( toolbarHeight = getToolbarHeight() ) ) {
+ editorHeight = editorHeight - toolbarHeight + 11;
+
+ // height cannot be under 50 or over 5000
+ if ( editorHeight > 50 && editorHeight < 5000 ) {
+ ed.theme.resizeTo( null, editorHeight );
+ }
+ }
</ins><span class="cx"> } else {
</span><del>- ed = new tinymce.Editor( id, tinyMCEPreInit.mceInit[ id ] );
- ed.render();
</del><ins>+ tinymce.init( tinyMCEPreInit.mceInit[id] );
+
+ // ed = tinymce.createEditor( id, tinyMCEPreInit.mceInit[id] );
+ // ed.render();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- dom.removeClass( wrap_id, 'html-active' );
- dom.addClass( wrap_id, 'tmce-active' );
</del><ins>+ DOM.removeClass( wrap_id, 'html-active' );
+ DOM.addClass( wrap_id, 'tmce-active' );
</ins><span class="cx"> setUserSetting( 'editor', 'tinymce' );
</span><span class="cx">
</span><span class="cx"> } else if ( 'html' === mode ) {
</span><span class="lines">@@ -62,6 +89,18 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ( ed ) {
</span><ins>+ editorHeight = DOM.get( id + '_ifr' );
+ editorHeight = editorHeight ? parseInt( editorHeight.style.height, 10 ) : 0;
+
+ if ( editorHeight && ( toolbarHeight = getToolbarHeight() ) ) {
+ editorHeight = editorHeight + toolbarHeight - 11;
+
+ // height cannot be under 50 or over 5000
+ if ( editorHeight > 50 && editorHeight < 5000 ) {
+ txtarea_el.style.height = editorHeight + 'px';
+ }
+ }
+
</ins><span class="cx"> ed.hide();
</span><span class="cx"> } else {
</span><span class="cx"> // The TinyMCE instance doesn't exist, run the content through 'pre_wpautop()' and show the textarea
</span><span class="lines">@@ -69,11 +108,11 @@
</span><span class="cx"> txtarea_el.value = t.pre_wpautop( txtarea_el.value );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- dom.setStyles( txtarea_el, {'display': '', 'visibility': ''} );
</del><ins>+ DOM.setStyles( txtarea_el, {'display': '', 'visibility': ''} );
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- dom.removeClass( wrap_id, 'tmce-active' );
- dom.addClass( wrap_id, 'html-active' );
</del><ins>+ DOM.removeClass( wrap_id, 'tmce-active' );
+ DOM.addClass( wrap_id, 'html-active' );
</ins><span class="cx"> setUserSetting( 'editor', 'html' );
</span><span class="cx"> }
</span><span class="cx"> return false;
</span><span class="lines">@@ -88,8 +127,9 @@
</span><span class="cx"> if ( content.indexOf( '<pre' ) !== -1 || content.indexOf( '<script' ) !== -1 ) {
</span><span class="cx"> preserve_linebreaks = true;
</span><span class="cx"> content = content.replace( /<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function( a ) {
</span><del>- a = a.replace( /<br ?\/?>(\r\n|\n)?/g, '<wp-temp-lb>' );
- return a.replace( /<\/?p( [^>]*)?>(\r\n|\n)?/g, '<wp-temp-lb>' );
</del><ins>+ a = a.replace( /<br ?\/?>(\r\n|\n)?/g, '<wp-line-break>' );
+ a = a.replace( /<\/?p( [^>]*)?>(\r\n|\n)?/g, '<wp-line-break>' );
+ return a.replace( /\r?\n/g, '<wp-line-break>' );
</ins><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -149,7 +189,7 @@
</span><span class="cx">
</span><span class="cx"> // put back the line breaks in pre|script
</span><span class="cx"> if ( preserve_linebreaks ) {
</span><del>- content = content.replace( /<wp-temp-lb>/g, '\n' );
</del><ins>+ content = content.replace( /<wp-line-break>/g, '\n' );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // and the <br> tags in captions
</span><span class="lines">@@ -181,7 +221,7 @@
</span><span class="cx"> if ( pee.indexOf( '<pre' ) !== -1 || pee.indexOf( '<script' ) !== -1 ) {
</span><span class="cx"> preserve_linebreaks = true;
</span><span class="cx"> pee = pee.replace( /<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function( a ) {
</span><del>- return a.replace( /(\r\n|\n)/g, '<wp-temp-lb>' );
</del><ins>+ return a.replace( /(\r\n|\n)/g, '<wp-line-break>' );
</ins><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -230,7 +270,7 @@
</span><span class="cx">
</span><span class="cx"> // put back the line breaks in pre|script
</span><span class="cx"> if ( preserve_linebreaks ) {
</span><del>- pee = pee.replace( /<wp-temp-lb>/g, '\n' );
</del><ins>+ pee = pee.replace( /<wp-line-break>/g, '\n' );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ( preserve_br ) {
</span></span></pre></div>
<a id="trunksrcwpadminjsmediauploadjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/js/media-upload.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/media-upload.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-admin/js/media-upload.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -6,24 +6,21 @@
</span><span class="cx"> send_to_editor = function(h) {
</span><span class="cx"> var ed, mce = typeof(tinymce) != 'undefined', qt = typeof(QTags) != 'undefined';
</span><span class="cx">
</span><del>- if ( !wpActiveEditor ) {
</del><ins>+ if ( ! wpActiveEditor ) {
</ins><span class="cx"> if ( mce && tinymce.activeEditor ) {
</span><span class="cx"> ed = tinymce.activeEditor;
</span><span class="cx"> wpActiveEditor = ed.id;
</span><del>- } else if ( !qt ) {
</del><ins>+ } else if ( ! qt ) {
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> } else if ( mce ) {
</span><del>- if ( tinymce.activeEditor && (tinymce.activeEditor.id == 'mce_fullscreen' || tinymce.activeEditor.id == 'wp_mce_fullscreen') )
- ed = tinymce.activeEditor;
- else
- ed = tinymce.get(wpActiveEditor);
</del><ins>+ ed = tinymce.get( wpActiveEditor );
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if ( ed && !ed.isHidden() ) {
</del><ins>+ if ( ed && ! ed.isHidden() ) {
</ins><span class="cx"> // restore caret position on IE
</span><del>- if ( tinymce.isIE && ed.windowManager.insertimagebookmark )
- ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark);
</del><ins>+ // if ( tinymce.isIE && ed.windowManager.insertimagebookmark )
+ // ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark);
</ins><span class="cx">
</span><span class="cx"> if ( h.indexOf('[caption') !== -1 ) {
</span><span class="cx"> if ( ed.wpSetImgCaption )
</span><span class="lines">@@ -78,7 +75,7 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> $(window).resize(function(){ tb_position(); });
</span><del>-
</del><ins>+/*
</ins><span class="cx"> // store caret position in IE
</span><span class="cx"> $(document).ready(function($){
</span><span class="cx"> $('a.thickbox').click(function(){
</span><span class="lines">@@ -90,5 +87,5 @@
</span><span class="cx"> }
</span><span class="cx"> });
</span><span class="cx"> });
</span><del>-
</del><ins>+*/
</ins><span class="cx"> })(jQuery);
</span></span></pre></div>
<a id="trunksrcwpadminjspostjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/js/post.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/post.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-admin/js/post.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -812,114 +812,72 @@
</span><span class="cx">
</span><span class="cx"> wptitlehint();
</span><span class="cx">
</span><del>- // resizable textarea#content
- (function() {
- var textarea = $('textarea#content'), offset = null, el;
</del><ins>+ // Resize the visual and text editors
+ ( function() {
+ var editor, offset, mce,
+ $document = $( document ),
+ $textarea = $('textarea#content'),
+ $handle = $('#post-status-info');
+
</ins><span class="cx"> // No point for touch devices
</span><del>- if ( !textarea.length || 'ontouchstart' in window )
</del><ins>+ if ( ! $textarea.length || 'ontouchstart' in window ) {
</ins><span class="cx"> return;
</span><ins>+ }
</ins><span class="cx">
</span><del>- function dragging(e) {
- textarea.height( Math.max(50, offset + e.pageY) + 'px' );
- return false;
</del><ins>+ function dragging( event ) {
+ if ( mce ) {
+ editor.theme.resizeTo( null, offset + event.pageY );
+ } else {
+ $textarea.height( Math.max( 50, offset + event.pageY ) );
+ }
+
+ event.preventDefault();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function endDrag() {
</span><del>- var height;
</del><ins>+ var height, toolbarHeight;
</ins><span class="cx">
</span><del>- textarea.focus();
- $(document).unbind('mousemove', dragging).unbind('mouseup', endDrag);
</del><ins>+ if ( mce ) {
+ editor.focus();
+ toolbarHeight = $( '#wp-content-editor-container .mce-toolbar-grp' ).height();
+ height = parseInt( $('#content_ifr').css('height'), 10 ) + toolbarHeight - 28;
+ } else {
+ $textarea.focus();
+ height = parseInt( $textarea.css('height'), 10 );
+ }
</ins><span class="cx">
</span><del>- height = parseInt( textarea.css('height'), 10 );
</del><ins>+ $document.off( 'mousemove.wp-editor-resize mouseup.wp-editor-resize' );
</ins><span class="cx">
</span><span class="cx"> // sanity check
</span><del>- if ( height && height > 50 && height < 5000 )
</del><ins>+ if ( height && height > 50 && height < 5000 ) {
</ins><span class="cx"> setUserSetting( 'ed_size', height );
</span><ins>+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- textarea.css('resize', 'none');
- el = $('<div id="content-resize-handle"><br></div>');
- $('#wp-content-wrap').append(el);
- el.on('mousedown', function(e) {
- offset = textarea.height() - e.pageY;
- textarea.blur();
- $(document).mousemove(dragging).mouseup(endDrag);
- return false;
- });
- })();
</del><ins>+ $textarea.css( 'resize', 'none' );
</ins><span class="cx">
</span><del>- if ( typeof(tinymce) != 'undefined' ) {
- tinymce.onAddEditor.add(function(mce, ed){
- // iOS expands the iframe to full height and the user cannot adjust it.
- if ( ed.id != 'content' || tinymce.isIOS5 )
- return;
</del><ins>+ $handle.on( 'mousedown.wp-editor-resize', function( event ) {
+ if ( typeof tinymce !== 'undefined' ) {
+ editor = tinymce.get('content');
+ }
</ins><span class="cx">
</span><del>- function getHeight() {
- var height, node = document.getElementById('content_ifr'),
- ifr_height = node ? parseInt( node.style.height, 10 ) : 0,
- tb_height = $('#content_tbl tr.mceFirst').height();
-
- if ( !ifr_height || !tb_height )
- return false;
-
- // total height including toolbar and statusbar
- height = ifr_height + tb_height + 21;
- // textarea height = total height - 33px toolbar
- height -= 33;
-
- return height;
</del><ins>+ if ( editor && ! editor.isHidden() ) {
+ mce = true;
+ offset = $('#content_ifr').height() - event.pageY;
+ } else {
+ mce = false;
+ offset = $textarea.height() - event.pageY;
+ $textarea.blur();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- // resize TinyMCE to match the textarea height when switching Text -> Visual
- ed.onLoadContent.add( function() {
- var ifr_height, node = document.getElementById('content'),
- height = node ? parseInt( node.style.height, 10 ) : 0,
- tb_height = $('#content_tbl tr.mceFirst').height() || 33;
</del><ins>+ $document.on( 'mousemove.wp-editor-resize', dragging )
+ .on( 'mouseup.wp-editor-resize', endDrag );
</ins><span class="cx">
</span><del>- // height cannot be under 50 or over 5000
- if ( !height || height < 50 || height > 5000 )
- height = 360; // default height for the main editor
-
- if ( getUserSetting( 'ed_size' ) > 5000 )
- setUserSetting( 'ed_size', 360 );
-
- // compensate for padding and toolbars
- ifr_height = ( height - tb_height ) + 12;
-
- // sanity check
- if ( ifr_height > 50 && ifr_height < 5000 ) {
- $('#content_tbl').css('height', '' );
- $('#content_ifr').css('height', ifr_height + 'px' );
- }
- });
-
- // resize the textarea to match TinyMCE's height when switching Visual -> Text
- ed.onSaveContent.add( function() {
- var height = getHeight();
-
- if ( !height || height < 50 || height > 5000 )
- return;
-
- $('textarea#content').css( 'height', height + 'px' );
- });
-
- // save on resizing TinyMCE
- ed.onPostRender.add(function() {
- $( '#content_resize' ).on( 'mousedown.wp-mce-resize', function() {
- $( document ).on( 'mouseup.wp-mce-resize', function() {
- var height;
-
- $(document).off('mouseup.wp-mce-resize');
-
- height = getHeight();
- // sanity check
- if ( height && height > 50 && height < 5000 )
- setUserSetting( 'ed_size', height );
- });
- });
- });
</del><ins>+ event.preventDefault();
</ins><span class="cx"> });
</span><ins>+ })();
</ins><span class="cx">
</span><ins>+ if ( typeof tinymce !== 'undefined' ) {
</ins><span class="cx"> // When changing post formats, change the editor body class
</span><span class="cx"> $( '#post-formats-select input.post-format' ).on( 'change.set-editor-class', function() {
</span><span class="cx"> var editor, body, format = this.id;
</span></span></pre></div>
<a id="trunksrcwpadminjswpfullscreenjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/js/wp-fullscreen.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/wp-fullscreen.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-admin/js/wp-fullscreen.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,132 +1,133 @@
</span><span class="cx"> /* global ajaxurl, deleteUserSetting, setUserSetting, switchEditors, tinymce, tinyMCEPreInit, wp_fullscreen_settings, wpActiveEditor:true, wpLink */
</span><span class="cx"> /**
</span><del>- * PubSub
</del><ins>+ * Distraction Free Writing
+ * (wp-fullscreen)
</ins><span class="cx"> *
</span><del>- * A lightweight publish/subscribe implementation.
- * Private use only!
</del><ins>+ * Access the API globally using the window.wp.editor.fullscreen variable.
</ins><span class="cx"> */
</span><del>-var PubSub, fullscreen, wptitlehint;
</del><ins>+( function( $, window ) {
+ var api, ps, s, toggleUI, uiTimer, PubSub,
+ oldheight = 0,
+ uiScrollTop = 0,
+ transitionend = 'transitionend webkitTransitionEnd',
+ $body = $( document.body ),
+ $document = $( document );
</ins><span class="cx">
</span><del>-PubSub = function() {
- this.topics = {};
-};
</del><ins>+ /**
+ * PubSub
+ *
+ * A lightweight publish/subscribe implementation.
+ *
+ * @access private
+ */
+ PubSub = function() {
+ this.topics = {};
</ins><span class="cx">
</span><del>-PubSub.prototype.subscribe = function( topic, callback ) {
- if ( ! this.topics[ topic ] )
- this.topics[ topic ] = [];
</del><ins>+ this.subscribe = function( topic, callback ) {
+ if ( ! this.topics[ topic ] )
+ this.topics[ topic ] = [];
</ins><span class="cx">
</span><del>- this.topics[ topic ].push( callback );
- return callback;
-};
</del><ins>+ this.topics[ topic ].push( callback );
+ return callback;
+ };
</ins><span class="cx">
</span><del>-PubSub.prototype.unsubscribe = function( topic, callback ) {
- var i, l,
- topics = this.topics[ topic ];
</del><ins>+ this.unsubscribe = function( topic, callback ) {
+ var i, l,
+ topics = this.topics[ topic ];
</ins><span class="cx">
</span><del>- if ( ! topics )
- return callback || [];
</del><ins>+ if ( ! topics )
+ return callback || [];
</ins><span class="cx">
</span><del>- // Clear matching callbacks
- if ( callback ) {
- for ( i = 0, l = topics.length; i < l; i++ ) {
- if ( callback == topics[i] )
- topics.splice( i, 1 );
- }
- return callback;
</del><ins>+ // Clear matching callbacks
+ if ( callback ) {
+ for ( i = 0, l = topics.length; i < l; i++ ) {
+ if ( callback == topics[i] )
+ topics.splice( i, 1 );
+ }
+ return callback;
</ins><span class="cx">
</span><del>- // Clear all callbacks
- } else {
- this.topics[ topic ] = [];
- return topics;
- }
-};
</del><ins>+ // Clear all callbacks
+ } else {
+ this.topics[ topic ] = [];
+ return topics;
+ }
+ };
</ins><span class="cx">
</span><del>-PubSub.prototype.publish = function( topic, args ) {
- var i, l, broken,
- topics = this.topics[ topic ];
</del><ins>+ this.publish = function( topic, args ) {
+ var i, l, broken,
+ topics = this.topics[ topic ];
</ins><span class="cx">
</span><del>- if ( ! topics )
- return;
</del><ins>+ if ( ! topics )
+ return;
</ins><span class="cx">
</span><del>- args = args || [];
</del><ins>+ args = args || [];
</ins><span class="cx">
</span><del>- for ( i = 0, l = topics.length; i < l; i++ ) {
- broken = ( topics[i].apply( null, args ) === false || broken );
- }
- return ! broken;
-};
</del><ins>+ for ( i = 0, l = topics.length; i < l; i++ ) {
+ broken = ( topics[i].apply( null, args ) === false || broken );
+ }
+ return ! broken;
+ };
+ };
</ins><span class="cx">
</span><del>-/**
- * Distraction Free Writing
- * (wp-fullscreen)
- *
- * Access the API globally using the fullscreen variable.
- */
-
-(function($){
- var api, ps, bounder, s, timer, block, set_title_hint;
-
</del><span class="cx"> // Initialize the fullscreen/api object
</span><del>- fullscreen = api = {};
</del><ins>+ api = {};
</ins><span class="cx">
</span><span class="cx"> // Create the PubSub (publish/subscribe) interface.
</span><span class="cx"> ps = api.pubsub = new PubSub();
</span><del>- timer = 0;
- block = false;
</del><span class="cx">
</span><span class="cx"> s = api.settings = { // Settings
</span><del>- visible : false,
- mode : 'tinymce',
- editor_id : 'content',
- title_id : '',
- timer : 0,
- toolbar_shown : false
</del><ins>+ visible: false,
+ mode: 'tinymce',
+ id: '',
+ title_id: '',
+ timer: 0,
+ toolbar_shown: false
</ins><span class="cx"> };
</span><span class="cx">
</span><ins>+ function _hideUI() {
+ $body.removeClass('wp-dfw-show-ui');
+ uiShown = false;
+ }
+
</ins><span class="cx"> /**
</span><del>- * Bounder
</del><ins>+ * toggleUI
</ins><span class="cx"> *
</span><del>- * Creates a function that publishes start/stop topics.
- * Used to throttle events.
</del><ins>+ * Toggle the CSS class to show/hide the toolbar, borders and statusbar.
</ins><span class="cx"> */
</span><del>- bounder = api.bounder = function( start, stop, delay, e ) {
- var y, top;
</del><ins>+ toggleUI = api.toggleUI = function( hide ) {
+ clearTimeout( uiTimer );
</ins><span class="cx">
</span><del>- delay = delay || 1250;
</del><ins>+ if ( ! $body.hasClass('wp-dfw-show-ui') ) {
+ $body.addClass('wp-dfw-show-ui');
+ }
</ins><span class="cx">
</span><del>- if ( e ) {
- y = e.pageY || e.clientY || e.offsetY;
- top = $(document).scrollTop();
-
- if ( !e.isDefaultPrevented ) // test if e ic jQuery normalized
- y = 135 + y;
-
- if ( y - top > 120 )
- return;
</del><ins>+ if ( hide === 'hide' ) {
+ uiTimer = setTimeout( _hideUI, 2000 );
</ins><span class="cx"> }
</span><ins>+ };
</ins><span class="cx">
</span><del>- if ( block )
- return;
</del><ins>+ function resetCssPosition( add ) {
+ s.$dfwWrap.parents().each( function( i, parent ) {
+ var cssPosition, $parent = $(parent);
</ins><span class="cx">
</span><del>- block = true;
</del><ins>+ if ( add ) {
+ if ( parent.style.position ) {
+ $parent.data( 'wp-dfw-css-position', parent.style.position );
+ }
</ins><span class="cx">
</span><del>- setTimeout( function() {
- block = false;
- }, 400 );
</del><ins>+ $parent.css( 'position', 'static' );
+ } else {
+ cssPosition = $parent.data( 'wp-dfw-css-position' );
+ cssPosition = cssPosition || '';
+ $parent.css( 'position', cssPosition );
+ }
</ins><span class="cx">
</span><del>- if ( s.timer )
- clearTimeout( s.timer );
- else
- ps.publish( start );
</del><ins>+ if ( parent.nodeName === 'BODY' ) {
+ return false;
+ }
+ });
+ }
</ins><span class="cx">
</span><del>- function timed() {
- ps.publish( stop );
- s.timer = 0;
- }
-
- s.timer = setTimeout( timed, delay );
- };
-
</del><span class="cx"> /**
</span><span class="cx"> * on()
</span><span class="cx"> *
</span><span class="lines">@@ -135,30 +136,68 @@
</span><span class="cx"> * @param string mode Optional. Switch to the given mode before opening.
</span><span class="cx"> */
</span><span class="cx"> api.on = function() {
</span><del>- if ( s.visible )
</del><ins>+ var id, $dfwWrap, editor, titleId;
+
+ if ( s.visible ) {
</ins><span class="cx"> return;
</span><ins>+ }
</ins><span class="cx">
</span><ins>+ if ( ! s.$fullscreenFader ) {
+ api.ui.init();
+ }
+
</ins><span class="cx"> // Settings can be added or changed by defining "wp_fullscreen_settings" JS object.
</span><del>- if ( typeof(wp_fullscreen_settings) == 'object' )
- $.extend( s, wp_fullscreen_settings );
</del><ins>+ if ( typeof window.wp_fullscreen_settings === 'object' )
+ $.extend( s, window.wp_fullscreen_settings );
</ins><span class="cx">
</span><del>- s.editor_id = wpActiveEditor || 'content';
</del><ins>+ id = s.id || window.wpActiveEditor;
</ins><span class="cx">
</span><del>- if ( $('input#title').length && s.editor_id == 'content' )
- s.title_id = 'title';
- else if ( $('input#' + s.editor_id + '-title').length ) // the title input field should have [editor_id]-title HTML ID to be auto detected
- s.title_id = s.editor_id + '-title';
- else
- $('#wp-fullscreen-title, #wp-fullscreen-title-prompt-text').hide();
</del><ins>+ if ( ! id ) {
+ if ( s.hasTinymce ) {
+ id = tinymce.activeEditor.id;
+ } else {
+ return;
+ }
+ }
</ins><span class="cx">
</span><del>- s.mode = $('#' + s.editor_id).is(':hidden') ? 'tinymce' : 'html';
- s.qt_canvas = $('#' + s.editor_id).get(0);
</del><ins>+ s.id = id;
+ $dfwWrap = s.$dfwWrap = $( '#wp-' + id + '-wrap' );
</ins><span class="cx">
</span><del>- if ( ! s.element )
- api.ui.init();
</del><ins>+ if ( ! $dfwWrap.length ) {
+ return;
+ }
</ins><span class="cx">
</span><del>- s.is_mce_on = s.has_tinymce && typeof( tinymce.get(s.editor_id) ) != 'undefined';
</del><ins>+ s.$dfwTextarea = $( '#' + id );
+ s.$editorContainer = $dfwWrap.find( '.wp-editor-container' );
+ uiScrollTop = $document.scrollTop();
</ins><span class="cx">
</span><ins>+ if ( s.hasTinymce ) {
+ s.editor = tinymce.get( id );
+ }
+
+ if ( s.editor && ! s.editor.isHidden() ) {
+ s.origHeight = $( '#' + id + '_ifr' ).height();
+ s.mode = 'tinymce';
+ } else {
+ s.origHeight = s.$dfwTextarea.height();
+ s.mode = 'html';
+ }
+
+ // Try to find title field
+ if ( typeof window.adminpage !== 'undefined' &&
+ ( window.adminpage === 'post-php' || window.adminpage === 'post-new-php' ) ) {
+
+ titleId = 'title';
+ } else {
+ titleId = id + '-title';
+ }
+
+ s.$dfwTitle = $( '#' + titleId );
+
+ if ( ! s.$dfwTitle.length ) {
+ s.$dfwTitle = null;
+ }
+
</ins><span class="cx"> api.ui.fade( 'show', 'showing', 'shown' );
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -187,17 +226,33 @@
</span><span class="cx"> api.switchmode = function( to ) {
</span><span class="cx"> var from = s.mode;
</span><span class="cx">
</span><del>- if ( ! to || ! s.visible || ! s.has_tinymce )
</del><ins>+ if ( ! to || ! s.visible || ! s.hasTinymce || typeof switchEditors === 'undefined' ) {
</ins><span class="cx"> return from;
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> // Don't switch if the mode is the same.
</span><span class="cx"> if ( from == to )
</span><span class="cx"> return from;
</span><span class="cx">
</span><del>- ps.publish( 'switchMode', [ from, to ] );
</del><ins>+ if ( to === 'tinymce' && ! s.editor ) {
+ s.editor = tinymce.get( s.id );
+
+ if ( ! s.editor && typeof tinyMCEPreInit !== 'undefined' &&
+ tinyMCEPreInit.mceInit && tinyMCEPreInit.mceInit[ s.id ] ) {
+
+ // If the TinyMCE instance hasn't been created, set the "wp_fulscreen" flag on creating it
+ tinyMCEPreInit.mceInit[ s.id ].wp_fullscreen = true;
+ }
+ }
+
</ins><span class="cx"> s.mode = to;
</span><del>- ps.publish( 'switchedMode', [ from, to ] );
</del><ins>+ switchEditors.go( s.id, to );
+ api.refreshButtons( true );
</ins><span class="cx">
</span><ins>+ if ( to === 'html' ) {
+ setTimeout( api.resizeTextarea, 200 );
+ }
+
</ins><span class="cx"> return to;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -206,309 +261,190 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> api.save = function() {
</span><del>- var hidden = $('#hiddenaction'), old = hidden.val(), spinner = $('#wp-fullscreen-save .spinner'),
- message = $('#wp-fullscreen-save span');
</del><ins>+ var $hidden = $('#hiddenaction'),
+ oldVal = $hidden.val(),
+ $spinner = $('#wp-fullscreen-save .spinner'),
+ $saveMessage = $('#wp-fullscreen-save .wp-fullscreen-saved-message')
+ $errorMessage = $('#wp-fullscreen-save .wp-fullscreen-error-message');
</ins><span class="cx">
</span><del>- spinner.show();
- api.savecontent();
</del><ins>+ $spinner.show();
+ $errorMessage.hide();
+ $hidden.val('wp-fullscreen-save-post');
</ins><span class="cx">
</span><del>- hidden.val('wp-fullscreen-save-post');
</del><ins>+ if ( s.editor && ! s.editor.isHidden() ) {
+ s.editor.save();
+ }
</ins><span class="cx">
</span><del>- $.post( ajaxurl, $('form#post').serialize(), function(r){
- spinner.hide();
- message.show();
</del><ins>+ $.ajax({
+ url: window.ajaxurl,
+ type: 'post',
+ data: $('form#post').serialize(),
+ dataType: 'json'
+ }).done( function( response ) {
+ $spinner.hide();
</ins><span class="cx">
</span><del>- setTimeout( function(){
- message.fadeOut(1000);
- }, 3000 );
</del><ins>+ if ( response && response.success ) {
+ $saveMessage.show();
</ins><span class="cx">
</span><del>- if ( r.last_edited )
- $('#wp-fullscreen-save input').attr( 'title', r.last_edited );
</del><ins>+ setTimeout( function() {
+ $saveMessage.fadeOut(300);
+ }, 3000 );
</ins><span class="cx">
</span><del>- }, 'json');
</del><ins>+ if ( response.data && response.data.last_edited ) {
+ $('#wp-fullscreen-save input').attr( 'title', response.data.last_edited );
+ }
+ } else {
+ $errorMessage.show();
+ }
+ }).fail( function() {
+ $spinner.hide();
+ $errorMessage.show();
+ });
</ins><span class="cx">
</span><del>- hidden.val(old);
</del><ins>+ $hidden.val( oldVal );
</ins><span class="cx"> };
</span><span class="cx">
</span><del>- api.savecontent = function() {
- var ed, content;
</del><ins>+ api.dfwWidth = function( pixels, total ) {
+ var width;
</ins><span class="cx">
</span><del>- if ( s.title_id )
- $('#' + s.title_id).val( $('#wp-fullscreen-title').val() );
</del><ins>+ if ( ! pixels ) {
+ // reset to theme width
+ width = $('#wp-fullscreen-body').data('theme-width') || 800;
+ s.$editorContainer.width( width );
</ins><span class="cx">
</span><del>- if ( s.mode === 'tinymce' && (ed = tinymce.get('wp_mce_fullscreen')) ) {
- content = ed.save();
- } else {
- content = $('#wp_mce_fullscreen').val();
- }
</del><ins>+ if ( s.$dfwTitle ) {
+ s.$dfwTitle.width( width - 16 );
+ }
</ins><span class="cx">
</span><del>- $('#' + s.editor_id).val( content );
- $(document).triggerHandler('wpcountwords', [ content ]);
- };
-
- set_title_hint = function( title ) {
- if ( ! title.val().length )
- title.siblings('label').css( 'visibility', '' );
- else
- title.siblings('label').css( 'visibility', 'hidden' );
- };
-
- api.dfw_width = function(n) {
- var el = $('#wp-fullscreen-wrap'), w = el.width();
-
- if ( !n ) { // reset to theme width
- el.width( $('#wp-fullscreen-central-toolbar').width() );
</del><span class="cx"> deleteUserSetting('dfw_width');
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- w = n + w;
</del><ins>+ if ( total ) {
+ width = pixels;
+ } else {
+ width = s.$editorContainer.width();
+ width += pixels;
+ }
</ins><span class="cx">
</span><del>- if ( w < 200 || w > 1200 ) // sanity check
</del><ins>+ if ( width < 200 || width > 1200 ) {
+ // sanity check
</ins><span class="cx"> return;
</span><ins>+ }
</ins><span class="cx">
</span><del>- el.width( w );
- setUserSetting('dfw_width', w);
</del><ins>+ s.$editorContainer.width( width );
+
+ if ( s.$dfwTitle ) {
+ s.$dfwTitle.width( width - 16 );
+ }
+
+ setUserSetting( 'dfw_width', width );
</ins><span class="cx"> };
</span><span class="cx">
</span><del>- ps.subscribe( 'showToolbar', function() {
- s.toolbars.removeClass('fade-1000').addClass('fade-300');
- api.fade.In( s.toolbars, 300, function(){ ps.publish('toolbarShown'); }, true );
- $('#wp-fullscreen-body').addClass('wp-fullscreen-focus');
- s.toolbar_shown = true;
- });
</del><ins>+ // This event occurs before the overlay blocks the UI.
+ ps.subscribe( 'show', function() {
+ var title = $('#last-edit').text();
</ins><span class="cx">
</span><del>- ps.subscribe( 'hideToolbar', function() {
- s.toolbars.removeClass('fade-300').addClass('fade-1000');
- api.fade.Out( s.toolbars, 1000, function(){ ps.publish('toolbarHidden'); }, true );
- $('#wp-fullscreen-body').removeClass('wp-fullscreen-focus');
</del><ins>+ if ( title ) {
+ $('#wp-fullscreen-save input').attr( 'title', title );
+ }
</ins><span class="cx"> });
</span><span class="cx">
</span><del>- ps.subscribe( 'toolbarShown', function() {
- s.toolbars.removeClass('fade-300');
- });
</del><ins>+ // This event occurs while the overlay blocks the UI.
+ ps.subscribe( 'showing', function() {
+ $body.addClass( 'wp-fullscreen-active' );
</ins><span class="cx">
</span><del>- ps.subscribe( 'toolbarHidden', function() {
- s.toolbars.removeClass('fade-1000');
- s.toolbar_shown = false;
- });
</del><ins>+ s.$dfwWrap.addClass( 'wp-fullscreen-wrap' );
+ s.$editorContainer.append( $('#wp-fullscreen-status') );
</ins><span class="cx">
</span><del>- ps.subscribe( 'show', function() { // This event occurs before the overlay blocks the UI.
- var title;
-
- if ( s.title_id ) {
- title = $('#wp-fullscreen-title').val( $('#' + s.title_id).val() );
- set_title_hint( title );
</del><ins>+ if ( s.$dfwTitle ) {
+ s.$dfwTitle.after( '<span id="wp-fullscreen-title-placeholder">' );
+ s.$dfwWrap.prepend( s.$dfwTitle.addClass('wp-fullscreen-title') );
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- $('#wp-fullscreen-save input').attr( 'title', $('#last-edit').text() );
</del><ins>+ api.refreshButtons();
+ resetCssPosition( true );
+ $('#wpadminbar').hide();
</ins><span class="cx">
</span><del>- s.textarea_obj.value = s.qt_canvas.value;
</del><ins>+ // Show the UI for 2 sec. when opening
+ toggleUI('hide');
</ins><span class="cx">
</span><del>- if ( s.has_tinymce && s.mode === 'tinymce' )
- tinymce.execCommand('wpFullScreenInit');
</del><ins>+ api.bind_resize();
</ins><span class="cx">
</span><del>- s.orig_y = $(window).scrollTop();
- });
</del><ins>+ if ( s.editor ) {
+ s.editor.execCommand( 'wpFullScreenOn' );
+ }
</ins><span class="cx">
</span><del>- ps.subscribe( 'showing', function() { // This event occurs while the DFW overlay blocks the UI.
- $( document.body ).addClass( 'fullscreen-active' );
- api.refresh_buttons();
</del><ins>+ api.dfwWidth( $( '#wp-fullscreen-body' ).data('dfw-width') || 800, true );
</ins><span class="cx">
</span><del>- $( document ).bind( 'mousemove.fullscreen', function(e) { bounder( 'showToolbar', 'hideToolbar', 2000, e ); } );
- bounder( 'showToolbar', 'hideToolbar', 2000 );
-
- api.bind_resize();
- setTimeout( api.resize_textarea, 200 );
-
</del><span class="cx"> // scroll to top so the user is not disoriented
</span><span class="cx"> scrollTo(0, 0);
</span><del>-
- // needed it for IE7 and compat mode
- $('#wpadminbar').hide();
</del><span class="cx"> });
</span><span class="cx">
</span><del>- ps.subscribe( 'shown', function() { // This event occurs after the DFW overlay is shown
- var interim_init;
-
</del><ins>+ // This event occurs after the overlay unblocks the UI
+ ps.subscribe( 'shown', function() {
</ins><span class="cx"> s.visible = true;
</span><span class="cx">
</span><del>- // init the standard TinyMCE instance if missing
- if ( s.has_tinymce && ! s.is_mce_on ) {
-
- interim_init = function(mce, ed) {
- var el = ed.getElement(), old_val = el.value, settings = tinyMCEPreInit.mceInit[s.editor_id];
-
- if ( settings && settings.wpautop && typeof(switchEditors) != 'undefined' )
- el.value = switchEditors.wpautop( el.value );
-
- ed.onInit.add(function(ed) {
- ed.hide();
- ed.getElement().value = old_val;
- tinymce.onAddEditor.remove(interim_init);
- });
- };
-
- tinymce.onAddEditor.add(interim_init);
- tinymce.init(tinyMCEPreInit.mceInit[s.editor_id]);
-
- s.is_mce_on = true;
</del><ins>+ if ( s.editor && ! s.editor.isHidden() ) {
+ s.editor.execCommand( 'wpAutoResize' );
+ } else {
+ api.resizeTextarea( 'force' );
</ins><span class="cx"> }
</span><del>-
- wpActiveEditor = 'wp_mce_fullscreen';
</del><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> ps.subscribe( 'hide', function() { // This event occurs before the overlay blocks DFW.
</span><del>- var htmled_is_hidden = $('#' + s.editor_id).is(':hidden');
- // Make sure the correct editor is displaying.
- if ( s.has_tinymce && s.mode === 'tinymce' && !htmled_is_hidden ) {
- switchEditors.go(s.editor_id, 'tmce');
- } else if ( s.mode === 'html' && htmled_is_hidden ) {
- switchEditors.go(s.editor_id, 'html');
- }
</del><ins>+ $document.unbind( '.fullscreen' );
+ s.$dfwTextarea.unbind('.wp-dfw-resize');
+ });
</ins><span class="cx">
</span><del>- // Save content must be after switchEditors or content will be overwritten. See #17229.
- api.savecontent();
</del><ins>+ ps.subscribe( 'hiding', function() { // This event occurs while the overlay blocks the DFW UI.
+ $body.removeClass( 'wp-fullscreen-active' );
+ $( '#wp-fullscreen-body' ).append( $('#wp-fullscreen-status') );
</ins><span class="cx">
</span><del>- $( document ).unbind( '.fullscreen' );
- $(s.textarea_obj).unbind('.grow');
</del><ins>+ if ( s.$dfwTitle ) {
+ $( '#wp-fullscreen-title-placeholder' ).before( s.$dfwTitle.removeClass('wp-fullscreen-title') ).remove();
+ }
</ins><span class="cx">
</span><del>- if ( s.has_tinymce && s.mode === 'tinymce' )
- tinymce.execCommand('wpFullScreenSave');
</del><ins>+ s.$dfwWrap.removeClass( 'wp-fullscreen-wrap' )
+ s.$editorContainer.css( 'width', '' );
+ s.$dfwTextarea.add( '#' + s.id + '_ifr' ).height( s.origHeight );
</ins><span class="cx">
</span><del>- if ( s.title_id )
- set_title_hint( $('#' + s.title_id) );
</del><ins>+ if ( s.editor ) {
+ s.editor.execCommand( 'wpFullScreenOff' );
+ }
</ins><span class="cx">
</span><del>- s.qt_canvas.value = s.textarea_obj.value;
- });
</del><ins>+ resetCssPosition( false );
</ins><span class="cx">
</span><del>- ps.subscribe( 'hiding', function() { // This event occurs while the overlay blocks the DFW UI.
-
- $( document.body ).removeClass( 'fullscreen-active' );
- scrollTo(0, s.orig_y);
</del><ins>+ window.scrollTo( 0, uiScrollTop );
</ins><span class="cx"> $('#wpadminbar').show();
</span><span class="cx"> });
</span><span class="cx">
</span><del>- ps.subscribe( 'hidden', function() { // This event occurs after DFW is removed.
</del><ins>+ // This event occurs after DFW is removed.
+ ps.subscribe( 'hidden', function() {
</ins><span class="cx"> s.visible = false;
</span><del>- $('#wp_mce_fullscreen, #wp-fullscreen-title').removeAttr('style');
-
- if ( s.has_tinymce && s.is_mce_on )
- tinymce.execCommand('wpFullScreenClose');
-
- s.textarea_obj.value = '';
- api.oldheight = 0;
- wpActiveEditor = s.editor_id;
</del><span class="cx"> });
</span><span class="cx">
</span><del>- ps.subscribe( 'switchMode', function( from, to ) {
- var ed;
-
- if ( !s.has_tinymce || !s.is_mce_on )
- return;
-
- ed = tinymce.get('wp_mce_fullscreen');
-
- if ( from === 'html' && to === 'tinymce' ) {
-
- if ( tinymce.get(s.editor_id).getParam('wpautop') && typeof(switchEditors) != 'undefined' )
- s.textarea_obj.value = switchEditors.wpautop( s.textarea_obj.value );
-
- if ( 'undefined' == typeof(ed) )
- tinymce.execCommand('wpFullScreenInit');
- else
- ed.show();
-
- } else if ( from === 'tinymce' && to === 'html' ) {
- if ( ed )
- ed.hide();
- }
- });
-
- ps.subscribe( 'switchedMode', function( from, to ) {
- api.refresh_buttons(true);
-
- if ( to === 'html' )
- setTimeout( api.resize_textarea, 200 );
- });
-
- /**
- * Buttons
- */
- api.b = function() {
- if ( s.has_tinymce && 'tinymce' === s.mode )
- tinymce.execCommand('Bold');
- };
-
- api.i = function() {
- if ( s.has_tinymce && 'tinymce' === s.mode )
- tinymce.execCommand('Italic');
- };
-
- api.ul = function() {
- if ( s.has_tinymce && 'tinymce' === s.mode )
- tinymce.execCommand('InsertUnorderedList');
- };
-
- api.ol = function() {
- if ( s.has_tinymce && 'tinymce' === s.mode )
- tinymce.execCommand('InsertOrderedList');
- };
-
- api.link = function() {
- if ( s.has_tinymce && 'tinymce' === s.mode )
- tinymce.execCommand('WP_Link');
- else
- wpLink.open();
- };
-
- api.unlink = function() {
- if ( s.has_tinymce && 'tinymce' === s.mode )
- tinymce.execCommand('unlink');
- };
-
- api.atd = function() {
- if ( s.has_tinymce && 'tinymce' === s.mode )
- tinymce.execCommand('mceWritingImprovementTool');
- };
-
- api.help = function() {
- if ( s.has_tinymce && 'tinymce' === s.mode )
- tinymce.execCommand('WP_Help');
- };
-
- api.blockquote = function() {
- if ( s.has_tinymce && 'tinymce' === s.mode )
- tinymce.execCommand('mceBlockQuote');
- };
-
- api.medialib = function() {
- if ( typeof wp !== 'undefined' && wp.media && wp.media.editor )
- wp.media.editor.open(s.editor_id);
- };
-
- api.refresh_buttons = function( fade ) {
- fade = fade || false;
-
</del><ins>+ api.refreshButtons = function( fade ) {
</ins><span class="cx"> if ( s.mode === 'html' ) {
</span><span class="cx"> $('#wp-fullscreen-mode-bar').removeClass('wp-tmce-mode').addClass('wp-html-mode');
</span><span class="cx">
</span><del>- if ( fade )
</del><ins>+ if ( fade ) {
</ins><span class="cx"> $('#wp-fullscreen-button-bar').fadeOut( 150, function(){
</span><span class="cx"> $(this).addClass('wp-html-mode').fadeIn( 150 );
</span><span class="cx"> });
</span><del>- else
</del><ins>+ } else {
</ins><span class="cx"> $('#wp-fullscreen-button-bar').addClass('wp-html-mode');
</span><del>-
</del><ins>+ }
</ins><span class="cx"> } else if ( s.mode === 'tinymce' ) {
</span><span class="cx"> $('#wp-fullscreen-mode-bar').removeClass('wp-html-mode').addClass('wp-tmce-mode');
</span><span class="cx">
</span><del>- if ( fade )
</del><ins>+ if ( fade ) {
</ins><span class="cx"> $('#wp-fullscreen-button-bar').fadeOut( 150, function(){
</span><span class="cx"> $(this).removeClass('wp-html-mode').fadeIn( 150 );
</span><span class="cx"> });
</span><del>- else
</del><ins>+ } else {
</ins><span class="cx"> $('#wp-fullscreen-button-bar').removeClass('wp-html-mode');
</span><ins>+ }
</ins><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -519,29 +455,27 @@
</span><span class="cx"> */
</span><span class="cx"> api.ui = {
</span><span class="cx"> init: function() {
</span><del>- var topbar = $('#fullscreen-topbar'), txtarea = $('#wp_mce_fullscreen'), last = 0;
</del><ins>+ var toolbar, last = 0;
</ins><span class="cx">
</span><del>- s.toolbars = topbar.add( $('#wp-fullscreen-status') );
- s.element = $('#fullscreen-fader');
- s.textarea_obj = txtarea[0];
- s.has_tinymce = typeof(tinymce) != 'undefined';
</del><ins>+ s.toolbar = toolbar = $('#fullscreen-topbar');
+ s.$fullscreenFader = $('#fullscreen-fader');
+ s.hasTinymce = typeof tinymce !== 'undefined';
</ins><span class="cx">
</span><del>- if ( !s.has_tinymce )
</del><ins>+ if ( ! s.hasTinymce )
</ins><span class="cx"> $('#wp-fullscreen-mode-bar').hide();
</span><span class="cx">
</span><del>- if ( wptitlehint && $('#wp-fullscreen-title').length )
- wptitlehint('wp-fullscreen-title');
-
- $(document).keyup(function(e){
</del><ins>+ $document.keyup( function(e) {
</ins><span class="cx"> var c = e.keyCode || e.charCode, a, data;
</span><span class="cx">
</span><del>- if ( !fullscreen.settings.visible )
- return true;
</del><ins>+ if ( ! s.visible ) {
+ return;
+ }
</ins><span class="cx">
</span><del>- if ( navigator.platform && navigator.platform.indexOf('Mac') != -1 )
</del><ins>+ if ( navigator.platform && navigator.platform.indexOf('Mac') !== -1 ) {
</ins><span class="cx"> a = e.ctrlKey; // Ctrl key for Mac
</span><del>- else
</del><ins>+ } else {
</ins><span class="cx"> a = e.altKey; // Alt key for Win & Linux
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> if ( 27 == c ) { // Esc
</span><span class="cx"> data = {
</span><span class="lines">@@ -555,79 +489,102 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>- if ( ! jQuery(document).triggerHandler( 'wp_CloseOnEscape', [data] ) )
</del><ins>+ if ( ! $(document).triggerHandler( 'wp_CloseOnEscape', [data] ) ) {
</ins><span class="cx"> fullscreen.off();
</span><ins>+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ( a && (61 == c || 107 == c || 187 == c) ) { // +
</span><del>- api.dfw_width(25);
</del><ins>+ api.dfwWidth( 25 );
</ins><span class="cx"> e.preventDefault();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ( a && (45 == c || 109 == c || 189 == c) ) { // -
</span><del>- api.dfw_width(-25);
</del><ins>+ api.dfwWidth( -25 );
</ins><span class="cx"> e.preventDefault();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ( a && 48 == c ) { // 0
</span><del>- api.dfw_width(0);
</del><ins>+ api.dfwWidth( 0 );
</ins><span class="cx"> e.preventDefault();
</span><span class="cx"> }
</span><span class="cx"> });
</span><span class="cx">
</span><del>- // word count in Text mode
- if ( typeof(wpWordCount) != 'undefined' ) {
</del><ins>+ toolbar.on( 'mouseenter', function() {
+ toggleUI('show');
+ }).on( 'mouseleave', function() {
+ toggleUI('hide');
+ });
</ins><span class="cx">
</span><del>- txtarea.keyup( function(e) {
- var k = e.keyCode || e.charCode;
</del><ins>+ // Bind buttons
+ $('#wp-fullscreen-buttons').on( 'click.wp-fullscreen', function( event ) {
+ var command = event.target.id && event.target.id.substr(6);
</ins><span class="cx">
</span><del>- if ( k == last )
- return true;
</del><ins>+ if ( s.editor && 'tinymce' === s.mode ) {
+ switch( command ) {
+ case 'bold':
+ s.editor.execCommand('Bold');
+ break;
+ case 'italic':
+ s.editor.execCommand('Italic');
+ break;
+ case 'bullist':
+ s.editor.execCommand('InsertUnorderedList');
+ break;
+ case 'numlist':
+ s.editor.execCommand('InsertOrderedList');
+ break;
+ case 'link':
+ s.editor.execCommand('WP_Link');
+ break;
+ case 'unlink':
+ s.editor.execCommand('unlink');
+ break;
+ case 'image':
+ s.editor.execCommand('mceImage');
+ break;
+ case 'help':
+ s.editor.execCommand('WP_Help');
+ break;
+ case 'blockquote':
+ s.editor.execCommand('mceBlockQuote');
+ break;
+ }
+ } else if ( command === 'link' && window.wpLink ) {
+ window.wpLink.open();
+ }
</ins><span class="cx">
</span><del>- if ( 13 == k || 8 == last || 46 == last )
- $(document).triggerHandler('wpcountwords', [ txtarea.val() ]);
-
- last = k;
- return true;
- });
- }
-
- topbar.mouseenter(function(){
- s.toolbars.addClass('fullscreen-make-sticky');
- $( document ).unbind( '.fullscreen' );
- clearTimeout( s.timer );
- s.timer = 0;
- }).mouseleave(function(){
- s.toolbars.removeClass('fullscreen-make-sticky');
-
- if ( s.visible )
- $( document ).bind( 'mousemove.fullscreen', function(e) { bounder( 'showToolbar', 'hideToolbar', 2000, e ); } );
</del><ins>+ if ( command === 'wp-media-library' && typeof wp !== 'undefined' && wp.media && wp.media.editor ) {
+ wp.media.editor.open( s.id );
+ }
</ins><span class="cx"> });
</span><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> fade: function( before, during, after ) {
</span><del>- if ( ! s.element )
</del><ins>+ if ( ! s.$fullscreenFader ) {
</ins><span class="cx"> api.ui.init();
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> // If any callback bound to before returns false, bail.
</span><del>- if ( before && ! ps.publish( before ) )
</del><ins>+ if ( before && ! ps.publish( before ) ) {
</ins><span class="cx"> return;
</span><ins>+ }
</ins><span class="cx">
</span><del>- api.fade.In( s.element, 600, function() {
- if ( during )
</del><ins>+ api.fade.In( s.$fullscreenFader, 200, function() {
+ if ( during ) {
</ins><span class="cx"> ps.publish( during );
</span><ins>+ }
</ins><span class="cx">
</span><del>- api.fade.Out( s.element, 600, function() {
- if ( after )
</del><ins>+ api.fade.Out( s.$fullscreenFader, 200, function() {
+ if ( after ) {
</ins><span class="cx"> ps.publish( after );
</span><ins>+ }
</ins><span class="cx"> });
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> api.fade = {
</span><del>- transitionend: 'transitionend webkitTransitionEnd oTransitionEnd',
-
</del><span class="cx"> // Sensitivity to allow browsers to render the blank element before animating.
</span><span class="cx"> sensitivity: 100,
</span><span class="cx">
</span><span class="lines">@@ -644,19 +601,22 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> element.show();
</span><del>- element.first().one( this.transitionend, function() {
</del><ins>+ element.first().one( transitionend, function() {
</ins><span class="cx"> callback();
</span><span class="cx"> });
</span><ins>+
</ins><span class="cx"> setTimeout( function() { element.addClass( 'fade-trigger' ); }, this.sensitivity );
</span><span class="cx"> } else {
</span><del>- if ( stop )
</del><ins>+ if ( stop ) {
</ins><span class="cx"> element.stop();
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> element.css( 'opacity', 1 );
</span><span class="cx"> element.first().fadeIn( speed, callback );
</span><span class="cx">
</span><del>- if ( element.length > 1 )
</del><ins>+ if ( element.length > 1 ) {
</ins><span class="cx"> element.not(':first').fadeIn( speed );
</span><ins>+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return element;
</span><span class="lines">@@ -668,38 +628,43 @@
</span><span class="cx"> speed = speed || 400;
</span><span class="cx"> stop = stop || false;
</span><span class="cx">
</span><del>- if ( ! element.is(':visible') )
</del><ins>+ if ( ! element.is(':visible') ) {
</ins><span class="cx"> return element;
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> if ( api.fade.transitions ) {
</span><del>- element.first().one( api.fade.transitionend, function() {
- if ( element.hasClass('fade-trigger') )
</del><ins>+ element.first().one( transitionend, function() {
+ if ( element.hasClass('fade-trigger') ) {
</ins><span class="cx"> return;
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> element.hide();
</span><span class="cx"> callback();
</span><span class="cx"> });
</span><span class="cx"> setTimeout( function() { element.removeClass( 'fade-trigger' ); }, this.sensitivity );
</span><span class="cx"> } else {
</span><del>- if ( stop )
</del><ins>+ if ( stop ) {
</ins><span class="cx"> element.stop();
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> element.first().fadeOut( speed, callback );
</span><span class="cx">
</span><del>- if ( element.length > 1 )
</del><ins>+ if ( element.length > 1 ) {
</ins><span class="cx"> element.not(':first').fadeOut( speed );
</span><ins>+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return element;
</span><span class="cx"> },
</span><span class="cx">
</span><del>- transitions: (function() { // Check if the browser supports CSS 3.0 transitions
- var s = document.documentElement.style;
</del><ins>+ // Check if the browser supports CSS 3.0 transitions
+ transitions: ( function() {
+ var style = document.documentElement.style;
</ins><span class="cx">
</span><del>- return ( typeof ( s.WebkitTransition ) == 'string' ||
- typeof ( s.MozTransition ) == 'string' ||
- typeof ( s.OTransition ) == 'string' ||
- typeof ( s.transition ) == 'string' );
</del><ins>+ return ( typeof style.WebkitTransition === 'string' ||
+ typeof style.MozTransition === 'string' ||
+ typeof style.OTransition === 'string' ||
+ typeof style.transition === 'string' );
</ins><span class="cx"> })()
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -708,23 +673,23 @@
</span><span class="cx"> *
</span><span class="cx"> * Automatically updates textarea height.
</span><span class="cx"> */
</span><del>-
</del><span class="cx"> api.bind_resize = function() {
</span><del>- $(s.textarea_obj).bind('keypress.grow click.grow paste.grow', function(){
- setTimeout( api.resize_textarea, 200 );
</del><ins>+ s.$dfwTextarea.on( 'keydown.wp-dfw-resize click.wp-dfw-resize paste.wp-dfw-resize', function(e) {
+ api.resizeTextarea(e);
</ins><span class="cx"> });
</span><span class="cx"> };
</span><span class="cx">
</span><del>- api.oldheight = 0;
- api.resize_textarea = function() {
- var txt = s.textarea_obj, newheight;
</del><ins>+ api.resizeTextarea = function( event ) {
+ var node = s.$dfwTextarea[0];
</ins><span class="cx">
</span><del>- newheight = txt.scrollHeight > 300 ? txt.scrollHeight : 300;
-
- if ( newheight != api.oldheight ) {
- txt.style.height = newheight + 'px';
- api.oldheight = newheight;
</del><ins>+ if ( node.scrollHeight > node.clientHeight ) {
+ node.style.height = node.scrollHeight + 50 + 'px';
</ins><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-})(jQuery);
</del><ins>+ // Export
+ window.wp = window.wp || {};
+ window.wp.editor = window.wp.editor || {};
+ window.wp.editor.fullscreen = api;
+
+})( jQuery, window );
</ins></span></pre></div>
<a id="trunksrcwpincludesclasswpeditorphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/class-wp-editor.php (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/class-wp-editor.php 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/class-wp-editor.php 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -189,46 +189,71 @@
</span><span class="cx">
</span><span class="cx"> if ( self::$this_tinymce ) {
</span><span class="cx">
</span><del>- if ( empty(self::$first_init) ) {
- self::$baseurl = includes_url('js/tinymce');
- self::$mce_locale = $mce_locale = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) ); // only ISO 639-1
</del><ins>+ if ( empty( self::$first_init ) ) {
+ self::$baseurl = includes_url( 'js/tinymce' );
+ $mce_locale = get_locale();
+
+ if ( empty( $mce_locale ) || 'en' == substr( $mce_locale, 0, 2 ) ) {
+ $mce_locale = 'en';
+ }
+
+ self::$mce_locale = $mce_locale;
</ins><span class="cx"> $no_captions = (bool) apply_filters( 'disable_captions', '' );
</span><del>- $plugins = array( 'inlinepopups', 'tabfocus', 'paste', 'media', 'fullscreen', 'wordpress', 'wpeditimage', 'wpgallery', 'wplink', 'wpdialogs' );
</del><span class="cx"> $first_run = true;
</span><span class="cx"> $ext_plugins = '';
</span><span class="cx">
</span><span class="cx"> if ( $set['teeny'] ) {
</span><del>- self::$plugins = $plugins = apply_filters( 'teeny_mce_plugins', array('inlinepopups', 'fullscreen', 'wordpress', 'wplink', 'wpdialogs' ), $editor_id );
</del><ins>+ self::$plugins = $plugins = apply_filters( 'teeny_mce_plugins', array( 'fullscreen', 'link', 'image', 'wordpress', 'wplink' ), $editor_id );
</ins><span class="cx"> } else {
</span><del>- /*
- The following filter takes an associative array of external plugins for TinyMCE in the form 'plugin_name' => 'url'.
- It adds the plugin's name to TinyMCE's plugins init and the call to PluginManager to load the plugin.
- The url should be absolute and should include the js file name to be loaded. Example:
- array( 'myplugin' => 'http://my-site.com/wp-content/plugins/myfolder/mce_plugin.js' )
- If the plugin uses a button, it should be added with one of the "$mce_buttons" filters.
- */
- $mce_external_plugins = apply_filters('mce_external_plugins', array());
</del><ins>+ /**
+ * TinyMCE external plugins filter
+ *
+ * Takes an associative array of external plugins for TinyMCE in the form 'plugin_name' => 'url'.
+ * The url should be absolute and should include the js file name to be loaded.
+ * Example: 'myplugin' => 'http://my-site.com/wp-content/plugins/myfolder/mce_plugin.js'.
+ * If the plugin adds a button, it should be added with one of the "$mce_buttons" filters.
+ */
+ $mce_external_plugins = apply_filters( 'mce_external_plugins', array() );
</ins><span class="cx">
</span><del>- if ( ! empty($mce_external_plugins) ) {
</del><ins>+ /**
+ * TinyMCE default plugins filter
+ *
+ * Specifies which of the default plugins that are included in WordPress should be added to
+ * the TinyMCE instance.
+ */
+ $plugins = array_unique( apply_filters( 'tiny_mce_plugins', array(
+ 'charmap',
+ 'link',
+ 'media',
+ 'paste',
+ 'tabfocus',
+ 'textcolor',
+ 'image',
+ 'fullscreen',
+ 'wordpress',
+ 'wpeditimage',
+ 'wpgallery',
+ 'wplink',
+ ) ) );
</ins><span class="cx">
</span><del>- /*
- The following filter loads external language files for TinyMCE plugins.
- It takes an associative array 'plugin_name' => 'path', where path is the
- include path to the file. The language file should follow the same format as
- /tinymce/langs/wp-langs.php and should define a variable $strings that
- holds all translated strings.
- When this filter is not used, the function will try to load {mce_locale}.js.
- If that is not found, en.js will be tried next.
- */
- $mce_external_languages = apply_filters('mce_external_languages', array());
</del><ins>+ if ( ! empty( $mce_external_plugins ) ) {
+ /**
+ * This filter loads translations for external TinyMCE 3.x plugins.
+ *
+ * Takes an associative array 'plugin_name' => 'path', where path is the
+ * include path to the file. The language file should follow the same format as
+ * wp_mce_translation() and should define a variable $strings that
+ * holds all translated strings.
+ */
+ $mce_external_languages = apply_filters( 'mce_external_languages', array() );
</ins><span class="cx">
</span><span class="cx"> $loaded_langs = array();
</span><span class="cx"> $strings = '';
</span><span class="cx">
</span><del>- if ( ! empty($mce_external_languages) ) {
</del><ins>+ if ( ! empty( $mce_external_languages ) ) {
</ins><span class="cx"> foreach ( $mce_external_languages as $name => $path ) {
</span><del>- if ( @is_file($path) && @is_readable($path) ) {
- include_once($path);
</del><ins>+ if ( @is_file( $path ) && @is_readable( $path ) ) {
+ include_once( $path );
</ins><span class="cx"> $ext_plugins .= $strings . "\n";
</span><span class="cx"> $loaded_langs[] = $name;
</span><span class="cx"> }
</span><span class="lines">@@ -236,48 +261,20 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> foreach ( $mce_external_plugins as $name => $url ) {
</span><ins>+ if ( in_array( $name, $plugins, true ) ) {
+ unset( $mce_external_plugins[ $name ] );
+ continue;
+ }
</ins><span class="cx">
</span><span class="cx"> $url = set_url_scheme( $url );
</span><ins>+ $mce_external_plugins[ $name ] = $url;
+ $plugurl = dirname( $url );
</ins><span class="cx">
</span><del>- $plugins[] = '-' . $name;
-
- $plugurl = dirname($url);
- $strings = $str1 = $str2 = '';
- if ( ! in_array($name, $loaded_langs) ) {
- $path = str_replace( content_url(), '', $plugurl );
- $path = WP_CONTENT_DIR . $path . '/langs/';
-
- if ( function_exists('realpath') )
- $path = trailingslashit( realpath($path) );
-
- if ( @is_file($path . $mce_locale . '.js') )
- $strings .= @file_get_contents($path . $mce_locale . '.js') . "\n";
-
- if ( @is_file($path . $mce_locale . '_dlg.js') )
- $strings .= @file_get_contents($path . $mce_locale . '_dlg.js') . "\n";
-
- if ( 'en' != $mce_locale && empty($strings) ) {
- if ( @is_file($path . 'en.js') ) {
- $str1 = @file_get_contents($path . 'en.js');
- $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ) . "\n";
- }
-
- if ( @is_file($path . 'en_dlg.js') ) {
- $str2 = @file_get_contents($path . 'en_dlg.js');
- $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 ) . "\n";
- }
- }
-
- if ( ! empty($strings) )
- $ext_plugins .= "\n" . $strings . "\n";
</del><ins>+ if ( in_array( $name, $loaded_langs ) ) {
+ $ext_plugins .= 'tinyMCEPreInit.load_ext("' . $plugurl . '", "' . $mce_locale . '");' . "\n";
</ins><span class="cx"> }
</span><del>-
- $ext_plugins .= 'tinyMCEPreInit.load_ext("' . $plugurl . '", "' . $mce_locale . '");' . "\n";
- $ext_plugins .= 'tinymce.PluginManager.load("' . $name . '", "' . $url . '");' . "\n";
</del><span class="cx"> }
</span><span class="cx"> }
</span><del>-
- $plugins = array_unique( apply_filters('tiny_mce_plugins', $plugins) );
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ( $set['dfw'] )
</span><span class="lines">@@ -286,82 +283,61 @@
</span><span class="cx"> self::$plugins = $plugins;
</span><span class="cx"> self::$ext_plugins = $ext_plugins;
</span><span class="cx">
</span><del>- if ( in_array( 'spellchecker', $plugins ) ) {
- /*
- translators: These languages show up in the spellchecker drop-down menu, in the order specified, and with the first
- language listed being the default language. They must be comma-separated and take the format of name=code, where name
- is the language name (which you may internationalize), and code is a valid ISO 639 language code. Please test the
- spellchecker with your values.
- */
- $mce_spellchecker_languages = __( 'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv' );
-
- /*
- The following filter allows localization scripts to change the languages displayed in the spellchecker's drop-down menu.
- By default it uses Google's spellchecker API, but can be configured to use PSpell/ASpell if installed on the server.
- The + sign marks the default language. More: http://www.tinymce.com/wiki.php/Plugin:spellchecker.
- */
- $mce_spellchecker_languages = apply_filters( 'mce_spellchecker_languages', '+' . $mce_spellchecker_languages );
- }
-
</del><span class="cx"> self::$first_init = array(
</span><del>- 'mode' => 'exact',
- 'width' => '100%',
- 'theme' => 'advanced',
- 'skin' => 'wp_theme',
</del><ins>+ 'theme' => 'modern',
+ 'skin' => 'lightgray',
</ins><span class="cx"> 'language' => self::$mce_locale,
</span><del>- 'theme_advanced_toolbar_location' => 'top',
- 'theme_advanced_toolbar_align' => 'left',
- 'theme_advanced_statusbar_location' => 'bottom',
- 'theme_advanced_resizing' => true,
- 'theme_advanced_resize_horizontal' => false,
- 'dialog_type' => 'modal',
</del><ins>+ 'resize' => 'vertical',
</ins><span class="cx"> 'formats' => "{
</span><del>- alignleft : [
- {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}},
- {selector : 'img,table', classes : 'alignleft'}
</del><ins>+ alignleft: [
+ {selector: 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles: {textAlign:'left'}},
+ {selector: 'img,table,dl.wp-caption', classes: 'alignleft'}
</ins><span class="cx"> ],
</span><del>- aligncenter : [
- {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}},
- {selector : 'img,table', classes : 'aligncenter'}
</del><ins>+ aligncenter: [
+ {selector: 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles: {textAlign:'center'}},
+ {selector: 'img,table,dl.wp-caption', classes: 'aligncenter'}
</ins><span class="cx"> ],
</span><del>- alignright : [
- {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}},
- {selector : 'img,table', classes : 'alignright'}
</del><ins>+ alignright: [
+ {selector: 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles: {textAlign:'right'}},
+ {selector: 'img,table,dl.wp-caption', classes: 'alignright'}
</ins><span class="cx"> ],
</span><del>- strikethrough : {inline : 'del'}
</del><ins>+ strikethrough: {inline: 'del'}
</ins><span class="cx"> }",
</span><span class="cx"> 'relative_urls' => false,
</span><span class="cx"> 'remove_script_host' => false,
</span><span class="cx"> 'convert_urls' => false,
</span><del>- 'remove_linebreaks' => true,
- 'gecko_spellcheck' => true,
</del><ins>+ 'browser_spellcheck' => true,
</ins><span class="cx"> 'fix_list_elements' => true,
</span><ins>+ 'entities' => '38,amp,60,lt,62,gt',
+ 'entity_encoding' => 'raw',
+ 'menubar' => false,
+ 'object_resizing' => false,
</ins><span class="cx"> 'keep_styles' => false,
</span><del>- 'entities' => '38,amp,60,lt,62,gt',
- 'accessibility_focus' => true,
- 'media_strict' => false,
</del><span class="cx"> 'paste_remove_styles' => true,
</span><del>- 'paste_remove_spans' => true,
- 'paste_strip_class_attributes' => 'all',
- 'paste_text_use_dialog' => true,
- 'webkit_fake_resize' => false,
- 'preview_styles' => 'font-family font-weight text-decoration text-transform',
- 'schema' => 'html5',
</del><ins>+
+ // limit the preview styles in the menu/toolbar
+ // 'preview_styles' => 'font-family font-weight font-style text-decoration text-transform color background-color border',
+
</ins><span class="cx"> 'wpeditimage_disable_captions' => $no_captions,
</span><del>- 'wp_fullscreen_content_css' => self::$baseurl . '/plugins/wpfullscreen/css/wp-fullscreen.css',
- 'plugins' => implode( ',', $plugins )
</del><ins>+ 'plugins' => implode( ',', $plugins ),
</ins><span class="cx"> );
</span><span class="cx">
</span><del>- if ( in_array( 'spellchecker', $plugins ) ) {
</del><ins>+ if ( ! empty( $mce_external_plugins ) ) {
+ self::$first_init['external_plugins'] = json_encode( $mce_external_plugins );
+ }
+
+ if ( in_array( 'spellchecker', $plugins, true ) ) {
</ins><span class="cx"> self::$first_init['spellchecker_rpc_url'] = self::$baseurl . '/plugins/spellchecker/rpc.php';
</span><del>- self::$first_init['spellchecker_languages'] = $mce_spellchecker_languages;
</del><ins>+ self::$first_init['spellchecker_language'] = self::$mce_locale;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+ // WordPress default stylesheet
+ $mce_css = array( self::$baseurl . '/skins/wordpress/wp-content.css' );
+
</ins><span class="cx"> // load editor_style.css if the current theme supports it
</span><span class="cx"> if ( ! empty( $GLOBALS['editor_styles'] ) && is_array( $GLOBALS['editor_styles'] ) ) {
</span><span class="cx"> $editor_styles = $GLOBALS['editor_styles'];
</span><span class="cx">
</span><del>- $mce_css = array();
</del><span class="cx"> $editor_styles = array_unique( array_filter( $editor_styles ) );
</span><span class="cx"> $style_uri = get_stylesheet_directory_uri();
</span><span class="cx"> $style_dir = get_stylesheet_directory();
</span><span class="lines">@@ -389,24 +365,20 @@
</span><span class="cx"> if ( $file && file_exists( "$style_dir/$file" ) )
</span><span class="cx"> $mce_css[] = "$style_uri/$file";
</span><span class="cx"> }
</span><del>-
- $mce_css = implode( ',', $mce_css );
- } else {
- $mce_css = '';
</del><span class="cx"> }
</span><span class="cx">
</span><del>- $mce_css = trim( apply_filters( 'mce_css', $mce_css ), ' ,' );
</del><ins>+ $mce_css = trim( apply_filters( 'mce_css', implode( ',', $mce_css ) ), ' ,' );
</ins><span class="cx">
</span><span class="cx"> if ( ! empty($mce_css) )
</span><span class="cx"> self::$first_init['content_css'] = $mce_css;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ( $set['teeny'] ) {
</span><del>- $mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id );
</del><ins>+ $mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id );
</ins><span class="cx"> $mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = array();
</span><span class="cx"> } else {
</span><del>- $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'justifyleft', 'justifycenter', 'justifyright', 'link', 'unlink', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id);
- $mce_buttons_2 = apply_filters('mce_buttons_2', array( 'formatselect', 'underline', 'justifyfull', 'forecolor', 'pastetext', 'pasteword', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help' ), $editor_id);
</del><ins>+ $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'alignleft', 'aligncenter', 'alignright', 'image', 'link', 'unlink', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id);
+ $mce_buttons_2 = apply_filters('mce_buttons_2', array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help' ), $editor_id);
</ins><span class="cx"> $mce_buttons_3 = apply_filters('mce_buttons_3', array(), $editor_id);
</span><span class="cx"> $mce_buttons_4 = apply_filters('mce_buttons_4', array(), $editor_id);
</span><span class="cx"> }
</span><span class="lines">@@ -442,40 +414,36 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> $mceInit = array (
</span><del>- 'elements' => $editor_id,
</del><ins>+ 'selector' => "#$editor_id",
</ins><span class="cx"> 'wpautop' => (bool) $set['wpautop'],
</span><del>- 'remove_linebreaks' => (bool) $set['wpautop'],
- 'apply_source_formatting' => (bool) !$set['wpautop'],
- 'theme_advanced_buttons1' => implode($mce_buttons, ','),
- 'theme_advanced_buttons2' => implode($mce_buttons_2, ','),
- 'theme_advanced_buttons3' => implode($mce_buttons_3, ','),
- 'theme_advanced_buttons4' => implode($mce_buttons_4, ','),
</del><ins>+ 'indent' => ! $set['wpautop'],
+ 'toolbar1' => implode($mce_buttons, ','),
+ 'toolbar2' => implode($mce_buttons_2, ','),
+ 'toolbar3' => implode($mce_buttons_3, ','),
+ 'toolbar4' => implode($mce_buttons_4, ','),
</ins><span class="cx"> 'tabfocus_elements' => $set['tabfocus_elements'],
</span><span class="cx"> 'body_class' => $body_class
</span><span class="cx"> );
</span><span class="cx">
</span><del>- // The main editor doesn't use the TinyMCE resizing cookie.
- $mceInit['theme_advanced_resizing_use_cookie'] = 'content' !== $editor_id || empty( $set['editor_height'] );
-
</del><span class="cx"> if ( $first_run )
</span><del>- $mceInit = array_merge(self::$first_init, $mceInit);
</del><ins>+ $mceInit = array_merge( self::$first_init, $mceInit );
</ins><span class="cx">
</span><del>- if ( is_array($set['tinymce']) )
- $mceInit = array_merge($mceInit, $set['tinymce']);
</del><ins>+ if ( is_array( $set['tinymce'] ) )
+ $mceInit = array_merge( $mceInit, $set['tinymce'] );
</ins><span class="cx">
</span><span class="cx"> // For people who really REALLY know what they're doing with TinyMCE
</span><span class="cx"> // You can modify $mceInit to add, remove, change elements of the config before tinyMCE.init
</span><span class="cx"> // Setting "valid_elements", "invalid_elements" and "extended_valid_elements" can be done through this filter.
</span><span class="cx"> // Best is to use the default cleanup by not specifying valid_elements, as TinyMCE contains full set of XHTML 1.0.
</span><span class="cx"> if ( $set['teeny'] ) {
</span><del>- $mceInit = apply_filters('teeny_mce_before_init', $mceInit, $editor_id);
</del><ins>+ $mceInit = apply_filters( 'teeny_mce_before_init', $mceInit, $editor_id );
</ins><span class="cx"> } else {
</span><del>- $mceInit = apply_filters('tiny_mce_before_init', $mceInit, $editor_id);
</del><ins>+ $mceInit = apply_filters( 'tiny_mce_before_init', $mceInit, $editor_id );
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if ( empty($mceInit['theme_advanced_buttons3']) && !empty($mceInit['theme_advanced_buttons4']) ) {
- $mceInit['theme_advanced_buttons3'] = $mceInit['theme_advanced_buttons4'];
- $mceInit['theme_advanced_buttons4'] = '';
</del><ins>+ if ( empty( $mceInit['toolbar3'] ) && ! empty( $mceInit['toolbar4'] ) ) {
+ $mceInit['toolbar3'] = $mceInit['toolbar4'];
+ $mceInit['toolbar4'] = '';
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> self::$mce_settings[$editor_id] = $mceInit;
</span><span class="lines">@@ -511,7 +479,7 @@
</span><span class="cx">
</span><span class="cx"> if ( in_array('wplink', self::$plugins, true) || in_array('link', self::$qt_buttons, true) ) {
</span><span class="cx"> wp_enqueue_script('wplink');
</span><del>- wp_enqueue_script('wpdialogs-popup');
</del><ins>+ wp_enqueue_script('wpdialogs');
</ins><span class="cx"> wp_enqueue_style('wp-jquery-ui-dialog');
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -519,11 +487,210 @@
</span><span class="cx"> wp_enqueue_script('wp-fullscreen');
</span><span class="cx">
</span><span class="cx"> if ( self::$has_medialib ) {
</span><del>- add_thickbox();
</del><ins>+ // add_thickbox(); // ?
</ins><span class="cx"> wp_enqueue_script('media-upload');
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ public static function wp_mce_translation() {
+
+ $mce_translation = array(
+ // Default TinyMCE strings
+ 'Cut' => __('Cut'),
+ 'Header 2' => __('Header 2'),
+ 'Your browser doesn\'t support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.' => __('Your browser does not support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.'),
+ 'Div' => __('Div'),
+ 'Paste' => __('Paste'),
+ 'Close' => __('Close'),
+ 'Pre' => __('Pre'),
+ 'Align right' => __('Align right'),
+ 'New document' => __('New document'),
+ 'Blockquote' => __('Blockquote'),
+ 'Numbered list' => __('Numbered list'),
+ 'Increase indent' => __('Increase indent'),
+ 'Formats' => __('Formats'),
+ 'Headers' => __('Headers'),
+ 'Select all' => __('Select all'),
+ 'Header 3' => __('Header 3'),
+ 'Blocks' => __('Blocks'),
+ 'Undo' => __('Undo'),
+ 'Strikethrough' => __('Strikethrough'),
+ 'Bullet list' => __('Bullet list'),
+ 'Header 1' => __('Header 1'),
+ 'Superscript' => __('Superscript'),
+ 'Clear formatting' => __('Clear formatting'),
+ 'Subscript' => __('Subscript'),
+ 'Header 6' => __('Header 6'),
+ 'Redo' => __('Redo'),
+ 'Paragraph' => __('Paragraph'),
+ 'Ok' => __('Ok'),
+ 'Bold' => __('Bold'),
+ 'Code' => __('Code'),
+ 'Italic' => __('Italic'),
+ 'Align center' => __('Align center'),
+ 'Header 5' => __('Header 5'),
+ 'Decrease indent' => __('Decrease indent'),
+ 'Header 4' => __('Header 4'),
+ 'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' => __('Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.'),
+ 'Underline' => __('Underline'),
+ 'Cancel' => __('Cancel'),
+ 'Justify' => __('Justify'),
+ 'Inline' => __('Inline'),
+ 'Copy' => __('Copy'),
+ 'Align left' => __('Align left'),
+ 'Visual aids' => __('Visual aids'),
+ 'Lower Greek' => __('Lower Greek'),
+ 'Square' => __('Square'),
+ 'Default' => __('Default'),
+ 'Lower Alpha' => __('Lower Alpha'),
+ 'Circle' => __('Circle'),
+ 'Disc' => __('Disc'),
+ 'Upper Alpha' => __('Upper Alpha'),
+ 'Upper Roman' => __('Upper Roman'),
+ 'Lower Roman' => __('Lower Roman'),
+ 'Name' => __('Name'),
+ 'Anchor' => __('Anchor'),
+ 'You have unsaved changes are you sure you want to navigate away?' => __('You have unsaved changes are you sure you want to navigate away?'),
+ 'Restore last draft' => __('Restore last draft'),
+ 'Special character' => __('Special character'),
+ 'Source code' => __('Source code'),
+ 'Right to left' => __('Right to left'),
+ 'Left to right' => __('Left to right'),
+ 'Emoticons' => __('Emoticons'),
+ 'Robots' => __('Robots'),
+ 'Document properties' => __('Document properties'),
+ 'Title' => __('Title'),
+ 'Keywords' => __('Keywords'),
+ 'Encoding' => __('Encoding'),
+ 'Description' => __('Description'),
+ 'Author' => __('Author'),
+ 'Fullscreen' => __('Fullscreen'),
+ 'Horizontal line' => __('Horizontal line'),
+ 'Horizontal space' => __('Horizontal space'),
+ 'Insert/edit image' => __('Insert/edit image'),
+ 'General' => __('General'),
+ 'Advanced' => __('Advanced'),
+ 'Source' => __('Source'),
+ 'Border' => __('Border'),
+ 'Constrain proportions' => __('Constrain proportions'),
+ 'Vertical space' => __('Vertical space'),
+ 'Image description' => __('Image description'),
+ 'Style' => __('Style'),
+ 'Dimensions' => __('Dimensions'),
+ 'Insert image' => __('Insert image'),
+ 'Insert date/time' => __('Insert date/time'),
+ 'Remove link' => __('Remove link'),
+ 'Url' => __('Url'),
+ 'Text to display' => __('Text to display'),
+ 'Anchors' => __('Anchors'),
+ 'Insert link' => __('Insert link'),
+ 'New window' => __('New window'),
+ 'None' => __('None'),
+ 'Target' => __('Target'),
+ 'Insert/edit link' => __('Insert/edit link'),
+ 'Insert/edit video' => __('Insert/edit video'),
+ 'Poster' => __('Poster'),
+ 'Alternative source' => __('Alternative source'),
+ 'Paste your embed code below:' => __('Paste your embed code below:'),
+ 'Insert video' => __('Insert video'),
+ 'Embed' => __('Embed'),
+ 'Nonbreaking space' => __('Nonbreaking space'),
+ 'Page break' => __('Page break'),
+ 'Paste as text' => __('Paste as text'),
+ 'Preview' => __('Preview'),
+ 'Print' => __('Print'),
+ 'Save' => __('Save'),
+ 'Could not find the specified string.' => __('Could not find the specified string.'),
+ 'Replace' => __('Replace'),
+ 'Next' => __('Next'),
+ 'Whole words' => __('Whole words'),
+ 'Find and replace' => __('Find and replace'),
+ 'Replace with' => __('Replace with'),
+ 'Find' => __('Find'),
+ 'Replace all' => __('Replace all'),
+ 'Match case' => __('Match case'),
+ 'Prev' => __('Prev'),
+ 'Spellcheck' => __('Spellcheck'),
+ 'Finish' => __('Finish'),
+ 'Ignore all' => __('Ignore all'),
+ 'Ignore' => __('Ignore'),
+ 'Insert row before' => __('Insert row before'),
+ 'Rows' => __('Rows'),
+ 'Height' => __('Height'),
+ 'Paste row after' => __('Paste row after'),
+ 'Alignment' => __('Alignment'),
+ 'Column group' => __('Column group'),
+ 'Row' => __('Row'),
+ 'Insert column before' => __('Insert column before'),
+ 'Split cell' => __('Split cell'),
+ 'Cell padding' => __('Cell padding'),
+ 'Cell spacing' => __('Cell spacing'),
+ 'Row type' => __('Row type'),
+ 'Insert table' => __('Insert table'),
+ 'Body' => __('Body'),
+ 'Caption' => __('Caption'),
+ 'Footer' => __('Footer'),
+ 'Delete row' => __('Delete row'),
+ 'Paste row before' => __('Paste row before'),
+ 'Scope' => __('Scope'),
+ 'Delete table' => __('Delete table'),
+ 'Header cell' => __('Header cell'),
+ 'Column' => __('Column'),
+ 'Cell' => __('Cell'),
+ 'Header' => __('Header'),
+ 'Cell type' => __('Cell type'),
+ 'Copy row' => __('Copy row'),
+ 'Row properties' => __('Row properties'),
+ 'Table properties' => __('Table properties'),
+ 'Row group' => __('Row group'),
+ 'Right' => __('Right'),
+ 'Insert column after' => __('Insert column after'),
+ 'Cols' => __('Cols'),
+ 'Insert row after' => __('Insert row after'),
+ 'Width' => __('Width'),
+ 'Cell properties' => __('Cell properties'),
+ 'Left' => __('Left'),
+ 'Cut row' => __('Cut row'),
+ 'Delete column' => __('Delete column'),
+ 'Center' => __('Center'),
+ 'Merge cells' => __('Merge cells'),
+ 'Insert template' => __('Insert template'),
+ 'Templates' => __('Templates'),
+ 'Background color' => __('Background color'),
+ 'Text color' => __('Text color'),
+ 'Show blocks' => __('Show blocks'),
+ 'Show invisible characters' => __('Show invisible characters'),
+ 'Words: {0}' => __('Words: {0}'),
+ 'Insert' => __('Insert'),
+ 'File' => __('File'),
+ 'Edit' => __('Edit'),
+ 'Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help' => __('Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help'),
+ 'Tools' => __('Tools'),
+ 'View' => __('View'),
+ 'Table' => __('Table'),
+ 'Format' => __('Format'),
+
+ // WordPress strings
+ 'Help' => __('Help'),
+ 'Toolbar Toggle' => __('Toolbar Toggle'),
+ 'Insert Read More tag' => __('Insert Read More tag'),
+ 'Distraction Free Writing' => __('Distraction Free Writing'),
+ );
+
+ $baseurl = self::$baseurl;
+ $mce_locale = self::$mce_locale;
+
+ $mce_translation = apply_filters( 'wp_mce_translation', $mce_translation, $mce_locale );
+
+ foreach ( $mce_translation as $key => $value ) {
+ if ( strpos( $value, '&' ) !== false )
+ $mce_translation[$key] = html_entity_decode( $value, ENT_QUOTES );
+ }
+
+ return "tinymce.addI18n( '$mce_locale', " . json_encode( $mce_translation ) . ");\n" .
+ "tinymce.ScriptLoader.markDone( '$baseurl/langs/$mce_locale.js' );\n";
+ }
+
</ins><span class="cx"> public static function editor_js() {
</span><span class="cx"> global $tinymce_version, $concatenate_scripts, $compress_scripts;
</span><span class="cx">
</span><span class="lines">@@ -543,9 +710,6 @@
</span><span class="cx"> $compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING'])
</span><span class="cx"> && false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
</span><span class="cx">
</span><del>- if ( $tmce_on && 'en' != self::$mce_locale )
- include_once(ABSPATH . WPINC . '/js/tinymce/langs/wp-langs.php');
-
</del><span class="cx"> $mceInit = $qtInit = '';
</span><span class="cx"> if ( $tmce_on ) {
</span><span class="cx"> foreach ( self::$mce_settings as $editor_id => $init ) {
</span><span class="lines">@@ -569,27 +733,26 @@
</span><span class="cx">
</span><span class="cx"> $ref = array(
</span><span class="cx"> 'plugins' => implode( ',', self::$plugins ),
</span><del>- 'theme' => 'advanced',
</del><ins>+ 'theme' => 'modern',
</ins><span class="cx"> 'language' => self::$mce_locale
</span><span class="cx"> );
</span><span class="cx">
</span><del>- $suffix = ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ? '_src' : '';
</del><ins>+ $suffix = ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ? '' : '.min';
</ins><span class="cx">
</span><del>- do_action('before_wp_tiny_mce', self::$mce_settings);
-?>
</del><ins>+ do_action( 'before_wp_tiny_mce', self::$mce_settings );
+ ?>
</ins><span class="cx">
</span><del>- <script type="text/javascript">
</del><ins>+ <script type="text/javascript">
</ins><span class="cx"> tinyMCEPreInit = {
</span><del>- base : "<?php echo self::$baseurl; ?>",
- suffix : "<?php echo $suffix; ?>",
- query : "<?php echo $version; ?>",
- mceInit : <?php echo $mceInit; ?>,
- qtInit : <?php echo $qtInit; ?>,
- ref : <?php echo self::_parse_init( $ref ); ?>,
- load_ext : function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');}
</del><ins>+ baseURL: "<?php echo self::$baseurl; ?>",
+ suffix: "<?php echo $suffix; ?>",
+ mceInit: <?php echo $mceInit; ?>,
+ qtInit: <?php echo $qtInit; ?>,
+ ref: <?php echo self::_parse_init( $ref ); ?>,
+ load_ext: function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');}
</ins><span class="cx"> };
</span><del>- </script>
-<?php
</del><ins>+ </script>
+ <?php
</ins><span class="cx">
</span><span class="cx"> $baseurl = self::$baseurl;
</span><span class="cx">
</span><span class="lines">@@ -597,76 +760,59 @@
</span><span class="cx"> if ( $compressed ) {
</span><span class="cx"> echo "<script type='text/javascript' src='{$baseurl}/wp-tinymce.php?c=1&$version'></script>\n";
</span><span class="cx"> } else {
</span><del>- echo "<script type='text/javascript' src='{$baseurl}/tiny_mce.js?$version'></script>\n";
- echo "<script type='text/javascript' src='{$baseurl}/wp-tinymce-schema.js?$version'></script>\n";
</del><ins>+ echo "<script type='text/javascript' src='{$baseurl}/tinymce.js?$version'></script>\n";
+ echo "<script type='text/javascript' src='{$baseurl}/plugins/compat3x/plugin{$suffix}.js?$version'></script>\n";
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if ( 'en' != self::$mce_locale && isset($lang) )
- echo "<script type='text/javascript'>\n$lang\n</script>\n";
- else
</del><ins>+ if ( 'en' != self::$mce_locale )
+ echo "<script type='text/javascript'>\n" . self::wp_mce_translation() . "</script>\n";
+
+ if ( self::$ext_plugins ) {
+ // Load the old-format English strings to prevent unsightly labels in old style popups
</ins><span class="cx"> echo "<script type='text/javascript' src='{$baseurl}/langs/wp-langs-en.js?$version'></script>\n";
</span><ins>+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- $mce = ( self::$has_tinymce && wp_default_editor() == 'tinymce' ) || ! self::$has_quicktags;
-?>
</del><ins>+ // Allow scripts to be added after tinymce.js has been loaded but before any editor instances are created.
+ do_action( 'wp_tiny_mce_init', self::$mce_settings );
</ins><span class="cx">
</span><del>- <script type="text/javascript">
- var wpActiveEditor;
</del><ins>+ ?>
+ <script type="text/javascript">
+ <?php
</ins><span class="cx">
</span><del>- (function(){
- var init, ed, qt, first_init, DOM, el, i, mce = <?php echo (int) $mce; ?>;
</del><ins>+ if ( self::$ext_plugins )
+ echo self::$ext_plugins . "\n";
</ins><span class="cx">
</span><del>- if ( typeof(tinymce) == 'object' ) {
- DOM = tinymce.DOM;
- // mark wp_theme/ui.css as loaded
- DOM.files[tinymce.baseURI.getURI() + '/themes/advanced/skins/wp_theme/ui.css'] = true;
</del><ins>+ if ( ! is_admin() )
+ echo 'var ajaxurl = "' . admin_url( 'admin-ajax.php', 'relative' ) . '";';
</ins><span class="cx">
</span><del>- DOM.events.add( DOM.select('.wp-editor-wrap'), 'mousedown', function(e){
- if ( this.id )
- wpActiveEditor = this.id.slice(3, -5);
- });
</del><ins>+ ?>
</ins><span class="cx">
</span><del>- for ( ed in tinyMCEPreInit.mceInit ) {
- if ( first_init ) {
- init = tinyMCEPreInit.mceInit[ed] = tinymce.extend( {}, first_init, tinyMCEPreInit.mceInit[ed] );
</del><ins>+ ( function() {
+ var init, edId, qtId, firstInit,
+ loadMCE = typeof getUserSetting !== 'undefined' ? getUserSetting( 'editor' ) === 'tinymce' : true;
+
+ if ( typeof quicktags !== 'undefined' ) {
+ for ( qtId in tinyMCEPreInit.qtInit ) {
+ try { quicktags( tinyMCEPreInit.qtInit[qtId] ); } catch(e){};
+ }
+ }
+
+ if ( typeof tinymce !== 'undefined' ) {
+ for ( edId in tinyMCEPreInit.mceInit ) {
+ if ( firstInit ) {
+ init = tinyMCEPreInit.mceInit[edId] = tinymce.extend( {}, firstInit, tinyMCEPreInit.mceInit[edId] );
</ins><span class="cx"> } else {
</span><del>- init = first_init = tinyMCEPreInit.mceInit[ed];
</del><ins>+ init = firstInit = tinyMCEPreInit.mceInit[edId];
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if ( mce )
- try { tinymce.init(init); } catch(e){}
- }
- } else {
- if ( tinyMCEPreInit.qtInit ) {
- for ( i in tinyMCEPreInit.qtInit ) {
- el = tinyMCEPreInit.qtInit[i].id;
- if ( el )
- document.getElementById('wp-'+el+'-wrap').onmousedown = function(){ wpActiveEditor = this.id.slice(3, -5); }
</del><ins>+ if ( ( loadMCE || ! tinyMCEPreInit.qtInit.hasOwnProperty( edId ) ) && ! init.wp_skip_init ) {
+ try { tinymce.init( init ); } catch(e){}
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><ins>+ }());
</ins><span class="cx">
</span><del>- if ( typeof(QTags) == 'function' ) {
- for ( qt in tinyMCEPreInit.qtInit ) {
- try { quicktags( tinyMCEPreInit.qtInit[qt] ); } catch(e){}
- }
- }
- })();
- <?php
-
- if ( self::$ext_plugins )
- echo self::$ext_plugins . "\n";
-
- if ( ! $compressed && $tmce_on ) {
- ?>
- (function(){var t=tinyMCEPreInit,sl=tinymce.ScriptLoader,ln=t.ref.language,th=t.ref.theme,pl=t.ref.plugins;sl.markDone(t.base+'/langs/'+ln+'.js');sl.markDone(t.base+'/themes/'+th+'/langs/'+ln+'.js');sl.markDone(t.base+'/themes/'+th+'/langs/'+ln+'_dlg.js');sl.markDone(t.base+'/themes/advanced/skins/wp_theme/ui.css');tinymce.each(pl.split(','),function(n){if(n&&n.charAt(0)!='-'){sl.markDone(t.base+'/plugins/'+n+'/langs/'+ln+'.js');sl.markDone(t.base+'/plugins/'+n+'/langs/'+ln+'_dlg.js');}});})();
- <?php
- }
-
- if ( !is_admin() )
- echo 'var ajaxurl = "' . admin_url( 'admin-ajax.php', 'relative' ) . '";';
-
- ?>
</del><span class="cx"> </script>
</span><span class="cx"> <?php
</span><span class="cx">
</span><span class="lines">@@ -676,93 +822,84 @@
</span><span class="cx"> if ( in_array('wpfullscreen', self::$plugins, true) || in_array('fullscreen', self::$qt_buttons, true) )
</span><span class="cx"> self::wp_fullscreen_html();
</span><span class="cx">
</span><del>- do_action('after_wp_tiny_mce', self::$mce_settings);
</del><ins>+ do_action( 'after_wp_tiny_mce', self::$mce_settings );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> public static function wp_fullscreen_html() {
</span><span class="cx"> global $content_width;
</span><span class="cx"> $post = get_post();
</span><span class="cx">
</span><del>- $width = isset($content_width) && 800 > $content_width ? $content_width : 800;
</del><ins>+ $width = isset( $content_width ) && 800 > $content_width ? $content_width : 800;
</ins><span class="cx"> $width = $width + 22; // compensate for the padding and border
</span><span class="cx"> $dfw_width = get_user_setting( 'dfw_width', $width );
</span><del>- $save = isset($post->post_status) && $post->post_status == 'publish' ? __('Update') : __('Save');
- ?>
- <div id="wp-fullscreen-body"<?php if ( is_rtl() ) echo ' class="rtl"'; ?>>
- <div id="fullscreen-topbar">
- <div id="wp-fullscreen-toolbar">
- <div id="wp-fullscreen-close"><a href="#" onclick="fullscreen.off();return false;"><?php _e('Exit fullscreen'); ?></a></div>
</del><ins>+ $save = isset( $post->post_status ) && $post->post_status == 'publish' ? __('Update') : __('Save');
+
+ ?>
+ <div id="wp-fullscreen-body"<?php if ( is_rtl() ) echo ' class="rtl"'; ?> data-theme-width="<?php echo (int) $width; ?>" data-dfw-width="<?php echo (int) $dfw_width; ?>">
+ <div id="fullscreen-topbar">
+ <div id="wp-fullscreen-toolbar">
+ <div id="wp-fullscreen-close"><a href="#" onclick="wp.editor.fullscreen.off();return false;"><?php _e('Exit fullscreen'); ?></a></div>
</ins><span class="cx"> <div id="wp-fullscreen-central-toolbar" style="width:<?php echo $width; ?>px;">
</span><span class="cx">
</span><span class="cx"> <div id="wp-fullscreen-mode-bar"><div id="wp-fullscreen-modes">
</span><del>- <a href="#" onclick="fullscreen.switchmode('tinymce');return false;"><?php _e( 'Visual' ); ?></a>
- <a href="#" onclick="fullscreen.switchmode('html');return false;"><?php _ex( 'Text', 'Name for the Text editor tab (formerly HTML)' ); ?></a>
</del><ins>+ <a href="#" onclick="wp.editor.fullscreen.switchmode('tinymce');return false;"><?php _e( 'Visual' ); ?></a>
+ <a href="#" onclick="wp.editor.fullscreen.switchmode('html');return false;"><?php _ex( 'Text', 'Name for the Text editor tab (formerly HTML)' ); ?></a>
</ins><span class="cx"> </div></div>
</span><span class="cx">
</span><del>- <div id="wp-fullscreen-button-bar"><div id="wp-fullscreen-buttons" class="wp_themeSkin">
- <?php
</del><ins>+ <div id="wp-fullscreen-button-bar"><div id="wp-fullscreen-buttons" class="mce-toolbar">
+ <?php
</ins><span class="cx">
</span><span class="cx"> $buttons = array(
</span><span class="cx"> // format: title, onclick, show in both editors
</span><del>- 'bold' => array( 'title' => __('Bold (Ctrl + B)'), 'onclick' => 'fullscreen.b();', 'both' => false ),
- 'italic' => array( 'title' => __('Italic (Ctrl + I)'), 'onclick' => 'fullscreen.i();', 'both' => false ),
- '0' => 'separator',
- 'bullist' => array( 'title' => __('Unordered list (Alt + Shift + U)'), 'onclick' => 'fullscreen.ul();', 'both' => false ),
- 'numlist' => array( 'title' => __('Ordered list (Alt + Shift + O)'), 'onclick' => 'fullscreen.ol();', 'both' => false ),
- '1' => 'separator',
- 'blockquote' => array( 'title' => __('Blockquote (Alt + Shift + Q)'), 'onclick' => 'fullscreen.blockquote();', 'both' => false ),
- 'image' => array( 'title' => __('Insert/edit image (Alt + Shift + M)'), 'onclick' => "fullscreen.medialib();", 'both' => true ),
- '2' => 'separator',
- 'link' => array( 'title' => __('Insert/edit link (Alt + Shift + A)'), 'onclick' => 'fullscreen.link();', 'both' => true ),
- 'unlink' => array( 'title' => __('Unlink (Alt + Shift + S)'), 'onclick' => 'fullscreen.unlink();', 'both' => false ),
- '3' => 'separator',
- 'help' => array( 'title' => __('Help (Alt + Shift + H)'), 'onclick' => 'fullscreen.help();', 'both' => false )
</del><ins>+ 'bold' => array( 'title' => __('Bold (Ctrl + B)'), 'both' => false ),
+ 'italic' => array( 'title' => __('Italic (Ctrl + I)'), 'both' => false ),
+ 'bullist' => array( 'title' => __('Unordered list (Alt + Shift + U)'), 'both' => false ),
+ 'numlist' => array( 'title' => __('Ordered list (Alt + Shift + O)'), 'both' => false ),
+ 'blockquote' => array( 'title' => __('Blockquote (Alt + Shift + Q)'), 'both' => false ),
+ 'wp-media-library' => array( 'title' => __('Media library (Alt + Shift + M)'), 'both' => true ),
+ 'image' => array( 'title' => __('Insert/edit image'), 'both' => false ),
+ 'link' => array( 'title' => __('Insert/edit link (Alt + Shift + A)'), 'both' => true ),
+ 'unlink' => array( 'title' => __('Unlink (Alt + Shift + S)'), 'both' => false ),
+ 'help' => array( 'title' => __('Help (Alt + Shift + H)'), 'both' => false ),
</ins><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> $buttons = apply_filters( 'wp_fullscreen_buttons', $buttons );
</span><span class="cx">
</span><span class="cx"> foreach ( $buttons as $button => $args ) {
</span><del>- if ( 'separator' == $args ) { ?>
- <div><span aria-orientation="vertical" role="separator" class="mceSeparator"></span></div>
- <?php continue;
- } ?>
</del><ins>+ if ( 'separator' == $args ) {
+ continue;
+ }
</ins><span class="cx">
</span><del>- <div<?php if ( $args['both'] ) { ?> class="wp-fullscreen-both"<?php } ?>>
- <a title="<?php echo $args['title']; ?>" onclick="<?php echo $args['onclick']; ?>return false;" class="mceButton mceButtonEnabled mce_<?php echo $button; ?>" href="#" id="wp_fs_<?php echo $button; ?>" role="button" aria-pressed="false">
- <span class="mceIcon mce_<?php echo $button; ?>"></span>
- </a>
- </div>
- <?php
- } ?>
</del><ins>+ $onclick = ! empty( $args['onclick'] ) ? ' onclick="' . $args['onclick'] . '"' : '';
+ ?>
</ins><span class="cx">
</span><del>- </div></div>
-
- <div id="wp-fullscreen-save">
- <input type="button" class="button-primary right" value="<?php echo $save; ?>" onclick="fullscreen.save();" />
- <span class="spinner"></span>
- <span class="fs-saved"><?php if ( $post->post_status == 'publish' ) _e('Updated.'); else _e('Saved.'); ?></span>
</del><ins>+ <div class="mce-widget mce-btn<?php if ( $args['both'] ) { ?> wp-fullscreen-both<?php } ?>">
+ <button type="button" role="presentation" title="<?php echo $args['title']; ?>"<?php echo $onclick; ?> id="wp_fs_<?php echo $button; ?>">
+ <i class="mce-ico mce-i-<?php echo $button; ?>"></i>
+ </button>
</ins><span class="cx"> </div>
</span><ins>+ <?php
+ }
</ins><span class="cx">
</span><del>- </div>
- </div>
- </div>
</del><ins>+ ?>
</ins><span class="cx">
</span><del>- <div id="wp-fullscreen-wrap" style="width:<?php echo $dfw_width; ?>px;">
- <?php if ( post_type_supports($post->post_type, 'title') ) { ?>
- <label id="wp-fullscreen-title-prompt-text" for="wp-fullscreen-title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label>
- <input type="text" id="wp-fullscreen-title" value="" autocomplete="off" />
- <?php } ?>
</del><ins>+ </div></div>
</ins><span class="cx">
</span><del>- <div id="wp-fullscreen-container">
- <textarea id="wp_mce_fullscreen"></textarea>
</del><ins>+ <div id="wp-fullscreen-save">
+ <input type="button" class="button-primary right" value="<?php echo $save; ?>" onclick="wp.editor.fullscreen.save();" />
+ <span class="spinner"></span>
+ <span class="wp-fullscreen-saved-message"><?php if ( $post->post_status == 'publish' ) _e('Updated.'); else _e('Saved.'); ?></span>
+ <span class="wp-fullscreen-error-message"><?php _e('Save failed.'); ?></span>
</ins><span class="cx"> </div>
</span><span class="cx">
</span><del>- <div id="wp-fullscreen-status">
- <div id="wp-fullscreen-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></div>
- <div id="wp-fullscreen-tagline"><?php _e('Just write.'); ?></div>
</del><span class="cx"> </div>
</span><ins>+ </div>
</ins><span class="cx"> </div>
</span><ins>+ <div id="wp-fullscreen-status">
+ <div id="wp-fullscreen-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></div>
+ <div id="wp-fullscreen-tagline"><?php _e('Just write.'); ?></div>
</ins><span class="cx"> </div>
</span><ins>+ </div>
</ins><span class="cx">
</span><span class="cx"> <div class="fullscreen-overlay" id="fullscreen-overlay"></div>
</span><span class="cx"> <div class="fullscreen-overlay fullscreen-fader fade-600" id="fullscreen-fader"></div>
</span></span></pre></div>
<a id="trunksrcwpincludescsseditorcss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/css/editor.css (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/css/editor.css 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/css/editor.css 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,1146 +1,265 @@
</span><del>-
</del><span class="cx"> /*------------------------------------------------------------------------------
</span><del>-
</del><span class="cx"> TinyMCE and Quicklinks toolbars
</span><span class="cx"> ------------------------------------------------------------------------------*/
</span><span class="cx">
</span><del>-/* wp_theme/ui.css */
-.wp_themeSkin table,
-.wp_themeSkin tbody,
-.wp_themeSkin a,
-.wp_themeSkin img,
-.wp_themeSkin tr,
-.wp_themeSkin div,
-.wp_themeSkin td,
-.wp_themeSkin iframe,
-.wp_themeSkin span,
-.wp_themeSkin *,
-.wp_themeSkin .mceText {
</del><ins>+.mce-panel {
</ins><span class="cx"> border: 0;
</span><del>- margin: 0;
- padding: 0;
- white-space: nowrap;
- text-decoration: none;
- font-weight: normal;
- cursor: default;
- vertical-align: baseline;
- width: auto;
- border-collapse: separate;
</del><ins>+ background: #fff;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin a:hover,
-.wp_themeSkin a:link,
-.wp_themeSkin a:visited,
-.wp_themeSkin a:active {
- text-decoration: none;
- font-weight: normal;
- cursor: default;
</del><ins>+.mce-toolbar-grp {
+ border-bottom: 1px solid #dedede;
+ background: #f5f5f5;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin table td {
- vertical-align: middle;
</del><ins>+.mce-toolbar {
+ padding: 1px 3px;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin *,
-.wp_themeSkin a:hover,
-.wp_themeSkin a:link,
-.wp_themeSkin a:visited,
-.wp_themeSkin a:active {
- color: #555;
-}
-
-/* These are part of TinyMCE, used in TinyMCE Advanced, but not WordPress. These are not updated for 3.8's design. */
-.wp_themeSkin span.mce_sup,
-.wp_themeSkin span.mce_sub,
-.wp_themeSkin span.mce_media,
-.wp_themeSkin span.mce_styleprops,
-.wp_themeSkin span.mce_search,
-.wp_themeSkin span.mce_emotions,
-.wp_themeSkin span.mce_print,
-.wp_themeSkin span.mce_attribs,
-.wp_themeSkin span.mce_hr,
-.wp_themeSkin span.mce_cut,
-.wp_themeSkin span.mce_copy,
-.wp_themeSkin span.mce_paste,
-.wp_themeSkin span.mce_cite,
-.wp_themeSkin span.mce_visualchars,
-.wp_themeSkin span.mce_advhr,
-.wp_themeSkin span.mce_insertdate,
-.wp_themeSkin span.mce_anchor,
-.wp_themeSkin span.mce_visualaid,
-.wp_themeSkin span.mce_cleanup,
-.wp_themeSkin span.mce_table,
-.wp_themeSkin span.mce_row_props,
-.wp_themeSkin span.mce_cell_props,
-.wp_themeSkin span.mce_row_before,
-.wp_themeSkin span.mce_row_after,
-.wp_themeSkin span.mce_delete_row,
-.wp_themeSkin span.mce_col_before,
-.wp_themeSkin span.mce_col_after,
-.wp_themeSkin span.mce_delete_col,
-.wp_themeSkin span.mce_split_cells,
-.wp_themeSkin span.mce_merge_cells,
-.wp_themeSkin span.mce_delete_table,
-.wp_themeSkin span.mce_ins,
-.wp_themeSkin span.mce_abbr,
-.wp_themeSkin span.mce_acronym,
-.wp_themeSkin span.mce_del,
-.wp_themeSkin span.mce_replace,
-.wp_themeSkin span.mce_code,
-.wp_themeSkin span.mce_nonbreaking,
-.wp_themeSkin span.mce_inserttime,
-.wp_themeSkin span.mce_insertlayer,
-.wp_themeSkin span.mce_moveforward,
-.wp_themeSkin span.mce_movebackward,
-.wp_themeSkin span.mce_absolute {
- -moz-transition: none;
- -webkit-transition: none;
- transition: none;
- background: url("../js/tinymce/themes/advanced/img/icons.gif") no-repeat 20px 20px;
-}
-
-/* No @font-face support */
-.no-font-face .wp_themeSkin span.mce_undo,
-.no-font-face .wp_themeSkin span.mce_redo,
-.no-font-face .wp_themeSkin span.mce_bullist,
-.no-font-face .wp_themeSkin span.mce_numlist,
-.no-font-face .wp_themeSkin span.mce_blockquote,
-.no-font-face .wp_themeSkin span.mce_charmap,
-.no-font-face .wp_themeSkin span.mce_bold,
-.no-font-face .wp_themeSkin span.mce_italic,
-.no-font-face .wp_themeSkin span.mce_underline,
-.no-font-face .wp_themeSkin span.mce_justifyleft,
-.no-font-face .wp_themeSkin span.mce_justifyright,
-.no-font-face .wp_themeSkin span.mce_justifycenter,
-.no-font-face .wp_themeSkin span.mce_justifyfull,
-.no-font-face .wp_themeSkin span.mce_indent,
-.no-font-face .wp_themeSkin span.mce_outdent,
-.no-font-face .wp_themeSkin span.mce_link,
-.no-font-face .wp_themeSkin span.mce_unlink,
-.no-font-face .wp_themeSkin span.mce_help,
-.no-font-face .wp_themeSkin span.mce_removeformat,
-.no-font-face .wp_themeSkin span.mce_fullscreen,
-.no-font-face .wp_themeSkin span.mce_wp_fullscreen,
-.no-font-face .wp_themeSkin span.mce_media,
-.no-font-face .wp_themeSkin span.mce_pastetext,
-.no-font-face .wp_themeSkin span.mce_pasteword,
-.no-font-face .wp_themeSkin span.mce_wp_help,
-.no-font-face .wp_themeSkin span.mce_wp_adv,
-.no-font-face .wp_themeSkin span.mce_wp_more,
-.no-font-face .wp_themeSkin span.mce_strikethrough,
-.no-font-face .wp_themeSkin span.mce_spellchecker,
-.no-font-face .wp_themeSkin span.mce_forecolor,
-.no-font-face .wp_themeSkin .mce_forecolorpicker,
-.no-font-face .wp_themeSkin .mceSplitButton .mce_spellchecker span.mce_spellchecker,
-.no-font-face .wp_themeSkin .mceSplitButton .mce_forecolor span.mce_forecolor,
-.no-font-face .wp_themeSkin .mceSplitButton span.mce_numlist,
-.no-font-face .wp_themeSkin .mceSplitButton span.mce_bullist {
- -moz-transition: none;
- -webkit-transition: none;
- transition: none;
- background-image: url('../images/wpicons.png?ver=20120720');
-}
-
-/* Theme */
-.no-font-face .wp_themeSkin span.mce_undo {background-position:-500px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_undo,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_undo {background-position:-500px 0}
-
-.no-font-face .wp_themeSkin span.mce_redo {background-position:-480px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_redo,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_redo {background-position:-480px 0}
-
-.no-font-face .wp_themeSkin span.mce_bullist {background-position:-40px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_bullist,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_bullist,
-.no-font-face .wp_themeSkin .mceSplitButton:hover span.mce_bullist {background-position:-40px 0}
-
-.no-font-face .wp_themeSkin span.mce_numlist {background-position:-60px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_numlist,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_numlist,
-.no-font-face .wp_themeSkin .mceSplitButton:hover span.mce_numlist {background-position:-60px 0}
-
-.no-font-face .wp_themeSkin span.mce_blockquote {background-position:-80px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_blockquote,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_blockquote {background-position:-80px 0}
-
-.no-font-face .wp_themeSkin span.mce_charmap {background-position:-420px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_charmap,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_charmap {background-position:-420px 0}
-
-.no-font-face .wp_themeSkin span.mce_bold {background-position:0 -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_bold,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_bold {background-position:0 0}
-
-.no-font-face .wp_themeSkin span.mce_italic {background-position:-20px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_italic,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_italic {background-position:-20px 0}
-
-.no-font-face .wp_themeSkin span.mce_underline {background-position:-280px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_underline,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_underline {background-position:-280px 0}
-
-.no-font-face .wp_themeSkin span.mce_justifyleft {background-position:-100px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_justifyleft,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_justifyleft {background-position:-100px 0}
-
-.no-font-face .wp_themeSkin span.mce_justifyright {background-position:-140px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_justifyright,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_justifyright {background-position:-140px 0}
-
-.no-font-face .wp_themeSkin span.mce_justifycenter {background-position:-120px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_justifycenter,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_justifycenter {background-position:-120px 0}
-
-.no-font-face .wp_themeSkin span.mce_justifyfull {background-position:-300px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_justifyfull,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_justifyfull {background-position:-300px 0}
-
-.no-font-face .wp_themeSkin span.mce_indent {background-position:-460px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_indent,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_indent {background-position:-460px 0}
-
-.no-font-face .wp_themeSkin span.mce_outdent {background-position:-440px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_outdent,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_outdent {background-position:-440px 0}
-
-.no-font-face .wp_themeSkin span.mce_link {background-position:-160px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_link,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_link {background-position:-160px 0}
-
-.no-font-face .wp_themeSkin span.mce_unlink {background-position:-180px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_unlink,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_unlink {background-position:-180px 0}
-
-.no-font-face .wp_themeSkin span.mce_help {background-position:-520px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_help,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_help {background-position:-520px 0}
-
-.no-font-face .wp_themeSkin span.mce_removeformat {background-position:-380px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_removeformat,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_removeformat {background-position:-380px 0}
-
-.no-font-face .wp_themeSkin span.mce_strikethrough {background-position:-540px -20px;}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_strikethrough,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_strikethrough {background-position:-540px 0}
-
-.no-font-face .wp_themeSkin .mceSplitButton .mce_forecolor span.mce_forecolor {background-position:-320px -20px}
-.no-font-face .wp_themeSkin .mceSplitButtonEnabled:hover span.mce_forecolor,
-.no-font-face .wp_themeSkin .mceSplitButtonSelected span.mce_forecolor {background-position:-320px 0}
-
-.no-font-face .wp_themeSkin .mce_forecolorpicker {background-position:-320px -20px}
-
-/* Plugins in WP */
-.no-font-face .wp_themeSkin span.mce_fullscreen {background-position:-240px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_fullscreen,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_fullscreen {background-position:-240px 0}
-
-.no-font-face .wp_themeSkin span.mce_wp_fullscreen {background-position:-240px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_wp_fullscreen,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_wp_fullscreen {background-position:-240px 0}
-
-.no-font-face .wp_themeSkin span.mce_media {background-position:-400px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_media,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_media {background-position:-400px 0}
-
-.no-font-face .wp_themeSkin span.mce_pastetext {background-position:-340px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_pastetext,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_pastetext {background-position:-340px 0}
-
-.no-font-face .wp_themeSkin span.mce_pasteword {background-position:-360px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_pasteword,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_pasteword {background-position:-360px 0}
-
-.no-font-face .wp_themeSkin span.mce_spellchecker {background-position:-220px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_spellchecker,
-.no-font-face .wp_themeSkin .mceSplitButtonEnabled:hover span.mce_spellchecker,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_spellchecker,
-.no-font-face .wp_themeSkin .mceSplitButtonSelected span.mce_spellchecker {background-position:-220px 0}
-
-.no-font-face .wp_themeSkin span.mce_wp_help {background-position:-520px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_wp_help,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_wp_help {background-position:-520px 0}
-
-.no-font-face .wp_themeSkin span.mce_wp_adv {background-position:-260px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_wp_adv,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_wp_adv {background-position:-260px 0}
-
-.no-font-face .wp_themeSkin span.mce_wp_more {background-position:-200px -20px}
-.no-font-face .wp_themeSkin .mceButtonEnabled:hover span.mce_wp_more,
-.no-font-face .wp_themeSkin .mceButtonActive span.mce_wp_more {background-position:-200px 0}
-
-.no-font-face .mceIcon:before {
- display: none !important;
-}
-/* End no @font-face */
-
-/* Containers */
-.wp_themeSkin table {}
-
-.wp_themeSkin iframe {
- display: block;
-}
-
-.wp_themeSkin #mce_fullscreen_ifr {
- background-color: #fff;
-}
-
-.wp_themeSkin .mceToolbar {
- padding: 1px;
-}
-
-/* External */
-.wp_themeSkin .mceExternalToolbar {
- position: absolute;
- border-bottom: 0;
- display: none;
-}
-
-.wp_themeSkin .mceExternalToolbar td.mceToolbar {
- padding-right: 13px;
-}
-
-.wp_themeSkin .mceExternalClose {
- position: absolute;
- top: 3px;
- right: 3px;
- width: 7px;
- height: 7px;
- background: url("../js/tinymce/themes/advanced/img/icons.gif") -820px 0;
-}
-
-/* Layout */
-.wp_themeSkin table.mceToolbar,
-.wp_themeSkin tr.mceFirst .mceToolbar tr td,
-.wp_themeSkin tr.mceLast .mceToolbar tr td {
- border: 0;
- margin: 0;
- padding: 0;
-}
-
-.wp_themeSkin table.mceLayout {
- border: 0;
-}
-
-.wp_themeSkin .mceStatusbar {
- background: #fff;
</del><ins>+.mce-statusbar {
</ins><span class="cx"> border-top: 1px solid #eee;
</span><del>- color: #000;
- display: block;
- font-family: sans-serif;
- font-size: 12px;
- height: 20px;
- line-height: 16px;
- padding: 0 0 0 8px;
- overflow: visible;
</del><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin .mceStatusbar * {
- color: #555;
</del><ins>+.mce-path {
+ padding: 0 8px 1px;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin .mceStatusbar div {
- float: left;
- padding: 2px;
</del><ins>+.mce-path-item {
+ line-height: 1;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin .mceStatusbar a.mceResize {
- display: block;
- float: right;
- background: url("../js/tinymce/themes/advanced/img/icons.gif") -800px 0;
- width: 20px;
- height: 20px;
- cursor: se-resize;
</del><ins>+.mce-toolbar .mce-btn {
+ border-color: transparent;
+ background: transparent;
+ box-shadow: none;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin .mceStatusbar a:hover {
- text-decoration: underline;
-}
-
-.wp_themeSkin table.mceToolbar {
- margin: 0 6px 2px;
-}
-
-.wp_themeSkin table.mceToolbar :active,
-.wp_themeSkin table.mceToolbar :focus,
-.wp_themeSkin table.mceToolbar:focus,
-.wp_themeSkin span.mceSeparator:focus {
- outline: none;
-}
-
-.wp_themeSkin #content_toolbar1 {
- margin-top: 2px;
-}
-
-.wp_themeSkin .mceToolbar .mceToolbarEndListBox span {
- display: none;
-}
-
-.wp_themeSkin span.mceIcon,
-.wp_themeSkin img.mceIcon {
- display: block;
- width: 20px;
- height: 20px;
-}
-
-a .mceIcon, .mceAction {
- text-align: center;
- font: normal 20px/1 'dashicons' !important;
- speak: none;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-
-.mceAction {
- line-height:16px;
-}
-
-/* Button */
-.wp_themeSkin .mceButton {
- display: block;
- width: 20px;
- height: 20px;
- cursor: default;
- padding: 1px 2px;
- margin: 1px;
</del><ins>+#wp-fullscreen-buttons .mce-btn,
+.mce-toolbar .mce-btn-group .mce-btn {
+ border: 1px solid transparent;
+ margin: 0 1px;
</ins><span class="cx"> -webkit-border-radius: 2px;
</span><span class="cx"> border-radius: 2px;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin a.mceButtonEnabled:hover {
- background-image: inherit 0 -10px;
</del><ins>+#wp-fullscreen-buttons .mce-btn:hover,
+.mce-toolbar .mce-btn-group .mce-btn:hover,
+.mce-toolbar .mce-btn-group .mce-btn.mce-active {
+ box-shadow: 0 0 transparent;
+ border-color: #bbb;
+ background: #eee;
+ background-image: -webkit-gradient(linear, left bottom, left top, from(#e5e5e5), to(#fff));
+ background-image: -webkit-linear-gradient(bottom, #e5e5e5, #fff);
+ background-image: linear-gradient(to top, #e5e5e5, #fff);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin .mceOldBoxModel a.mceButton span, .wp_themeSkin .mceOldBoxModel a.mceButton img {
- margin: 0 0 0 1px;
</del><ins>+.mce-toolbar .mce-btn-group .mce-disabled.mce-btn:hover {
+ border-color: transparent;
+ background: transparent;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin .mceButtonDisabled .mceIcon {
- opacity: 0.2;
- filter: alpha(opacity=20);
</del><ins>+.mce-toolbar .mce-btn-group .mce-first,
+.mce-toolbar .mce-btn-group .mce-last {
+ border-color: transparent;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-/* Separator */
-.wp_themeSkin .mceSeparator {
- display: none;
</del><ins>+.mce-toolbar .mce-btn button {
+ padding: 2px 3px;
+ line-height: normal;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-/* ListBox */
-.wp_themeSkin .mceListBox,
-.wp_themeSkin .mceListBox a {
- display: block;
</del><ins>+.mce-toolbar .mce-btn i {
+ text-shadow: 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin .mceListBox .mceText {
- padding: 1px 4px 1px 5px;
- width: 70px;
- text-align: left;
- text-decoration: none;
- -webkit-border-bottom-left-radius: 2px;
- -webkit-border-top-left-radius: 2px;
- border-bottom-left-radius: 2px;
- border-top-left-radius: 2px;
- font-family: sans-serif;
- font-size: 12px;
- height: 20px;
- line-height: 20px;
- overflow: hidden;
-}
-
-.wp_themeSkin .mceListBox {
- margin: 1px;
</del><ins>+.mce-toolbar .mce-btn-group .mce-btn.mce-listbox {
+ border-radius: 0;
</ins><span class="cx"> direction: ltr;
</span><del>- background-color: #fff;
</del><ins>+ background: #fff;
</ins><span class="cx"> border: 1px solid #ddd;
</span><span class="cx"> -webkit-box-shadow: inset 0 1px 1px -1px rgba(0, 0, 0, .2);
</span><span class="cx"> box-shadow: inset 0 1px 1px -1px rgba(0, 0, 0, .2);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin .mceListBox .mceOpen {
- width: 12px;
- height: 20px;
- border-collapse: separate;
- padding: 1px;
- -webkit-border-bottom-left-radius: 0;
- -webkit-border-top-left-radius: 0;
- border-bottom-left-radius: 0;
- border-top-left-radius: 0;
</del><ins>+.mce-toolbar .mce-btn-group .mce-btn.mce-listbox:hover {
+ background-image: none;
+ border-color: #bbb;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin .mceListBox .mceFirst a {
- border-style: solid;
- border-width: 1px;
- border-bottom-right-radius: 2px;
- border-top-right-radius: 2px;
</del><ins>+.mce-toolbar .mce-colorbutton .mce-open {
+ border-right: 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin .mceListBoxMenu .mce_formatPreview {
- line-height: normal;
</del><ins>+.mce-toolbar .mce-colorbutton .mce-preview {
+ margin-left: -16px;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin .mceListBox .mceOpen,
-.wp_themeSkin .mceListBoxHover .mceOpen,
-.wp_themeSkin .mceListBoxSelected .mceOpen,
-.wp_themeSkin table.mceListBoxEnabled .mceOpen {
- background-image: url("../images/down_arrow.gif");
- background-position: 3px 1px;
- background-repeat: no-repeat;
-}
-
-.wp_themeSkin .mceListBoxDisabled .mceText {
- color: gray;
-}
-
-.wp_themeSkin .mceListBoxMenu {
- overflow: auto;
- overflow-x: hidden;
-}
-
-.wp_themeSkin .mceOldBoxModel .mceListBox .mceText {
- height: 22px;
-}
-
-.wp_themeSkin select.mceListBox {
- font-family: sans-serif;
- font-size: 12px;
- border-color: #b2b2b2;
- background-color: #fff;
-}
-
-/* SplitButton */
-.wp_themeSkin .mceSplitButton a,
-.wp_themeSkin .mceSplitButton span {
- display: block;
- height: 20px;
-}
-
-.wp_themeSkin .mceSplitButton {
- display: block;
- direction: ltr;
-}
-
-.wp_themeSkin table.mceSplitButton td {
- padding: 2px;
- -webkit-border-radius: 2px;
- border-radius: 2px;
-}
-
-.wp_themeSkin table.mceSplitButton:hover td {
- background-image: inherit 0 -10px;
-}
-
-.wp_themeSkin .mceSplitButton a.mceAction {
- height: 20px;
</del><ins>+/* Icons */
+.mce-toolbar .mce-ico {
+ color: #777;
+ line-height: 20px;
</ins><span class="cx"> width: 20px;
</span><del>- padding: 1px 2px;
- border-right: 0 none;
-}
-
-.wp_themeSkin .mceSplitButton span.mceAction {
- background-image: url("../js/tinymce/themes/advanced/img/icons.gif");
- background-repeat: no-repeat;
- background-color: transparent;
- width: 20px;
-}
-
-.wp_themeSkin .mceSplitButton span.mceAction.mce_bullist,
-.wp_themeSkin .mceSplitButton span.mceAction.mce_numlist {
- background-image: none;
-}
-
-.wp_themeSkin .mceSplitButton a.mceOpen {
- width: 11px;
</del><span class="cx"> height: 20px;
</span><del>- background-position: 0px 2px;
- background-repeat: no-repeat;
- padding: 1px 0;
-}
-
-.wp_themeSkin .mceSplitButton span.mceOpen {
- display: none;
-}
-
-.wp_themeSkin .mceSplitButtonDisabled .mceAction {
- opacity: 0.3;
- filter: alpha(opacity=30);
-}
-
-.wp_themeSkin .mceListBox a.mceText,
-.wp_themeSkin .mceSplitButton a.mceAction {
- -webkit-border-bottom-left-radius: 2px;
- -webkit-border-top-left-radius: 2px;
- border-bottom-left-radius: 2px;
- border-top-left-radius: 2px;
-}
-
-.wp_themeSkin .mceSplitButton a.mceOpen,
-.wp_themeSkin .mceListBox a.mceOpen {
- -webkit-border-bottom-right-radius: 2px;
- -webkit-border-top-right-radius: 2px;
- border-bottom-right-radius: 2px;
- border-top-right-radius: 2px;
-}
-
-/* ColorSplitButton */
-.wp_themeSkin div.mceColorSplitMenu table {
- background-color: #ebebeb;
- border-color: #bbb;
-}
-
-.wp_themeSkin .mceColorSplitMenu td {
- padding: 2px;
-}
-
-.wp_themeSkin .mceColorSplitMenu a {
- display: block;
- width: 9px;
- height: 9px;
- overflow: hidden;
- border-color: #B2B2B2;
-}
-
-.wp_themeSkin .mceColorSplitMenu td.mceMoreColors {
- padding: 1px 3px 1px 1px;
-}
-
-.wp_themeSkin .mceColorSplitMenu a.mceMoreColors {
- width: 100%;
- height: auto;
</del><span class="cx"> text-align: center;
</span><del>- font-family: "Open Sans", sans-serif;
- font-size: 11px;
- line-height: 20px;
- border-color: #fff;
</del><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover {}
-.wp_themeSkin a.mceMoreColors:hover {}
-.wp_themeSkin .mceColorPreview {
- margin: -5px 0 0 2px;
- width: 16px;
- height: 4px;
- overflow: hidden;
</del><ins>+.mce-toolbar .mce-btn:hover .mce-ico {
+ color: #333;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-/* Menu */
-.wp_themeSkin .mceMenu {
- position: absolute;
- left: 0;
- top: 0;
- z-index: 1000;
- border-color: #ddd;
- direction: ltr;
</del><ins>+.mce-i-bold,
+.mce-i-italic,
+.mce-i-bullist,
+.mce-i-numlist,
+.mce-i-blockquote,
+.mce-i-alignleft,
+.mce-i-aligncenter,
+.mce-i-alignright,
+.mce-i-link,
+.mce-i-unlink,
+.mce-i-wp_more,
+.mce-i-strikethrough,
+.mce-i-spellchecker,
+.mce-i-fullscreen,
+.mce-i-wp_fullscreen,
+.mce-i-wp_adv,
+.mce-i-underline,
+.mce-i-alignjustify,
+.mce-i-forecolor,
+.mce-i-pastetext,
+.mce-i-pasteword,
+.mce-i-removeformat,
+.mce-i-charmap,
+.mce-i-outdent,
+.mce-i-indent,
+.mce-i-undo,
+.mce-i-redo,
+.mce-i-help,
+.mce-i-wp_help,
+.mce-i-wp-media-library,
+.mce-i-ltr {
+ font: normal 20px/1 'dashicons';
+ padding: 0;
+ vertical-align: top;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.wp_themeSkin .mceNoIcons span.mceIcon {
- width: 0;
-}
-
-.wp_themeSkin .mceNoIcons a .mceText {
- padding-left: 10px;
-}
-
-.wp_themeSkin .mceMenu table {
- background-color: #ebeaeb;
-}
-
-.wp_themeSkin .mceMenu a,
-.wp_themeSkin .mceMenu span,
-.wp_themeSkin .mceMenu {
- display: block;
-}
-
-.wp_themeSkin .mceMenu td {
- height: 20px;overflow: hidden;
-}
-
-.wp_themeSkin .mceMenu a {
- position: relative;
- padding: 3px 0 4px 0;
- text-decoration: none !important;
-}
-
-.wp_themeSkin .mceMenu .mceText {
- position: relative;
- display: block;
- font-family: "Open Sans", sans-serif;
- cursor: default;
- margin: 0;
- padding: 0 25px;
- color: #000;
-}
-
-.wp_themeSkin .mceMenu span.mceText, .wp_themeSkin .mceMenu .mcePreview {
- font-size: 12px;
-}
-
-.wp_themeSkin .mceMenu pre.mceText {
- font-family: Monospace;
-}
-
-.wp_themeSkin .mceMenu .mceIcon {
- position: absolute;
- top: 0;
- left: 0;
- width: 22px;
-}
-
-.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,
-.wp_themeSkin .mceMenu .mceMenuItemActive {
- background-color: #f5f5f5;
-}
-
-.wp_themeSkin td.mceMenuItemSeparator {
- height: 1px;
- background-color: #aaa;
-}
-
-.wp_themeSkin .mceMenuItemTitle a {
- border-top: 0;
- border-right: 0;
- border-left: 0;
- border-bottom: 1px solid #aaa;
- text-decoration: none !important;
- background-color: #ccc;
-}
-
-.wp_themeSkin .mceMenuItemTitle span.mceText {
- font-weight: bold;
- padding-left: 4px;
- color: #000;
-}
-
-.wp_themeSkin .mceMenuItemSelected .mceIcon {
- background: url("../js/tinymce/themes/advanced/skins/default/img/menu_check.gif");
- color: #888;
-}
-
-.wp_themeSkin .mceNoIcons .mceMenuItemSelected a {
- background: url("../js/tinymce/themes/advanced/skins/default/img/menu_arrow.gif") no-repeat -6px center;
-}
-
-.wp_themeSkin .mceMenu span.mceMenuLine {
- display: none;
-}
-
-.wp_themeSkin .mceMenuItemSub a {
- background: url("../js/tinymce/themes/advanced/skins/default/img/menu_arrow.gif") no-repeat top right;
-}
-
-/* Progress,Resize */
-.wp_themeSkin .mceBlocker {
- position: absolute;
- left: 0;
- top: 0;
- z-index: 1000;
- opacity: 0.5;
- filter: alpha(opacity=50);
- background: #FFF;
-}
-
-.wp_themeSkin .mceProgress {
- position: absolute;
- left: 0;
- top: 0;
- z-index: 1001;
- background: url("../js/tinymce/themes/advanced/skins/default/img/progress.gif") no-repeat;
- width: 32px;
- height: 32px;
- margin: -16px 0 0 -16px;
-}
-
-.wp_themeSkin .mcePlaceHolder {
- border: 1px dotted gray;
-}
-
-/* Rtl */
-.mceRtl .mceListBox .mceText {
- text-align: right;
- padding: 0 4px 0 0;
-}
-
-.mceRtl .mceMenuItem .mceText {
- text-align: right;
-}
-
-/* Formats */
-.wp_themeSkin .mce_p span.mceText {}
-.wp_themeSkin .mce_address span.mceText {
- font-style: italic;
-}
-
-.wp_themeSkin .mce_pre span.mceText {
- font-family: monospace;
-}
-
-.wp_themeSkin .mce_h1 span.mceText {
- font-weight: bolder;
- font-size: 18px;
-}
-
-.wp_themeSkin .mce_h2 span.mceText {
- font-weight: bolder;
- font-size: 14px;
-}
-
-.wp_themeSkin .mce_h3 span.mceText {
- font-weight: bolder;
- font-size: 12px;
-}
-
-.wp_themeSkin .mce_h4 span.mceText {
- font-weight: bolder;
- font-size: 11px;
-}
-
-.wp_themeSkin .mce_h5 span.mceText {
- font-weight: bolder;
- font-size: 11px;
-}
-
-.wp_themeSkin .mce_h6 span.mceText {
- font-weight: bolder;
- font-size: 10px;
-}
-
-span.mce_bold:before {
</del><ins>+.mce-i-bold:before {
</ins><span class="cx"> content: '\f200';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_italic:before {
</del><ins>+.mce-i-italic:before {
</ins><span class="cx"> content: '\f201';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_bullist:before {
</del><ins>+.mce-i-bullist:before {
</ins><span class="cx"> content: '\f203';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_numlist:before {
</del><ins>+.mce-i-numlist:before {
</ins><span class="cx"> content: '\f204';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_blockquote:before {
</del><ins>+.mce-i-blockquote:before {
</ins><span class="cx"> content: '\f205';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_justifyleft:before {
</del><ins>+.mce-i-alignleft:before {
</ins><span class="cx"> content: '\f206';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_justifycenter:before {
</del><ins>+.mce-i-aligncenter:before {
</ins><span class="cx"> content: '\f207';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_justifyright:before {
</del><ins>+.mce-i-alignright:before {
</ins><span class="cx"> content: '\f208';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_link:before {
</del><ins>+.mce-i-link:before {
</ins><span class="cx"> content: '\f103';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_unlink:before {
</del><ins>+.mce-i-unlink:before {
</ins><span class="cx"> content: '\f225';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_wp_more:before {
</del><ins>+.mce-i-wp_more:before {
</ins><span class="cx"> content: '\f209';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_strikethrough:before {
</del><ins>+.mce-i-strikethrough:before {
</ins><span class="cx"> content: '\f224';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_spellchecker {
- font-size: 20px;
- background: none !important;
- margin-top: 2px;
-}
-
-span.mce_spellchecker:before {
</del><ins>+.mce-i-spellchecker:before {
</ins><span class="cx"> content: '\f210';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_fullscreen:before,
-span.mce_wp_fullscreen:before {
</del><ins>+.mce-i-fullscreen:before,
+.mce-i-wp_fullscreen:before {
</ins><span class="cx"> content: '\f211';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_wp_adv:before {
</del><ins>+.mce-i-wp_adv:before {
</ins><span class="cx"> content: '\f212';
</span><span class="cx"> }
</span><del>-span.mce_underline:before {
</del><ins>+.mce-i-underline:before {
</ins><span class="cx"> content: '\f213';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_justifyfull:before {
</del><ins>+.mce-i-alignjustify:before {
</ins><span class="cx"> content: '\f214';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_forecolor {
- background: none !important;
-}
-
-span.mce_forecolor:before {
</del><ins>+.mce-i-forecolor:before {
</ins><span class="cx"> content: '\f215';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_pastetext:before {
</del><ins>+.mce-i-pastetext:before {
</ins><span class="cx"> content: '\f217';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_pasteword:before {
- content: '\f216';
-}
-
-span.mce_removeformat:before {
</del><ins>+.mce-i-removeformat:before {
</ins><span class="cx"> content: '\f218';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_charmap:before {
</del><ins>+.mce-i-charmap:before {
</ins><span class="cx"> content: '\f220';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_outdent:before {
</del><ins>+.mce-i-outdent:before {
</ins><span class="cx"> content: '\f221';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_indent:before {
</del><ins>+.mce-i-indent:before {
</ins><span class="cx"> content: '\f222';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_undo:before {
</del><ins>+.mce-i-undo:before {
</ins><span class="cx"> content: '\f171';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_redo:before {
</del><ins>+.mce-i-redo:before {
</ins><span class="cx"> content: '\f172';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_help:before,
-span.mce_wp_help:before {
</del><ins>+.mce-i-help:before,
+.mce-i-wp_help:before {
</ins><span class="cx"> content: '\f223';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_image:before {
</del><ins>+.mce-i-wp-media-library:before {
</ins><span class="cx"> content: '\f104';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-span.mce_ltr:before {
</del><ins>+.mce-i-ltr:before {
</ins><span class="cx"> content: '\f320';
</span><span class="cx"> }
</span><span class="cx">
</span><del>-/* Default icons */
-.wp_themeSkin span.mce_cleanup {background-position:-380px -20px}
-.wp_themeSkin span.mce_anchor {background-position:-200px 0}
-.wp_themeSkin span.mce_sub {background-position:-600px 0}
-.wp_themeSkin span.mce_sup {background-position:-620px 0}
-.wp_themeSkin span.mce_newdocument {background-position:-520px 0}
-.wp_themeSkin span.mce_image {background-position:-380px 0}
-.wp_themeSkin span.mce_code {background-position:-260px 0}
-.wp_themeSkin span.mce_hr {background-position:-360px 0}
-.wp_themeSkin span.mce_visualaid {background-position:-660px 0}
-.wp_themeSkin span.mce_paste {background-position:-560px 0}
-.wp_themeSkin span.mce_copy {background-position:-700px 0}
-.wp_themeSkin span.mce_cut {background-position:-680px 0}
-.wp_themeSkin .mce_backcolor span.mceAction {background-position:-760px 0}
-.wp_themeSkin .mce_backcolorpicker {background-position:-760px 0}
-
-/* Plugins */
-.wp_themeSkin span.mce_advhr {background-position:-0px -20px}
-.wp_themeSkin span.mce_ltr {background-position:-20px -20px}
-.wp_themeSkin span.mce_rtl {background-position:-40px -20px}
-.wp_themeSkin span.mce_emotions {background-position:-60px -20px}
-.wp_themeSkin span.mce_fullpage {background-position:-80px -20px}
-.wp_themeSkin span.mce_iespell {background-position:-120px -20px}
-.wp_themeSkin span.mce_insertdate {background-position:-140px -20px}
-.wp_themeSkin span.mce_inserttime {background-position:-160px -20px}
-.wp_themeSkin span.mce_absolute {background-position:-180px -20px}
-.wp_themeSkin span.mce_backward {background-position:-200px -20px}
-.wp_themeSkin span.mce_forward {background-position:-220px -20px}
-.wp_themeSkin span.mce_insert_layer {background-position:-240px -20px}
-.wp_themeSkin span.mce_insertlayer {background-position:-260px -20px}
-.wp_themeSkin span.mce_movebackward {background-position:-280px -20px}
-.wp_themeSkin span.mce_moveforward {background-position:-300px -20px}
-.wp_themeSkin span.mce_media {background-position:-320px -20px}
-.wp_themeSkin span.mce_nonbreaking {background-position:-340px -20px}
-.wp_themeSkin span.mce_selectall {background-position:-400px -20px}
-.wp_themeSkin span.mce_preview {background-position:-420px -20px}
-.wp_themeSkin span.mce_print {background-position:-440px -20px}
-.wp_themeSkin span.mce_cancel {background-position:-460px -20px}
-.wp_themeSkin span.mce_save {background-position:-480px -20px}
-.wp_themeSkin span.mce_replace {background-position:-500px -20px}
-.wp_themeSkin span.mce_search {background-position:-520px -20px}
-.wp_themeSkin span.mce_styleprops {background-position:-560px -20px}
-.wp_themeSkin span.mce_table {background-position:-580px -20px}
-.wp_themeSkin span.mce_cell_props {background-position:-600px -20px}
-.wp_themeSkin span.mce_delete_table {background-position:-620px -20px}
-.wp_themeSkin span.mce_delete_col {background-position:-640px -20px}
-.wp_themeSkin span.mce_delete_row {background-position:-660px -20px}
-.wp_themeSkin span.mce_col_after {background-position:-680px -20px}
-.wp_themeSkin span.mce_col_before {background-position:-700px -20px}
-.wp_themeSkin span.mce_row_after {background-position:-720px -20px}
-.wp_themeSkin span.mce_row_before {background-position:-740px -20px}
-.wp_themeSkin span.mce_merge_cells {background-position:-760px -20px}
-.wp_themeSkin span.mce_table_props {background-position:-980px -20px}
-.wp_themeSkin span.mce_row_props {background-position:-780px -20px}
-.wp_themeSkin span.mce_split_cells {background-position:-800px -20px}
-.wp_themeSkin span.mce_template {background-position:-820px -20px}
-.wp_themeSkin span.mce_visualchars {background-position:-840px -20px}
-.wp_themeSkin span.mce_abbr {background-position:-860px -20px}
-.wp_themeSkin span.mce_acronym {background-position:-880px -20px}
-.wp_themeSkin span.mce_attribs {background-position:-900px -20px}
-.wp_themeSkin span.mce_cite {background-position:-920px -20px}
-.wp_themeSkin span.mce_del {background-position:-940px -20px}
-.wp_themeSkin span.mce_ins {background-position:-960px -20px}
-.wp_themeSkin span.mce_pagebreak {background-position:0 -40px}
-.wp_themeSkin span.mce_restoredraft {background-position:-20px -40px}
-.wp_themeSkin span.mce_visualblocks {background-position: -40px -40px}
-
-/* border */
-.wp_themeSkin .mceExternalToolbar,
-.wp_themeSkin .mceButton,
-.wp_themeSkin a.mceButtonEnabled:hover,
-.wp_themeSkin a.mceButtonActive,
-.wp_themeSkin a.mceButtonSelected,
-.wp_themeSkin .mceListBox .mceText,
-.wp_themeSkin .mceListBox .mceOpen,
-.wp_themeSkin select.mceListBox,
-.wp_themeSkin .mceSplitButton a.mceAction,
-.wp_themeSkin .mceSplitButton a.mceOpen,
-.wp_themeSkin .mceSplitButton a.mceOpen:hover,
-.wp_themeSkin .mceSplitButtonSelected a.mceOpen,
-.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,
-.wp_themeSkin .mceSplitButton a.mceAction:hover,
-.wp_themeSkin div.mceColorSplitMenu table,
-.wp_themeSkin .mceColorSplitMenu a,
-.wp_themeSkin .mceColorSplitMenu a.mceMoreColors,
-.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover,
-.wp_themeSkin a.mceMoreColors:hover,
-.wp_themeSkin .mceMenu {
- border-style: solid;
- border-width: 1px;
-}
-
-.wp_themeSkin .mceListBox .mceText {
- border-right: 0 none;
-}
-
-.wp_themeSkin iframe {
- background: transparent;
-}
-
-.wp_themeSkin .mceButton {
- border-color: transparent;
-}
-
-.wp_themeSkin .mceListBox .mceText,
-.wp_themeSkin .mceListBox .mceOpen {
- border-color: transparent;
-}
-
-.wp_themeSkin a.mceButtonEnabled:hover,
-.wp_themeSkin table.mceSplitButton:hover {
- border-color: #bbb;
- background: #eee;
- background-image: -webkit-gradient(linear, left bottom, left top, from(#e5e5e5), to(#fff));
- background-image: -webkit-linear-gradient(bottom, #e5e5e5, #fff);
- background-image: -moz-linear-gradient(bottom, #e5e5e5, #fff);
- background-image: -o-linear-gradient(bottom, #e5e5e5, #fff);
- background-image: linear-gradient(to top, #e5e5e5, #fff);
-}
-
-.wp_themeSkin a.mceButton:active,
-.wp_themeSkin a.mceButtonEnabled:active,
-.wp_themeSkin a.mceButtonSelected:active,
-.wp_themeSkin a.mceButtonActive,
-.wp_themeSkin a.mceButtonActive:active,
-.wp_themeSkin a.mceButtonActive:hover,
-.wp_themeSkin .mceSplitButtonSelected table,
-.wp_themeSkin .mceSplitButtonSelected table:hover {
- outline: none;
- border-color: #999 #ccc #ccc #999;
- background: #eee;
- background-image: -webkit-gradient(linear, left bottom, left top, from(#f6f6f6), to(#e3e3e3));
- background-image: -webkit-linear-gradient(bottom, #f6f6f6, #e3e3e3);
- background-image: -moz-linear-gradient(bottom, #f6f6f6, #e3e3e3);
- background-image: -o-linear-gradient(bottom, #f6f6f6, #e3e3e3);
- background-image: linear-gradient(to top, #f6f6f6, #e3e3e3);
-}
-
-.wp_themeSkin .mceSplitButtonSelected table a.mceOpen,
-.wp_themeSkin .mceSplitButtonSelected table a.mceAction {
- border-color: #999 #ccc #ccc #999;
-}
-
-.wp_themeSkin .mceButtonDisabled {
- border-color: transparent;
-}
-
-.wp_themeSkin .mceListBox .mceOpen {
- border-left: 0;
-}
-
-.wp_themeSkin .mceListBoxEnabled:hover,
-.wp_themeSkin .mceListBoxEnabled:active,
-.wp_themeSkin .mceListBoxHover,
-.wp_themeSkin .mceListBoxHover:active,
-.wp_themeSkin .mceListBoxSelected {
- -webkit-box-shadow: inset 0 1px 1px -1px rgba(0, 0, 0, .3);
- box-shadow: inset 0 1px 1px -1px rgba(0, 0, 0, .3);
- border-color: #bbb;
-}
-
-/* SplitButton */
-.wp_themeSkin .mceSplitButton .mceLast span.mceOpen .mceIconOnly {
- display: block;
-}
-
-.wp_themeSkin .mceSplitButton a.mceAction,
-.wp_themeSkin .mceSplitButton a.mceOpen {
- border-color: transparent;
-}
-
-.wp_themeSkin .mceSplitButton:hover a {
- border-color: #bbb;
-}
-
-.wp_themeSkin .mceSplitButtonEnabled a.mceOpen,
-.wp_themeSkin .mceSplitButtonSelected a.mceOpen,
-.wp_themeSkin .mceSplitButtonActive a.mceOpen,
-.wp_themeSkin .mceSplitButtonEnabled:hover a.mceOpen {
- background-image: url("../images/down_arrow.gif");
- background-position: 1px 2px;
- background-repeat: no-repeat;
- border-left: 0;
-}
-
-.wp_themeSkin .mceSplitButtonActive td {
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover {
- border-color: #0A246A;
- background-color: #B6BDD2;
-}
-
-.wp_themeSkin a.mceMoreColors:hover {
- border-color: #0A246A;
-}
-
-.wp_themeSkin .mceMenuItemDisabled .mceText {
- color: #888;
-}
-
-#mceModalBlocker {
- background: #000;
- opacity: 0.7;
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
- filter: alpha(opacity=70);
-}
-
-/* WP specific */
</del><ins>+/* Editors */
</ins><span class="cx"> .wp-editor-wrap {
</span><span class="cx"> position: relative;
</span><span class="cx"> }
</span><span class="lines">@@ -1285,6 +404,7 @@
</span><span class="cx"> content: '\f104';
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/* Quicktags */
</ins><span class="cx"> .quicktags-toolbar {
</span><span class="cx"> border-bottom-style: solid;
</span><span class="cx"> border-bottom-width: 1px;
</span><span class="lines">@@ -1879,6 +999,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /* TinyMCE modal */
</span><ins>+/* TODO: restyle the TinyMCE 4.0 modals
</ins><span class="cx"> .clearlooks2 .mceTop {
</span><span class="cx"> border-bottom: 1px solid #ccc;
</span><span class="cx"> }
</span><span class="lines">@@ -1946,7 +1067,7 @@
</span><span class="cx"> color: #999;
</span><span class="cx"> padding-left: 12px;
</span><span class="cx"> }
</span><del>-
</del><ins>+*/
</ins><span class="cx"> /* Distraction Free Writing mode
</span><span class="cx"> * =Overlay Styles
</span><span class="cx"> -------------------------------------------------------------- */
</span><span class="lines">@@ -1961,8 +1082,8 @@
</span><span class="cx"> filter: inherit;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.fullscreen-active .fullscreen-overlay,
-.fullscreen-active #wp-fullscreen-body {
</del><ins>+.wp-fullscreen-active .fullscreen-overlay,
+.wp-fullscreen-active #wp-fullscreen-body {
</ins><span class="cx"> display: block;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1970,76 +1091,76 @@
</span><span class="cx"> z-index: 200000;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.fullscreen-active .fullscreen-fader {
</del><ins>+.wp-fullscreen-active .fullscreen-fader {
</ins><span class="cx"> display: none;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /* =Overlay Body
</span><span class="cx"> -------------------------------------------------------------- */
</span><ins>+
</ins><span class="cx"> #wp-fullscreen-body {
</span><del>- width: 100%;
</del><span class="cx"> z-index: 150005;
</span><span class="cx"> display: none;
</span><ins>+}
+
+.wp-fullscreen-wrap {
+ margin: 0;
+ padding: 0;
</ins><span class="cx"> position: absolute;
</span><del>- top: 0;
</del><span class="cx"> left: 0;
</span><del>- font-size: 12px;
</del><ins>+ right: 0;
+ bottom: 30px;
+ top: 60px;
+ z-index: 150010;
+
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-#wp-fullscreen-wrap {
- margin: 0 auto 50px;
- position: relative;
- padding-top: 60px;
</del><ins>+.wp-fullscreen-wrap .wp-editor-container,
+#wp-fullscreen-central-toolbar {
+ max-width: 100%;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-#wp-fullscreen-title {
- font-size: 1.7em;
- line-height: 100%;
- outline: medium none;
- padding: 6px 7px;
- width: 100%;
- margin-bottom: 30px;
- -webkit-box-shadow: none;
- box-shadow: none;
</del><ins>+.wp-fullscreen-active .wp-editor-tools,
+.wp-fullscreen-active .quicktags-toolbar,
+.wp-fullscreen-active .mce-toolbar-grp,
+.wp-fullscreen-active .mce-statusbar {
+ display: none;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-#wp-fullscreen-container {
- padding: 4px 10px 50px;
</del><ins>+#wp-fullscreen-status {
+ margin: auto;
+ -webkit-transition: opacity 0.4s;
+ transition: opacity 0.4s;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-#wp-fullscreen-title,
-#wp-fullscreen-container {
</del><ins>+.wp-fullscreen-active .wp-fullscreen-title,
+.wp-fullscreen-active .wp-fullscreen-title:focus,
+.wp-fullscreen-active .wp-editor-container {
</ins><span class="cx"> -webkit-border-radius: 0;
</span><span class="cx"> border-radius: 0;
</span><span class="cx"> border: 1px dashed transparent;
</span><span class="cx"> background: transparent;
</span><del>- -moz-transition-property: border-color;
- -moz-transition-duration: 0.6s;
- -webkit-transition-property: border-color;
- -webkit-transition-duration: 0.6s;
- -o-transition-property: border-color;
- -o-transition-duration: 0.6s;
- transition-property: border-color;
- transition-duration: 0.6s;
-}
-
-#wp_mce_fullscreen {
- width: 100%;
- min-height: 300px;
- border: 0;
- background: transparent;
- font-family: Consolas, Monaco, monospace;
- line-height: 1.6em;
- padding: 0;
- overflow-y: hidden;
- outline: none;
- resize: none;
</del><span class="cx"> -webkit-box-shadow: none;
</span><span class="cx"> box-shadow: none;
</span><ins>+ -webkit-transition: border-color 0.4s;
+ transition: border-color 0.4s;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+.wp-fullscreen-active .wp-editor-container {
+ margin: auto;
+}
+
+.wp-fullscreen-active .wp-fullscreen-title {
+ font-size: 1.7em;
+ line-height: 100%;
+ outline: medium none;
+ padding: 3px 7px;
+ margin: 10px auto 30px;
+ display: block;
+}
+
</ins><span class="cx"> #wp-fullscreen-tagline {
</span><del>- color: #BBBBBB;
</del><ins>+ color: #bbb;
</ins><span class="cx"> font-size: 18px;
</span><span class="cx"> float: right;
</span><span class="cx"> padding-top: 5px;
</span><span class="lines">@@ -2050,20 +1171,21 @@
</span><span class="cx"> #fullscreen-topbar {
</span><span class="cx"> background: #f5f5f5;
</span><span class="cx"> border-bottom: 1px solid #fff;
</span><del>- height: 40px;
</del><ins>+ height: 45px;
+ position: fixed;
</ins><span class="cx"> left: 0;
</span><del>- min-width: 800px;
- position: fixed;
</del><ins>+ right: 0;
</ins><span class="cx"> top: 0;
</span><span class="cx"> width: 100%;
</span><span class="cx"> z-index: 150050;
</span><ins>+ -webkit-transition: opacity 0.4s;
+ transition: opacity 0.4s;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #wp-fullscreen-toolbar {
</span><span class="cx"> padding: 6px 10px 0;
</span><span class="cx"> clear: both;
</span><span class="cx"> max-width: 1100px;
</span><del>- min-width: 820px;
</del><span class="cx"> margin: 0 auto;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2074,6 +1196,10 @@
</span><span class="cx"> float: left;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#wp-fullscreen-button-bar {
+ margin-top: 2px;
+}
+
</ins><span class="cx"> #wp-fullscreen-save {
</span><span class="cx"> float: right;
</span><span class="cx"> padding: 2px 2px 0 5px;
</span><span class="lines">@@ -2081,7 +1207,7 @@
</span><span class="cx">
</span><span class="cx"> #wp-fullscreen-count,
</span><span class="cx"> #wp-fullscreen-close {
</span><del>- padding-top: 5px;
</del><ins>+ padding-top: 6px;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #wp-fullscreen-central-toolbar {
</span><span class="lines">@@ -2094,7 +1220,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #wp-fullscreen-mode-bar {
</span><del>- padding: 1px 14px 0 0;
</del><ins>+ padding: 3px 14px 0 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #wp-fullscreen-modes a {
</span><span class="lines">@@ -2146,10 +1272,6 @@
</span><span class="cx"> border-bottom-right-radius: 3px;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#wp-fullscreen-buttons .active a {
- background: inherit;
-}
-
</del><span class="cx"> #wp-fullscreen-buttons .hidden {
</span><span class="cx"> display: none;
</span><span class="cx"> }
</span><span class="lines">@@ -2158,6 +1280,23 @@
</span><span class="cx"> opacity: 0.5;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#wp-fullscreen-buttons .mce-btn button {
+ margin: 0;
+ outline: 0 none;
+ border: 0 none;
+ white-space: nowrap;
+ width: auto;
+ background: none;
+ color: #333333;
+ cursor: pointer;
+ font-size: 18px;
+ line-height: 20px;
+ overflow: visible;
+ text-align: center;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
</ins><span class="cx"> .wp-html-mode #wp-fullscreen-buttons div {
</span><span class="cx"> display: none;
</span><span class="cx"> }
</span><span class="lines">@@ -2166,10 +1305,6 @@
</span><span class="cx"> display: block;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#fullscreen-topbar.fullscreen-make-sticky {
- display: block !important;
-}
-
</del><span class="cx"> #wp-fullscreen-save img {
</span><span class="cx"> vertical-align: middle;
</span><span class="cx"> }
</span><span class="lines">@@ -2177,82 +1312,94 @@
</span><span class="cx"> #wp-fullscreen-save img,
</span><span class="cx"> #wp-fullscreen-save span {
</span><span class="cx"> padding-right: 4px;
</span><ins>+ line-height: 26px;
</ins><span class="cx"> display: none;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /* =Thickbox Adjustments
</span><span class="cx"> -------------------------------------------------------------- */
</span><del>-.fullscreen-active #TB_overlay {
</del><ins>+.wp-fullscreen-active #TB_overlay {
</ins><span class="cx"> z-index: 150100;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.fullscreen-active #TB_window {
</del><ins>+.wp-fullscreen-active #TB_window {
</ins><span class="cx"> z-index: 150102;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /* =TinyMCE Adjustments
</span><span class="cx"> -------------------------------------------------------------- */
</span><del>-#wp_mce_fullscreen_ifr {
- background: transparent;
</del><ins>+.wp-fullscreen-active #mce-modal-block {
+ z-index: 150100 !important;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-#wp_mce_fullscreen_parent #wp_mce_fullscreen_tbl tr.mceFirst {
- display : none;
</del><ins>+.wp-fullscreen-active .mce-window {
+ z-index: 150102 !important;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-#wp-fullscreen-container .wp_themeSkin table td {
- vertical-align: top;
-}
-
</del><span class="cx"> /* Colors */
</span><span class="cx"> .fullscreen-overlay {
</span><span class="cx"> background: #fff;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.wp-fullscreen-focus #wp-fullscreen-title,
-.wp-fullscreen-focus #wp-fullscreen-container {
</del><ins>+/* =CSS 3 transitions
+-------------------------------------------------------------- */
+
+.wp-fullscreen-active #wp-fullscreen-status,
+.wp-fullscreen-active #fullscreen-topbar {
+ -webkit-transition-duration: 0.8s;
+ transition-duration: 0.8s;
+ opacity: 0;
+ filter: alpha(opacity=0);
+}
+
+.wp-fullscreen-active.wp-dfw-show-ui #wp-fullscreen-status,
+.wp-fullscreen-active.wp-dfw-show-ui #fullscreen-topbar {
+ -webkit-transition-duration: 0.4s;
+ transition-duration: 0.4s;
+ opacity: 1;
+ filter: alpha(opacity=100);
+}
+
+.wp-fullscreen-active .wp-fullscreen-title,
+.wp-fullscreen-active .wp-editor-container {
+ -webkit-transition-duration: 0.8s;
+ transition-duration: 0.8s;
+ border-color: transparent;
+}
+
+.wp-fullscreen-active.wp-dfw-show-ui .wp-fullscreen-title,
+.wp-fullscreen-active.wp-dfw-show-ui .wp-editor-container {
+ -webkit-transition-duration: 0.4s;
+ transition-duration: 0.4s;
</ins><span class="cx"> border-color: #ccc;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-/* =CSS 3 transitions
--------------------------------------------------------------- */
-
</del><span class="cx"> .fade-1000,
</span><span class="cx"> .fade-600,
</span><span class="cx"> .fade-400,
</span><span class="cx"> .fade-300 {
</span><span class="cx"> opacity: 0;
</span><del>- -moz-transition-property: opacity;
</del><span class="cx"> -webkit-transition-property: opacity;
</span><del>- -o-transition-property: opacity;
</del><span class="cx"> transition-property: opacity;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .fade-1000 {
</span><del>- -moz-transition-duration: 1s;
</del><span class="cx"> -webkit-transition-duration: 1s;
</span><del>- -o-transition-duration: 1s;
</del><span class="cx"> transition-duration: 1s;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .fade-600 {
</span><del>- -moz-transition-duration: 0.6s;
</del><span class="cx"> -webkit-transition-duration: 0.6s;
</span><del>- -o-transition-duration: 0.6s;
</del><span class="cx"> transition-duration: 0.6s;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .fade-400 {
</span><del>- -moz-transition-duration: 0.4s;
</del><span class="cx"> -webkit-transition-duration: 0.4s;
</span><del>- -o-transition-duration: 0.4s;
</del><span class="cx"> transition-duration: 0.4s;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .fade-300 {
</span><del>- -moz-transition-duration: 0.3s;
</del><span class="cx"> -webkit-transition-duration: 0.3s;
</span><del>- -o-transition-duration: 0.3s;
</del><span class="cx"> transition-duration: 0.3s;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2262,21 +1409,13 @@
</span><span class="cx">
</span><span class="cx"> /* =Localization
</span><span class="cx"> -------------------------------------------------------------- */
</span><del>-.rtl .wp_themeSkin .mceColorSplitMenu a.mceMoreColors,
-.rtl .wp_themeSkin .mceMenu .mceText,
</del><span class="cx"> .rtl .wp-switch-editor,
</span><del>-.rtl .quicktags-toolbar input,
-.rtl .clearlooks2 .mceTop span,
-.rtl .wp_themeSkin .mceColorSplitMenu a.mceMoreColors {
</del><ins>+.rtl .quicktags-toolbar input {
</ins><span class="cx"> font-family: Tahoma, sans-serif;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-html:lang(he-il) .rtl .wp_themeSkin .mceColorSplitMenu a.mceMoreColors,
-html:lang(he-il) .rtl .wp_themeSkin .mceMenu .mceText,
</del><span class="cx"> html:lang(he-il) .rtl .wp-switch-editor,
</span><del>-html:lang(he-il) .rtl .quicktags-toolbar input,
-html:lang(he-il) .rtl .clearlooks2 .mceTop span,
-html:lang(he-il) .rtl .wp_themeSkin .mceColorSplitMenu a.mceMoreColors {
</del><ins>+html:lang(he-il) .rtl .quicktags-toolbar input {
</ins><span class="cx"> font-family: Arial, sans-serif;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2291,24 +1430,12 @@
</span><span class="cx"> background: none;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- .wp_themeSkin .mceListBox .mceOpen,
- .wp_themeSkin .mceListBoxHover .mceOpen,
- .wp_themeSkin .mceListBoxSelected .mceOpen,
- .wp_themeSkin table.mceListBoxEnabled .mceOpen {
- background-image: url('../images/down_arrow-2x.gif');
- background-size: 10px 20px;
- }
-
- .wp_themeSkin .mceSplitButtonEnabled a.mceOpen,
- .wp_themeSkin .mceSplitButtonSelected a.mceOpen,
- .wp_themeSkin .mceSplitButtonActive a.mceOpen,
- .wp_themeSkin .mceSplitButtonEnabled:hover a.mceOpen {
- background-image: url('../images/down_arrow-2x.gif');
- background-size: 10px 20px;
- }
-
</del><span class="cx"> #wp-link .toggle-arrow {
</span><span class="cx"> background: transparent url('../images/toggle-arrow-2x.png') top left no-repeat;
</span><span class="cx"> background-size: 19px 69px;
</span><span class="cx"> }
</span><span class="cx"> }
</span><ins>+
+/* TODO: DFW responsive */
+
+
</ins></span></pre></div>
<a id="trunksrcwpincludesjsautosavejs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/autosave.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/autosave.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/autosave.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -43,23 +43,13 @@
</span><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> window.onbeforeunload = function(){
</span><del>- var editor = typeof(tinymce) != 'undefined' ? tinymce.activeEditor : false, compareString;
</del><ins>+ var editor = typeof(tinymce) != 'undefined' ? tinymce.activeEditor : false;
</ins><span class="cx">
</span><span class="cx"> if ( editor && ! editor.isHidden() ) {
</span><span class="cx"> if ( editor.isDirty() )
</span><span class="cx"> return autosaveL10n.saveAlert;
</span><span class="cx"> } else {
</span><del>- if ( fullscreen && fullscreen.settings.visible ) {
- compareString = wp.autosave.getCompareString({
- post_title: $('#wp-fullscreen-title').val() || '',
- content: $('#wp_mce_fullscreen').val() || '',
- excerpt: $('#excerpt').val() || ''
- });
- } else {
- compareString = wp.autosave.getCompareString();
- }
-
- if ( compareString != autosaveLast )
</del><ins>+ if ( wp.autosave.getCompareString() != autosaveLast )
</ins><span class="cx"> return autosaveL10n.saveAlert;
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="lines">@@ -115,25 +105,23 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> // This code is meant to allow tabbing from Title to Post content.
</span><del>- $('#title').on('keydown.editor-focus', function(e) {
- var ed;
</del><ins>+ $('#title').on( 'keydown.editor-focus', function( event ) {
+ var editor;
</ins><span class="cx">
</span><del>- if ( e.which != 9 )
- return;
</del><ins>+ if ( event.which === 9 && ! event.ctrlKey && ! event.altKey && ! event.shiftKey ) {
+ if ( typeof tinymce !== 'undefined' ) {
+ editor = tinymce.get('content');
+ }
</ins><span class="cx">
</span><del>- if ( !e.ctrlKey && !e.altKey && !e.shiftKey ) {
- if ( typeof(tinymce) != 'undefined' )
- ed = tinymce.get('content');
-
- if ( ed && !ed.isHidden() ) {
- $(this).one('keyup', function(){
- $('#content_tbl td.mceToolbar > a').focus();
</del><ins>+ if ( editor && ! editor.isHidden() ) {
+ $(this).one( 'keyup', function() {
+ editor.focus();
</ins><span class="cx"> });
</span><span class="cx"> } else {
</span><span class="cx"> $('#content').focus();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- e.preventDefault();
</del><ins>+ event.preventDefault();
</ins><span class="cx"> }
</span><span class="cx"> });
</span><span class="cx">
</span><span class="lines">@@ -345,20 +333,12 @@
</span><span class="cx"> data.autosave = false;
</span><span class="cx"> return data;
</span><span class="cx"> } else {
</span><del>- if ( 'mce_fullscreen' == ed.id )
- tinymce.get('content').setContent(ed.getContent({format : 'raw'}), {format : 'raw'});
-
</del><span class="cx"> tinymce.triggerSave();
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ( typeof fullscreen != 'undefined' && fullscreen.settings.visible ) {
- data.post_title = $('#wp-fullscreen-title').val() || '';
- data.content = $('#wp_mce_fullscreen').val() || '';
- } else {
- data.post_title = $('#title').val() || '';
- data.content = $('#content').val() || '';
- }
</del><ins>+ data.post_title = $('#title').val() || '';
+ data.content = $('#content').val() || '';
</ins><span class="cx">
</span><span class="cx"> /*
</span><span class="cx"> // We haven't been saving tags with autosave since 2.8... Start again?
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaeditorjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/media-editor.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/media-editor.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/media-editor.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -466,16 +466,13 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> } else if ( mce ) {
</span><del>- if ( tinymce.activeEditor && (tinymce.activeEditor.id == 'mce_fullscreen' || tinymce.activeEditor.id == 'wp_mce_fullscreen') )
- ed = tinymce.activeEditor;
- else
- ed = tinymce.get(wpActiveEditor);
</del><ins>+ ed = tinymce.get( wpActiveEditor );
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if ( ed && !ed.isHidden() ) {
</del><ins>+ if ( ed && ! ed.isHidden() ) {
</ins><span class="cx"> // restore caret position on IE
</span><del>- if ( tinymce.isIE && ed.windowManager.insertimagebookmark )
- ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark);
</del><ins>+ // if ( tinymce.isIE && ed.windowManager.insertimagebookmark )
+ // ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark);
</ins><span class="cx">
</span><span class="cx"> if ( h.indexOf('[caption') !== -1 ) {
</span><span class="cx"> if ( ed.wpSetImgCaption )
</span><span class="lines">@@ -664,7 +661,7 @@
</span><span class="cx"> options = options || {};
</span><span class="cx">
</span><span class="cx"> id = this.id( id );
</span><del>-
</del><ins>+/*
</ins><span class="cx"> // Save a bookmark of the caret position in IE.
</span><span class="cx"> if ( typeof tinymce !== 'undefined' ) {
</span><span class="cx"> editor = tinymce.get( id );
</span><span class="lines">@@ -674,7 +671,7 @@
</span><span class="cx"> editor.windowManager.insertimagebookmark = editor.selection.getBookmark();
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>-
</del><ins>+*/
</ins><span class="cx"> workflow = this.get( id );
</span><span class="cx">
</span><span class="cx"> // Redo workflow if state has changed
</span></span></pre></div>
<a id="trunksrcwpincludesjsquicktagsjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/quicktags.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/quicktags.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/quicktags.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -185,6 +185,9 @@
</span><span class="cx"> tb = document.createElement('div');
</span><span class="cx"> tb.id = toolbar_id;
</span><span class="cx"> tb.className = 'quicktags-toolbar';
</span><ins>+ tb.onclick = function() {
+ window.wpActiveEditor = id;
+ };
</ins><span class="cx">
</span><span class="cx"> canvas.parentNode.insertBefore(tb, canvas);
</span><span class="cx"> t.toolbar = tb;
</span><span class="lines">@@ -563,8 +566,8 @@
</span><span class="cx"> qt.LinkButton.prototype.callback = function(e, c, ed, defaultValue) {
</span><span class="cx"> var URL, t = this;
</span><span class="cx">
</span><del>- if ( typeof(wpLink) !== 'undefined' ) {
- wpLink.open();
</del><ins>+ if ( typeof wpLink !== 'undefined' ) {
+ wpLink.open( ed.id );
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -605,11 +608,11 @@
</span><span class="cx"> };
</span><span class="cx"> qt.FullscreenButton.prototype = new qt.Button();
</span><span class="cx"> qt.FullscreenButton.prototype.callback = function(e, c) {
</span><del>- if ( !c.id || typeof(fullscreen) === 'undefined' ) {
</del><ins>+ if ( ! c.id || typeof wp === 'undefined' || ! wp.editor || ! wp.editor.fullscreen ) {
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- fullscreen.on();
</del><ins>+ wp.editor.fullscreen.on();
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> qt.TextDirectionButton = function() {
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcelangswplangsenjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/langs/wp-langs-en.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/langs/wp-langs-en.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/langs/wp-langs-en.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,504 +1,519 @@
</span><del>-tinyMCE.addI18n({en:{
-common:{
-edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?",
-apply:"Apply",
-insert:"Insert",
-update:"Update",
-cancel:"Cancel",
-close:"Close",
-browse:"Browse",
-class_name:"Class",
-not_set:"-- Not set --",
-clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.",
-clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",
-popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",
-invalid_data:"ERROR: Invalid values entered, these are marked in red.",
-invalid_data_number:"{#field} must be a number",
-invalid_data_min:"{#field} must be a number greater than {#min}",
-invalid_data_size:"{#field} must be a number or percentage",
-more_colors:"More colors"
-},
-colors:{
-"000000":"Black",
-"993300":"Burnt orange",
-"333300":"Dark olive",
-"003300":"Dark green",
-"003366":"Dark azure",
-"000080":"Navy Blue",
-"333399":"Indigo",
-"333333":"Very dark gray",
-"800000":"Maroon",
-"FF6600":"Orange",
-"808000":"Olive",
-"008000":"Green",
-"008080":"Teal",
-"0000FF":"Blue",
-"666699":"Grayish blue",
-"808080":"Gray",
-"FF0000":"Red",
-"FF9900":"Amber",
-"99CC00":"Yellow green",
-"339966":"Sea green",
-"33CCCC":"Turquoise",
-"3366FF":"Royal blue",
-"800080":"Purple",
-"999999":"Medium gray",
-"FF00FF":"Magenta",
-"FFCC00":"Gold",
-"FFFF00":"Yellow",
-"00FF00":"Lime",
-"00FFFF":"Aqua",
-"00CCFF":"Sky blue",
-"993366":"Brown",
-"C0C0C0":"Silver",
-"FF99CC":"Pink",
-"FFCC99":"Peach",
-"FFFF99":"Light yellow",
-"CCFFCC":"Pale green",
-"CCFFFF":"Pale cyan",
-"99CCFF":"Light sky blue",
-"CC99FF":"Plum",
-"FFFFFF":"White"
-},
-contextmenu:{
-align:"Alignment",
-left:"Left",
-center:"Center",
-right:"Right",
-full:"Full"
-},
-insertdatetime:{
-date_fmt:"%Y-%m-%d",
-time_fmt:"%H:%M:%S",
-insertdate_desc:"Insert date",
-inserttime_desc:"Insert time",
-months_long:"January,February,March,April,May,June,July,August,September,October,November,December",
-months_short:"Jan_January_abbreviation,Feb_February_abbreviation,Mar_March_abbreviation,Apr_April_abbreviation,May_May_abbreviation,Jun_June_abbreviation,Jul_July_abbreviation,Aug_August_abbreviation,Sep_September_abbreviation,Oct_October_abbreviation,Nov_November_abbreviation,Dec_December_abbreviation",
-day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",
-day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat"
-},
-print:{
-print_desc:"Print"
-},
-preview:{
-preview_desc:"Preview"
-},
-directionality:{
-ltr_desc:"Direction left to right",
-rtl_desc:"Direction right to left"
-},
-layer:{
-insertlayer_desc:"Insert new layer",
-forward_desc:"Move forward",
-backward_desc:"Move backward",
-absolute_desc:"Toggle absolute positioning",
-content:"New layer..."
-},
-save:{
-save_desc:"Save",
-cancel_desc:"Cancel all changes"
-},
-nonbreaking:{
-nonbreaking_desc:"Insert non-breaking space character"
-},
-iespell:{
-iespell_desc:"Run spell checking",
-download:"ieSpell not detected. Do you want to install it now?"
-},
-advhr:{
-advhr_desc:"Horizontal rule"
-},
-emotions:{
-emotions_desc:"Emotions"
-},
-searchreplace:{
-search_desc:"Find",
-replace_desc:"Find/Replace"
-},
-advimage:{
-image_desc:"Insert/edit image"
-},
-advlink:{
-link_desc:"Insert/edit link"
-},
-xhtmlxtras:{
-cite_desc:"Citation",
-abbr_desc:"Abbreviation",
-acronym_desc:"Acronym",
-del_desc:"Deletion",
-ins_desc:"Insertion",
-attribs_desc:"Insert/Edit Attributes"
-},
-style:{
-desc:"Edit CSS Style"
-},
-paste:{
-paste_text_desc:"Paste as Plain Text",
-paste_word_desc:"Paste from Word",
-selectall_desc:"Select All",
-plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.",
-plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode."
-},
-paste_dlg:{
-text_title:"Use CTRL + V on your keyboard to paste the text into the window.",
-text_linebreaks:"Keep linebreaks",
-word_title:"Use CTRL + V on your keyboard to paste the text into the window."
-},
-table:{
-desc:"Inserts a new table",
-row_before_desc:"Insert row before",
-row_after_desc:"Insert row after",
-delete_row_desc:"Delete row",
-col_before_desc:"Insert column before",
-col_after_desc:"Insert column after",
-delete_col_desc:"Remove column",
-split_cells_desc:"Split merged table cells",
-merge_cells_desc:"Merge table cells",
-row_desc:"Table row properties",
-cell_desc:"Table cell properties",
-props_desc:"Table properties",
-paste_row_before_desc:"Paste table row before",
-paste_row_after_desc:"Paste table row after",
-cut_row_desc:"Cut table row",
-copy_row_desc:"Copy table row",
-del:"Delete table",
-row:"Row",
-col:"Column",
-cell:"Cell"
-},
-autosave:{
-unload_msg:"The changes you made will be lost if you navigate away from this page."
-},
-fullscreen:{
-desc:"Toggle fullscreen mode (Alt + Shift + G)"
-},
-media:{
-desc:"Insert / edit embedded media",
-edit:"Edit embedded media"
-},
-fullpage:{
-desc:"Document properties"
-},
-template:{
-desc:"Insert predefined template content"
-},
-visualchars:{
-desc:"Visual control characters on/off."
-},
-spellchecker:{
-desc:"Toggle spellchecker (Alt + Shift + N)",
-menu:"Spellchecker settings",
-ignore_word:"Ignore word",
-ignore_words:"Ignore all",
-langs:"Languages",
-wait:"Please wait...",
-sug:"Suggestions",
-no_sug:"No suggestions",
-no_mpell:"No misspellings found.",
-learn_word:"Learn word"
-},
-pagebreak:{
-desc:"Insert Page Break"
-},
-advlist:{
-types:"Types",
-def:"Default",
-lower_alpha:"Lower alpha",
-lower_greek:"Lower greek",
-lower_roman:"Lower roman",
-upper_alpha:"Upper alpha",
-upper_roman:"Upper roman",
-circle:"Circle",
-disc:"Disc",
-square:"Square"
-},
-aria:{
-rich_text_area:"Rich Text Area"
-},
-wordcount:{
-words:"Words: "
-}
-}});
</del><ins>+/**
+ * TinyMCE 3.x language strings
+ *
+ * Loaded only when external plugins are added to TinyMCE.
+ */
+( function() {
+ var main = {}, lang = 'en';
</ins><span class="cx">
</span><del>-tinyMCE.addI18n("en.advanced",{
-style_select:"Styles",
-font_size:"Font size",
-fontdefault:"Font family",
-block:"Format",
-paragraph:"Paragraph",
-div:"Div",
-address:"Address",
-pre:"Preformatted",
-h1:"Heading 1",
-h2:"Heading 2",
-h3:"Heading 3",
-h4:"Heading 4",
-h5:"Heading 5",
-h6:"Heading 6",
-blockquote:"Blockquote",
-code:"Code",
-samp:"Code sample",
-dt:"Definition term ",
-dd:"Definition description",
-bold_desc:"Bold (Ctrl + B)",
-italic_desc:"Italic (Ctrl + I)",
-underline_desc:"Underline",
-striketrough_desc:"Strikethrough (Alt + Shift + D)",
-justifyleft_desc:"Align Left (Alt + Shift + L)",
-justifycenter_desc:"Align Center (Alt + Shift + C)",
-justifyright_desc:"Align Right (Alt + Shift + R)",
-justifyfull_desc:"Align Full (Alt + Shift + J)",
-bullist_desc:"Unordered list (Alt + Shift + U)",
-numlist_desc:"Ordered list (Alt + Shift + O)",
-outdent_desc:"Outdent",
-indent_desc:"Indent",
-undo_desc:"Undo (Ctrl + Z)",
-redo_desc:"Redo (Ctrl + Y)",
-link_desc:"Insert/edit link (Alt + Shift + A)",
-unlink_desc:"Unlink (Alt + Shift + S)",
-image_desc:"Insert/edit image (Alt + Shift + M)",
-cleanup_desc:"Cleanup messy code",
-code_desc:"Edit HTML Source",
-sub_desc:"Subscript",
-sup_desc:"Superscript",
-hr_desc:"Insert horizontal ruler",
-removeformat_desc:"Remove formatting",
-forecolor_desc:"Select text color",
-backcolor_desc:"Select background color",
-charmap_desc:"Insert custom character",
-visualaid_desc:"Toggle guidelines/invisible elements",
-anchor_desc:"Insert/edit anchor",
-cut_desc:"Cut",
-copy_desc:"Copy",
-paste_desc:"Paste",
-image_props_desc:"Image properties",
-newdocument_desc:"New document",
-help_desc:"Help",
-blockquote_desc:"Blockquote (Alt + Shift + Q)",
-clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.",
-path:"Path",
-newdocument:"Are you sure you want to clear all contents?",
-toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",
-more_colors:"More colors",
-shortcuts_desc:"Accessibility Help",
-help_shortcut:" Press ALT F10 for toolbar. Press ALT 0 for help.",
-rich_text_area:"Rich Text Area",
-toolbar:"Toolbar"
-});
</del><ins>+ if ( typeof tinyMCEPreInit !== 'undefined' && tinyMCEPreInit.ref.language !== 'en' ) {
+ lang = tinyMCEPreInit.ref.language;
+ }
</ins><span class="cx">
</span><del>-tinyMCE.addI18n("en.advanced_dlg",{
-about_title:"About TinyMCE",
-about_general:"About",
-about_help:"Help",
-about_license:"License",
-about_plugins:"Plugins",
-about_plugin:"Plugin",
-about_author:"Author",
-about_version:"Version",
-about_loaded:"Loaded plugins",
-anchor_title:"Insert/edit anchor",
-anchor_name:"Anchor name",
-code_title:"HTML Source Editor",
-code_wordwrap:"Word wrap",
-colorpicker_title:"Select a color",
-colorpicker_picker_tab:"Picker",
-colorpicker_picker_title:"Color picker",
-colorpicker_palette_tab:"Palette",
-colorpicker_palette_title:"Palette colors",
-colorpicker_named_tab:"Named",
-colorpicker_named_title:"Named colors",
-colorpicker_color:"Color:",
-colorpicker_name:"Name:",
-charmap_title:"Select custom character",
-charmap_usage:"Use left and right arrows to navigate.",
-image_title:"Insert/edit image",
-image_src:"Image URL",
-image_alt:"Image description",
-image_list:"Image list",
-image_border:"Border",
-image_dimensions:"Dimensions",
-image_vspace:"Vertical space",
-image_hspace:"Horizontal space",
-image_align:"Alignment",
-image_align_baseline:"Baseline",
-image_align_top:"Top",
-image_align_middle:"Middle",
-image_align_bottom:"Bottom",
-image_align_texttop:"Text top",
-image_align_textbottom:"Text bottom",
-image_align_left:"Left",
-image_align_right:"Right",
-link_title:"Insert/edit link",
-link_url:"Link URL",
-link_target:"Target",
-link_target_same:"Open link in the same window",
-link_target_blank:"Open link in a new window",
-link_titlefield:"Title",
-link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",
-link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",
-link_list:"Link list",
-accessibility_help:"Accessibility Help",
-accessibility_usage_title:"General Usage"
-});
</del><ins>+ main[lang] = {
+ common: {
+ edit_confirm: "Do you want to use the WYSIWYG mode for this textarea?",
+ apply: "Apply",
+ insert: "Insert",
+ update: "Update",
+ cancel: "Cancel",
+ close: "Close",
+ browse: "Browse",
+ class_name: "Class",
+ not_set: "-- Not set --",
+ clipboard_msg: "Copy/Cut/Paste is not available in Mozilla and Firefox.",
+ clipboard_no_support: "Currently not supported by your browser, use keyboard shortcuts instead.",
+ popup_blocked: "Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",
+ invalid_data: "ERROR: Invalid values entered, these are marked in red.",
+ invalid_data_number: "{#field} must be a number",
+ invalid_data_min: "{#field} must be a number greater than {#min}",
+ invalid_data_size: "{#field} must be a number or percentage",
+ more_colors: "More colors"
+ },
+ colors: {
+ "000000": "Black",
+ "993300": "Burnt orange",
+ "333300": "Dark olive",
+ "003300": "Dark green",
+ "003366": "Dark azure",
+ "000080": "Navy Blue",
+ "333399": "Indigo",
+ "333333": "Very dark gray",
+ "800000": "Maroon",
+ "FF6600": "Orange",
+ "808000": "Olive",
+ "008000": "Green",
+ "008080": "Teal",
+ "0000FF": "Blue",
+ "666699": "Grayish blue",
+ "808080": "Gray",
+ "FF0000": "Red",
+ "FF9900": "Amber",
+ "99CC00": "Yellow green",
+ "339966": "Sea green",
+ "33CCCC": "Turquoise",
+ "3366FF": "Royal blue",
+ "800080": "Purple",
+ "999999": "Medium gray",
+ "FF00FF": "Magenta",
+ "FFCC00": "Gold",
+ "FFFF00": "Yellow",
+ "00FF00": "Lime",
+ "00FFFF": "Aqua",
+ "00CCFF": "Sky blue",
+ "993366": "Brown",
+ "C0C0C0": "Silver",
+ "FF99CC": "Pink",
+ "FFCC99": "Peach",
+ "FFFF99": "Light yellow",
+ "CCFFCC": "Pale green",
+ "CCFFFF": "Pale cyan",
+ "99CCFF": "Light sky blue",
+ "CC99FF": "Plum",
+ "FFFFFF": "White"
+ },
+ contextmenu: {
+ align: "Alignment",
+ left: "Left",
+ center: "Center",
+ right: "Right",
+ full: "Full"
+ },
+ insertdatetime: {
+ date_fmt: "%Y-%m-%d",
+ time_fmt: "%H:%M:%S",
+ insertdate_desc: "Insert date",
+ inserttime_desc: "Insert time",
+ months_long: "January,February,March,April,May,June,July,August,September,October,November,December",
+ months_short: "Jan_January_abbreviation,Feb_February_abbreviation,Mar_March_abbreviation,Apr_April_abbreviation,May_May_abbreviation,Jun_June_abbreviation,Jul_July_abbreviation,Aug_August_abbreviation,Sep_September_abbreviation,Oct_October_abbreviation,Nov_November_abbreviation,Dec_December_abbreviation",
+ day_long: "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",
+ day_short: "Sun,Mon,Tue,Wed,Thu,Fri,Sat"
+ },
+ print: {
+ print_desc: "Print"
+ },
+ preview: {
+ preview_desc: "Preview"
+ },
+ directionality: {
+ ltr_desc: "Direction left to right",
+ rtl_desc: "Direction right to left"
+ },
+ layer: {
+ insertlayer_desc: "Insert new layer",
+ forward_desc: "Move forward",
+ backward_desc: "Move backward",
+ absolute_desc: "Toggle absolute positioning",
+ content: "New layer..."
+ },
+ save: {
+ save_desc: "Save",
+ cancel_desc: "Cancel all changes"
+ },
+ nonbreaking: {
+ nonbreaking_desc: "Insert non-breaking space character"
+ },
+ iespell: {
+ iespell_desc: "Run spell checking",
+ download: "ieSpell not detected. Do you want to install it now?"
+ },
+ advhr: {
+ advhr_desc: "Horizontal rule"
+ },
+ emotions: {
+ emotions_desc: "Emotions"
+ },
+ searchreplace: {
+ search_desc: "Find",
+ replace_desc: "Find/Replace"
+ },
+ advimage: {
+ image_desc: "Insert/edit image"
+ },
+ advlink: {
+ link_desc: "Insert/edit link"
+ },
+ xhtmlxtras: {
+ cite_desc: "Citation",
+ abbr_desc: "Abbreviation",
+ acronym_desc: "Acronym",
+ del_desc: "Deletion",
+ ins_desc: "Insertion",
+ attribs_desc: "Insert/Edit Attributes"
+ },
+ style: {
+ desc: "Edit CSS Style"
+ },
+ paste: {
+ paste_text_desc: "Paste as Plain Text",
+ paste_word_desc: "Paste from Word",
+ selectall_desc: "Select All",
+ plaintext_mode_sticky: "Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.",
+ plaintext_mode: "Paste is now in plain text mode. Click again to toggle back to regular paste mode."
+ },
+ paste_dlg: {
+ text_title: "Use CTRL + V on your keyboard to paste the text into the window.",
+ text_linebreaks: "Keep linebreaks",
+ word_title: "Use CTRL + V on your keyboard to paste the text into the window."
+ },
+ table: {
+ desc: "Inserts a new table",
+ row_before_desc: "Insert row before",
+ row_after_desc: "Insert row after",
+ delete_row_desc: "Delete row",
+ col_before_desc: "Insert column before",
+ col_after_desc: "Insert column after",
+ delete_col_desc: "Remove column",
+ split_cells_desc: "Split merged table cells",
+ merge_cells_desc: "Merge table cells",
+ row_desc: "Table row properties",
+ cell_desc: "Table cell properties",
+ props_desc: "Table properties",
+ paste_row_before_desc: "Paste table row before",
+ paste_row_after_desc: "Paste table row after",
+ cut_row_desc: "Cut table row",
+ copy_row_desc: "Copy table row",
+ del: "Delete table",
+ row: "Row",
+ col: "Column",
+ cell: "Cell"
+ },
+ autosave: {
+ unload_msg: "The changes you made will be lost if you navigate away from this page."
+ },
+ fullscreen: {
+ desc: "Toggle fullscreen mode (Alt + Shift + G)"
+ },
+ media: {
+ desc: "Insert / edit embedded media",
+ edit: "Edit embedded media"
+ },
+ fullpage: {
+ desc: "Document properties"
+ },
+ template: {
+ desc: "Insert predefined template content"
+ },
+ visualchars: {
+ desc: "Visual control characters on/off."
+ },
+ spellchecker: {
+ desc: "Toggle spellchecker (Alt + Shift + N)",
+ menu: "Spellchecker settings",
+ ignore_word: "Ignore word",
+ ignore_words: "Ignore all",
+ langs: "Languages",
+ wait: "Please wait...",
+ sug: "Suggestions",
+ no_sug: "No suggestions",
+ no_mpell: "No misspellings found.",
+ learn_word: "Learn word"
+ },
+ pagebreak: {
+ desc: "Insert Page Break"
+ },
+ advlist:{
+ types: "Types",
+ def: "Default",
+ lower_alpha: "Lower alpha",
+ lower_greek: "Lower greek",
+ lower_roman: "Lower roman",
+ upper_alpha: "Upper alpha",
+ upper_roman: "Upper roman",
+ circle: "Circle",
+ disc: "Disc",
+ square: "Square"
+ },
+ aria: {
+ rich_text_area: "Rich Text Area"
+ },
+ wordcount:{
+ words: "Words: "
+ }
+ };
</ins><span class="cx">
</span><del>-tinyMCE.addI18n("en.media_dlg",{
-title:"Insert / edit embedded media",
-general:"General",
-advanced:"Advanced",
-file:"File/URL",
-list:"List",
-size:"Dimensions",
-preview:"Preview",
-constrain_proportions:"Constrain proportions",
-type:"Type",
-id:"Id",
-name:"Name",
-class_name:"Class",
-vspace:"V-Space",
-hspace:"H-Space",
-play:"Auto play",
-loop:"Loop",
-menu:"Show menu",
-quality:"Quality",
-scale:"Scale",
-align:"Align",
-salign:"SAlign",
-wmode:"WMode",
-bgcolor:"Background",
-base:"Base",
-flashvars:"Flashvars",
-liveconnect:"SWLiveConnect",
-autohref:"AutoHREF",
-cache:"Cache",
-hidden:"Hidden",
-controller:"Controller",
-kioskmode:"Kiosk mode",
-playeveryframe:"Play every frame",
-targetcache:"Target cache",
-correction:"No correction",
-enablejavascript:"Enable JavaScript",
-starttime:"Start time",
-endtime:"End time",
-href:"href",
-qtsrcchokespeed:"Choke speed",
-target:"Target",
-volume:"Volume",
-autostart:"Auto start",
-enabled:"Enabled",
-fullscreen:"Fullscreen",
-invokeurls:"Invoke URLs",
-mute:"Mute",
-stretchtofit:"Stretch to fit",
-windowlessvideo:"Windowless video",
-balance:"Balance",
-baseurl:"Base URL",
-captioningid:"Captioning id",
-currentmarker:"Current marker",
-currentposition:"Current position",
-defaultframe:"Default frame",
-playcount:"Play count",
-rate:"Rate",
-uimode:"UI Mode",
-flash_options:"Flash options",
-qt_options:"QuickTime options",
-wmp_options:"Windows media player options",
-rmp_options:"Real media player options",
-shockwave_options:"Shockwave options",
-autogotourl:"Auto goto URL",
-center:"Center",
-imagestatus:"Image status",
-maintainaspect:"Maintain aspect",
-nojava:"No java",
-prefetch:"Prefetch",
-shuffle:"Shuffle",
-console:"Console",
-numloop:"Num loops",
-controls:"Controls",
-scriptcallbacks:"Script callbacks",
-swstretchstyle:"Stretch style",
-swstretchhalign:"Stretch H-Align",
-swstretchvalign:"Stretch V-Align",
-sound:"Sound",
-progress:"Progress",
-qtsrc:"QT Src",
-qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.",
-align_top:"Top",
-align_right:"Right",
-align_bottom:"Bottom",
-align_left:"Left",
-align_center:"Center",
-align_top_left:"Top left",
-align_top_right:"Top right",
-align_bottom_left:"Bottom left",
-align_bottom_right:"Bottom right",
-flv_options:"Flash video options",
-flv_scalemode:"Scale mode",
-flv_buffer:"Buffer",
-flv_startimage:"Start image",
-flv_starttime:"Start time",
-flv_defaultvolume:"Default volume",
-flv_hiddengui:"Hidden GUI",
-flv_autostart:"Auto start",
-flv_loop:"Loop",
-flv_showscalemodes:"Show scale modes",
-flv_smoothvideo:"Smooth video",
-flv_jscallback:"JS Callback",
-html5_video_options:"HTML5 Video Options",
-altsource1:"Alternative source 1",
-altsource2:"Alternative source 2",
-preload:"Preload",
-poster:"Poster",
-source:"Source"
-});
</del><ins>+ tinyMCE.addI18n( main );
</ins><span class="cx">
</span><del>-tinyMCE.addI18n("en.wordpress",{
-wp_adv_desc:"Show/Hide Kitchen Sink (Alt + Shift + Z)",
-wp_more_desc:"Insert More Tag (Alt + Shift + T)",
-wp_page_desc:"Insert Page break (Alt + Shift + P)",
-wp_help_desc:"Help (Alt + Shift + H)",
-wp_more_alt:"More...",
-wp_page_alt:"Next page...",
-add_media:"Add Media",
-add_image:"Add an Image",
-add_video:"Add Video",
-add_audio:"Add Audio",
-editgallery:"Edit Gallery",
-delgallery:"Delete Gallery",
-wp_fullscreen_desc:"Distraction Free Writing mode (Alt + Shift + W)"
-});
</del><ins>+ tinyMCE.addI18n( lang + ".advanced", {
+ style_select: "Styles",
+ font_size: "Font size",
+ fontdefault: "Font family",
+ block: "Format",
+ paragraph: "Paragraph",
+ div: "Div",
+ address: "Address",
+ pre: "Preformatted",
+ h1: "Heading 1",
+ h2: "Heading 2",
+ h3: "Heading 3",
+ h4: "Heading 4",
+ h5: "Heading 5",
+ h6: "Heading 6",
+ blockquote: "Blockquote",
+ code: "Code",
+ samp: "Code sample",
+ dt: "Definition term ",
+ dd: "Definition description",
+ bold_desc: "Bold (Ctrl + B)",
+ italic_desc: "Italic (Ctrl + I)",
+ underline_desc: "Underline",
+ striketrough_desc: "Strikethrough (Alt + Shift + D)",
+ justifyleft_desc: "Align Left (Alt + Shift + L)",
+ justifycenter_desc: "Align Center (Alt + Shift + C)",
+ justifyright_desc: "Align Right (Alt + Shift + R)",
+ justifyfull_desc: "Align Full (Alt + Shift + J)",
+ bullist_desc: "Unordered list (Alt + Shift + U)",
+ numlist_desc: "Ordered list (Alt + Shift + O)",
+ outdent_desc: "Outdent",
+ indent_desc: "Indent",
+ undo_desc: "Undo (Ctrl + Z)",
+ redo_desc: "Redo (Ctrl + Y)",
+ link_desc: "Insert/edit link (Alt + Shift + A)",
+ unlink_desc: "Unlink (Alt + Shift + S)",
+ image_desc: "Insert/edit image (Alt + Shift + M)",
+ cleanup_desc: "Cleanup messy code",
+ code_desc: "Edit HTML Source",
+ sub_desc: "Subscript",
+ sup_desc: "Superscript",
+ hr_desc: "Insert horizontal ruler",
+ removeformat_desc: "Remove formatting",
+ forecolor_desc: "Select text color",
+ backcolor_desc: "Select background color",
+ charmap_desc: "Insert custom character",
+ visualaid_desc: "Toggle guidelines/invisible elements",
+ anchor_desc: "Insert/edit anchor",
+ cut_desc: "Cut",
+ copy_desc: "Copy",
+ paste_desc: "Paste",
+ image_props_desc: "Image properties",
+ newdocument_desc: "New document",
+ help_desc: "Help",
+ blockquote_desc: "Blockquote (Alt + Shift + Q)",
+ clipboard_msg: "Copy/Cut/Paste is not available in Mozilla and Firefox.",
+ path: "Path",
+ newdocument: "Are you sure you want to clear all contents?",
+ toolbar_focus: "Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",
+ more_colors: "More colors",
+ shortcuts_desc: "Accessibility Help",
+ help_shortcut: " Press ALT F10 for toolbar. Press ALT 0 for help.",
+ rich_text_area: "Rich Text Area",
+ toolbar: "Toolbar"
+ });
</ins><span class="cx">
</span><del>-tinyMCE.addI18n("en.wpeditimage",{
-edit_img:"Edit Image",
-del_img:"Delete Image",
-adv_settings:"Advanced Settings",
-none:"None",
-size:"Size",
-thumbnail:"Thumbnail",
-medium:"Medium",
-full_size:"Full Size",
-current_link:"Current Link",
-link_to_img:"Link to Image",
-link_help:"Enter a link URL or click above for presets.",
-adv_img_settings:"Advanced Image Settings",
-source:"Source",
-width:"Width",
-height:"Height",
-orig_size:"Original Size",
-css:"CSS Class",
-adv_link_settings:"Advanced Link Settings",
-link_rel:"Link Rel",
-height:"Height",
-orig_size:"Original Size",
-css:"CSS Class",
-s60:"60%",
-s70:"70%",
-s80:"80%",
-s90:"90%",
-s100:"100%",
-s110:"110%",
-s120:"120%",
-s130:"130%",
-img_title:"Title",
-caption:"Caption",
-alt:"Alternative Text"
-});
</del><ins>+ tinyMCE.addI18n( lang + ".advanced_dlg", {
+ about_title: "About TinyMCE",
+ about_general: "About",
+ about_help: "Help",
+ about_license: "License",
+ about_plugins: "Plugins",
+ about_plugin: "Plugin",
+ about_author: "Author",
+ about_version: "Version",
+ about_loaded: "Loaded plugins",
+ anchor_title: "Insert/edit anchor",
+ anchor_name: "Anchor name",
+ code_title: "HTML Source Editor",
+ code_wordwrap: "Word wrap",
+ colorpicker_title: "Select a color",
+ colorpicker_picker_tab: "Picker",
+ colorpicker_picker_title: "Color picker",
+ colorpicker_palette_tab: "Palette",
+ colorpicker_palette_title: "Palette colors",
+ colorpicker_named_tab: "Named",
+ colorpicker_named_title: "Named colors",
+ colorpicker_color: "Color: ",
+ colorpicker_name: "Name: ",
+ charmap_title: "Select custom character",
+ charmap_usage: "Use left and right arrows to navigate.",
+ image_title: "Insert/edit image",
+ image_src: "Image URL",
+ image_alt: "Image description",
+ image_list: "Image list",
+ image_border: "Border",
+ image_dimensions: "Dimensions",
+ image_vspace: "Vertical space",
+ image_hspace: "Horizontal space",
+ image_align: "Alignment",
+ image_align_baseline: "Baseline",
+ image_align_top: "Top",
+ image_align_middle: "Middle",
+ image_align_bottom: "Bottom",
+ image_align_texttop: "Text top",
+ image_align_textbottom: "Text bottom",
+ image_align_left: "Left",
+ image_align_right: "Right",
+ link_title: "Insert/edit link",
+ link_url: "Link URL",
+ link_target: "Target",
+ link_target_same: "Open link in the same window",
+ link_target_blank: "Open link in a new window",
+ link_titlefield: "Title",
+ link_is_email: "The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",
+ link_is_external: "The URL you entered seems to be an external link, do you want to add the required http:// prefix?",
+ link_list: "Link list",
+ accessibility_help: "Accessibility Help",
+ accessibility_usage_title: "General Usage"
+ });
+
+ tinyMCE.addI18n( lang + ".media_dlg", {
+ title: "Insert / edit embedded media",
+ general: "General",
+ advanced: "Advanced",
+ file: "File/URL",
+ list: "List",
+ size: "Dimensions",
+ preview: "Preview",
+ constrain_proportions: "Constrain proportions",
+ type: "Type",
+ id: "Id",
+ name: "Name",
+ class_name: "Class",
+ vspace: "V-Space",
+ hspace: "H-Space",
+ play: "Auto play",
+ loop: "Loop",
+ menu: "Show menu",
+ quality: "Quality",
+ scale: "Scale",
+ align: "Align",
+ salign: "SAlign",
+ wmode: "WMode",
+ bgcolor: "Background",
+ base: "Base",
+ flashvars: "Flashvars",
+ liveconnect: "SWLiveConnect",
+ autohref: "AutoHREF",
+ cache: "Cache",
+ hidden: "Hidden",
+ controller: "Controller",
+ kioskmode: "Kiosk mode",
+ playeveryframe: "Play every frame",
+ targetcache: "Target cache",
+ correction: "No correction",
+ enablejavascript: "Enable JavaScript",
+ starttime: "Start time",
+ endtime: "End time",
+ href: "href",
+ qtsrcchokespeed: "Choke speed",
+ target: "Target",
+ volume: "Volume",
+ autostart: "Auto start",
+ enabled: "Enabled",
+ fullscreen: "Fullscreen",
+ invokeurls: "Invoke URLs",
+ mute: "Mute",
+ stretchtofit: "Stretch to fit",
+ windowlessvideo: "Windowless video",
+ balance: "Balance",
+ baseurl: "Base URL",
+ captioningid: "Captioning id",
+ currentmarker: "Current marker",
+ currentposition: "Current position",
+ defaultframe: "Default frame",
+ playcount: "Play count",
+ rate: "Rate",
+ uimode: "UI Mode",
+ flash_options: "Flash options",
+ qt_options: "QuickTime options",
+ wmp_options: "Windows media player options",
+ rmp_options: "Real media player options",
+ shockwave_options: "Shockwave options",
+ autogotourl: "Auto goto URL",
+ center: "Center",
+ imagestatus: "Image status",
+ maintainaspect: "Maintain aspect",
+ nojava: "No java",
+ prefetch: "Prefetch",
+ shuffle: "Shuffle",
+ console: "Console",
+ numloop: "Num loops",
+ controls: "Controls",
+ scriptcallbacks: "Script callbacks",
+ swstretchstyle: "Stretch style",
+ swstretchhalign: "Stretch H-Align",
+ swstretchvalign: "Stretch V-Align",
+ sound: "Sound",
+ progress: "Progress",
+ qtsrc: "QT Src",
+ qt_stream_warn: "Streamed rtsp resources should be added to the QT Src field under the advanced tab.",
+ align_top: "Top",
+ align_right: "Right",
+ align_bottom: "Bottom",
+ align_left: "Left",
+ align_center: "Center",
+ align_top_left: "Top left",
+ align_top_right: "Top right",
+ align_bottom_left: "Bottom left",
+ align_bottom_right: "Bottom right",
+ flv_options: "Flash video options",
+ flv_scalemode: "Scale mode",
+ flv_buffer: "Buffer",
+ flv_startimage: "Start image",
+ flv_starttime: "Start time",
+ flv_defaultvolume: "Default volume",
+ flv_hiddengui: "Hidden GUI",
+ flv_autostart: "Auto start",
+ flv_loop: "Loop",
+ flv_showscalemodes: "Show scale modes",
+ flv_smoothvideo: "Smooth video",
+ flv_jscallback: "JS Callback",
+ html5_video_options: "HTML5 Video Options",
+ altsource1: "Alternative source 1",
+ altsource2: "Alternative source 2",
+ preload: "Preload",
+ poster: "Poster",
+ source: "Source"
+ });
+
+ tinyMCE.addI18n( lang + ".wordpress", {
+ wp_adv_desc: "Show/Hide Kitchen Sink (Alt + Shift + Z)",
+ wp_more_desc: "Insert More Tag (Alt + Shift + T)",
+ wp_page_desc: "Insert Page break (Alt + Shift + P)",
+ wp_help_desc: "Help (Alt + Shift + H)",
+ wp_more_alt: "More...",
+ wp_page_alt: "Next page...",
+ add_media: "Add Media",
+ add_image: "Add an Image",
+ add_video: "Add Video",
+ add_audio: "Add Audio",
+ editgallery: "Edit Gallery",
+ delgallery: "Delete Gallery",
+ wp_fullscreen_desc: "Distraction Free Writing mode (Alt + Shift + W)"
+ });
+
+ tinyMCE.addI18n( lang + ".wpeditimage", {
+ edit_img: "Edit Image",
+ del_img: "Delete Image",
+ adv_settings: "Advanced Settings",
+ none: "None",
+ size: "Size",
+ thumbnail: "Thumbnail",
+ medium: "Medium",
+ full_size: "Full Size",
+ current_link: "Current Link",
+ link_to_img: "Link to Image",
+ link_help: "Enter a link URL or click above for presets.",
+ adv_img_settings: "Advanced Image Settings",
+ source: "Source",
+ width: "Width",
+ height: "Height",
+ orig_size: "Original Size",
+ css: "CSS Class",
+ adv_link_settings: "Advanced Link Settings",
+ link_rel: "Link Rel",
+ height: "Height",
+ orig_size: "Original Size",
+ css: "CSS Class",
+ s60: "60%",
+ s70: "70%",
+ s80: "80%",
+ s90: "90%",
+ s100: "100%",
+ s110: "110%",
+ s120: "120%",
+ s130: "130%",
+ img_title: "Title",
+ caption: "Caption",
+ alt: "Alternative Text"
+ });
+}());
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcelangswplangsphp"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/langs/wp-langs.php (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/langs/wp-langs.php 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/langs/wp-langs.php 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,565 +0,0 @@
</span><del>-<?php
-
-if ( ! defined( 'ABSPATH' ) )
- exit;
-
-if ( ! class_exists( '_WP_Editors' ) )
- require( ABSPATH . WPINC . '/class-wp-editor.php' );
-
-// deprecated, not used
-function mce_escape($text) {
- return esc_js($text);
-}
-
-function wp_mce_translation() {
-
- $default = array(
- 'common' => array(
- 'edit_confirm' => __('Do you want to use the WYSIWYG mode for this textarea?'),
- 'apply' => __('Apply'),
- 'insert' => __('Insert'),
- 'update' => __('Update'),
- 'cancel' => __('Cancel'),
- 'close' => __('Close'),
- 'browse' => __('Browse'),
- 'class_name' => __('Class'),
- 'not_set' => __('-- Not set --'),
- 'clipboard_msg' => __('Copy/Cut/Paste is not available in Mozilla and Firefox.'),
- 'clipboard_no_support' => __('Currently not supported by your browser, use keyboard shortcuts instead.'),
- 'popup_blocked' => __('Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.'),
- 'invalid_data' => __('ERROR: Invalid values entered, these are marked in red.'),
- 'invalid_data_number' => __('{#field} must be a number'),
- 'invalid_data_min' => __('{#field} must be a number greater than {#min}'),
- 'invalid_data_size' => __('{#field} must be a number or percentage'),
- 'more_colors' => __('More colors')
- ),
-
- 'colors' => array(
- '000000' => __('Black'),
- '993300' => __('Burnt orange'),
- '333300' => __('Dark olive'),
- '003300' => __('Dark green'),
- '003366' => __('Dark azure'),
- '000080' => __('Navy Blue'),
- '333399' => __('Indigo'),
- '333333' => __('Very dark gray'),
- '800000' => __('Maroon'),
- 'FF6600' => __('Orange'),
- '808000' => __('Olive'),
- '008000' => __('Green'),
- '008080' => __('Teal'),
- '0000FF' => __('Blue'),
- '666699' => __('Grayish blue'),
- '808080' => __('Gray'),
- 'FF0000' => __('Red'),
- 'FF9900' => __('Amber'),
- '99CC00' => __('Yellow green'),
- '339966' => __('Sea green'),
- '33CCCC' => __('Turquoise'),
- '3366FF' => __('Royal blue'),
- '800080' => __('Purple'),
- '999999' => __('Medium gray'),
- 'FF00FF' => __('Magenta'),
- 'FFCC00' => __('Gold'),
- 'FFFF00' => __('Yellow'),
- '00FF00' => __('Lime'),
- '00FFFF' => __('Aqua'),
- '00CCFF' => __('Sky blue'),
- '993366' => __('Brown'),
- 'C0C0C0' => __('Silver'),
- 'FF99CC' => __('Pink'),
- 'FFCC99' => __('Peach'),
- 'FFFF99' => __('Light yellow'),
- 'CCFFCC' => __('Pale green'),
- 'CCFFFF' => __('Pale cyan'),
- '99CCFF' => __('Light sky blue'),
- 'CC99FF' => __('Plum'),
- 'FFFFFF' => __('White')
- ),
-
- 'contextmenu' => array(
- 'align' => __('Alignment'), /* translators: alignment */
- 'left' => __('Left'), /* translators: alignment */
- 'center' => __('Center'), /* translators: alignment */
- 'right' => __('Right'), /* translators: alignment */
- 'full' => __('Full') /* translators: alignment */
- ),
-
- 'insertdatetime' => array(
- 'date_fmt' => __('%Y-%m-%d'), /* translators: year, month, date */
- 'time_fmt' => __('%H:%M:%S'), /* translators: hours, minutes, seconds */
- 'insertdate_desc' => __('Insert date'),
- 'inserttime_desc' => __('Insert time'),
- 'months_long' => __('January').','.__('February').','.__('March').','.__('April').','.__('May').','.__('June').','.__('July').','.__('August').','.__('September').','.__('October').','.__('November').','.__('December'),
- 'months_short' => __('Jan_January_abbreviation').','.__('Feb_February_abbreviation').','.__('Mar_March_abbreviation').','.__('Apr_April_abbreviation').','.__('May_May_abbreviation').','.__('Jun_June_abbreviation').','.__('Jul_July_abbreviation').','.__('Aug_August_abbreviation').','.__('Sep_September_abbreviation').','.__('Oct_October_abbreviation').','.__('Nov_November_abbreviation').','.__('Dec_December_abbreviation'),
- 'day_long' => __('Sunday').','.__('Monday').','.__('Tuesday').','.__('Wednesday').','.__('Thursday').','.__('Friday').','.__('Saturday'),
- 'day_short' => __('Sun').','.__('Mon').','.__('Tue').','.__('Wed').','.__('Thu').','.__('Fri').','.__('Sat')
- ),
-
- 'print' => array(
- 'print_desc' => __('Print')
- ),
-
- 'preview' => array(
- 'preview_desc' => __('Preview')
- ),
-
- 'directionality' => array(
- 'ltr_desc' => __('Direction left to right'),
- 'rtl_desc' => __('Direction right to left')
- ),
-
- 'layer' => array(
- 'insertlayer_desc' => __('Insert new layer'),
- 'forward_desc' => __('Move forward'),
- 'backward_desc' => __('Move backward'),
- 'absolute_desc' => __('Toggle absolute positioning'),
- 'content' => __('New layer...')
- ),
-
- 'save' => array(
- 'save_desc' => __('Save'),
- 'cancel_desc' => __('Cancel all changes')
- ),
-
- 'nonbreaking' => array(
- 'nonbreaking_desc' => __('Insert non-breaking space character')
- ),
-
- 'iespell' => array(
- 'iespell_desc' => __('Run spell checking'),
- 'download' => __('ieSpell not detected. Do you want to install it now?')
- ),
-
- 'advhr' => array(
- 'advhr_desc' => __('Horizontal rule')
- ),
-
- 'emotions' => array(
- 'emotions_desc' => __('Emotions')
- ),
-
- 'searchreplace' => array(
- 'search_desc' => __('Find'),
- 'replace_desc' => __('Find/Replace')
- ),
-
- 'advimage' => array(
- 'image_desc' => __('Insert/edit image')
- ),
-
- 'advlink' => array(
- 'link_desc' => __('Insert/edit link')
- ),
-
- 'xhtmlxtras' => array(
- 'cite_desc' => __('Citation'),
- 'abbr_desc' => __('Abbreviation'),
- 'acronym_desc' => __('Acronym'),
- 'del_desc' => __('Deletion'),
- 'ins_desc' => __('Insertion'),
- 'attribs_desc' => __('Insert/Edit Attributes')
- ),
-
- 'style' => array(
- 'desc' => __('Edit CSS Style')
- ),
-
- 'paste' => array(
- 'paste_text_desc' => __('Paste as Plain Text'),
- 'paste_word_desc' => __('Paste from Word'),
- 'selectall_desc' => __('Select All'),
- 'plaintext_mode_sticky' => __('Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.'),
- 'plaintext_mode' => __('Paste is now in plain text mode. Click again to toggle back to regular paste mode.')
- ),
-
- 'paste_dlg' => array(
- 'text_title' => __('Use CTRL+V on your keyboard to paste the text into the window.'),
- 'text_linebreaks' => __('Keep linebreaks'),
- 'word_title' => __('Use CTRL+V on your keyboard to paste the text into the window.')
- ),
-
- 'table' => array(
- 'desc' => __('Inserts a new table'),
- 'row_before_desc' => __('Insert row before'),
- 'row_after_desc' => __('Insert row after'),
- 'delete_row_desc' => __('Delete row'),
- 'col_before_desc' => __('Insert column before'),
- 'col_after_desc' => __('Insert column after'),
- 'delete_col_desc' => __('Remove column'),
- 'split_cells_desc' => __('Split merged table cells'),
- 'merge_cells_desc' => __('Merge table cells'),
- 'row_desc' => __('Table row properties'),
- 'cell_desc' => __('Table cell properties'),
- 'props_desc' => __('Table properties'),
- 'paste_row_before_desc' => __('Paste table row before'),
- 'paste_row_after_desc' => __('Paste table row after'),
- 'cut_row_desc' => __('Cut table row'),
- 'copy_row_desc' => __('Copy table row'),
- 'del' => __('Delete table'),
- 'row' => __('Row'),
- 'col' => __('Column'),
- 'cell' => __('Cell')
- ),
-
- 'autosave' => array(
- 'unload_msg' => __('The changes you made will be lost if you navigate away from this page.')
- ),
-
- 'fullscreen' => array(
- 'desc' => __('Toggle fullscreen mode (Alt + Shift + G)')
- ),
-
- 'media' => array(
- 'desc' => __('Insert / edit embedded media'),
- 'edit' => __('Edit embedded media')
- ),
-
- 'fullpage' => array(
- 'desc' => __('Document properties')
- ),
-
- 'template' => array(
- 'desc' => __('Insert predefined template content')
- ),
-
- 'visualchars' => array(
- 'desc' => __('Visual control characters on/off.')
- ),
-
- 'spellchecker' => array(
- 'desc' => __('Toggle spellchecker (Alt + Shift + N)'),
- 'menu' => __('Spellchecker settings'),
- 'ignore_word' => __('Ignore word'),
- 'ignore_words' => __('Ignore all'),
- 'langs' => __('Languages'),
- 'wait' => __('Please wait...'),
- 'sug' => __('Suggestions'),
- 'no_sug' => __('No suggestions'),
- 'no_mpell' => __('No misspellings found.'),
- 'learn_word' => __('Learn word')
- ),
-
- 'pagebreak' => array(
- 'desc' => __('Insert Page Break')
- ),
-
- 'advlist' => array(
- 'types' => __('Types'),
- 'def' => __('Default'),
- 'lower_alpha' => __('Lower alpha'),
- 'lower_greek' => __('Lower greek'),
- 'lower_roman' => __('Lower roman'),
- 'upper_alpha' => __('Upper alpha'),
- 'upper_roman' => __('Upper roman'),
- 'circle' => __('Circle'),
- 'disc' => __('Disc'),
- 'square' => __('Square')
- ),
-
- 'aria' => array(
- 'rich_text_area' => __('Rich Text Area')
- ),
-
- 'wordcount' => array(
- 'words' => __('Words:')
- )
- );
-
- $advanced = array(
- 'style_select' => __('Styles'), /* translators: TinyMCE inline styles */
- 'font_size' => __('Font size'),
- 'fontdefault' => __('Font family'),
- 'block' => __('Format'),
- 'paragraph' => __('Paragraph'),
- 'div' => __('Div'),
- 'address' => __('Address'),
- 'pre' => __('Preformatted'),
- 'h1' => __('Heading 1'),
- 'h2' => __('Heading 2'),
- 'h3' => __('Heading 3'),
- 'h4' => __('Heading 4'),
- 'h5' => __('Heading 5'),
- 'h6' => __('Heading 6'),
- 'blockquote' => __('Blockquote'),
- 'code' => __('Code'),
- 'samp' => __('Code sample'),
- 'dt' => __('Definition term '),
- 'dd' => __('Definition description'),
- 'bold_desc' => __('Bold (Ctrl + B)'),
- 'italic_desc' => __('Italic (Ctrl + I)'),
- 'underline_desc' => __('Underline'),
- 'striketrough_desc' => __('Strikethrough (Alt + Shift + D)'),
- 'justifyleft_desc' => __('Align Left (Alt + Shift + L)'),
- 'justifycenter_desc' => __('Align Center (Alt + Shift + C)'),
- 'justifyright_desc' => __('Align Right (Alt + Shift + R)'),
- 'justifyfull_desc' => __('Align Full (Alt + Shift + J)'),
- 'bullist_desc' => __('Unordered list (Alt + Shift + U)'),
- 'numlist_desc' => __('Ordered list (Alt + Shift + O)'),
- 'outdent_desc' => __('Outdent'),
- 'indent_desc' => __('Indent'),
- 'undo_desc' => __('Undo (Ctrl + Z)'),
- 'redo_desc' => __('Redo (Ctrl + Y)'),
- 'link_desc' => __('Insert/edit link (Alt + Shift + A)'),
- 'unlink_desc' => __('Unlink (Alt + Shift + S)'),
- 'image_desc' => __('Insert/edit image (Alt + Shift + M)'),
- 'cleanup_desc' => __('Cleanup messy code'),
- 'code_desc' => __('Edit HTML Source'),
- 'sub_desc' => __('Subscript'),
- 'sup_desc' => __('Superscript'),
- 'hr_desc' => __('Insert horizontal ruler'),
- 'removeformat_desc' => __('Remove formatting'),
- 'forecolor_desc' => __('Select text color'),
- 'backcolor_desc' => __('Select background color'),
- 'charmap_desc' => __('Insert custom character'),
- 'visualaid_desc' => __('Toggle guidelines/invisible elements'),
- 'anchor_desc' => __('Insert/edit anchor'),
- 'cut_desc' => __('Cut'),
- 'copy_desc' => __('Copy'),
- 'paste_desc' => __('Paste'),
- 'image_props_desc' => __('Image properties'),
- 'newdocument_desc' => __('New document'),
- 'help_desc' => __('Help'),
- 'blockquote_desc' => __('Blockquote (Alt + Shift + Q)'),
- 'clipboard_msg' => __('Copy/Cut/Paste is not available in Mozilla and Firefox.'),
- 'path' => __('Path'),
- 'newdocument' => __('Are you sure you want to clear all contents?'),
- 'toolbar_focus' => __('Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X'),
- 'more_colors' => __('More colors'),
- 'shortcuts_desc' => __('Accessibility Help'),
- 'help_shortcut' => __('Press ALT F10 for toolbar. Press ALT 0 for help.'),
- 'rich_text_area' => __('Rich Text Area'),
- 'toolbar' => __('Toolbar')
- );
-
- $advanced_dlg = array(
- 'about_title' => __('About TinyMCE'),
- 'about_general' => __('About'),
- 'about_help' => __('Help'),
- 'about_license' => __('License'),
- 'about_plugins' => __('Plugins'),
- 'about_plugin' => __('Plugin'),
- 'about_author' => __('Author'),
- 'about_version' => __('Version'),
- 'about_loaded' => __('Loaded plugins'),
- 'anchor_title' => __('Insert/edit anchor'),
- 'anchor_name' => __('Anchor name'),
- 'code_title' => __('HTML Source Editor'),
- 'code_wordwrap' => __('Word wrap'),
- 'colorpicker_title' => __('Select a color'),
- 'colorpicker_picker_tab' => __('Picker'),
- 'colorpicker_picker_title' => __('Color picker'),
- 'colorpicker_palette_tab' => __('Palette'),
- 'colorpicker_palette_title' => __('Palette colors'),
- 'colorpicker_named_tab' => __('Named'),
- 'colorpicker_named_title' => __('Named colors'),
- 'colorpicker_color' => __('Color:'),
- 'colorpicker_name' => _x('Name:', 'html attribute'),
- 'charmap_title' => __('Select custom character'),
- 'charmap_usage' => __('Use left and right arrows to navigate.'),
- 'image_title' => __('Insert/edit image'),
- 'image_src' => __('Image URL'),
- 'image_alt' => __('Image description'),
- 'image_list' => __('Image list'),
- 'image_border' => __('Border'),
- 'image_dimensions' => __('Dimensions'),
- 'image_vspace' => __('Vertical space'),
- 'image_hspace' => __('Horizontal space'),
- 'image_align' => __('Alignment'),
- 'image_align_baseline' => __('Baseline'),
- 'image_align_top' => __('Top'),
- 'image_align_middle' => __('Middle'),
- 'image_align_bottom' => __('Bottom'),
- 'image_align_texttop' => __('Text top'),
- 'image_align_textbottom' => __('Text bottom'),
- 'image_align_left' => __('Left'),
- 'image_align_right' => __('Right'),
- 'link_title' => __('Insert/edit link'),
- 'link_url' => __('Link URL'),
- 'link_target' => __('Target'),
- 'link_target_same' => __('Open link in the same window'),
- 'link_target_blank' => __('Open link in a new window'),
- 'link_titlefield' => __('Title'),
- 'link_is_email' => __('The URL you entered seems to be an email address, do you want to add the required mailto: prefix?'),
- 'link_is_external' => __('The URL you entered seems to external link, do you want to add the required http:// prefix?'),
- 'link_list' => __('Link list'),
- 'accessibility_help' => __('Accessibility Help'),
- 'accessibility_usage_title' => __('General Usage')
- );
-
- $media_dlg = array(
- 'title' => __('Insert / edit embedded media'),
- 'general' => __('General'),
- 'advanced' => __('Advanced'),
- 'file' => __('File/URL'),
- 'list' => __('List'),
- 'size' => __('Dimensions'),
- 'preview' => __('Preview'),
- 'constrain_proportions' => __('Constrain proportions'),
- 'type' => __('Type'),
- 'id' => __('Id'),
- 'name' => _x('Name', 'html attribute'),
- 'class_name' => __('Class'),
- 'vspace' => __('V-Space'),
- 'hspace' => __('H-Space'),
- 'play' => __('Auto play'),
- 'loop' => __('Loop'),
- 'menu' => __('Show menu'),
- 'quality' => __('Quality'),
- 'scale' => __('Scale'),
- 'align' => __('Align'),
- 'salign' => __('SAlign'),
- 'wmode' => __('WMode'),
- 'bgcolor' => __('Background'),
- 'base' => __('Base'),
- 'flashvars' => __('Flashvars'),
- 'liveconnect' => __('SWLiveConnect'),
- 'autohref' => __('AutoHREF'),
- 'cache' => __('Cache'),
- 'hidden' => __('Hidden'),
- 'controller' => __('Controller'),
- 'kioskmode' => __('Kiosk mode'),
- 'playeveryframe' => __('Play every frame'),
- 'targetcache' => __('Target cache'),
- 'correction' => __('No correction'),
- 'enablejavascript' => __('Enable JavaScript'),
- 'starttime' => __('Start time'),
- 'endtime' => __('End time'),
- 'href' => __('href'),
- 'qtsrcchokespeed' => __('Choke speed'),
- 'target' => __('Target'),
- 'volume' => __('Volume'),
- 'autostart' => __('Auto start'),
- 'enabled' => __('Enabled'),
- 'fullscreen' => __('Fullscreen'),
- 'invokeurls' => __('Invoke URLs'),
- 'mute' => __('Mute'),
- 'stretchtofit' => __('Stretch to fit'),
- 'windowlessvideo' => __('Windowless video'),
- 'balance' => __('Balance'),
- 'baseurl' => __('Base URL'),
- 'captioningid' => __('Captioning id'),
- 'currentmarker' => __('Current marker'),
- 'currentposition' => __('Current position'),
- 'defaultframe' => __('Default frame'),
- 'playcount' => __('Play count'),
- 'rate' => __('Rate'),
- 'uimode' => __('UI Mode'),
- 'flash_options' => __('Flash options'),
- 'qt_options' => __('QuickTime options'),
- 'wmp_options' => __('Windows media player options'),
- 'rmp_options' => __('Real media player options'),
- 'shockwave_options' => __('Shockwave options'),
- 'autogotourl' => __('Auto goto URL'),
- 'center' => __('Center'),
- 'imagestatus' => __('Image status'),
- 'maintainaspect' => __('Maintain aspect'),
- 'nojava' => __('No java'),
- 'prefetch' => __('Prefetch'),
- 'shuffle' => __('Shuffle'),
- 'console' => __('Console'),
- 'numloop' => __('Num loops'),
- 'controls' => __('Controls'),
- 'scriptcallbacks' => __('Script callbacks'),
- 'swstretchstyle' => __('Stretch style'),
- 'swstretchhalign' => __('Stretch H-Align'),
- 'swstretchvalign' => __('Stretch V-Align'),
- 'sound' => __('Sound'),
- 'progress' => __('Progress'),
- 'qtsrc' => __('QT Src'),
- 'qt_stream_warn' => __('Streamed rtsp resources should be added to the QT Src field under the advanced tab.'),
- 'align_top' => __('Top'),
- 'align_right' => __('Right'),
- 'align_bottom' => __('Bottom'),
- 'align_left' => __('Left'),
- 'align_center' => __('Center'),
- 'align_top_left' => __('Top left'),
- 'align_top_right' => __('Top right'),
- 'align_bottom_left' => __('Bottom left'),
- 'align_bottom_right' => __('Bottom right'),
- 'flv_options' => __('Flash video options'),
- 'flv_scalemode' => __('Scale mode'),
- 'flv_buffer' => __('Buffer'),
- 'flv_startimage' => __('Start image'),
- 'flv_starttime' => __('Start time'),
- 'flv_defaultvolume' => __('Default volume'),
- 'flv_hiddengui' => __('Hidden GUI'),
- 'flv_autostart' => __('Auto start'),
- 'flv_loop' => __('Loop'),
- 'flv_showscalemodes' => __('Show scale modes'),
- 'flv_smoothvideo' => __('Smooth video'),
- 'flv_jscallback' => __('JS Callback'),
- 'html5_video_options' => __('HTML5 Video Options'),
- 'altsource1' => __('Alternative source 1'),
- 'altsource2' => __('Alternative source 2'),
- 'preload' => __('Preload'),
- 'poster' => __('Poster'),
- 'source' => __('Source')
- );
-
- $wordpress = array(
- 'wp_adv_desc' => __('Show/Hide Kitchen Sink (Alt + Shift + Z)'),
- 'wp_more_desc' => __('Insert More Tag (Alt + Shift + T)'),
- 'wp_page_desc' => __('Insert Page break (Alt + Shift + P)'),
- 'wp_help_desc' => __('Help (Alt + Shift + H)'),
- 'wp_more_alt' => __('More...'),
- 'wp_page_alt' => __('Next page...'),
- 'add_media' => __('Add Media'),
- 'add_image' => __('Add an Image'),
- 'add_video' => __('Add Video'),
- 'add_audio' => __('Add Audio'),
- 'editgallery' => __('Edit Gallery'),
- 'delgallery' => __('Delete Gallery'),
- 'wp_fullscreen_desc' => __('Distraction Free Writing mode (Alt + Shift + W)')
- );
-
- $wpeditimage = array(
- 'edit_img' => __('Edit Image'),
- 'del_img' => __('Delete Image'),
- 'adv_settings' => __('Advanced Settings'),
- 'none' => __('None'),
- 'size' => __('Size'),
- 'thumbnail' => __('Thumbnail'),
- 'medium' => __('Medium'),
- 'full_size' => __('Full Size'),
- 'current_link' => __('Current Link'),
- 'link_to_img' => __('Link to Image'),
- 'link_help' => __('Enter a link URL or click above for presets.'),
- 'adv_img_settings' => __('Advanced Image Settings'),
- 'source' => __('Source'),
- 'width' => __('Width'),
- 'height' => __('Height'),
- 'orig_size' => __('Original Size'),
- 'css' => __('CSS Class'),
- 'adv_link_settings' => __('Advanced Link Settings'),
- 'link_rel' => __('Link Rel'),
- 'height' => __('Height'),
- 'orig_size' => __('Original Size'),
- 'css' => __('CSS Class'),
- 's60' => __('60%'),
- 's70' => __('70%'),
- 's80' => __('80%'),
- 's90' => __('90%'),
- 's100' => __('100%'),
- 's110' => __('110%'),
- 's120' => __('120%'),
- 's130' => __('130%'),
- 'img_title' => __('Title'),
- 'caption' => __('Caption'),
- 'alt' => __('Alternative Text')
- );
-
- $locale = _WP_Editors::$mce_locale;
-
- $translated = 'tinyMCE.addI18n({' . $locale . ':' . json_encode( $default ) . "});\n";
- $translated .= 'tinyMCE.addI18n("' . $locale . '.advanced", ' . json_encode( $advanced ) . ");\n";
- $translated .= 'tinyMCE.addI18n("' . $locale . '.advanced_dlg", ' . json_encode( $advanced_dlg ) . ");\n";
- $translated .= 'tinyMCE.addI18n("' . $locale . '.media_dlg", ' . json_encode( $media_dlg ) . ");\n";
- $translated .= 'tinyMCE.addI18n("' . $locale . '.wordpress", ' . json_encode( $wordpress ) . ");\n";
- $translated .= 'tinyMCE.addI18n("' . $locale . '.wpeditimage", ' . json_encode( $wpeditimage ) . ');';
-
- return $translated;
-}
-
-$lang = wp_mce_translation();
-
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcemark_loaded_srcjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/mark_loaded_src.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/mark_loaded_src.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/mark_loaded_src.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,21 +0,0 @@
</span><del>-/* global tinyMCEPreInit, tinymce */
-(function(){
- if ( typeof tinyMCEPreInit === 'undefined' )
- return;
-
- var t = tinyMCEPreInit, baseurl = t.base, markDone = tinymce.ScriptLoader.markDone, lang = t.ref.language,
- theme = t.ref.theme, plugins = t.ref.plugins, suffix = t.suffix;
-
- markDone( baseurl+'/langs/'+lang+'.js' );
- markDone( baseurl+'/themes/'+theme+'/editor_template'+suffix+'.js' );
- markDone( baseurl+'/themes/'+theme+'/langs/'+lang+'.js' );
- markDone( baseurl+'/themes/'+theme+'/langs/'+lang+'_dlg.js' );
-
- tinymce.each( plugins.split(','), function(plugin){
- if ( plugin && plugin.charAt(0) != '-' ) {
- markDone( baseurl+'/plugins/'+plugin+'/editor_plugin'+suffix+'.js' );
- markDone( baseurl+'/plugins/'+plugin+'/langs/'+lang+'.js' );
- markDone( baseurl+'/plugins/'+plugin+'/langs/'+lang+'_dlg.js' );
- }
- });
-})();
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginscharmappluginjs"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.js (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,362 @@
</span><ins>+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('charmap', function(editor) {
+ var charmap = [
+ ['160', 'no-break space'],
+ ['38', 'ampersand'],
+ ['34', 'quotation mark'],
+ // finance
+ ['162', 'cent sign'],
+ ['8364', 'euro sign'],
+ ['163', 'pound sign'],
+ ['165', 'yen sign'],
+ // signs
+ ['169', 'copyright sign'],
+ ['174', 'registered sign'],
+ ['8482', 'trade mark sign'],
+ ['8240', 'per mille sign'],
+ ['181', 'micro sign'],
+ ['183', 'middle dot'],
+ ['8226', 'bullet'],
+ ['8230', 'three dot leader'],
+ ['8242', 'minutes / feet'],
+ ['8243', 'seconds / inches'],
+ ['167', 'section sign'],
+ ['182', 'paragraph sign'],
+ ['223', 'sharp s / ess-zed'],
+ // quotations
+ ['8249', 'single left-pointing angle quotation mark'],
+ ['8250', 'single right-pointing angle quotation mark'],
+ ['171', 'left pointing guillemet'],
+ ['187', 'right pointing guillemet'],
+ ['8216', 'left single quotation mark'],
+ ['8217', 'right single quotation mark'],
+ ['8220', 'left double quotation mark'],
+ ['8221', 'right double quotation mark'],
+ ['8218', 'single low-9 quotation mark'],
+ ['8222', 'double low-9 quotation mark'],
+ ['60', 'less-than sign'],
+ ['62', 'greater-than sign'],
+ ['8804', 'less-than or equal to'],
+ ['8805', 'greater-than or equal to'],
+ ['8211', 'en dash'],
+ ['8212', 'em dash'],
+ ['175', 'macron'],
+ ['8254', 'overline'],
+ ['164', 'currency sign'],
+ ['166', 'broken bar'],
+ ['168', 'diaeresis'],
+ ['161', 'inverted exclamation mark'],
+ ['191', 'turned question mark'],
+ ['710', 'circumflex accent'],
+ ['732', 'small tilde'],
+ ['176', 'degree sign'],
+ ['8722', 'minus sign'],
+ ['177', 'plus-minus sign'],
+ ['247', 'division sign'],
+ ['8260', 'fraction slash'],
+ ['215', 'multiplication sign'],
+ ['185', 'superscript one'],
+ ['178', 'superscript two'],
+ ['179', 'superscript three'],
+ ['188', 'fraction one quarter'],
+ ['189', 'fraction one half'],
+ ['190', 'fraction three quarters'],
+ // math / logical
+ ['402', 'function / florin'],
+ ['8747', 'integral'],
+ ['8721', 'n-ary sumation'],
+ ['8734', 'infinity'],
+ ['8730', 'square root'],
+ ['8764', 'similar to'],
+ ['8773', 'approximately equal to'],
+ ['8776', 'almost equal to'],
+ ['8800', 'not equal to'],
+ ['8801', 'identical to'],
+ ['8712', 'element of'],
+ ['8713', 'not an element of'],
+ ['8715', 'contains as member'],
+ ['8719', 'n-ary product'],
+ ['8743', 'logical and'],
+ ['8744', 'logical or'],
+ ['172', 'not sign'],
+ ['8745', 'intersection'],
+ ['8746', 'union'],
+ ['8706', 'partial differential'],
+ ['8704', 'for all'],
+ ['8707', 'there exists'],
+ ['8709', 'diameter'],
+ ['8711', 'backward difference'],
+ ['8727', 'asterisk operator'],
+ ['8733', 'proportional to'],
+ ['8736', 'angle'],
+ // undefined
+ ['180', 'acute accent'],
+ ['184', 'cedilla'],
+ ['170', 'feminine ordinal indicator'],
+ ['186', 'masculine ordinal indicator'],
+ ['8224', 'dagger'],
+ ['8225', 'double dagger'],
+ // alphabetical special chars
+ ['192', 'A - grave'],
+ ['193', 'A - acute'],
+ ['194', 'A - circumflex'],
+ ['195', 'A - tilde'],
+ ['196', 'A - diaeresis'],
+ ['197', 'A - ring above'],
+ ['198', 'ligature AE'],
+ ['199', 'C - cedilla'],
+ ['200', 'E - grave'],
+ ['201', 'E - acute'],
+ ['202', 'E - circumflex'],
+ ['203', 'E - diaeresis'],
+ ['204', 'I - grave'],
+ ['205', 'I - acute'],
+ ['206', 'I - circumflex'],
+ ['207', 'I - diaeresis'],
+ ['208', 'ETH'],
+ ['209', 'N - tilde'],
+ ['210', 'O - grave'],
+ ['211', 'O - acute'],
+ ['212', 'O - circumflex'],
+ ['213', 'O - tilde'],
+ ['214', 'O - diaeresis'],
+ ['216', 'O - slash'],
+ ['338', 'ligature OE'],
+ ['352', 'S - caron'],
+ ['217', 'U - grave'],
+ ['218', 'U - acute'],
+ ['219', 'U - circumflex'],
+ ['220', 'U - diaeresis'],
+ ['221', 'Y - acute'],
+ ['376', 'Y - diaeresis'],
+ ['222', 'THORN'],
+ ['224', 'a - grave'],
+ ['225', 'a - acute'],
+ ['226', 'a - circumflex'],
+ ['227', 'a - tilde'],
+ ['228', 'a - diaeresis'],
+ ['229', 'a - ring above'],
+ ['230', 'ligature ae'],
+ ['231', 'c - cedilla'],
+ ['232', 'e - grave'],
+ ['233', 'e - acute'],
+ ['234', 'e - circumflex'],
+ ['235', 'e - diaeresis'],
+ ['236', 'i - grave'],
+ ['237', 'i - acute'],
+ ['238', 'i - circumflex'],
+ ['239', 'i - diaeresis'],
+ ['240', 'eth'],
+ ['241', 'n - tilde'],
+ ['242', 'o - grave'],
+ ['243', 'o - acute'],
+ ['244', 'o - circumflex'],
+ ['245', 'o - tilde'],
+ ['246', 'o - diaeresis'],
+ ['248', 'o slash'],
+ ['339', 'ligature oe'],
+ ['353', 's - caron'],
+ ['249', 'u - grave'],
+ ['250', 'u - acute'],
+ ['251', 'u - circumflex'],
+ ['252', 'u - diaeresis'],
+ ['253', 'y - acute'],
+ ['254', 'thorn'],
+ ['255', 'y - diaeresis'],
+ ['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', 'final sigma'],
+ ['963', 'sigma'],
+ ['964', 'tau'],
+ ['965', 'upsilon'],
+ ['966', 'phi'],
+ ['967', 'chi'],
+ ['968', 'psi'],
+ ['969', 'omega'],
+ // symbols
+ ['8501', 'alef symbol'],
+ ['982', 'pi symbol'],
+ ['8476', 'real part symbol'],
+ ['978', 'upsilon - hook symbol'],
+ ['8472', 'Weierstrass p'],
+ ['8465', 'imaginary part'],
+ // arrows
+ ['8592', 'leftwards arrow'],
+ ['8593', 'upwards arrow'],
+ ['8594', 'rightwards arrow'],
+ ['8595', 'downwards arrow'],
+ ['8596', 'left right arrow'],
+ ['8629', 'carriage return'],
+ ['8656', 'leftwards double arrow'],
+ ['8657', 'upwards double arrow'],
+ ['8658', 'rightwards double arrow'],
+ ['8659', 'downwards double arrow'],
+ ['8660', 'left right double arrow'],
+ ['8756', 'therefore'],
+ ['8834', 'subset of'],
+ ['8835', 'superset of'],
+ ['8836', 'not a subset of'],
+ ['8838', 'subset of or equal to'],
+ ['8839', 'superset of or equal to'],
+ ['8853', 'circled plus'],
+ ['8855', 'circled times'],
+ ['8869', 'perpendicular'],
+ ['8901', 'dot operator'],
+ ['8968', 'left ceiling'],
+ ['8969', 'right ceiling'],
+ ['8970', 'left floor'],
+ ['8971', 'right floor'],
+ ['9001', 'left-pointing angle bracket'],
+ ['9002', 'right-pointing angle bracket'],
+ ['9674', 'lozenge'],
+ ['9824', 'black spade suit'],
+ ['9827', 'black club suit'],
+ ['9829', 'black heart suit'],
+ ['9830', 'black diamond suit'],
+ ['8194', 'en space'],
+ ['8195', 'em space'],
+ ['8201', 'thin space'],
+ ['8204', 'zero width non-joiner'],
+ ['8205', 'zero width joiner'],
+ ['8206', 'left-to-right mark'],
+ ['8207', 'right-to-left mark'],
+ ['173', 'soft hyphen']
+ ];
+
+ function showDialog() {
+ var gridHtml, x, y, win;
+
+ function getParentTd(elm) {
+ while (elm) {
+ if (elm.nodeName == 'TD') {
+ return elm;
+ }
+
+ elm = elm.parentNode;
+ }
+ }
+
+ gridHtml = '<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';
+
+ var width = 25;
+ for (y = 0; y < 10; y++) {
+ gridHtml += '<tr>';
+
+ for (x = 0; x < width; x++) {
+ var chr = charmap[y * width + x];
+ var id = 'g' + (y * width + x);
+
+ gridHtml += '<td title="' + chr[1] + '"><div id="' + id + '" tabIndex="-1">' +
+ (chr ? String.fromCharCode(parseInt(chr[0], 10)) : ' ') + '</div></td>';
+ }
+
+ gridHtml += '</tr>';
+ }
+
+ gridHtml += '</tbody></table>';
+
+ var charMapPanel = {
+ type: 'container',
+ html: gridHtml,
+ onclick: function(e) {
+ var target = e.target;
+ if (target.nodeName == 'DIV') {
+ editor.execCommand('mceInsertContent', false, target.firstChild.nodeValue);
+ }
+ },
+ onmouseover: function(e) {
+ var td = getParentTd(e.target);
+
+ if (td) {
+ win.find('#preview').text(td.firstChild.firstChild.data);
+ }
+ }
+ };
+
+ win = editor.windowManager.open({
+ title: "Special character",
+ spacing: 10,
+ padding: 10,
+ items: [
+ charMapPanel,
+ {
+ type: 'label',
+ name: 'preview',
+ text: ' ',
+ style: 'font-size: 40px; text-align: center',
+ border: 1,
+ minWidth: 100,
+ minHeight: 80
+ }
+ ],
+ buttons: [
+ {text: "Close", onclick: function() {
+ win.close();
+ }}
+ ]
+ });
+ }
+
+ editor.addButton('charmap', {
+ icon: 'charmap',
+ tooltip: 'Special character',
+ onclick: showDialog
+ });
+
+ editor.addMenuItem('charmap', {
+ icon: 'charmap',
+ text: 'Special character',
+ onclick: showDialog,
+ context: 'insert'
+ });
+});
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymcepluginscharmappluginminjs"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.min.js (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.min.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.min.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+tinymce.PluginManager.add("charmap",function(e){function t(){function t(e){for(;e;){if("TD"==e.nodeName)return e;e=e.parentNode}}var i,a,r,o;i='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';var s=25;for(r=0;10>r;r++){for(i+="<tr>",a=0;s>a;a++){var l=n[r*s+a],c="g"+(r*s+a);i+='<td title="'+l[1]+'"><div id="'+c+'" tabIndex="-1">'+(l?String.fromCharCode(parseInt(l[0],10)):" ")+"</div></td>"}i+="</tr>"}i+="</tbody></table>";var u={type:"container",html:i,onclick:function(t){var n=t.target;"DIV"==n.nodeName&&e.execCommand("mceInsertContent",!1,n.firstChild.nodeValue)},onmouseover:function(e){var n=t(e.target);n&&o.find("#preview").text(n.firstChild.firstChild.data)}};o=e.windowManager
.open({title:"Special character",spacing:10,padding:10,items:[u,{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:100,minHeight:80}],buttons:[{text:"Close",onclick:function(){o.close()}}]})}var n=[["160","no-break space"],["38","ampersand"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],[&q
uot;8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8
211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190",&q
uot;fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there ex
ists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203",&q
uot;E - diaeresis"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["221","Y - acute"],["376","Y - diaeresis"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - ci
rcumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["339","ligature oe"],["353","s - caron"],["249","u -
grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["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&qu
ot;],["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","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],[&
quot;8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],[
"8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205&
quot;,"zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"],["173","soft hyphen"]];e.addButton("charmap",{icon:"charmap",tooltip:"Special character",onclick:t}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",onclick:t,context:"insert"})});
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.min.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymcepluginscompat3xcssdialogcss"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/plugins/compat3x/css/dialog.css (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/compat3x/css/dialog.css (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/compat3x/css/dialog.css 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,212 @@
</span><ins>+@import url('//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=latin-ext,latin');
+
+/* Generic */
+body {
+font-family: "Open Sans", sans-serif;
+font-size:13px;
+background:#fcfcfc;
+padding:0;
+margin:8px 8px 0 8px;
+}
+
+textarea {resize:none;outline:none;}
+
+a:link, a:hover {
+ color: #2B6FB6;
+}
+
+a:visited {
+ color: #3C2BB6;
+}
+
+.nowrap {white-space: nowrap}
+
+/* Forms */
+form {margin: 0;}
+fieldset {margin:0; padding:4px; border:1px solid #dfdfdf; font-family:Verdana, Arial; font-size:10px;}
+legend {color:#2B6FB6; font-weight:bold;}
+label.msg {display:none;}
+label.invalid {color:#EE0000; display:inline;}
+input.invalid {border:1px solid #EE0000;}
+input {background:#FFF; border:1px solid #dfdfdf;}
+input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+input, select, textarea {border:1px solid #dfdfdf;}
+input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
+input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
+.input_noborder {border:0;}
+
+/* Buttons */
+#insert,
+#cancel,
+#apply,
+.mceActionPanel .button,
+input.mceButton,
+.updateButton {
+ display: inline-block;
+ text-decoration: none;
+ border: 1px solid #adadad;
+ margin: 0;
+ padding: 0 10px 1px;
+ font-size: 13px;
+ height: 24px;
+ line-height: 22px;
+ color: #333;
+ cursor: pointer;
+ -webkit-border-radius: 3px;
+ -webkit-appearance: none;
+ border-radius: 3px;
+ white-space: nowrap;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background: #fafafa;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#fafafa), to(#e9e9e9));
+ background-image: -webkit-linear-gradient(top, #fafafa, #e9e9e9);
+ background-image: -moz-linear-gradient(top, #fafafa, #e9e9e9);
+ background-image: -o-linear-gradient(top, #fafafa, #e9e9e9);
+ background-image: linear-gradient(to bottom, #fafafa, #e9e9e9);
+
+ text-shadow: 0 1px 0 #fff;
+ -webkit-box-shadow: inset 0 1px 0 #fff;
+ -moz-box-shadow: inset 0 1px 0 #fff;
+ box-shadow: inset 0 1px 0 #fff;
+}
+
+#insert {
+ background: #2ea2cc;
+ background: -webkit-gradient(linear, left top, left bottom, from(#2ea2cc), to(#1e8cbe));
+ background: -webkit-linear-gradient(top, #2ea2cc 0%,#1e8cbe 100%);
+ background: linear-gradient(top, #2ea2cc 0%,#1e8cbe 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2ea2cc', endColorstr='#1e8cbe',GradientType=0 );
+ border-color: #0074a2;
+ -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
+ box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
+ color: #fff;
+ text-decoration: none;
+ text-shadow: 0 1px 0 rgba(0,86,132,0.7);
+}
+
+#cancel:hover,
+input.mceButton:hover,
+.updateButton:hover,
+#cancel:focus,
+input.mceButton:focus,
+.updateButton:focus {
+ background: #f3f3f3;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f3f3f3));
+ background-image: -webkit-linear-gradient(top, #fff, #f3f3f3);
+ background-image: -moz-linear-gradient(top, #fff, #f3f3f3);
+ background-image: -ms-linear-gradient(top, #fff, #f3f3f3);
+ background-image: -o-linear-gradient(top, #fff, #f3f3f3);
+ background-image: linear-gradient(to bottom, #fff, #f3f3f3);
+ border-color: #999;
+ color: #222;
+}
+
+#insert:hover,
+#insert:focus {
+ background: #1e8cbe;
+ background: -webkit-gradient(linear, left top, left bottom, from(#1e8cbe), to(#0074a2));
+ background: -webkit-linear-gradient(top, #1e8cbe 0%,#0074a2 100%);
+ background: linear-gradient(top, #1e8cbe 0%,#0074a2 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e8cbe', endColorstr='#0074a2',GradientType=0 );
+ border-color: #0074a2;
+ -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
+ box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
+ color: #fff;
+}
+
+.mceActionPanel #insert {
+ float: right;
+}
+
+/* Browse */
+a.pickcolor, a.browse {text-decoration:none}
+a.browse span {display:block; width:20px; height:18px; border:1px solid #FFF; margin-left:1px;}
+.mceOldBoxModel a.browse span {width:22px; height:20px;}
+a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
+a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30);}
+a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
+a.pickcolor span {display:block; width:20px; height:16px; margin-left:2px;}
+.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
+a.pickcolor:hover span {background-color:#B2BBD0;}
+div.iframecontainer {background: #fff;}
+
+/* Charmap */
+table.charmap {border:1px solid #AAA; text-align:center}
+td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
+#charmap a {display:block; color:#000; text-decoration:none; border:0}
+#charmap a:hover {background:#CCC;color:#2B6FB6}
+#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
+#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
+#charmap #charmapView {background-color:#fff;}
+
+/* Source */
+.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
+.mceActionPanel {margin-top:5px;}
+
+/* Tabs classes */
+.tabs {width:100%; height:19px; line-height:normal; border-bottom: 1px solid #aaa;}
+.tabs ul {margin:0; padding:0; list-style:none;}
+.tabs li {float:left; border: 1px solid #aaa; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}
+.tabs li.current {border-bottom: 1px solid #fff; margin-right:2px;}
+.tabs span {float:left; display:block; padding:0px 10px 0 0;}
+.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
+.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
+
+.wp-core-ui #tabs {
+ padding-bottom: 5px;
+ background-color: transparent;
+}
+
+.wp-core-ui #tabs a {
+ padding: 6px 10px;
+ margin: 0 2px;
+}
+
+/* Panels */
+.panel_wrapper div.panel {display:none;}
+.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
+.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
+
+/* Columns */
+.column {float:left;}
+.properties {width:100%;}
+.properties .column1 {}
+.properties .column2 {text-align:left;}
+
+/* Titles */
+h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
+h3 {font-size:14px;}
+.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
+
+/* Dialog specific */
+#link .panel_wrapper, #link div.current {height:125px;}
+#image .panel_wrapper, #image div.current {height:200px;}
+#plugintable thead {font-weight:bold; background:#DDD;}
+#plugintable, #about #plugintable td {border:1px solid #919B9C;}
+#plugintable {width:96%; margin-top:10px;}
+#pluginscontainer {height:290px; overflow:auto;}
+#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px}
+#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline}
+#colorpicker #preview_wrapper {text-align:center; padding-top:4px; white-space: nowrap; float: right;}
+#colorpicker #insert, #colorpicker #cancel {width: 90px}
+#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
+#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
+#colorpicker #light div {overflow:hidden;}
+#colorpicker .panel_wrapper div.current {height:175px;}
+#colorpicker #namedcolors {width:150px;}
+#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
+#colorpicker #colornamecontainer {margin-top:5px;}
+#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
+
+
+/* Localization */
+
+body[dir="rtl"],
+body[dir="rtl"] fieldset,
+body[dir="rtl"] input, body[dir="rtl"] select, body[dir="rtl"] textarea,
+body[dir="rtl"] #charmap #codeN,
+body[dir="rtl"] .tabs a {
+ font-family: Tahoma, sans-serif;
+}
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginscompat3xpluginjs"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.js (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,235 @@
</span><ins>+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true, console:true */
+
+/**
+ * This plugin adds missing events form the 4.x API back. Not every event is
+ * properly supported but most things should work.
+ *
+ * Unsupported things:
+ * - No editor.onEvent
+ * - Can't cancel execCommands with beforeExecCommand
+ */
+(function(tinymce) {
+ var reported;
+
+ function log(apiCall) {
+ if (!reported && window && window.console) {
+ reported = true;
+ console.log("Deprecated TinyMCE API call: " + apiCall);
+ }
+ }
+
+ function Dispatcher(target, newEventName, argsMap, defaultScope) {
+ target = target || this;
+
+ this.add = function(callback, scope) {
+ log('<target>.on' + newEventName + ".add(..)");
+
+ // Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2)
+ function patchedEventCallback(e) {
+ var callbackArgs = [];
+
+ if (typeof argsMap == "string") {
+ argsMap = argsMap.split(" ");
+ }
+
+ if (argsMap && typeof argsMap != "function") {
+ for (var i = 0; i < argsMap.length; i++) {
+ callbackArgs.push(e[argsMap[i]]);
+ }
+ }
+
+ if (typeof argsMap == "function") {
+ callbackArgs = argsMap(newEventName, e, target);
+ if (!callbackArgs) {
+ return;
+ }
+ }
+
+ if (!argsMap) {
+ callbackArgs = [e];
+ }
+
+ callbackArgs.unshift(defaultScope || target);
+
+ if (callback.apply(scope || defaultScope || target, callbackArgs) === false) {
+ e.stopImmediatePropagation();
+ }
+ }
+
+ target.on(newEventName, patchedEventCallback);
+
+ return patchedEventCallback;
+ };
+
+ // Not supported to just use add
+ this.addToTop = this.add;
+
+ this.remove = function(callback) {
+ return target.off(newEventName, callback);
+ };
+
+ this.dispatch = function() {
+ target.fire(newEventName);
+
+ return true;
+ };
+ }
+
+ tinymce.onBeforeUnload = new Dispatcher(tinymce, "BeforeUnload");
+ tinymce.onAddEditor = new Dispatcher(tinymce, "AddEditor", "editor");
+ tinymce.onRemoveEditor = new Dispatcher(tinymce, "RemoveEditor", "editor");
+
+ function patchEditor(editor) {
+ function patchEditorEvents(oldEventNames, argsMap) {
+ tinymce.each(oldEventNames.split(" "), function(oldName) {
+ editor["on" + oldName] = new Dispatcher(editor, oldName, argsMap);
+ });
+ }
+
+ function convertUndoEventArgs(type, event, target) {
+ return [
+ event.level,
+ target
+ ];
+ }
+
+ function filterSelectionEvents(needsSelection) {
+ return function(type, e) {
+ if ((!e.selection && !needsSelection) || e.selection == needsSelection) {
+ return [e];
+ }
+ };
+ }
+
+ if (editor.controlManager) {
+ return;
+ }
+
+ editor.controlManager = {
+ buttons: {},
+
+ setDisabled: function(name, state) {
+ log("controlManager.setDisabled(..)");
+
+ if (this.buttons[name]) {
+ this.buttons[name].disabled(state);
+ }
+ },
+
+ setActive: function(name, state) {
+ log("controlManager.setActive(..)");
+
+ if (this.buttons[name]) {
+ this.buttons[name].active(state);
+ }
+ },
+ };
+
+ patchEditorEvents("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate", "editor");
+ patchEditorEvents("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset");
+ patchEditorEvents("BeforeExecCommand ExecCommand", "command ui value args"); // args.terminate not supported
+ patchEditorEvents("PreProcess PostProcess LoadContent SaveContent Change");
+ patchEditorEvents("BeforeSetContent BeforeGetContent SetContent GetContent", filterSelectionEvents(false));
+ patchEditorEvents("SetProgressState", "state time");
+ patchEditorEvents("VisualAid", "element hasVisual");
+ patchEditorEvents("Undo Redo", convertUndoEventArgs);
+
+ patchEditorEvents("NodeChange", function(type, e) {
+ return [
+ editor.controlManager,
+ e.element,
+ editor.selection.isCollapsed(),
+ e
+ ];
+ });
+
+ var originalAddButton = editor.addButton;
+ editor.addButton = function(name, settings) {
+ var originalOnPostRender;
+
+ function patchedPostRender() {
+ editor.controlManager.buttons[name] = this;
+
+ if (originalOnPostRender) {
+ return originalOnPostRender.call(this);
+ }
+ }
+
+ for (var key in settings) {
+ if (key.toLowerCase() === "onpostrender") {
+ originalOnPostRender = settings[key];
+ settings.onPostRender = patchedPostRender;
+ }
+ }
+
+ if (!originalOnPostRender) {
+ settings.onPostRender = patchedPostRender;
+ }
+
+ settings.title = tinymce.i18n.translate((editor.settings.language || "en") + "." + settings.title);
+
+ return originalAddButton.call(this, name, settings);
+ };
+
+ editor.on('init', function() {
+ var undoManager = editor.undoManager, selection = editor.selection;
+
+ undoManager.onUndo = new Dispatcher(editor, "Undo", convertUndoEventArgs, null, undoManager);
+ undoManager.onRedo = new Dispatcher(editor, "Redo", convertUndoEventArgs, null, undoManager);
+ undoManager.onBeforeAdd = new Dispatcher(editor, "BeforeAddUndo", null, undoManager);
+ undoManager.onAdd = new Dispatcher(editor, "AddUndo", null, undoManager);
+
+ selection.onBeforeGetContent = new Dispatcher(editor, "BeforeGetContent", filterSelectionEvents(true), selection);
+ selection.onGetContent = new Dispatcher(editor, "GetContent", filterSelectionEvents(true), selection);
+ selection.onBeforeSetContent = new Dispatcher(editor, "BeforeSetContent", filterSelectionEvents(true), selection);
+ selection.onSetContent = new Dispatcher(editor, "SetContent", filterSelectionEvents(true), selection);
+
+ editor.windowManager.createInstance = function(className, a, b, c, d, e) {
+ log("windowManager.createInstance(..)");
+
+ var constr = tinymce.resolve(className);
+ return new constr(a, b, c, d, e);
+ };
+ });
+ }
+
+ tinymce.on('SetupEditor', patchEditor);
+ tinymce.PluginManager.add("compat3x", patchEditor);
+
+ tinymce.addI18n = function(prefix, o) {
+ var I18n = tinymce.util.I18n, each = tinymce.each;
+
+ if (typeof(prefix) == "string" && prefix.indexOf('.') === -1) {
+ I18n.add(prefix, o);
+ return;
+ }
+
+ if (!tinymce.is(prefix, 'string')) {
+ each(prefix, function(o, lc) {
+ each(o, function(o, g) {
+ each(o, function(o, k) {
+ if (g === 'common') {
+ I18n.data[lc + '.' + k] = o;
+ } else {
+ I18n.data[lc + '.' + g + '.' + k] = o;
+ }
+ });
+ });
+ });
+ } else {
+ each(o, function(o, k) {
+ I18n.data[prefix + '.' + k] = o;
+ });
+ }
+ };
+})(tinymce);
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymcepluginscompat3xpluginminjs"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.min.js (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.min.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.min.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+!function(n){function e(n){!i&&window&&window.console&&(i=!0,console.log("Deprecated TinyMCE API call: "+n))}function t(n,t,o,i){n=n||this,this.add=function(r,a){function d(e){var d=[];if("string"==typeof o&&(o=o.split(" ")),o&&"function"!=typeof o)for(var s=0;s<o.length;s++)d.push(e[o[s]]);("function"!=typeof o||(d=o(t,e,n)))&&(o||(d=[e]),d.unshift(i||n),r.apply(a||i||n,d)===!1&&e.stopImmediatePropagation())}return e("<target>.on"+t+".add(..)"),n.on(t,d),d},this.addToTop=this.add,this.remove=function(e){return n.off(t,e)},this.dispatch=function(){return n.fire(t),!0}}function o(o){function i(e,i){n.each(e.split(" "),function(n){o["on"+n]=new t(o,n,i)})}function r(n,e,t){return[e.level,t]}function a(n){return function(e,t){return!t.selection&&!n||t.selection==n?[t]:void 0}}if(!o.controlManager){o.controlManager
={buttons:{},setDisabled:function(n,t){e("controlManager.setDisabled(..)"),this.buttons[n]&&this.buttons[n].disabled(t)},setActive:function(n,t){e("controlManager.setActive(..)"),this.buttons[n]&&this.buttons[n].active(t)}},i("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate","editor"),i("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset"),i("BeforeExecCommand ExecCommand","command ui value args"),i("PreProcess PostProcess LoadContent SaveContent Change"),i("BeforeSetContent BeforeGetContent SetContent GetContent",a(!1)),i("SetProgressState","state time"),i("VisualAid","element hasVisual"),i("Undo Redo",r),i("NodeChange",function(n,e){return[o.controlManager,e.element,o.selection.isCollapsed(),e]});var d=o.addButton;o.addButton=function(e,t){function i(){return
o.controlManager.buttons[e]=this,r?r.call(this):void 0}var r;for(var a in t)"onpostrender"===a.toLowerCase()&&(r=t[a],t.onPostRender=i);return r||(t.onPostRender=i),t.title=n.i18n.translate((o.settings.language||"en")+"."+t.title),d.call(this,e,t)},o.on("init",function(){var i=o.undoManager,d=o.selection;i.onUndo=new t(o,"Undo",r,null,i),i.onRedo=new t(o,"Redo",r,null,i),i.onBeforeAdd=new t(o,"BeforeAddUndo",null,i),i.onAdd=new t(o,"AddUndo",null,i),d.onBeforeGetContent=new t(o,"BeforeGetContent",a(!0),d),d.onGetContent=new t(o,"GetContent",a(!0),d),d.onBeforeSetContent=new t(o,"BeforeSetContent",a(!0),d),d.onSetContent=new t(o,"SetContent",a(!0),d),o.windowManager.createInstance=function(t,o,i,r,a,d){e("windowManager.createInstance(..)");var s=n.resolve(t);return new s(o,i,r,a,d)}})}}var i;n.onBeforeUnload=new t(n,"BeforeUnload"),n.onAd
dEditor=new t(n,"AddEditor","editor"),n.onRemoveEditor=new t(n,"RemoveEditor","editor"),n.on("SetupEditor",o),n.PluginManager.add("compat3x",o),n.addI18n=function(e,t){var o=n.util.I18n,i=n.each;return"string"==typeof e&&-1===e.indexOf(".")?(o.add(e,t),void 0):(n.is(e,"string")?i(t,function(n,t){o.data[e+"."+t]=n}):i(e,function(n,e){i(n,function(n,t){i(n,function(n,i){"common"===t?o.data[e+"."+i]=n:o.data[e+"."+t+"."+i]=n})})}),void 0)}}(tinymce);
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.min.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymcepluginsdirectionalityeditor_pluginjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(b,c){var d=this;d.editor=b;function a(e){var h=b.dom,g,f=b.selection.getSelectedBlocks();if(f.length){g=h.getAttrib(f[0],"dir");tinymce.each(f,function(i){if(!h.getParent(i.parentNode,"*[dir='"+e+"']",h.getRoot())){if(g!=e){h.setAttrib(i,"dir",e)}else{h.setAttrib(i,"dir",null)}}});b.nodeChanged()}}b.addCommand("mceDirectionLTR",function(){a("ltr")});b.addCommand("mceDirectionRTL",function(){a("rtl")});b.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});b.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});b.onNodeChange.add(d._nodeChange,d)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infou
rl:"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)})();
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsdirectionalityeditor_plugin_srcjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/directionality/editor_plugin_src.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/directionality/editor_plugin_src.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/directionality/editor_plugin_src.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,85 +0,0 @@
</span><del>-/**
- * 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.Directionality', {
- init : function(ed, url) {
- var t = this;
-
- t.editor = ed;
-
- function setDir(dir) {
- var dom = ed.dom, curDir, blocks = ed.selection.getSelectedBlocks();
-
- if (blocks.length) {
- curDir = dom.getAttrib(blocks[0], "dir");
-
- tinymce.each(blocks, function(block) {
- // Add dir to block if the parent block doesn't already have that dir
- if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) {
- if (curDir != dir) {
- dom.setAttrib(block, "dir", dir);
- } else {
- dom.setAttrib(block, "dir", null);
- }
- }
- });
-
- ed.nodeChanged();
- }
- }
-
- ed.addCommand('mceDirectionLTR', function() {
- setDir("ltr");
- });
-
- ed.addCommand('mceDirectionRTL', function() {
- setDir("rtl");
- });
-
- ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});
- ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'});
-
- ed.onNodeChange.add(t._nodeChange, t);
- },
-
- 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
- };
- },
-
- // Private methods
-
- _nodeChange : function(ed, cm, n) {
- var dom = ed.dom, dir;
-
- n = dom.getParent(n, dom.isBlock);
- if (!n) {
- cm.setDisabled('ltr', 1);
- cm.setDisabled('rtl', 1);
- return;
- }
-
- dir = dom.getAttrib(n, 'dir');
- cm.setActive('ltr', dir == "ltr");
- cm.setDisabled('ltr', 0);
- cm.setActive('rtl', dir == "rtl");
- cm.setDisabled('rtl', 0);
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality);
-})();
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsdirectionalitypluginjsfromrev26862trunksrcwpincludesjstinymcepluginsdirectionalityeditor_plugin_srcjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/directionality/plugin.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/directionality/editor_plugin_src.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/directionality/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/directionality/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('directionality', function(editor) {
+ function setDir(dir) {
+ var dom = editor.dom, curDir, blocks = editor.selection.getSelectedBlocks();
+
+ if (blocks.length) {
+ curDir = dom.getAttrib(blocks[0], "dir");
+
+ tinymce.each(blocks, function(block) {
+ // Add dir to block if the parent block doesn't already have that dir
+ if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) {
+ if (curDir != dir) {
+ dom.setAttrib(block, "dir", dir);
+ } else {
+ dom.setAttrib(block, "dir", null);
+ }
+ }
+ });
+
+ editor.nodeChanged();
+ }
+ }
+
+ function generateSelector(dir) {
+ var selector = [];
+
+ tinymce.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function(name) {
+ selector.push(name + '[dir=' + dir + ']');
+ });
+
+ return selector.join(',');
+ }
+
+ editor.addCommand('mceDirectionLTR', function() {
+ setDir("ltr");
+ });
+
+ editor.addCommand('mceDirectionRTL', function() {
+ setDir("rtl");
+ });
+
+ editor.addButton('ltr', {
+ title: 'Left to right',
+ cmd: 'mceDirectionLTR',
+ stateSelector: generateSelector('ltr')
+ });
+
+ editor.addButton('rtl', {
+ title: 'Right to left',
+ cmd: 'mceDirectionRTL',
+ stateSelector: generateSelector('rtl')
+ });
+});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsdirectionalitypluginminjsfromrev26875trunksrcwpincludesjstinymcepluginsdirectionalityeditor_pluginjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/directionality/plugin.min.js (from rev 26875, trunk/src/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/directionality/plugin.min.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/directionality/plugin.min.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+tinymce.PluginManager.add("directionality",function(e){function t(t){var n,i=e.dom,a=e.selection.getSelectedBlocks();a.length&&(n=i.getAttrib(a[0],"dir"),tinymce.each(a,function(e){i.getParent(e.parentNode,"*[dir='"+t+"']",i.getRoot())||(n!=t?i.setAttrib(e,"dir",t):i.setAttrib(e,"dir",null))}),e.nodeChanged())}function n(e){var t=[];return tinymce.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(n){t.push(n+"[dir="+e+"]")}),t.join(",")}e.addCommand("mceDirectionLTR",function(){t("ltr")}),e.addCommand("mceDirectionRTL",function(){t("rtl")}),e.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:n("ltr")}),e.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:n("rtl")})});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsfullscreeneditor_pluginjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-(function(){var b=tinymce.DOM;var a=function(d,f,e){var c=function(g){var i=d.controlManager.get(g);var h=f.controlManager.get(g);if(i&&h){h.displayColor(i.value)}};c("forecolor");c("backcolor");f.setContent(d.getContent({format:"raw"}),{format:"raw"});f.selection.moveToBookmark(e);if(d.plugins.spellchecker&&f.plugins.spellchecker){f.plugins.spellchecker.setLanguage(d.plugins.spellchecker.selectedLang)}};tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(i,c){var l=this,m={},k=b.doc.documentElement,d,o,h,g,f,e,j;i.addCommand("mceFullScreen",function(){var q,r;if(i.getParam("fullscreen_is_enabled")){if(i.getParam("fullscreen_new_window")){closeFullscreen()}else{b.win.setTimeout(function(){var t=i;var s=tinyMCE.get(t.getParam("fullscreen_editor_id"));s.plugins.fullscreen.saveState(t);tinyMCE.remove(t)},10)}return}if(i.getParam("fullscreen_new_window&
quot;)){l.fullscreenSettings={bookmark:i.selection.getBookmark()};q=b.win.open(c+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{q.resizeTo(screen.availWidth,screen.availHeight)}catch(p){}}else{o=b.getStyle(b.doc.body,"overflow",1)||"auto";h=b.getStyle(k,"overflow",1);d=b.getViewPort();g=d.x;f=d.y;if(tinymce.isOpera&&o=="visible"){o="auto"}if(tinymce.isIE&&o=="scroll"){o="auto"}if(tinymce.isIE&&(h=="visible"||h=="scroll")){h="auto"}if(o=="0px"){o=""}b.setStyle(b.doc.body,"overflow","hidden");k.style.overflow="hidden";d=b.getViewPort();b.win.scrollTo(0,0);if(tinymce.isIE){d.h-=1}if(tinymce.isIE6||document.compatMode=="BackCompat"){e=&q
uot;absolute;top:"+d.y}else{e="fixed;top:0"}n=b.add(b.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+e+";left:0;width:"+d.w+"px;height:"+d.h+"px;z-index:200000;"});b.add(n,"div",{id:"mce_fullscreen"});tinymce.each(i.settings,function(s,t){m[t]=s});m.id="mce_fullscreen";m.width=n.clientWidth;m.height=n.clientHeight-15;m.fullscreen_is_enabled=true;m.fullscreen_editor_id=i.id;m.theme_advanced_resizing=false;m.save_onsavecallback=function(){i.setContent(tinyMCE.get(m.id).getContent());i.execCommand("mceSave")};tinymce.each(i.getParam("fullscreen_settings"),function(t,s){m[s]=t});l.fullscreenSettings={bookmark:i.selection.getBookmark(),fullscreen_overflow:o,fullscreen_html_overflow:h,fullscreen_scrollx:g,fullscreen_scrolly:f};if(m.theme_advanced_toolbar_location==="external"){m.theme_advanced_toolbar_location="top"}tinyMCE.oldSe
ttings=tinyMCE.settings;l.fullscreenEditor=new tinymce.Editor("mce_fullscreen",m);l.fullscreenEditor.onInit.add(function(){l.loadState(l.fullscreenEditor)});l.fullscreenEditor.render();l.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");l.fullscreenElement.update();l.resizeFunc=tinymce.dom.Event.add(b.win,"resize",function(){var v=tinymce.DOM.getViewPort(),t=l.fullscreenEditor,s,u;s=t.dom.getSize(t.getContainer().getElementsByTagName("table")[0]);u=t.dom.getSize(t.getContainer().getElementsByTagName("iframe")[0]);t.theme.resizeTo(v.w-s.w+u.w,v.h-s.h+u.h)})}});i.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});i.onNodeChange.add(function(q,p){p.setActive("fullscreen",q.getParam("fullscreen_is_enabled"))});l.loadState=function(p){if(!(p&&l.fullscreenSettings)){throw"No fullscreen editor to load to"}a(i,p,l.fullscreenSettings.boo
kmark);p.focus()};l.saveState=function(q){if(!(q&&l.fullscreenSettings)){throw"No fullscreen editor to restore from"}var p=l.fullscreenSettings;a(q,i,q.selection.getBookmark());if(!i.getParam("fullscreen_new_window")){tinymce.dom.Event.remove(b.win,"resize",l.resizeFunc);delete l.resizeFunc;b.remove("mce_fullscreen_container");b.doc.documentElement.style.overflow=p.fullscreen_html_overflow;b.setStyle(b.doc.body,"overflow",p.fullscreen_overflow);b.win.scrollTo(p.fullscreen_scrollx,p.fullscreen_scrolly)}tinyMCE.settings=tinyMCE.oldSettings;delete tinyMCE.oldSettings;delete l.fullscreenEditor;delete l.fullscreenElement;delete l.fullscreenSettings;b.win.setTimeout(function(){i.selection.moveToBookmark(j);i.focus()},10)}},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugi
ns/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsfullscreeneditor_plugin_srcjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin_src.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin_src.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin_src.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,234 +0,0 @@
</span><del>-/**
- * editor_plugin_src.js
- *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
- *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
- */
-
-(function() {
- var DOM = tinymce.DOM;
-
- // State Transfer function
- var transferState = function(oldEditor, newEditor, bookmark) {
- var transferColorButtonState = function(swapme) {
- var c = oldEditor.controlManager.get(swapme);
- var newC = newEditor.controlManager.get(swapme);
-
- if (c && newC) {
- newC.displayColor(c.value);
- }
-
- };
-
- transferColorButtonState('forecolor');
- transferColorButtonState('backcolor');
- newEditor.setContent(oldEditor.getContent({format : 'raw'}), {format : 'raw'});
- newEditor.selection.moveToBookmark(bookmark);
-
- if (oldEditor.plugins.spellchecker && newEditor.plugins.spellchecker) {
- newEditor.plugins.spellchecker.setLanguage(oldEditor.plugins.spellchecker.selectedLang);
- }
- };
-
- tinymce.create('tinymce.plugins.FullScreenPlugin', {
- init : function(ed, url) {
- var t = this, s = {}, de = DOM.doc.documentElement, vp, fullscreen_overflow, fullscreen_html_overflow, fullscreen_scrollx, fullscreen_scrolly, posCss, bookmark;
-
- // Register commands
- ed.addCommand('mceFullScreen', function() {
- var win, oed;
-
- if (ed.getParam('fullscreen_is_enabled')) {
- if (ed.getParam('fullscreen_new_window'))
- closeFullscreen(); // Call to close in fullscreen.htm
- else {
- DOM.win.setTimeout(function() {
- var fullscreenEditor = ed;
-
- // find the editor that opened this one, execute restore function there
- var originalEditor = tinyMCE.get(fullscreenEditor.getParam('fullscreen_editor_id'));
- originalEditor.plugins.fullscreen.saveState(fullscreenEditor);
-
- tinyMCE.remove(fullscreenEditor);
- }, 10);
- }
-
- return;
- }
-
- if (ed.getParam('fullscreen_new_window')) {
- t.fullscreenSettings = {
- bookmark: ed.selection.getBookmark()
- };
- 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);
- try {
- win.resizeTo(screen.availWidth, screen.availHeight);
- } catch (e) {
- // Ignore
- }
- } else {
- fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';
- fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
- vp = DOM.getViewPort();
- fullscreen_scrollx = vp.x;
- fullscreen_scrolly = vp.y;
-
- // Fixes an Opera bug where the scrollbars doesn't reappear
- if (tinymce.isOpera && fullscreen_overflow == 'visible')
- fullscreen_overflow = 'auto';
-
- // Fixes an IE bug where horizontal scrollbars would appear
- if (tinymce.isIE && fullscreen_overflow == 'scroll')
- fullscreen_overflow = 'auto';
-
- // Fixes an IE bug where the scrollbars doesn't reappear
- if (tinymce.isIE && (fullscreen_html_overflow == 'visible' || fullscreen_html_overflow == 'scroll'))
- fullscreen_html_overflow = 'auto';
-
- if (fullscreen_overflow == '0px')
- fullscreen_overflow = '';
-
- DOM.setStyle(DOM.doc.body, 'overflow', 'hidden');
- de.style.overflow = 'hidden'; //Fix for IE6/7
- vp = DOM.getViewPort();
- DOM.win.scrollTo(0, 0);
-
- if (tinymce.isIE)
- vp.h -= 1;
-
- // Use fixed position if it exists
- if (tinymce.isIE6 || document.compatMode == 'BackCompat')
- posCss = 'absolute;top:' + vp.y;
- else
- posCss = 'fixed;top:0';
-
- n = DOM.add(DOM.doc.body, 'div', {
- id : 'mce_fullscreen_container',
- style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'});
- DOM.add(n, 'div', {id : 'mce_fullscreen'});
-
- tinymce.each(ed.settings, function(v, n) {
- s[n] = v;
- });
-
- s.id = 'mce_fullscreen';
- s.width = n.clientWidth;
- s.height = n.clientHeight - 15;
- s.fullscreen_is_enabled = true;
- s.fullscreen_editor_id = ed.id;
- s.theme_advanced_resizing = false;
- s.save_onsavecallback = function() {
- ed.setContent(tinyMCE.get(s.id).getContent());
- ed.execCommand('mceSave');
- };
-
- tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) {
- s[k] = v;
- });
-
- t.fullscreenSettings = {
- bookmark: ed.selection.getBookmark(),
- fullscreen_overflow: fullscreen_overflow,
- fullscreen_html_overflow: fullscreen_html_overflow,
- fullscreen_scrollx: fullscreen_scrollx,
- fullscreen_scrolly: fullscreen_scrolly
- };
-
- if (s.theme_advanced_toolbar_location === 'external')
- s.theme_advanced_toolbar_location = 'top';
-
- tinyMCE.oldSettings = tinyMCE.settings; // Store old settings, the Editor constructor overwrites them
- t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s);
- t.fullscreenEditor.onInit.add(function() {
- t.loadState(t.fullscreenEditor);
- });
-
- t.fullscreenEditor.render();
-
- t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container');
- t.fullscreenElement.update();
- //document.body.overflow = 'hidden';
-
- t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() {
- var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize;
-
- // Get outer/inner size to get a delta size that can be used to calc the new iframe size
- outerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('table')[0]);
- innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]);
-
- fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h);
- });
- }
- });
-
- // Register buttons
- ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'});
-
- ed.onNodeChange.add(function(ed, cm) {
- cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled'));
- });
-
- // fullscreenEditor is a param here because in window mode we don't create it
- t.loadState = function(fullscreenEditor) {
- if (!(fullscreenEditor && t.fullscreenSettings)) {
- throw "No fullscreen editor to load to";
- }
-
- transferState(ed, fullscreenEditor, t.fullscreenSettings.bookmark);
- fullscreenEditor.focus();
-
- };
-
- // fullscreenEditor is a param here because in window mode we don't create it
- t.saveState = function(fullscreenEditor) {
- if (!(fullscreenEditor && t.fullscreenSettings)) {
- throw "No fullscreen editor to restore from";
- }
- var settings = t.fullscreenSettings;
-
- transferState(fullscreenEditor, ed, fullscreenEditor.selection.getBookmark());
-
- // cleanup only required if window mode isn't used
- if (!ed.getParam('fullscreen_new_window')) {
- tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
- delete t.resizeFunc;
-
- DOM.remove('mce_fullscreen_container');
-
- DOM.doc.documentElement.style.overflow = settings.fullscreen_html_overflow;
- DOM.setStyle(DOM.doc.body, 'overflow', settings.fullscreen_overflow);
- DOM.win.scrollTo(settings.fullscreen_scrollx, settings.fullscreen_scrolly);
- }
- tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings
-
- // clear variables
- delete tinyMCE.oldSettings;
- delete t.fullscreenEditor;
- delete t.fullscreenElement;
- delete t.fullscreenSettings;
-
- // allow the fullscreen editor to be removed before restoring focus and selection
- DOM.win.setTimeout(function() {
- ed.selection.moveToBookmark(bookmark);
- ed.focus();
- }, 10);
- };
- },
-
- 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
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin);
-})();
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsfullscreenfullscreenhtm"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,117 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title></title>
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <script type="text/javascript" src="../../tiny_mce.js?ver=359-20131010"></script>
- <script type="text/javascript">
- function patchCallback(settings, key) {
- if (settings[key])
- settings[key] = "window.opener." + settings[key];
- }
-
- var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id;
-
- // Clone array
- for (var n in paSe)
- settings[n] = paSe[n];
-
- // Override options for fullscreen
- for (var n in paSe.fullscreen_settings)
- settings[n] = paSe.fullscreen_settings[n];
-
- // Patch callbacks, make them point to window.opener
- patchCallback(settings, 'urlconverter_callback');
- patchCallback(settings, 'insertlink_callback');
- patchCallback(settings, 'insertimage_callback');
- patchCallback(settings, 'setupcontent_callback');
- patchCallback(settings, 'save_callback');
- patchCallback(settings, 'onchange_callback');
- patchCallback(settings, 'init_instance_callback');
- patchCallback(settings, 'file_browser_callback');
- patchCallback(settings, 'cleanup_callback');
- patchCallback(settings, 'execcommand_callback');
- patchCallback(settings, 'oninit');
-
- // Set options
- delete settings.id;
- settings['mode'] = 'exact';
- settings['elements'] = 'fullscreenarea';
- settings['add_unload_trigger'] = false;
- settings['ask'] = false;
- settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI();
- settings['fullscreen_is_enabled'] = true;
- settings['fullscreen_editor_id'] = oeID;
- settings['theme_advanced_resizing'] = false;
- settings['strict_loading_mode'] = true;
-
- settings.save_onsavecallback = function() {
- moveContent();
- window.opener.tinyMCE.get(oeID).execCommand('mceSave');
- window.close();
- };
-
- function unloadHandler(e) {
- moveContent();
- }
-
- function moveContent() {
- // find the original editor, execute restore state in it's plugin instance
- window.opener.tinyMCE.get(oeID).plugins.fullscreen.saveState(tinyMCE.activeEditor);
-
- // prevent moveContent from being called twice - e.g. if the unloadHandler runs after moveContent()
- tinymce.dom.Event.remove(window, "beforeunload", unloadHandler);
- }
-
- function closeFullscreen() {
- // moveContent() will be called by the unload handler
- window.close();
- }
-
- function doParentSubmit() {
- moveContent();
-
- if (window.opener.tinyMCE.selectedInstance.formElement.form)
- window.opener.tinyMCE.selectedInstance.formElement.form.submit();
-
- window.close();
-
- return false;
- }
-
- function render() {
- var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
-
- vp = dom.getViewPort();
- settings.width = vp.w;
- settings.height = vp.h - 15;
-
- settings.oninit = function() {
- var ed = tinyMCE.activeEditor;
- window.opener.tinyMCE.get(oeID).plugins.fullscreen.loadState(ed);
-
- tinymce.dom.Event.add(window, 'resize', function() {
- var vp = dom.getViewPort();
-
- tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
- });
- }
-
- tinyMCE.init(settings);
- }
-
- // Add onunload
- tinymce.dom.Event.add(window, "beforeunload", unloadHandler);
- </script>
-</head>
-<body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no">
-<form onsubmit="doParentSubmit();">
-<textarea id="fullscreenarea" style="width:100%; height:100%"></textarea>
-</form>
-
-<script type="text/javascript">
- render();
-</script>
-
-</body>
-</html>
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsfullscreenpluginjsfromrev26862trunksrcwpincludesjstinymcepluginsfullscreeneditor_plugin_srcjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/fullscreen/plugin.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin_src.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/fullscreen/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/fullscreen/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,136 @@
</span><ins>+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('fullscreen', function(editor) {
+ var fullscreenState = false, DOM = tinymce.DOM, iframeWidth, iframeHeight, resizeHandler;
+ var containerWidth, containerHeight;
+
+ if (editor.settings.inline) {
+ return;
+ }
+
+ function getWindowSize() {
+ var w, h, win = window, doc = document;
+ var body = doc.body;
+
+ // Old IE
+ if (body.offsetWidth) {
+ w = body.offsetWidth;
+ h = body.offsetHeight;
+ }
+
+ // Modern browsers
+ if (win.innerWidth && win.innerHeight) {
+ w = win.innerWidth;
+ h = win.innerHeight;
+ }
+
+ return {w: w, h: h};
+ }
+
+ function toggleFullscreen() {
+ var body = document.body, documentElement = document.documentElement, editorContainerStyle;
+ var editorContainer, iframe, iframeStyle;
+
+ function resize() {
+ DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight));
+ }
+
+ fullscreenState = !fullscreenState;
+
+ editorContainer = editor.getContainer();
+ editorContainerStyle = editorContainer.style;
+ iframe = editor.getContentAreaContainer().firstChild;
+ iframeStyle = iframe.style;
+
+ if (fullscreenState) {
+ iframeWidth = iframeStyle.width;
+ iframeHeight = iframeStyle.height;
+ iframeStyle.width = iframeStyle.height = '100%';
+ containerWidth = editorContainerStyle.width;
+ containerHeight = editorContainerStyle.height;
+ editorContainerStyle.width = editorContainerStyle.height = '';
+
+ DOM.addClass(body, 'mce-fullscreen');
+ DOM.addClass(documentElement, 'mce-fullscreen');
+ DOM.addClass(editorContainer, 'mce-fullscreen');
+
+ DOM.bind(window, 'resize', resize);
+ resize();
+ resizeHandler = resize;
+ } else {
+ iframeStyle.width = iframeWidth;
+ iframeStyle.height = iframeHeight;
+
+ if (containerWidth) {
+ editorContainerStyle.width = containerWidth;
+ }
+
+ if (containerHeight) {
+ editorContainerStyle.height = containerHeight;
+ }
+
+ DOM.removeClass(body, 'mce-fullscreen');
+ DOM.removeClass(documentElement, 'mce-fullscreen');
+ DOM.removeClass(editorContainer, 'mce-fullscreen');
+ DOM.unbind(window, 'resize', resizeHandler);
+ }
+
+ editor.fire('FullscreenStateChanged', {state: fullscreenState});
+ }
+
+ editor.on('init', function() {
+ editor.addShortcut('Ctrl+Alt+F', '', toggleFullscreen);
+ });
+
+ editor.on('remove', function() {
+ if (resizeHandler) {
+ DOM.unbind(window, 'resize', resizeHandler);
+ }
+ });
+
+ editor.addCommand('mceFullScreen', toggleFullscreen);
+
+ editor.addMenuItem('fullscreen', {
+ text: 'Fullscreen',
+ shortcut: 'Ctrl+Alt+F',
+ selectable: true,
+ onClick: toggleFullscreen,
+ onPostRender: function() {
+ var self = this;
+
+ editor.on('FullscreenStateChanged', function(e) {
+ self.active(e.state);
+ });
+ },
+ context: 'view'
+ });
+
+ editor.addButton('fullscreen', {
+ tooltip: 'Fullscreen',
+ shortcut: 'Ctrl+Alt+F',
+ onClick: toggleFullscreen,
+ onPostRender: function() {
+ var self = this;
+
+ editor.on('FullscreenStateChanged', function(e) {
+ self.active(e.state);
+ });
+ }
+ });
+
+ return {
+ isFullscreen: function() {
+ return fullscreenState;
+ }
+ };
+});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsfullscreenpluginminjsfromrev26862trunksrcwpincludesjstinymcepluginsfullscreeneditor_pluginjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+tinymce.PluginManager.add("fullscreen",function(e){function t(){var e,t,n=window,i=document,l=i.body;return l.offsetWidth&&(e=l.offsetWidth,t=l.offsetHeight),n.innerWidth&&n.innerHeight&&(e=n.innerWidth,t=n.innerHeight),{w:e,h:t}}function n(){function n(){d.setStyle(a,"height",t().h-(h.clientHeight-a.clientHeight))}var u,h,a,f,m=document.body,g=document.documentElement;s=!s,h=e.getContainer(),u=h.style,a=e.getContentAreaContainer().firstChild,f=a.style,s?(i=f.width,l=f.height,f.width=f.height="100%",c=u.width,o=u.height,u.width=u.height="",d.addClass(m,"mce-fullscreen"),d.addClass(g,"mce-fullscreen"),d.addClass(h,"mce-fullscreen"),d.bind(window,"resize",n),n(),r=n):(f.width=i,f.height=l,c&&(u.width=c),o&&(u.height=o),d.removeClass(m,"mce-fullscreen"),d.removeClass(g,"mce-fullscreen"),d.removeClass(h,"mce-fullscreen"),d.unbi
nd(window,"resize",r)),e.fire("FullscreenStateChanged",{state:s})}var i,l,r,c,o,s=!1,d=tinymce.DOM;return e.settings.inline?void 0:(e.on("init",function(){e.addShortcut("Ctrl+Alt+F","",n)}),e.on("remove",function(){r&&d.unbind(window,"resize",r)}),e.addCommand("mceFullScreen",n),e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Alt+F",selectable:!0,onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})},context:"view"}),e.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Alt+F",onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})}}),{isFullscreen:function(){return s}})});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsimagepluginjs"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/plugins/image/plugin.js (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/image/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/image/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,370 @@
</span><ins>+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('image', function(editor) {
+ function getImageSize(url, callback) {
+ var img = document.createElement('img');
+
+ function done(width, height) {
+ img.parentNode.removeChild(img);
+ callback({width: width, height: height});
+ }
+
+ img.onload = function() {
+ done(img.clientWidth, img.clientHeight);
+ };
+
+ img.onerror = function() {
+ done();
+ };
+
+ img.src = url;
+
+ var style = img.style;
+ style.visibility = 'hidden';
+ style.position = 'fixed';
+ style.bottom = style.left = 0;
+ style.width = style.height = 'auto';
+
+ document.body.appendChild(img);
+ }
+
+ function createImageList(callback) {
+ return function() {
+ var imageList = editor.settings.image_list;
+
+ if (typeof(imageList) == "string") {
+ tinymce.util.XHR.send({
+ url: imageList,
+ success: function(text) {
+ callback(tinymce.util.JSON.parse(text));
+ }
+ });
+ } else {
+ callback(imageList);
+ }
+ };
+ }
+
+ function showDialog(imageList) {
+ var win, data = {}, dom = editor.dom, imgElm = editor.selection.getNode();
+ var width, height, imageListCtrl;
+
+ function buildImageList() {
+ var imageListItems = [{text: 'None', value: ''}];
+
+ tinymce.each(imageList, function(image) {
+ imageListItems.push({
+ text: image.text || image.title,
+ value: editor.convertURL(image.value || image.url, 'src'),
+ menu: image.menu
+ });
+ });
+
+ return imageListItems;
+ }
+
+ function recalcSize(e) {
+ var widthCtrl, heightCtrl, newWidth, newHeight;
+
+ widthCtrl = win.find('#width')[0];
+ heightCtrl = win.find('#height')[0];
+
+ newWidth = widthCtrl.value();
+ newHeight = heightCtrl.value();
+
+ if (win.find('#constrain')[0].checked() && width && height && newWidth && newHeight) {
+ if (e.control == widthCtrl) {
+ newHeight = Math.round((newWidth / width) * newHeight);
+ heightCtrl.value(newHeight);
+ } else {
+ newWidth = Math.round((newHeight / height) * newWidth);
+ widthCtrl.value(newWidth);
+ }
+ }
+
+ width = newWidth;
+ height = newHeight;
+ }
+
+ function onSubmitForm() {
+ function waitLoad(imgElm) {
+ function selectImage() {
+ imgElm.onload = imgElm.onerror = null;
+ editor.selection.select(imgElm);
+ editor.nodeChanged();
+ }
+
+ imgElm.onload = function() {
+ if (!data.width && !data.height) {
+ dom.setAttribs(imgElm, {
+ width: imgElm.clientWidth,
+ height: imgElm.clientHeight
+ });
+ //WP
+ editor.fire( 'wpNewImageRefresh', { node: imgElm } );
+ }
+
+ selectImage();
+ };
+
+ imgElm.onerror = selectImage;
+ }
+
+ var data = win.toJSON();
+ var caption = data.caption; // WP
+
+ if (data.width === '') {
+ data.width = null;
+ }
+
+ if (data.height === '') {
+ data.height = null;
+ }
+
+ if (data.style === '') {
+ data.style = null;
+ }
+
+ data = {
+ src: data.src,
+ alt: data.alt,
+ width: data.width,
+ height: data.height,
+ style: data.style
+ };
+
+ editor.undoManager.transact(function() {
+ // WP
+ var eventData = { node: imgElm, data: data, caption: caption };
+
+ editor.fire( 'wpImageFormSubmit', { imgData: eventData } );
+
+ if ( eventData.cancel ) {
+ waitLoad( eventData.node );
+ return;
+ }
+ // WP end
+
+ if (!data.src) {
+ if (imgElm) {
+ dom.remove(imgElm);
+ editor.nodeChanged();
+ }
+
+ return;
+ }
+
+ if (!imgElm) {
+ data.id = '__mcenew';
+ editor.selection.setContent(dom.createHTML('img', data));
+ imgElm = dom.get('__mcenew');
+ dom.setAttrib(imgElm, 'id', null);
+ } else {
+ dom.setAttribs(imgElm, data);
+ }
+
+ waitLoad(imgElm);
+ });
+ }
+
+ function removePixelSuffix(value) {
+ if (value) {
+ value = value.replace(/px$/, '');
+ }
+
+ return value;
+ }
+
+ function srcChange() {
+ if (imageListCtrl) {
+ imageListCtrl.value(editor.convertURL(this.value(), 'src'));
+ }
+
+ getImageSize(this.value(), function(data) {
+ if (data.width && data.height) {
+ width = data.width;
+ height = data.height;
+
+ win.find('#width').value(width);
+ win.find('#height').value(height);
+ }
+ });
+ }
+
+ width = dom.getAttrib(imgElm, 'width');
+ height = dom.getAttrib(imgElm, 'height');
+
+ if (imgElm.nodeName == 'IMG' && !imgElm.getAttribute('data-mce-object') && !imgElm.getAttribute('data-mce-placeholder')) {
+ data = {
+ src: dom.getAttrib(imgElm, 'src'),
+ alt: dom.getAttrib(imgElm, 'alt'),
+ width: width,
+ height: height
+ };
+
+ // WP
+ editor.fire( 'wpLoadImageData', { imgData: { data: data, node: imgElm } } );
+ } else {
+ imgElm = null;
+ }
+
+ if (imageList) {
+ imageListCtrl = {
+ type: 'listbox',
+ label: 'Image list',
+ values: buildImageList(),
+ value: data.src && editor.convertURL(data.src, 'src'),
+ onselect: function(e) {
+ var altCtrl = win.find('#alt');
+
+ if (!altCtrl.value() || (e.lastControl && altCtrl.value() == e.lastControl.text())) {
+ altCtrl.value(e.control.text());
+ }
+
+ win.find('#src').value(e.control.value());
+ },
+ onPostRender: function() {
+ imageListCtrl = this;
+ }
+ };
+ }
+
+ // General settings shared between simple and advanced dialogs
+ var generalFormItems = [
+ {name: 'src', type: 'filepicker', filetype: 'image', label: 'Source', autofocus: true, onchange: srcChange},
+ imageListCtrl,
+ {name: 'alt', type: 'textbox', label: 'Image description'},
+ {
+ type: 'container',
+ label: 'Dimensions',
+ layout: 'flex',
+ direction: 'row',
+ align: 'center',
+ spacing: 5,
+ items: [
+ {name: 'width', type: 'textbox', maxLength: 3, size: 3, onchange: recalcSize},
+ {type: 'label', text: 'x'},
+ {name: 'height', type: 'textbox', maxLength: 3, size: 3, onchange: recalcSize},
+ {name: 'constrain', type: 'checkbox', checked: true, text: 'Constrain proportions'}
+ ]
+ }
+ ];
+
+ // WP
+ editor.fire( 'wpLoadImageForm', { data: generalFormItems } );
+
+ function updateStyle() {
+ function addPixelSuffix(value) {
+ if (value.length > 0 && /^[0-9]+$/.test(value)) {
+ value += 'px';
+ }
+
+ return value;
+ }
+
+ var data = win.toJSON();
+ var css = dom.parseStyle(data.style);
+
+ delete css.margin;
+ css['margin-top'] = css['margin-bottom'] = addPixelSuffix(data.vspace);
+ css['margin-left'] = css['margin-right'] = addPixelSuffix(data.hspace);
+ css['border-width'] = addPixelSuffix(data.border);
+
+ win.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css))));
+ }
+
+ if (editor.settings.image_advtab) {
+ // Parse styles from img
+ if (imgElm) {
+ data.hspace = removePixelSuffix(imgElm.style.marginLeft || imgElm.style.marginRight);
+ data.vspace = removePixelSuffix(imgElm.style.marginTop || imgElm.style.marginBottom);
+ data.border = removePixelSuffix(imgElm.style.borderWidth);
+ data.style = editor.dom.serializeStyle(editor.dom.parseStyle(editor.dom.getAttrib(imgElm, 'style')));
+ }
+
+ // Advanced dialog shows general+advanced tabs
+ win = editor.windowManager.open({
+ title: 'Insert/edit image',
+ data: data,
+ bodyType: 'tabpanel',
+ body: [
+ {
+ title: 'General',
+ type: 'form',
+ items: generalFormItems
+ },
+
+ {
+ title: 'Advanced',
+ type: 'form',
+ pack: 'start',
+ items: [
+ {
+ label: 'Style',
+ name: 'style',
+ type: 'textbox'
+ },
+ {
+ type: 'form',
+ layout: 'grid',
+ packV: 'start',
+ columns: 2,
+ padding: 0,
+ alignH: ['left', 'right'],
+ defaults: {
+ type: 'textbox',
+ maxWidth: 50,
+ onchange: updateStyle
+ },
+ items: [
+ {label: 'Vertical space', name: 'vspace'},
+ {label: 'Horizontal space', name: 'hspace'},
+ {label: 'Border', name: 'border'}
+ ]
+ }
+ ]
+ }
+ ],
+ onSubmit: onSubmitForm
+ });
+ } else {
+ // Simple default dialog
+ win = editor.windowManager.open({
+ title: 'Insert/edit image',
+ data: data,
+ body: generalFormItems,
+ onSubmit: onSubmitForm
+ });
+ }
+ }
+
+ // WP
+ editor.addCommand( 'mceImage', function() {
+ createImageList( showDialog )();
+ });
+
+ editor.addButton('image', {
+ icon: 'image',
+ tooltip: 'Insert/edit image',
+ onclick: createImageList(showDialog),
+ stateSelector: 'img:not([data-mce-object],[data-mce-placeholder])'
+ });
+
+ editor.addMenuItem('image', {
+ icon: 'image',
+ text: 'Insert image',
+ onclick: createImageList(showDialog),
+ context: 'insert',
+ prependToContext: true
+ });
+});
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/plugins/image/plugin.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymcepluginsimagepluginminjs"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/plugins/image/plugin.min.js (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/image/plugin.min.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/image/plugin.min.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+tinymce.PluginManager.add("image",function(a){function b(a,b){function c(a,c){d.parentNode.removeChild(d),b({width:a,height:c})}var d=document.createElement("img");d.onload=function(){c(d.clientWidth,d.clientHeight)},d.onerror=function(){c()},d.src=a;var e=d.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left=0,e.width=e.height="auto",document.body.appendChild(d)}function c(b){return function(){var c=a.settings.image_list;"string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):b(c)}}function d(c){function d(){var b=[{text:"None",value:""}];return tinymce.each(c,function(c){b.push({text:c.text||c.title,value:a.convertURL(c.value||c.url,"src"),menu:c.menu})}),b}function e(a){var b,c,d,e;b=j.find("#width")[0],c=j.find("#height")[0],d=b.value(),e=c.value(),j.find("#constrain")[0].checked()&&k&a
mp;&l&&d&&e&&(a.control==b?(e=Math.round(d/k*e),c.value(e)):(d=Math.round(e/l*d),b.value(d))),k=d,l=e}function f(){function b(b){function d(){b.onload=b.onerror=null,a.selection.select(b),a.nodeChanged()}b.onload=function(){c.width||c.height||(o.setAttribs(b,{width:b.clientWidth,height:b.clientHeight}),a.fire("wpNewImageRefresh",{node:b})),d()},b.onerror=d}var c=j.toJSON(),d=c.caption;""===c.width&&(c.width=null),""===c.height&&(c.height=null),""===c.style&&(c.style=null),c={src:c.src,alt:c.alt,width:c.width,height:c.height,style:c.style},a.undoManager.transact(function(){var e={node:p,data:c,caption:d};return a.fire("wpImageFormSubmit",{imgData:e}),e.cancel?(b(e.node),void 0):c.src?(p?o.setAttribs(p,c):(c.id="__mcenew",a.selection.setContent(o.createHTML("img",c)),p=o.get("__mcenew"),o.setAttrib(p,"id",null)),b(p),void 0):(p&&(o.remov
e(p),a.nodeChanged()),void 0)})}function g(a){return a&&(a=a.replace(/px$/,"")),a}function h(){m&&m.value(a.convertURL(this.value(),"src")),b(this.value(),function(a){a.width&&a.height&&(k=a.width,l=a.height,j.find("#width").value(k),j.find("#height").value(l))})}function i(){function a(a){return a.length>0&&/^[0-9]+$/.test(a)&&(a+="px"),a}var b=j.toJSON(),c=o.parseStyle(b.style);delete c.margin,c["margin-top"]=c["margin-bottom"]=a(b.vspace),c["margin-left"]=c["margin-right"]=a(b.hspace),c["border-width"]=a(b.border),j.find("#style").value(o.serializeStyle(o.parseStyle(o.serializeStyle(c))))}var j,k,l,m,n={},o=a.dom,p=a.selection.getNode();k=o.getAttrib(p,"width"),l=o.getAttrib(p,"height"),"IMG"!=p.nodeName||p.getAttribute("data-mce-object")||p.getAttribute("data-mce-placeholder&q
uot;)?p=null:(n={src:o.getAttrib(p,"src"),alt:o.getAttrib(p,"alt"),width:k,height:l},a.fire("wpLoadImageData",{imgData:{data:n,node:p}})),c&&(m={type:"listbox",label:"Image list",values:d(),value:n.src&&a.convertURL(n.src,"src"),onselect:function(a){var b=j.find("#alt");(!b.value()||a.lastControl&&b.value()==a.lastControl.text())&&b.value(a.control.text()),j.find("#src").value(a.control.value())},onPostRender:function(){m=this}});var q=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:h},m,{name:"alt",type:"textbox",label:"Image description"},{type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:3,size:3,onchange:e},{t
ype:"label",text:"x"},{name:"height",type:"textbox",maxLength:3,size:3,onchange:e},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}];a.fire("wpLoadImageForm",{data:q}),a.settings.image_advtab?(p&&(n.hspace=g(p.style.marginLeft||p.style.marginRight),n.vspace=g(p.style.marginTop||p.style.marginBottom),n.border=g(p.style.borderWidth),n.style=a.dom.serializeStyle(a.dom.parseStyle(a.dom.getAttrib(p,"style")))),j=a.windowManager.open({title:"Insert/edit image",data:n,bodyType:"tabpanel",body:[{title:"General",type:"form",items:q},{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox"},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{ty
pe:"textbox",maxWidth:50,onchange:i},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]}],onSubmit:f})):j=a.windowManager.open({title:"Insert/edit image",data:n,body:q,onSubmit:f})}a.addCommand("mceImage",function(){c(d)()}),a.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:c(d),stateSelector:"img:not([data-mce-object],[data-mce-placeholder])"}),a.addMenuItem("image",{icon:"image",text:"Insert image",onclick:c(d),context:"insert",prependToContext:!0})});
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/plugins/image/plugin.min.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymcepluginslinkpluginjs"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/plugins/link/plugin.js (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/link/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/link/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,308 @@
</span><ins>+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('link', function(editor) {
+ function createLinkList(callback) {
+ return function() {
+ var linkList = editor.settings.link_list;
+
+ if (typeof(linkList) == "string") {
+ tinymce.util.XHR.send({
+ url: linkList,
+ success: function(text) {
+ callback(tinymce.util.JSON.parse(text));
+ }
+ });
+ } else {
+ callback(linkList);
+ }
+ };
+ }
+
+ function showDialog(linkList) {
+ var data = {}, selection = editor.selection, dom = editor.dom, selectedElm, anchorElm, initialText;
+ var win, linkListCtrl, relListCtrl, targetListCtrl;
+
+ function linkListChangeHandler(e) {
+ var textCtrl = win.find('#text');
+
+ if (!textCtrl.value() || (e.lastControl && textCtrl.value() == e.lastControl.text())) {
+ textCtrl.value(e.control.text());
+ }
+
+ win.find('#href').value(e.control.value());
+ }
+
+ function buildLinkList() {
+ var linkListItems = [{text: 'None', value: ''}];
+
+ tinymce.each(linkList, function(link) {
+ linkListItems.push({
+ text: link.text || link.title,
+ value: editor.convertURL(link.value || link.url, 'href'),
+ menu: link.menu
+ });
+ });
+
+ return linkListItems;
+ }
+
+ function buildRelList(relValue) {
+ var relListItems = [{text: 'None', value: ''}];
+
+ tinymce.each(editor.settings.rel_list, function(rel) {
+ relListItems.push({
+ text: rel.text || rel.title,
+ value: rel.value,
+ selected: relValue === rel.value
+ });
+ });
+
+ return relListItems;
+ }
+
+ function buildTargetList(targetValue) {
+ var targetListItems = [{text: 'None', value: ''}];
+
+ if (!editor.settings.target_list) {
+ targetListItems.push({text: 'New window', value: '_blank'});
+ }
+
+ tinymce.each(editor.settings.target_list, function(target) {
+ targetListItems.push({
+ text: target.text || target.title,
+ value: target.value,
+ selected: targetValue === target.value
+ });
+ });
+
+ return targetListItems;
+ }
+
+ function buildAnchorListControl(url) {
+ var anchorList = [];
+
+ tinymce.each(editor.dom.select('a:not([href])'), function(anchor) {
+ var id = anchor.name || anchor.id;
+
+ if (id) {
+ anchorList.push({
+ text: id,
+ value: '#' + id,
+ selected: url.indexOf('#' + id) != -1
+ });
+ }
+ });
+
+ if (anchorList.length) {
+ anchorList.unshift({text: 'None', value: ''});
+
+ return {
+ name: 'anchor',
+ type: 'listbox',
+ label: 'Anchors',
+ values: anchorList,
+ onselect: linkListChangeHandler
+ };
+ }
+ }
+
+ function urlChange() {
+ if (linkListCtrl) {
+ linkListCtrl.value(editor.convertURL(this.value(), 'href'));
+ }
+
+ if (!initialText && data.text.length === 0) {
+ this.parent().parent().find('#text')[0].value(this.value());
+ }
+ }
+
+ selectedElm = selection.getNode();
+ anchorElm = dom.getParent(selectedElm, 'a[href]');
+
+ data.text = initialText = anchorElm ? (anchorElm.innerText || anchorElm.textContent) : selection.getContent({format: 'text'});
+ data.href = anchorElm ? dom.getAttrib(anchorElm, 'href') : '';
+ data.target = anchorElm ? dom.getAttrib(anchorElm, 'target') : '';
+ data.rel = anchorElm ? dom.getAttrib(anchorElm, 'rel') : '';
+
+ if (selectedElm.nodeName == "IMG") {
+ data.text = initialText = " ";
+ }
+
+ if (linkList) {
+ linkListCtrl = {
+ type: 'listbox',
+ label: 'Link list',
+ values: buildLinkList(),
+ onselect: linkListChangeHandler,
+ value: editor.convertURL(data.href, 'href'),
+ onPostRender: function() {
+ linkListCtrl = this;
+ }
+ };
+ }
+
+ if (editor.settings.target_list !== false) {
+ targetListCtrl = {
+ name: 'target',
+ type: 'listbox',
+ label: 'Target',
+ values: buildTargetList(data.target)
+ };
+ }
+
+ if (editor.settings.rel_list) {
+ relListCtrl = {
+ name: 'rel',
+ type: 'listbox',
+ label: 'Rel',
+ values: buildRelList(data.rel)
+ };
+ }
+
+ win = editor.windowManager.open({
+ title: 'Insert link',
+ data: data,
+ body: [
+ {
+ name: 'href',
+ type: 'filepicker',
+ filetype: 'file',
+ size: 40,
+ autofocus: true,
+ label: 'Url',
+ onchange: urlChange,
+ onkeyup: urlChange
+ },
+ {name: 'text', type: 'textbox', size: 40, label: 'Text to display', onchange: function() {
+ data.text = this.value();
+ }},
+ buildAnchorListControl(data.href),
+ linkListCtrl,
+ relListCtrl,
+ targetListCtrl
+ ],
+ onSubmit: function(e) {
+ var data = e.data, href = data.href;
+
+ // Delay confirm since onSubmit will move focus
+ function delayedConfirm(message, callback) {
+ var rng = editor.selection.getRng();
+
+ window.setTimeout(function() {
+ editor.windowManager.confirm(message, function(state) {
+ editor.selection.setRng(rng);
+ callback(state);
+ });
+ }, 0);
+ }
+
+ function insertLink() {
+ if (data.text != initialText) {
+ if (anchorElm) {
+ editor.focus();
+ anchorElm.innerHTML = data.text;
+
+ dom.setAttribs(anchorElm, {
+ href: href,
+ target: data.target ? data.target : null,
+ rel: data.rel ? data.rel : null
+ });
+
+ selection.select(anchorElm);
+ } else {
+ editor.insertContent(dom.createHTML('a', {
+ href: href,
+ target: data.target ? data.target : null,
+ rel: data.rel ? data.rel : null
+ }, data.text));
+ }
+ } else {
+ editor.execCommand('mceInsertLink', false, {
+ href: href,
+ target: data.target,
+ rel: data.rel ? data.rel : null
+ });
+ }
+ }
+
+ if (!href) {
+ editor.execCommand('unlink');
+ return;
+ }
+
+ // Is email and not //user@domain.com
+ if (href.indexOf('@') > 0 && href.indexOf('//') == -1 && href.indexOf('mailto:') == -1) {
+ delayedConfirm(
+ 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?',
+ function(state) {
+ if (state) {
+ href = 'mailto:' + href;
+ }
+
+ insertLink();
+ }
+ );
+
+ return;
+ }
+
+ // Is www. prefixed
+ if (/^\s*www\./i.test(href)) {
+ delayedConfirm(
+ 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?',
+ function(state) {
+ if (state) {
+ href = 'http://' + href;
+ }
+
+ insertLink();
+ }
+ );
+
+ return;
+ }
+
+ insertLink();
+ }
+ });
+ }
+
+ editor.addButton('link', {
+ icon: 'link',
+ tooltip: 'Insert/edit link',
+ shortcut: 'Ctrl+K',
+ onclick: createLinkList(showDialog),
+ stateSelector: 'a[href]'
+ });
+
+ editor.addButton('unlink', {
+ icon: 'unlink',
+ tooltip: 'Remove link',
+ cmd: 'unlink',
+ stateSelector: 'a[href]'
+ });
+
+ editor.addShortcut('Ctrl+K', '', createLinkList(showDialog));
+
+ this.showDialog = showDialog;
+
+ editor.addMenuItem('link', {
+ icon: 'link',
+ text: 'Insert link',
+ shortcut: 'Ctrl+K',
+ onclick: createLinkList(showDialog),
+ stateSelector: 'a[href]',
+ context: 'insert',
+ prependToContext: true
+ });
+});
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/plugins/link/plugin.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymcepluginslinkpluginminjs"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/plugins/link/plugin.min.js (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/link/plugin.min.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/link/plugin.min.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+tinymce.PluginManager.add("link",function(e){function t(t){return function(){var n=e.settings.link_list;"string"==typeof n?tinymce.util.XHR.send({url:n,success:function(e){t(tinymce.util.JSON.parse(e))}}):t(n)}}function n(t){function n(e){var t=f.find("#text");(!t.value()||e.lastControl&&t.value()==e.lastControl.text())&&t.value(e.control.text()),f.find("#href").value(e.control.value())}function l(){var n=[{text:"None",value:""}];return tinymce.each(t,function(t){n.push({text:t.text||t.title,value:e.convertURL(t.value||t.url,"href"),menu:t.menu})}),n}function i(t){var n=[{text:"None",value:""}];return tinymce.each(e.settings.rel_list,function(e){n.push({text:e.text||e.title,value:e.value,selected:t===e.value})}),n}function r(t){var n=[{text:"None",value:""}];return e.settings.target_list||n.push({text:"New window",value:"_blank"
;}),tinymce.each(e.settings.target_list,function(e){n.push({text:e.text||e.title,value:e.value,selected:t===e.value})}),n}function a(t){var l=[];return tinymce.each(e.dom.select("a:not([href])"),function(e){var n=e.name||e.id;n&&l.push({text:n,value:"#"+n,selected:-1!=t.indexOf("#"+n)})}),l.length?(l.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:l,onselect:n}):void 0}function o(){d&&d.value(e.convertURL(this.value(),"href")),c||0!==x.text.length||this.parent().parent().find("#text")[0].value(this.value())}var u,s,c,f,d,h,v,x={},g=e.selection,m=e.dom;u=g.getNode(),s=m.getParent(u,"a[href]"),x.text=c=s?s.innerText||s.textContent:g.getContent({format:"text"}),x.href=s?m.getAttrib(s,"href"):"",x.target=s?m.getAttrib(s,"target"):"",x.rel=s?m.getAttrib(s,"rel"):"
","IMG"==u.nodeName&&(x.text=c=" "),t&&(d={type:"listbox",label:"Link list",values:l(),onselect:n,value:e.convertURL(x.href,"href"),onPostRender:function(){d=this}}),e.settings.target_list!==!1&&(v={name:"target",type:"listbox",label:"Target",values:r(x.target)}),e.settings.rel_list&&(h={name:"rel",type:"listbox",label:"Rel",values:i(x.rel)}),f=e.windowManager.open({title:"Insert link",data:x,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:o,onkeyup:o},{name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){x.text=this.value()}},a(x.href),d,h,v],onSubmit:function(t){function n(t,n){var l=e.selection.getRng();window.setTimeout(function(){e.windowManager.confirm(t,function(t){e.selection.setR
ng(l),n(t)})},0)}function l(){i.text!=c?s?(e.focus(),s.innerHTML=i.text,m.setAttribs(s,{href:r,target:i.target?i.target:null,rel:i.rel?i.rel:null}),g.select(s)):e.insertContent(m.createHTML("a",{href:r,target:i.target?i.target:null,rel:i.rel?i.rel:null},i.text)):e.execCommand("mceInsertLink",!1,{href:r,target:i.target,rel:i.rel?i.rel:null})}var i=t.data,r=i.href;return r?r.indexOf("@")>0&&-1==r.indexOf("//")&&-1==r.indexOf("mailto:")?(n("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(e){e&&(r="mailto:"+r),l()}),void 0):/^\s*www\./i.test(r)?(n("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(e){e&&(r="http://"+r),l()}),void 0):(l(),void 0):(e.execCommand("unlink"),void 0)}})}e.addButton("link",{icon:"link",toolti
p:"Insert/edit link",shortcut:"Ctrl+K",onclick:t(n),stateSelector:"a[href]"}),e.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",stateSelector:"a[href]"}),e.addShortcut("Ctrl+K","",t(n)),this.showDialog=n,e.addMenuItem("link",{icon:"link",text:"Insert link",shortcut:"Ctrl+K",onclick:t(n),stateSelector:"a[href]",context:"insert",prependToContext:!0})});
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/plugins/link/plugin.min.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymcepluginsmediaeditor_pluginjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/media/editor_plugin.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/media/editor_plugin.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/media/editor_plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-(function(){var b=tinymce.explode("id,name,width,height,style,align,class,hspace,vspace,bgcolor,type"),a=tinymce.makeMap(b.join(",")),f=tinymce.html.Node,d,i,h=tinymce.util.JSON,g;d=[["Flash","d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["ShockWave","166b1bca-3f9c-11cf-8075-444553540000","application/x-director","http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],["WindowsMedia","6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a","application/x-mplayer2","http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],["QuickTime","02bf25d5-8c17-4b23-bc80-d3488abddc6b","video/qu
icktime","http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],["RealMedia","cfcdaa03-8be4-11cf-b84b-0020afbbccfa","audio/x-pn-realaudio-plugin","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["Java","8ad9c840-044e-11d1-b3e9-00805f499d93","application/x-java-applet","http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],["Silverlight","dfeaf541-f3e1-4c24-acac-99c30715084a","application/x-silverlight-2"],["Iframe"],["Video"],["EmbeddedAudio"],["Audio"]];function e(j){return typeof(j)=="string"?j.replace(/[^0-9%]/g,""):j}function c(m){var l,j,k;if(m&&!m.splice){j=[];for(k=0;true;k++){if(m[k]){j[k]=m[k]}else{break}}return j}return m}tinymce.create("tinymce.plugins.MediaPlugin",{init:function(n,j){va
r r=this,l={},m,p,q,k;function o(s){return s&&s.nodeName==="IMG"&&n.dom.hasClass(s,"mceItemMedia")}r.editor=n;r.url=j;i="";for(m=0;m<d.length;m++){k=d[m][0];q={name:k,clsids:tinymce.explode(d[m][1]||""),mimes:tinymce.explode(d[m][2]||""),codebase:d[m][3]};for(p=0;p<q.clsids.length;p++){l["clsid:"+q.clsids[p]]=q}for(p=0;p<q.mimes.length;p++){l[q.mimes[p]]=q}l["mceItem"+k]=q;l[k.toLowerCase()]=q;i+=(i?"|":"")+k}tinymce.each(n.getParam("media_types","video=mp4,m4v,ogv,webm;silverlight=xap;flash=swf,flv;shockwave=dcr;quicktime=mov,qt,mpg,mpeg;shockwave=dcr;windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;realmedia=rm,ra,ram;java=jar;audio=mp3,ogg").split(";"),function(v){var s,u,t;v=v.split(/=/);u=tinymce.explode(v[1].toLowerCase());for(s=0;s<u.length;s++){t=l[v[0].toLowerCase()];if(t){l[u[s]]=t}}});i=new RegExp("write("+i+")\\(([^)]+)
\\)");r.lookup=l;n.onPreInit.add(function(){n.schema.addValidElements("object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]");n.parser.addNodeFilter("object,embed,video,audio,script,iframe",function(s){var t=s.length;while(t--){r.objectToImg(s[t])}});n.serializer.addNodeFilter("img",function(s,u,t){var v=s.length,w;while(v--){w=s[v];if((w.attr("class")||"").indexOf("mceItemMedia")!==-1){r.imgToObject(w,t)}}})});n.onInit.add(function(){if(n.theme&&n.theme.onResolveName){n.theme.onResolveName.add(function(s,t){if(t.name==="img"&&n.dom.hasClass(t.node,"mceItemMedia")){t.name="media"}})}if(n&&n.plugins.contextmenu){n.plugins.contextmenu.onContextMenu.add(function(t,u,s){if(s.nodeName==="IMG"&&s.className.indexOf("mceItemMedia")!==-1){u.add({title:"media.edi
t",icon:"media",cmd:"mceMedia"})}})}});n.addCommand("mceMedia",function(){var t,s;s=n.selection.getNode();if(o(s)){t=n.dom.getAttrib(s,"data-mce-json");if(t){t=h.parse(t);tinymce.each(b,function(u){var v=n.dom.getAttrib(s,u);if(v){t[u]=v}});t.type=r.getType(s.className).name.toLowerCase()}}if(!t){t={type:"flash",video:{sources:[]},params:{}}}n.windowManager.open({file:j+"/media.htm",width:430+parseInt(n.getLang("media.delta_width",0)),height:500+parseInt(n.getLang("media.delta_height",0)),inline:1},{plugin_url:j,data:t})});n.addButton("media",{title:"media.desc",cmd:"mceMedia"});n.onNodeChange.add(function(t,s,u){s.setActive("media",o(u))})},convertUrl:function(l,o){var k=this,n=k.editor,m=n.settings,p=m.url_converter,j=m.url_converter_scope||k;if(!l){return l}if(o){return n.documentBaseURI.toAbsolute(l)}return p.call(j,l,"src","object")},g
etInfo: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}},dataToImg:function(m,k){var r=this,o=r.editor,p=o.documentBaseURI,j,q,n,l;m.params.src=r.convertUrl(m.params.src,k);q=m.video.attrs;if(q){q.src=r.convertUrl(q.src,k)}if(q){q.poster=r.convertUrl(q.poster,k)}j=c(m.video.sources);if(j){for(l=0;l<j.length;l++){j[l].src=r.convertUrl(j[l].src,k)}}n=r.editor.dom.create("img",{id:m.id,style:m.style,align:m.align,hspace:m.hspace,vspace:m.vspace,src:r.editor.theme.url+"/img/trans.gif","class":"mceItemMedia mceItem"+r.getType(m.type).name,"data-mce-json":h.serialize(m,"'")});n.width=m.width=e(m.width||(m.type=="audio"?"300":"320"));n.height=m.height=e(m.height||(m.type==
"audio"?"32":"240"));return n},dataToHtml:function(j,k){return this.editor.serializer.serialize(this.dataToImg(j,k),{forced_root_block:"",force_absolute:k})},htmlToData:function(l){var k,j,m;m={type:"flash",video:{sources:[]},params:{}};k=this.editor.parser.parse(l);j=k.getAll("img")[0];if(j){m=h.parse(j.attr("data-mce-json"));m.type=this.getType(j.attr("class")).name.toLowerCase();tinymce.each(b,function(n){var o=j.attr(n);if(o){m[n]=o}})}return m},getType:function(m){var k,j,l;j=tinymce.explode(m," ");for(k=0;k<j.length;k++){l=this.lookup[j[k]];if(l){return l}}},imgToObject:function(z,o){var u=this,p=u.editor,C,H,j,t,I,y,G,w,k,E,s,q,A,D,m,x,l,B,F;function r(n,J){var N,M,O,L,K;K=p.getParam("flash_video_player_url",u.convertUrl(u.url+"/moxieplayer.swf"));if(K){N=p.documentBaseURI;G.params.src=K;if(p.getParam("flash_video_player_absvideourl",true)){n=N.toAbsolute
(n||"",true);J=N.toAbsolute(J||"",true)}O="";M=p.getParam("flash_video_player_flashvars",{url:"$url",poster:"$poster"});tinymce.each(M,function(Q,P){Q=Q.replace(/\$url/,n||"");Q=Q.replace(/\$poster/,J||"");if(Q.length>0){O+=(O?"&":"")+P+"="+escape(Q)}});if(O.length){G.params.flashvars=O}L=p.getParam("flash_video_player_params",{allowfullscreen:true,allowscriptaccess:true});tinymce.each(L,function(Q,P){G.params[P]=""+Q})}}G=z.attr("data-mce-json");if(!G){return}G=h.parse(G);q=this.getType(z.attr("class"));B=z.attr("data-mce-style");if(!B){B=z.attr("style");if(B){B=p.dom.serializeStyle(p.dom.parseStyle(B,"img"))}}G.width=z.attr("width")||G.width;G.height=z.attr("height")||G.height;if(q.name==="Iframe"){x=new f("iframe",1);tinymce.each(b,function(n){var J=z.attr(
n);if(n=="class"&&J){J=J.replace(/mceItem.+ ?/g,"")}if(J&&J.length>0){x.attr(n,J)}});for(I in G.params){x.attr(I,G.params[I])}x.attr({style:B,src:G.params.src});z.replace(x);return}if(this.editor.settings.media_use_script){x=new f("script",1).attr("type","text/javascript");y=new f("#text",3);y.value="write"+q.name+"("+h.serialize(tinymce.extend(G.params,{width:z.attr("width"),height:z.attr("height")}))+");";x.append(y);z.replace(x);return}if(q.name==="Video"&&G.video.sources[0]){C=new f("video",1).attr(tinymce.extend({id:z.attr("id"),width:e(z.attr("width")),height:e(z.attr("height")),style:B},G.video.attrs));if(G.video.attrs){l=G.video.attrs.poster}k=G.video.sources=c(G.video.sources);for(A=0;A<k.length;A++){if(/\.mp4$/.test(k[A].src)){m=k[A].src}}if(!k[0].type){C.attr("src",k[0].src);
k.splice(0,1)}for(A=0;A<k.length;A++){w=new f("source",1).attr(k[A]);w.shortEnded=true;C.append(w)}if(m){r(m,l);q=u.getType("flash")}else{G.params.src=""}}if(q.name==="Audio"&&G.video.sources[0]){F=new f("audio",1).attr(tinymce.extend({id:z.attr("id"),width:e(z.attr("width")),height:e(z.attr("height")),style:B},G.video.attrs));if(G.video.attrs){l=G.video.attrs.poster}k=G.video.sources=c(G.video.sources);if(!k[0].type){F.attr("src",k[0].src);k.splice(0,1)}for(A=0;A<k.length;A++){w=new f("source",1).attr(k[A]);w.shortEnded=true;F.append(w)}G.params.src=""}if(q.name==="EmbeddedAudio"){j=new f("embed",1);j.shortEnded=true;j.attr({id:z.attr("id"),width:e(z.attr("width")),height:e(z.attr("height")),style:B,type:z.attr("type")});for(I in G.params){j.attr(I,G.params[I])}tinymce.each(b,function(n){if(G[n]&&
amp;n!="type"){j.attr(n,G[n])}});G.params.src=""}if(G.params.src){if(/\.flv$/i.test(G.params.src)){r(G.params.src,"")}if(o&&o.force_absolute){G.params.src=p.documentBaseURI.toAbsolute(G.params.src)}H=new f("object",1).attr({id:z.attr("id"),width:e(z.attr("width")),height:e(z.attr("height")),style:B});tinymce.each(b,function(n){var J=G[n];if(n=="class"&&J){J=J.replace(/mceItem.+ ?/g,"")}if(J&&n!="type"){H.attr(n,J)}});for(I in G.params){s=new f("param",1);s.shortEnded=true;y=G.params[I];if(I==="src"&&q.name==="WindowsMedia"){I="url"}s.attr({name:I,value:y});H.append(s)}if(this.editor.getParam("media_strict",true)){H.attr({data:G.params.src,type:q.mimes[0]})}else{H.attr({classid:"clsid:"+q.clsids[0],codebase:q.codebase});j=new f("embed",1);j.shortEnded=true;j.attr({id:z.attr("id&qu
ot;),width:e(z.attr("width")),height:e(z.attr("height")),style:B,type:q.mimes[0]});for(I in G.params){j.attr(I,G.params[I])}tinymce.each(b,function(n){if(G[n]&&n!="type"){j.attr(n,G[n])}});H.append(j)}if(G.object_html){y=new f("#text",3);y.raw=true;y.value=G.object_html;H.append(y)}if(C){C.append(H)}}if(C){if(G.video_html){y=new f("#text",3);y.raw=true;y.value=G.video_html;C.append(y)}}if(F){if(G.video_html){y=new f("#text",3);y.raw=true;y.value=G.video_html;F.append(y)}}var v=C||F||H||j;if(v){z.replace(v)}else{z.remove()}},objectToImg:function(C){var L,k,F,s,M,N,y,A,x,G,E,t,q,I,B,l,K,o,H=this.lookup,m,z,v=this.editor.settings.url_converter,n=this.editor.settings.url_converter_scope,w,r,D,j;function u(O){return new tinymce.html.Serializer({inner:true,validate:false}).serialize(O)}function J(P,O){return H[(P.attr(O)||"").toLowerCase()]}function p(P){var O=P.replace(/^.*\.([^.]+)$/,"$1");return H[O
.toLowerCase()||""]}if(!C.parent){return}if(C.name==="script"){if(C.firstChild){m=i.exec(C.firstChild.value)}if(!m){return}o=m[1];K={video:{},params:h.parse(m[2])};A=K.params.width;x=K.params.height}K=K||{video:{},params:{}};M=new f("img",1);M.attr({src:this.editor.theme.url+"/img/trans.gif"});N=C.name;if(N==="video"||N=="audio"){F=C;L=C.getAll("object")[0];k=C.getAll("embed")[0];A=F.attr("width");x=F.attr("height");y=F.attr("id");K.video={attrs:{},sources:[]};z=K.video.attrs;for(N in F.attributes.map){z[N]=F.attributes.map[N]}B=C.attr("src");if(B){K.video.sources.push({src:v.call(n,B,"src",C.name)})}l=F.getAll("source");for(E=0;E<l.length;E++){B=l[E].remove();K.video.sources.push({src:v.call(n,B.attr("src"),"src","source"),type:B.attr("type"),media:B.attr("media")})}if(z.poster){z.poster=v.ca
ll(n,z.poster,"poster",C.name)}}if(C.name==="object"){L=C;k=C.getAll("embed")[0]}if(C.name==="embed"){k=C}if(C.name==="iframe"){s=C;o="Iframe"}if(L){A=A||L.attr("width");x=x||L.attr("height");G=G||L.attr("style");y=y||L.attr("id");w=w||L.attr("hspace");r=r||L.attr("vspace");D=D||L.attr("align");j=j||L.attr("bgcolor");K.name=L.attr("name");I=L.getAll("param");for(E=0;E<I.length;E++){q=I[E];N=q.remove().attr("name");if(!a[N]){K.params[N]=q.attr("value")}}K.params.src=K.params.src||L.attr("data")}if(k){A=A||k.attr("width");x=x||k.attr("height");G=G||k.attr("style");y=y||k.attr("id");w=w||k.attr("hspace");r=r||k.attr("vspace");D=D||k.attr("align");j=j||k.attr("bgcolor");for(N in k.attributes.map){if(!a[N]&&!K.p
arams[N]){K.params[N]=k.attributes.map[N]}}}if(s){A=e(s.attr("width"));x=e(s.attr("height"));G=G||s.attr("style");y=s.attr("id");w=s.attr("hspace");r=s.attr("vspace");D=s.attr("align");j=s.attr("bgcolor");tinymce.each(b,function(O){M.attr(O,s.attr(O))});for(N in s.attributes.map){if(!a[N]&&!K.params[N]){K.params[N]=s.attributes.map[N]}}}if(K.params.movie){K.params.src=K.params.src||K.params.movie;delete K.params.movie}if(K.params.src){K.params.src=v.call(n,K.params.src,"src","object")}if(F){if(C.name==="video"){o=H.video.name}else{if(C.name==="audio"){o=H.audio.name}}}if(L&&!o){o=(J(L,"clsid")||J(L,"classid")||J(L,"type")||{}).name}if(k&&!o){o=(J(k,"type")||p(K.params.src)||{}).name}if(k&&o=="EmbeddedAudio"){K.params.type=k.attr("type")}C.replace(M);if(k){k.remove()}if(L){t=
u(L.remove());if(t){K.object_html=t}}if(F){t=u(F.remove());if(t){K.video_html=t}}K.hspace=w;K.vspace=r;K.align=D;K.bgcolor=j;M.attr({id:y,"class":"mceItemMedia mceItem"+(o||"Flash"),style:G,width:A||(C.name=="audio"?"300":"320"),height:x||(C.name=="audio"?"32":"240"),hspace:w,vspace:r,align:D,bgcolor:j,"data-mce-json":h.serialize(K,"'")})}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})();
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsmediaeditor_plugin_srcjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/media/editor_plugin_src.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/media/editor_plugin_src.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/media/editor_plugin_src.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,897 +0,0 @@
</span><del>-/**
- * editor_plugin_src.js
- *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
- *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
- */
-
-(function() {
- var rootAttributes = tinymce.explode('id,name,width,height,style,align,class,hspace,vspace,bgcolor,type'), excludedAttrs = tinymce.makeMap(rootAttributes.join(',')), Node = tinymce.html.Node,
- mediaTypes, scriptRegExp, JSON = tinymce.util.JSON, mimeTypes;
-
- // Media types supported by this plugin
- mediaTypes = [
- // Type, clsid:s, mime types, codebase
- ["Flash", "d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],
- ["ShockWave", "166b1bca-3f9c-11cf-8075-444553540000", "application/x-director", "http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],
- ["WindowsMedia", "6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a", "application/x-mplayer2", "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],
- ["QuickTime", "02bf25d5-8c17-4b23-bc80-d3488abddc6b", "video/quicktime", "http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],
- ["RealMedia", "cfcdaa03-8be4-11cf-b84b-0020afbbccfa", "audio/x-pn-realaudio-plugin", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],
- ["Java", "8ad9c840-044e-11d1-b3e9-00805f499d93", "application/x-java-applet", "http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],
- ["Silverlight", "dfeaf541-f3e1-4c24-acac-99c30715084a", "application/x-silverlight-2"],
- ["Iframe"],
- ["Video"],
- ["EmbeddedAudio"],
- ["Audio"]
- ];
-
- function normalizeSize(size) {
- return typeof(size) == "string" ? size.replace(/[^0-9%]/g, '') : size;
- }
-
- function toArray(obj) {
- var undef, out, i;
-
- if (obj && !obj.splice) {
- out = [];
-
- for (i = 0; true; i++) {
- if (obj[i])
- out[i] = obj[i];
- else
- break;
- }
-
- return out;
- }
-
- return obj;
- };
-
- tinymce.create('tinymce.plugins.MediaPlugin', {
- init : function(ed, url) {
- var self = this, lookup = {}, i, y, item, name;
-
- function isMediaImg(node) {
- return node && node.nodeName === 'IMG' && ed.dom.hasClass(node, 'mceItemMedia');
- };
-
- self.editor = ed;
- self.url = url;
-
- // Parse media types into a lookup table
- scriptRegExp = '';
- for (i = 0; i < mediaTypes.length; i++) {
- name = mediaTypes[i][0];
-
- item = {
- name : name,
- clsids : tinymce.explode(mediaTypes[i][1] || ''),
- mimes : tinymce.explode(mediaTypes[i][2] || ''),
- codebase : mediaTypes[i][3]
- };
-
- for (y = 0; y < item.clsids.length; y++)
- lookup['clsid:' + item.clsids[y]] = item;
-
- for (y = 0; y < item.mimes.length; y++)
- lookup[item.mimes[y]] = item;
-
- lookup['mceItem' + name] = item;
- lookup[name.toLowerCase()] = item;
-
- scriptRegExp += (scriptRegExp ? '|' : '') + name;
- }
-
- // Handle the media_types setting
- tinymce.each(ed.getParam("media_types",
- "video=mp4,m4v,ogv,webm;" +
- "silverlight=xap;" +
- "flash=swf,flv;" +
- "shockwave=dcr;" +
- "quicktime=mov,qt,mpg,mpeg;" +
- "shockwave=dcr;" +
- "windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;" +
- "realmedia=rm,ra,ram;" +
- "java=jar;" +
- "audio=mp3,ogg"
- ).split(';'), function(item) {
- var i, extensions, type;
-
- item = item.split(/=/);
- extensions = tinymce.explode(item[1].toLowerCase());
- for (i = 0; i < extensions.length; i++) {
- type = lookup[item[0].toLowerCase()];
-
- if (type)
- lookup[extensions[i]] = type;
- }
- });
-
- scriptRegExp = new RegExp('write(' + scriptRegExp + ')\\(([^)]+)\\)');
- self.lookup = lookup;
-
- ed.onPreInit.add(function() {
- // Allow video elements
- ed.schema.addValidElements('object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]');
-
- // Convert video elements to image placeholder
- ed.parser.addNodeFilter('object,embed,video,audio,script,iframe', function(nodes) {
- var i = nodes.length;
-
- while (i--)
- self.objectToImg(nodes[i]);
- });
-
- // Convert image placeholders to video elements
- ed.serializer.addNodeFilter('img', function(nodes, name, args) {
- var i = nodes.length, node;
-
- while (i--) {
- node = nodes[i];
- if ((node.attr('class') || '').indexOf('mceItemMedia') !== -1)
- self.imgToObject(node, args);
- }
- });
- });
-
- ed.onInit.add(function() {
- // Display "media" instead of "img" in element path
- if (ed.theme && ed.theme.onResolveName) {
- ed.theme.onResolveName.add(function(theme, path_object) {
- if (path_object.name === 'img' && ed.dom.hasClass(path_object.node, 'mceItemMedia'))
- path_object.name = 'media';
- });
- }
-
- // Add contect menu if it's loaded
- if (ed && ed.plugins.contextmenu) {
- ed.plugins.contextmenu.onContextMenu.add(function(plugin, menu, element) {
- if (element.nodeName === 'IMG' && element.className.indexOf('mceItemMedia') !== -1)
- menu.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'});
- });
- }
- });
-
- // Register commands
- ed.addCommand('mceMedia', function() {
- var data, img;
-
- img = ed.selection.getNode();
- if (isMediaImg(img)) {
- data = ed.dom.getAttrib(img, 'data-mce-json');
- if (data) {
- data = JSON.parse(data);
-
- // Add some extra properties to the data object
- tinymce.each(rootAttributes, function(name) {
- var value = ed.dom.getAttrib(img, name);
-
- if (value)
- data[name] = value;
- });
-
- data.type = self.getType(img.className).name.toLowerCase();
- }
- }
-
- if (!data) {
- data = {
- type : 'flash',
- video: {sources:[]},
- params: {}
- };
- }
-
- ed.windowManager.open({
- file : url + '/media.htm',
- width : 430 + parseInt(ed.getLang('media.delta_width', 0)),
- height : 500 + parseInt(ed.getLang('media.delta_height', 0)),
- inline : 1
- }, {
- plugin_url : url,
- data : data
- });
- });
-
- // Register buttons
- ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'});
-
- // Update media selection status
- ed.onNodeChange.add(function(ed, cm, node) {
- cm.setActive('media', isMediaImg(node));
- });
- },
-
- convertUrl : function(url, force_absolute) {
- var self = this, editor = self.editor, settings = editor.settings,
- urlConverter = settings.url_converter,
- urlConverterScope = settings.url_converter_scope || self;
-
- if (!url)
- return url;
-
- if (force_absolute)
- return editor.documentBaseURI.toAbsolute(url);
-
- return urlConverter.call(urlConverterScope, url, 'src', 'object');
- },
-
- 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
- };
- },
-
- /**
- * Converts the JSON data object to an img node.
- */
- dataToImg : function(data, force_absolute) {
- var self = this, editor = self.editor, baseUri = editor.documentBaseURI, sources, attrs, img, i;
-
- data.params.src = self.convertUrl(data.params.src, force_absolute);
-
- attrs = data.video.attrs;
- if (attrs)
- attrs.src = self.convertUrl(attrs.src, force_absolute);
-
- if (attrs)
- attrs.poster = self.convertUrl(attrs.poster, force_absolute);
-
- sources = toArray(data.video.sources);
- if (sources) {
- for (i = 0; i < sources.length; i++)
- sources[i].src = self.convertUrl(sources[i].src, force_absolute);
- }
-
- img = self.editor.dom.create('img', {
- id : data.id,
- style : data.style,
- align : data.align,
- hspace : data.hspace,
- vspace : data.vspace,
- src : self.editor.theme.url + '/img/trans.gif',
- 'class' : 'mceItemMedia mceItem' + self.getType(data.type).name,
- 'data-mce-json' : JSON.serialize(data, "'")
- });
-
- img.width = data.width = normalizeSize(data.width || (data.type == 'audio' ? "300" : "320"));
- img.height = data.height = normalizeSize(data.height || (data.type == 'audio' ? "32" : "240"));
-
- return img;
- },
-
- /**
- * Converts the JSON data object to a HTML string.
- */
- dataToHtml : function(data, force_absolute) {
- return this.editor.serializer.serialize(this.dataToImg(data, force_absolute), {forced_root_block : '', force_absolute : force_absolute});
- },
-
- /**
- * Converts the JSON data object to a HTML string.
- */
- htmlToData : function(html) {
- var fragment, img, data;
-
- data = {
- type : 'flash',
- video: {sources:[]},
- params: {}
- };
-
- fragment = this.editor.parser.parse(html);
- img = fragment.getAll('img')[0];
-
- if (img) {
- data = JSON.parse(img.attr('data-mce-json'));
- data.type = this.getType(img.attr('class')).name.toLowerCase();
-
- // Add some extra properties to the data object
- tinymce.each(rootAttributes, function(name) {
- var value = img.attr(name);
-
- if (value)
- data[name] = value;
- });
- }
-
- return data;
- },
-
- /**
- * Get type item by extension, class, clsid or mime type.
- *
- * @method getType
- * @param {String} value Value to get type item by.
- * @return {Object} Type item object or undefined.
- */
- getType : function(value) {
- var i, values, typeItem;
-
- // Find type by checking the classes
- values = tinymce.explode(value, ' ');
- for (i = 0; i < values.length; i++) {
- typeItem = this.lookup[values[i]];
-
- if (typeItem)
- return typeItem;
- }
- },
-
- /**
- * Converts a tinymce.html.Node image element to video/object/embed.
- */
- imgToObject : function(node, args) {
- var self = this, editor = self.editor, video, object, embed, iframe, name, value, data,
- source, sources, params, param, typeItem, i, item, mp4Source, replacement,
- posterSrc, style, audio;
-
- // Adds the flash player
- function addPlayer(video_src, poster_src) {
- var baseUri, flashVars, flashVarsOutput, params, flashPlayer;
-
- flashPlayer = editor.getParam('flash_video_player_url', self.convertUrl(self.url + '/moxieplayer.swf'));
- if (flashPlayer) {
- baseUri = editor.documentBaseURI;
- data.params.src = flashPlayer;
-
- // Convert the movie url to absolute urls
- if (editor.getParam('flash_video_player_absvideourl', true)) {
- video_src = baseUri.toAbsolute(video_src || '', true);
- poster_src = baseUri.toAbsolute(poster_src || '', true);
- }
-
- // Generate flash vars
- flashVarsOutput = '';
- flashVars = editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'});
- tinymce.each(flashVars, function(value, name) {
- // Replace $url and $poster variables in flashvars value
- value = value.replace(/\$url/, video_src || '');
- value = value.replace(/\$poster/, poster_src || '');
-
- if (value.length > 0)
- flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value);
- });
-
- if (flashVarsOutput.length)
- data.params.flashvars = flashVarsOutput;
-
- params = editor.getParam('flash_video_player_params', {
- allowfullscreen: true,
- allowscriptaccess: true
- });
-
- tinymce.each(params, function(value, name) {
- data.params[name] = "" + value;
- });
- }
- };
-
- data = node.attr('data-mce-json');
- if (!data)
- return;
-
- data = JSON.parse(data);
- typeItem = this.getType(node.attr('class'));
-
- style = node.attr('data-mce-style');
- if (!style) {
- style = node.attr('style');
-
- if (style)
- style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img'));
- }
-
- // Use node width/height to override the data width/height when the placeholder is resized
- data.width = node.attr('width') || data.width;
- data.height = node.attr('height') || data.height;
-
- // Handle iframe
- if (typeItem.name === 'Iframe') {
- replacement = new Node('iframe', 1);
-
- tinymce.each(rootAttributes, function(name) {
- var value = node.attr(name);
-
- if (name == 'class' && value)
- value = value.replace(/mceItem.+ ?/g, '');
-
- if (value && value.length > 0)
- replacement.attr(name, value);
- });
-
- for (name in data.params)
- replacement.attr(name, data.params[name]);
-
- replacement.attr({
- style: style,
- src: data.params.src
- });
-
- node.replace(replacement);
-
- return;
- }
-
- // Handle scripts
- if (this.editor.settings.media_use_script) {
- replacement = new Node('script', 1).attr('type', 'text/javascript');
-
- value = new Node('#text', 3);
- value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, {
- width: node.attr('width'),
- height: node.attr('height')
- })) + ');';
-
- replacement.append(value);
- node.replace(replacement);
-
- return;
- }
-
- // Add HTML5 video element
- if (typeItem.name === 'Video' && data.video.sources && data.video.sources[0]) {
- // Create new object element
- video = new Node('video', 1).attr(tinymce.extend({
- id : node.attr('id'),
- width: normalizeSize(node.attr('width')),
- height: normalizeSize(node.attr('height')),
- style : style
- }, data.video.attrs));
-
- // Get poster source and use that for flash fallback
- if (data.video.attrs)
- posterSrc = data.video.attrs.poster;
-
- sources = data.video.sources = toArray(data.video.sources);
- for (i = 0; i < sources.length; i++) {
- if (/\.mp4$/.test(sources[i].src))
- mp4Source = sources[i].src;
- }
-
- if (!sources[0].type) {
- video.attr('src', sources[0].src);
- sources.splice(0, 1);
- }
-
- for (i = 0; i < sources.length; i++) {
- source = new Node('source', 1).attr(sources[i]);
- source.shortEnded = true;
- video.append(source);
- }
-
- // Create flash fallback for video if we have a mp4 source
- if (mp4Source) {
- addPlayer(mp4Source, posterSrc);
- typeItem = self.getType('flash');
- } else
- data.params.src = '';
- }
-
- // Add HTML5 audio element
- if (typeItem.name === 'Audio' && data.video.sources && data.video.sources[0]) {
- // Create new object element
- audio = new Node('audio', 1).attr(tinymce.extend({
- id : node.attr('id'),
- width: normalizeSize(node.attr('width')),
- height: normalizeSize(node.attr('height')),
- style : style
- }, data.video.attrs));
-
- // Get poster source and use that for flash fallback
- if (data.video.attrs)
- posterSrc = data.video.attrs.poster;
-
- sources = data.video.sources = toArray(data.video.sources);
- if (!sources[0].type) {
- audio.attr('src', sources[0].src);
- sources.splice(0, 1);
- }
-
- for (i = 0; i < sources.length; i++) {
- source = new Node('source', 1).attr(sources[i]);
- source.shortEnded = true;
- audio.append(source);
- }
-
- data.params.src = '';
- }
-
- if (typeItem.name === 'EmbeddedAudio') {
- embed = new Node('embed', 1);
- embed.shortEnded = true;
- embed.attr({
- id: node.attr('id'),
- width: normalizeSize(node.attr('width')),
- height: normalizeSize(node.attr('height')),
- style : style,
- type: node.attr('type')
- });
-
- for (name in data.params)
- embed.attr(name, data.params[name]);
-
- tinymce.each(rootAttributes, function(name) {
- if (data[name] && name != 'type')
- embed.attr(name, data[name]);
- });
-
- data.params.src = '';
- }
-
- // Do we have a params src then we can generate object
- if (data.params.src) {
- // Is flv movie add player for it
- if (/\.flv$/i.test(data.params.src))
- addPlayer(data.params.src, '');
-
- if (args && args.force_absolute)
- data.params.src = editor.documentBaseURI.toAbsolute(data.params.src);
-
- // Create new object element
- object = new Node('object', 1).attr({
- id : node.attr('id'),
- width: normalizeSize(node.attr('width')),
- height: normalizeSize(node.attr('height')),
- style : style
- });
-
- tinymce.each(rootAttributes, function(name) {
- var value = data[name];
-
- if (name == 'class' && value)
- value = value.replace(/mceItem.+ ?/g, '');
-
- if (value && name != 'type')
- object.attr(name, value);
- });
-
- // Add params
- for (name in data.params) {
- param = new Node('param', 1);
- param.shortEnded = true;
- value = data.params[name];
-
- // Windows media needs to use url instead of src for the media URL
- if (name === 'src' && typeItem.name === 'WindowsMedia')
- name = 'url';
-
- param.attr({name: name, value: value});
- object.append(param);
- }
-
- // Setup add type and classid if strict is disabled
- if (this.editor.getParam('media_strict', true)) {
- object.attr({
- data: data.params.src,
- type: typeItem.mimes[0]
- });
- } else {
- if ( typeItem.clsids )
- object.attr('clsid', typeItem.clsids[0]);
- object.attr('codebase', typeItem.codebase);
-
- embed = new Node('embed', 1);
- embed.shortEnded = true;
- embed.attr({
- id: node.attr('id'),
- width: normalizeSize(node.attr('width')),
- height: normalizeSize(node.attr('height')),
- style : style,
- type: typeItem.mimes[0]
- });
-
- for (name in data.params)
- embed.attr(name, data.params[name]);
-
- tinymce.each(rootAttributes, function(name) {
- if (data[name] && name != 'type')
- embed.attr(name, data[name]);
- });
-
- object.append(embed);
- }
-
- // Insert raw HTML
- if (data.object_html) {
- value = new Node('#text', 3);
- value.raw = true;
- value.value = data.object_html;
- object.append(value);
- }
-
- // Append object to video element if it exists
- if (video)
- video.append(object);
- }
-
- if (video) {
- // Insert raw HTML
- if (data.video_html) {
- value = new Node('#text', 3);
- value.raw = true;
- value.value = data.video_html;
- video.append(value);
- }
- }
-
- if (audio) {
- // Insert raw HTML
- if (data.video_html) {
- value = new Node('#text', 3);
- value.raw = true;
- value.value = data.video_html;
- audio.append(value);
- }
- }
-
- var n = video || audio || object || embed;
- if (n)
- node.replace(n);
- else
- node.remove();
- },
-
- /**
- * Converts a tinymce.html.Node video/object/embed to an img element.
- *
- * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this:
- * <img class="mceItemMedia mceItemFlash" width="100" height="100" data-mce-json="{..}" />
- *
- * The JSON structure will be like this:
- * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}}
- */
- objectToImg : function(node) {
- var object, embed, video, iframe, img, name, id, width, height, style, i, html,
- param, params, source, sources, data, type, lookup = this.lookup,
- matches, attrs, urlConverter = this.editor.settings.url_converter,
- urlConverterScope = this.editor.settings.url_converter_scope,
- hspace, vspace, align, bgcolor;
-
- function getInnerHTML(node) {
- return new tinymce.html.Serializer({
- inner: true,
- validate: false
- }).serialize(node);
- };
-
- function lookupAttribute(o, attr) {
- return lookup[(o.attr(attr) || '').toLowerCase()];
- }
-
- function lookupExtension(src) {
- var ext = src.replace(/^.*\.([^.]+)$/, '$1');
- return lookup[ext.toLowerCase() || ''];
- }
-
- // If node isn't in document
- if (!node.parent)
- return;
-
- // Handle media scripts
- if (node.name === 'script') {
- if (node.firstChild)
- matches = scriptRegExp.exec(node.firstChild.value);
-
- if (!matches)
- return;
-
- type = matches[1];
- data = {video : {}, params : JSON.parse(matches[2])};
- width = data.params.width;
- height = data.params.height;
- }
-
- // Setup data objects
- data = data || {
- video : {},
- params : {}
- };
-
- // Setup new image object
- img = new Node('img', 1);
- img.attr({
- src : this.editor.theme.url + '/img/trans.gif'
- });
-
- // Video element
- name = node.name;
- if (name === 'video' || name == 'audio') {
- video = node;
- object = node.getAll('object')[0];
- embed = node.getAll('embed')[0];
- width = video.attr('width');
- height = video.attr('height');
- id = video.attr('id');
- data.video = {attrs : {}, sources : []};
-
- // Get all video attributes
- attrs = data.video.attrs;
- for (name in video.attributes.map)
- attrs[name] = video.attributes.map[name];
-
- source = node.attr('src');
- if (source)
- data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)});
-
- // Get all sources
- sources = video.getAll("source");
- for (i = 0; i < sources.length; i++) {
- source = sources[i].remove();
-
- data.video.sources.push({
- src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'),
- type: source.attr('type'),
- media: source.attr('media')
- });
- }
-
- // Convert the poster URL
- if (attrs.poster)
- attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name);
- }
-
- // Object element
- if (node.name === 'object') {
- object = node;
- embed = node.getAll('embed')[0];
- }
-
- // Embed element
- if (node.name === 'embed')
- embed = node;
-
- // Iframe element
- if (node.name === 'iframe') {
- iframe = node;
- type = 'Iframe';
- }
-
- if (object) {
- // Get width/height
- width = width || object.attr('width');
- height = height || object.attr('height');
- style = style || object.attr('style');
- id = id || object.attr('id');
- hspace = hspace || object.attr('hspace');
- vspace = vspace || object.attr('vspace');
- align = align || object.attr('align');
- bgcolor = bgcolor || object.attr('bgcolor');
- data.name = object.attr('name');
-
- // Get all object params
- params = object.getAll("param");
- for (i = 0; i < params.length; i++) {
- param = params[i];
- name = param.remove().attr('name');
-
- if (!excludedAttrs[name])
- data.params[name] = param.attr('value');
- }
-
- data.params.src = data.params.src || object.attr('data');
- }
-
- if (embed) {
- // Get width/height
- width = width || embed.attr('width');
- height = height || embed.attr('height');
- style = style || embed.attr('style');
- id = id || embed.attr('id');
- hspace = hspace || embed.attr('hspace');
- vspace = vspace || embed.attr('vspace');
- align = align || embed.attr('align');
- bgcolor = bgcolor || embed.attr('bgcolor');
-
- // Get all embed attributes
- for (name in embed.attributes.map) {
- if (!excludedAttrs[name] && !data.params[name])
- data.params[name] = embed.attributes.map[name];
- }
- }
-
- if (iframe) {
- // Get width/height
- width = normalizeSize(iframe.attr('width'));
- height = normalizeSize(iframe.attr('height'));
- style = style || iframe.attr('style');
- id = iframe.attr('id');
- hspace = iframe.attr('hspace');
- vspace = iframe.attr('vspace');
- align = iframe.attr('align');
- bgcolor = iframe.attr('bgcolor');
-
- tinymce.each(rootAttributes, function(name) {
- img.attr(name, iframe.attr(name));
- });
-
- // Get all iframe attributes
- for (name in iframe.attributes.map) {
- if (!excludedAttrs[name] && !data.params[name])
- data.params[name] = iframe.attributes.map[name];
- }
- }
-
- // Use src not movie
- if (data.params.movie) {
- data.params.src = data.params.src || data.params.movie;
- delete data.params.movie;
- }
-
- // Convert the URL to relative/absolute depending on configuration
- if (data.params.src)
- data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object');
-
- if (video) {
- if (node.name === 'video')
- type = lookup.video.name;
- else if (node.name === 'audio')
- type = lookup.audio.name;
- }
-
- if (object && !type)
- type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name;
-
- if (embed && !type)
- type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name;
-
- // for embedded audio we preserve the original specified type
- if (embed && type == 'EmbeddedAudio') {
- data.params.type = embed.attr('type');
- }
-
- // Replace the video/object/embed element with a placeholder image containing the data
- node.replace(img);
-
- // Remove embed
- if (embed)
- embed.remove();
-
- // Serialize the inner HTML of the object element
- if (object) {
- html = getInnerHTML(object.remove());
-
- if (html)
- data.object_html = html;
- }
-
- // Serialize the inner HTML of the video element
- if (video) {
- html = getInnerHTML(video.remove());
-
- if (html)
- data.video_html = html;
- }
-
- data.hspace = hspace;
- data.vspace = vspace;
- data.align = align;
- data.bgcolor = bgcolor;
-
- // Set width/height of placeholder
- img.attr({
- id : id,
- 'class' : 'mceItemMedia mceItem' + (type || 'Flash'),
- style : style,
- width : width || (node.name == 'audio' ? "300" : "320"),
- height : height || (node.name == 'audio' ? "32" : "240"),
- hspace : hspace,
- vspace : vspace,
- align : align,
- bgcolor : bgcolor,
- "data-mce-json" : JSON.serialize(data, "'")
- });
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin);
-})();
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsmediamediahtm"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/media/media.htm (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/media/media.htm 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/media/media.htm 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,922 +0,0 @@
</span><del>-<!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>{#media_dlg.title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=359-20131010"></script>
- <script type="text/javascript" src="js/media.js?ver=359-20131010"></script>
- <script type="text/javascript" src="../../utils/mctabs.js?ver=359-20131010"></script>
- <script type="text/javascript" src="../../utils/validate.js?ver=359-20131010"></script>
- <script type="text/javascript" src="../../utils/form_utils.js?ver=359-20131010"></script>
- <script type="text/javascript" src="../../utils/editable_selects.js?ver=359-20131010"></script>
- <link href="css/media.css?ver=359-20131010" rel="stylesheet" type="text/css" />
-</head>
-<body style="display: none" role="application">
-<form onsubmit="Media.insert();return false;" action="#">
- <div class="tabs" role="presentation">
- <ul>
- <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');Media.formToData();" onmousedown="return false;">{#media_dlg.general}</a></span></li>
- <li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');Media.formToData();" onmousedown="return false;">{#media_dlg.advanced}</a></span></li>
- <li id="source_tab" aria-controls="source_panel"><span><a href="javascript:mcTabs.displayTab('source_tab','source_panel');Media.formToData('source');" onmousedown="return false;">{#media_dlg.source}</a></span></li>
- </ul>
- </div>
-
- <div class="panel_wrapper">
- <div id="general_panel" class="panel current">
- <fieldset>
- <legend>{#media_dlg.general}</legend>
-
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td><label for="media_type">{#media_dlg.type}</label></td>
- <td>
- <select id="media_type"></select>
- </td>
- </tr>
- <tr>
- <td><label for="src">{#media_dlg.file}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input id="src" name="src" type="text" value="" class="mceFocus" onchange="Media.formToData();" /></td>
- <td id="filebrowsercontainer"> </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr id="linklistrow">
- <td><label for="linklist">{#media_dlg.list}</label></td>
- <td id="linklistcontainer"><select id="linklist"><option value=""></option></select></td>
- </tr>
- <tr>
- <td><label for="width">{#media_dlg.size}</label></td>
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="text" id="width" name="width" value="" class="size" onchange="Media.formToData('width');" onfocus="Media.beforeResize();" /> x <input type="text" id="height" name="height" value="" class="size" onfocus="Media.beforeResize();" onchange="Media.formToData('height');" /></td>
- <td> <input id="constrain" type="checkbox" name="constrain" class="checkbox" checked="checked" /></td>
- <td><label id="constrainlabel" for="constrain">{#media_dlg.constrain_proportions}</label></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
-
- <fieldset>
- <legend>{#media_dlg.preview}</legend>
- <div id="prev"></div>
- </fieldset>
- </div>
-
- <div id="advanced_panel" class="panel">
- <fieldset>
- <legend>{#media_dlg.advanced}</legend>
-
- <table role="presentation" border="0" cellpadding="4" cellspacing="0" width="100%">
- <tr>
- <td><label for="id">{#media_dlg.id}</label></td>
- <td><input type="text" id="id" name="id" onchange="Media.formToData();" /></td>
- <td><label for="name">{#media_dlg.name}</label></td>
- <td><input type="text" id="name" name="name" onchange="Media.formToData();" /></td>
- </tr>
-
- <tr>
- <td><label for="align">{#media_dlg.align}</label></td>
- <td>
- <select id="align" name="align" onchange="Media.formToData();">
- <option value="">{#not_set}</option>
- <option value="top">{#media_dlg.align_top}</option>
- <option value="right">{#media_dlg.align_right}</option>
- <option value="bottom">{#media_dlg.align_bottom}</option>
- <option value="left">{#media_dlg.align_left}</option>
- </select>
- </td>
-
- <td><label for="bgcolor">{#media_dlg.bgcolor}</label></td>
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');Media.formToData();" /></td>
- <td id="bgcolor_pickcontainer"> </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="vspace">{#media_dlg.vspace}</label></td>
- <td><input type="text" id="vspace" name="vspace" class="number" onchange="Media.formToData();" /></td>
- <td><label for="hspace">{#media_dlg.hspace}</label></td>
- <td><input type="text" id="hspace" name="hspace" class="number" onchange="Media.formToData();" /></td>
- </tr>
- </table>
- </fieldset>
-
- <fieldset id="video_options">
- <legend>{#media_dlg.html5_video_options}</legend>
-
- <table role="presentation">
- <tr>
- <td><label for="video_altsource1">{#media_dlg.altsource1}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="video_altsource1" name="video_altsource1" onchange="Media.formToData();" style="width: 240px" /></td>
- <td id="video_altsource1_filebrowser"> </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="video_altsource2">{#media_dlg.altsource2}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="video_altsource2" name="video_altsource2" onchange="Media.formToData();" style="width: 240px" /></td>
- <td id="video_altsource2_filebrowser"> </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="video_poster">{#media_dlg.poster}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="video_poster" name="video_poster" onchange="Media.formToData();" style="width: 240px" /></td>
- <td id="video_poster_filebrowser"> </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="video_preload">{#media_dlg.preload}</label></td>
- <td>
- <select id="video_preload" name="video_preload" onchange="Media.formToData();">
- <option value="none">{#media_dlg.preload_none}</option>
- <option value="metadata">{#media_dlg.preload_metadata}</option>
- <option value="auto">{#media_dlg.preload_auto}</option>
- </select>
- </td>
- </tr>
- </table>
-
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="video_autoplay" name="video_autoplay" onchange="Media.formToData();" /></td>
- <td><label for="video_autoplay">{#media_dlg.play}</label></td>
- </tr>
- </table>
- </td>
-
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="video_muted" name="video_muted" onchange="Media.formToData();" /></td>
- <td><label for="video_muted">{#media_dlg.mute}</label></td>
- </tr>
- </table>
- </td>
-
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="video_loop" name="video_loop" onchange="Media.formToData();" /></td>
- <td><label for="video_loop">{#media_dlg.loop}</label></td>
- </tr>
- </table>
- </td>
-
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="video_controls" name="video_controls" onchange="Media.formToData();" /></td>
- <td><label for="video_controls">{#media_dlg.controls}</label></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
-
- <fieldset id="embeddedaudio_options">
- <legend>{#media_dlg.embedded_audio_options}</legend>
-
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="embeddedaudio_autoplay" name="audio_autoplay" onchange="Media.formToData();" /></td>
- <td><label for="audio_autoplay">{#media_dlg.play}</label></td>
- </tr>
- </table>
- </td>
-
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="embeddedaudio_loop" name="audio_loop" onchange="Media.formToData();" /></td>
- <td><label for="audio_loop">{#media_dlg.loop}</label></td>
- </tr>
- </table>
- </td>
-
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="embeddedaudio_controls" name="audio_controls" onchange="Media.formToData();" /></td>
- <td><label for="audio_controls">{#media_dlg.controls}</label></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
-
- <fieldset id="audio_options">
- <legend>{#media_dlg.html5_audio_options}</legend>
-
- <table role="presentation">
- <tr>
- <td><label for="audio_altsource1">{#media_dlg.altsource1}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="audio_altsource1" name="audio_altsource1" onchange="Media.formToData();" style="width: 240px" /></td>
- <td id="audio_altsource1_filebrowser"> </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="audio_altsource2">{#media_dlg.altsource2}</label></td>
- <td>
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="audio_altsource2" name="audio_altsource2" onchange="Media.formToData();" style="width: 240px" /></td>
- <td id="audio_altsource2_filebrowser"> </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="audio_preload">{#media_dlg.preload}</label></td>
- <td>
- <select id="audio_preload" name="audio_preload" onchange="Media.formToData();">
- <option value="none">{#media_dlg.preload_none}</option>
- <option value="metadata">{#media_dlg.preload_metadata}</option>
- <option value="auto">{#media_dlg.preload_auto}</option>
- </select>
- </td>
- </tr>
- </table>
-
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="audio_autoplay" name="audio_autoplay" onchange="Media.formToData();" /></td>
- <td><label for="audio_autoplay">{#media_dlg.play}</label></td>
- </tr>
- </table>
- </td>
-
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="audio_loop" name="audio_loop" onchange="Media.formToData();" /></td>
- <td><label for="audio_loop">{#media_dlg.loop}</label></td>
- </tr>
- </table>
- </td>
-
- <td>
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="audio_controls" name="audio_controls" onchange="Media.formToData();" /></td>
- <td><label for="audio_controls">{#media_dlg.controls}</label></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
-
- <fieldset id="flash_options">
- <legend>{#media_dlg.flash_options}</legend>
-
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td><label for="flash_quality">{#media_dlg.quality}</label></td>
- <td>
- <select id="flash_quality" name="flash_quality" onchange="Media.formToData();">
- <option value="">{#not_set}</option>
- <option value="high">high</option>
- <option value="low">low</option>
- <option value="autolow">autolow</option>
- <option value="autohigh">autohigh</option>
- <option value="best">best</option>
- </select>
- </td>
-
- <td><label for="flash_scale">{#media_dlg.scale}</label></td>
- <td>
- <select id="flash_scale" name="flash_scale" onchange="Media.formToData();">
- <option value="">{#not_set}</option>
- <option value="showall">showall</option>
- <option value="noborder">noborder</option>
- <option value="exactfit">exactfit</option>
- <option value="noscale">noscale</option>
- </select>
- </td>
- </tr>
-
- <tr>
- <td><label for="flash_wmode">{#media_dlg.wmode}</label></td>
- <td>
- <select id="flash_wmode" name="flash_wmode" onchange="Media.formToData();">
- <option value="">{#not_set}</option>
- <option value="window">window</option>
- <option value="opaque">opaque</option>
- <option value="transparent">transparent</option>
- </select>
- </td>
-
- <td><label for="flash_salign">{#media_dlg.salign}</label></td>
- <td>
- <select id="flash_salign" name="flash_salign" onchange="Media.formToData();">
- <option value="">{#not_set}</option>
- <option value="l">{#media_dlg.align_left}</option>
- <option value="t">{#media_dlg.align_top}</option>
- <option value="r">{#media_dlg.align_right}</option>
- <option value="b">{#media_dlg.align_bottom}</option>
- <option value="tl">{#media_dlg.align_top_left}</option>
- <option value="tr">{#media_dlg.align_top_right}</option>
- <option value="bl">{#media_dlg.align_bottom_left}</option>
- <option value="br">{#media_dlg.align_bottom_right}</option>
- </select>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="Media.formToData();" /></td>
- <td><label for="flash_play">{#media_dlg.play}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="Media.formToData();" /></td>
- <td><label for="flash_loop">{#media_dlg.loop}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="Media.formToData();" /></td>
- <td><label for="flash_menu">{#media_dlg.menu}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="Media.formToData();" /></td>
- <td><label for="flash_swliveconnect">{#media_dlg.liveconnect}</label></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
-
- <table role="presentation">
- <tr>
- <td><label for="flash_base">{#media_dlg.base}</label></td>
- <td><input type="text" id="flash_base" name="flash_base" onchange="Media.formToData();" /></td>
- </tr>
-
- <tr>
- <td><label for="flash_flashvars">{#media_dlg.flashvars}</label></td>
- <td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="Media.formToData();" /></td>
- </tr>
- </table>
- </fieldset>
-
- <fieldset id="quicktime_options">
- <legend>{#media_dlg.qt_options}</legend>
-
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="quicktime_loop" name="quicktime_loop" onchange="Media.formToData();" /></td>
- <td><label for="quicktime_loop">{#media_dlg.loop}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="quicktime_autoplay" name="quicktime_autoplay" checked="checked" onchange="Media.formToData();" /></td>
- <td><label for="quicktime_autoplay">{#media_dlg.play}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="quicktime_cache" name="quicktime_cache" onchange="Media.formToData();" /></td>
- <td><label for="quicktime_cache">{#media_dlg.cache}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="quicktime_controller" name="quicktime_controller" checked="checked" onchange="Media.formToData();" /></td>
- <td><label for="quicktime_controller">{#media_dlg.controller}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="quicktime_correction" name="quicktime_correction" onchange="Media.formToData();" /></td>
- <td><label for="quicktime_correction">{#media_dlg.correction}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="quicktime_enablejavascript" name="quicktime_enablejavascript" onchange="Media.formToData();" /></td>
- <td><label for="quicktime_enablejavascript">{#media_dlg.enablejavascript}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="quicktime_kioskmode" name="quicktime_kioskmode" onchange="Media.formToData();" /></td>
- <td><label for="quicktime_kioskmode">{#media_dlg.kioskmode}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="quicktime_autohref" name="quicktime_autohref" onchange="Media.formToData();" /></td>
- <td><label for="quicktime_autohref">{#media_dlg.autohref}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="quicktime_playeveryframe" name="quicktime_playeveryframe" onchange="Media.formToData();" /></td>
- <td><label for="quicktime_playeveryframe">{#media_dlg.playeveryframe}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="quicktime_targetcache" name="quicktime_targetcache" onchange="Media.formToData();" /></td>
- <td><label for="quicktime_targetcache">{#media_dlg.targetcache}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="quicktime_scale">{#media_dlg.scale}</label></td>
- <td><select id="quicktime_scale" name="quicktime_scale" class="mceEditableSelect" onchange="Media.formToData();">
- <option value="">{#not_set}</option>
- <option value="tofit">tofit</option>
- <option value="aspect">aspect</option>
- </select>
- </td>
-
- <td colspan="2"> </td>
- </tr>
-
- <tr>
- <td><label for="quicktime_starttime">{#media_dlg.starttime}</label></td>
- <td><input type="text" id="quicktime_starttime" name="quicktime_starttime" onchange="Media.formToData();" /></td>
-
- <td><label for="quicktime_endtime">{#media_dlg.endtime}</label></td>
- <td><input type="text" id="quicktime_endtime" name="quicktime_endtime" onchange="Media.formToData();" /></td>
- </tr>
-
- <tr>
- <td><label for="quicktime_target">{#media_dlg.target}</label></td>
- <td><input type="text" id="quicktime_target" name="quicktime_target" onchange="Media.formToData();" /></td>
-
- <td><label for="quicktime_href">{#media_dlg.href}</label></td>
- <td><input type="text" id="quicktime_href" name="quicktime_href" onchange="Media.formToData();" /></td>
- </tr>
-
- <tr>
- <td><label for="quicktime_qtsrcchokespeed">{#media_dlg.qtsrcchokespeed}</label></td>
- <td><input type="text" id="quicktime_qtsrcchokespeed" name="quicktime_qtsrcchokespeed" onchange="Media.formToData();" /></td>
-
- <td><label for="quicktime_volume">{#media_dlg.volume}</label></td>
- <td><input type="text" id="quicktime_volume" name="quicktime_volume" onchange="Media.formToData();" /></td>
- </tr>
-
- <tr>
- <td><label for="quicktime_qtsrc">{#media_dlg.qtsrc}</label></td>
- <td colspan="4">
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="quicktime_qtsrc" name="quicktime_qtsrc" onchange="Media.formToData();" /></td>
- <td id="qtsrcfilebrowsercontainer"> </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
-
- <fieldset id="windowsmedia_options">
- <legend>{#media_dlg.wmp_options}</legend>
-
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="windowsmedia_autostart" name="windowsmedia_autostart" checked="checked" onchange="Media.formToData();" /></td>
- <td><label for="windowsmedia_autostart">{#media_dlg.autostart}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="windowsmedia_enabled" name="windowsmedia_enabled" onchange="Media.formToData();" /></td>
- <td><label for="windowsmedia_enabled">{#media_dlg.enabled}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="windowsmedia_enablecontextmenu" name="windowsmedia_enablecontextmenu" checked="checked" onchange="Media.formToData();" /></td>
- <td><label for="windowsmedia_enablecontextmenu">{#media_dlg.menu}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="windowsmedia_fullscreen" name="windowsmedia_fullscreen" onchange="Media.formToData();" /></td>
- <td><label for="windowsmedia_fullscreen">{#media_dlg.fullscreen}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="windowsmedia_invokeurls" name="windowsmedia_invokeurls" checked="checked" onchange="Media.formToData();" /></td>
- <td><label for="windowsmedia_invokeurls">{#media_dlg.invokeurls}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="windowsmedia_mute" name="windowsmedia_mute" onchange="Media.formToData();" /></td>
- <td><label for="windowsmedia_mute">{#media_dlg.mute}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="windowsmedia_stretchtofit" name="windowsmedia_stretchtofit" onchange="Media.formToData();" /></td>
- <td><label for="windowsmedia_stretchtofit">{#media_dlg.stretchtofit}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="windowsmedia_windowlessvideo" name="windowsmedia_windowlessvideo" onchange="Media.formToData();" /></td>
- <td><label for="windowsmedia_windowlessvideo">{#media_dlg.windowlessvideo}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="windowsmedia_balance">{#media_dlg.balance}</label></td>
- <td><input type="text" id="windowsmedia_balance" name="windowsmedia_balance" onchange="Media.formToData();" /></td>
-
- <td><label for="windowsmedia_baseurl">{#media_dlg.baseurl}</label></td>
- <td><input type="text" id="windowsmedia_baseurl" name="windowsmedia_baseurl" onchange="Media.formToData();" /></td>
- </tr>
-
- <tr>
- <td><label for="windowsmedia_captioningid">{#media_dlg.captioningid}</label></td>
- <td><input type="text" id="windowsmedia_captioningid" name="windowsmedia_captioningid" onchange="Media.formToData();" /></td>
-
- <td><label for="windowsmedia_currentmarker">{#media_dlg.currentmarker}</label></td>
- <td><input type="text" id="windowsmedia_currentmarker" name="windowsmedia_currentmarker" onchange="Media.formToData();" /></td>
- </tr>
-
- <tr>
- <td><label for="windowsmedia_currentposition">{#media_dlg.currentposition}</label></td>
- <td><input type="text" id="windowsmedia_currentposition" name="windowsmedia_currentposition" onchange="Media.formToData();" /></td>
-
- <td><label for="windowsmedia_defaultframe">{#media_dlg.defaultframe}</label></td>
- <td><input type="text" id="windowsmedia_defaultframe" name="windowsmedia_defaultframe" onchange="Media.formToData();" /></td>
- </tr>
-
- <tr>
- <td><label for="windowsmedia_playcount">{#media_dlg.playcount}</label></td>
- <td><input type="text" id="windowsmedia_playcount" name="windowsmedia_playcount" onchange="Media.formToData();" /></td>
-
- <td><label for="windowsmedia_rate">{#media_dlg.rate}</label></td>
- <td><input type="text" id="windowsmedia_rate" name="windowsmedia_rate" onchange="Media.formToData();" /></td>
- </tr>
-
- <tr>
- <td><label for="windowsmedia_uimode">{#media_dlg.uimode}</label></td>
- <td><input type="text" id="windowsmedia_uimode" name="windowsmedia_uimode" onchange="Media.formToData();" /></td>
-
- <td><label for="windowsmedia_volume">{#media_dlg.volume}</label></td>
- <td><input type="text" id="windowsmedia_volume" name="windowsmedia_volume" onchange="Media.formToData();" /></td>
- </tr>
-
- </table>
- </fieldset>
-
- <fieldset id="realmedia_options">
- <legend>{#media_dlg.rmp_options}</legend>
-
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="realmedia_autostart" name="realmedia_autostart" onchange="Media.formToData();" /></td>
- <td><label for="realmedia_autostart">{#media_dlg.autostart}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="realmedia_loop" name="realmedia_loop" onchange="Media.formToData();" /></td>
- <td><label for="realmedia_loop">{#media_dlg.loop}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="realmedia_autogotourl" name="realmedia_autogotourl" checked="checked" onchange="Media.formToData();" /></td>
- <td><label for="realmedia_autogotourl">{#media_dlg.autogotourl}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="realmedia_center" name="realmedia_center" onchange="Media.formToData();" /></td>
- <td><label for="realmedia_center">{#media_dlg.center}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="realmedia_imagestatus" name="realmedia_imagestatus" checked="checked" onchange="Media.formToData();" /></td>
- <td><label for="realmedia_imagestatus">{#media_dlg.imagestatus}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="realmedia_maintainaspect" name="realmedia_maintainaspect" onchange="Media.formToData();" /></td>
- <td><label for="realmedia_maintainaspect">{#media_dlg.maintainaspect}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="realmedia_nojava" name="realmedia_nojava" onchange="Media.formToData();" /></td>
- <td><label for="realmedia_nojava">{#media_dlg.nojava}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="realmedia_prefetch" name="realmedia_prefetch" onchange="Media.formToData();" /></td>
- <td><label for="realmedia_prefetch">{#media_dlg.prefetch}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="realmedia_shuffle" name="realmedia_shuffle" onchange="Media.formToData();" /></td>
- <td><label for="realmedia_shuffle">{#media_dlg.shuffle}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
-
- </td>
- </tr>
-
- <tr>
- <td><label for="realmedia_console">{#media_dlg.console}</label></td>
- <td><input type="text" id="realmedia_console" name="realmedia_console" onchange="Media.formToData();" /></td>
-
- <td><label for="realmedia_controls">{#media_dlg.controls}</label></td>
- <td><input type="text" id="realmedia_controls" name="realmedia_controls" onchange="Media.formToData();" /></td>
- </tr>
-
- <tr>
- <td><label for="realmedia_numloop">{#media_dlg.numloop}</label></td>
- <td><input type="text" id="realmedia_numloop" name="realmedia_numloop" onchange="Media.formToData();" /></td>
-
- <td><label for="realmedia_scriptcallbacks">{#media_dlg.scriptcallbacks}</label></td>
- <td><input type="text" id="realmedia_scriptcallbacks" name="realmedia_scriptcallbacks" onchange="Media.formToData();" /></td>
- </tr>
- </table>
- </fieldset>
-
- <fieldset id="shockwave_options">
- <legend>{#media_dlg.shockwave_options}</legend>
-
- <table role="presentation" border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td><label for="shockwave_swstretchstyle">{#media_dlg.swstretchstyle}</label></td>
- <td>
- <select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="Media.formToData();">
- <option value="none">{#not_set}</option>
- <option value="meet">Meet</option>
- <option value="fill">Fill</option>
- <option value="stage">Stage</option>
- </select>
- </td>
-
- <td><label for="shockwave_swvolume">{#media_dlg.volume}</label></td>
- <td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="Media.formToData();" /></td>
- </tr>
-
- <tr>
- <td><label for="shockwave_swstretchhalign">{#media_dlg.swstretchhalign}</label></td>
- <td>
- <select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="Media.formToData();">
- <option value="none">{#not_set}</option>
- <option value="left">{#media_dlg.align_left}</option>
- <option value="center">{#media_dlg.align_center}</option>
- <option value="right">{#media_dlg.align_right}</option>
- </select>
- </td>
-
- <td><label for="shockwave_swstretchvalign">{#media_dlg.swstretchvalign}</label></td>
- <td>
- <select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="Media.formToData();">
- <option value="none">{#not_set}</option>
- <option value="meet">Meet</option>
- <option value="fill">Fill</option>
- <option value="stage">Stage</option>
- </select>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="Media.formToData();" checked="checked" /></td>
- <td><label for="shockwave_autostart">{#media_dlg.autostart}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="Media.formToData();" checked="checked" /></td>
- <td><label for="shockwave_sound">{#media_dlg.sound}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
-
- <tr>
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="Media.formToData();" /></td>
- <td><label for="shockwave_swliveconnect">{#media_dlg.liveconnect}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="Media.formToData();" checked="checked" /></td>
- <td><label for="shockwave_progress">{#media_dlg.progress}</label></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
- </div>
-
- <div id="source_panel" class="panel">
- <fieldset>
- <legend>{#media_dlg.source}</legend>
- <textarea id="source" style="width: 99%; height: 390px"></textarea>
- </fieldset>
- </div>
- </div>
-
- <div class="mceActionPanel">
- <input type="submit" id="insert" name="insert" value="{#insert}" />
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
- </div>
- </form>
-</body>
-</html>
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsmediamoxieplayerswf"></a>
<div class="binary"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/media/moxieplayer.swf</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsmediapluginjsfromrev26862trunksrcwpincludesjstinymcepluginsmediaeditor_plugin_srcjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/media/plugin.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/media/editor_plugin_src.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/media/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/media/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,654 @@
</span><ins>+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint maxlen:255 */
+/*global tinymce:true */
+
+tinymce.PluginManager.add('media', function(editor, url) {
+ var urlPatterns = [
+ {regex: /youtu\.be\/([a-z1-9.-_]+)/, type: 'iframe', w: 425, h: 350, url: 'http://www.youtube.com/embed/$1'},
+ {regex: /youtube\.com(.+)v=([^&]+)/, type: 'iframe', w: 425, h: 350, url: 'http://www.youtube.com/embed/$2'},
+ {regex: /vimeo\.com\/([0-9]+)/, type: 'iframe', w: 425, h: 350, url: 'http://player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc'},
+ {regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/, type: 'iframe', w: 425, h: 350, url: 'http://maps.google.com/maps/ms?msid=$2&output=embed"'}
+ ];
+
+ function guessMime(url) {
+ if (url.indexOf('.mp3') != -1) {
+ return 'audio/mpeg';
+ }
+
+ if (url.indexOf('.wav') != -1) {
+ return 'audio/wav';
+ }
+
+ if (url.indexOf('.mp4') != -1) {
+ return 'video/mp4';
+ }
+
+ if (url.indexOf('.webm') != -1) {
+ return 'video/webm';
+ }
+
+ if (url.indexOf('.ogg') != -1) {
+ return 'video/ogg';
+ }
+
+ if (url.indexOf('.swf') != -1) {
+ return 'application/x-shockwave-flash';
+ }
+
+ return '';
+ }
+
+ function getVideoScriptMatch(src) {
+ var prefixes = editor.settings.media_scripts;
+
+ if (prefixes) {
+ for (var i = 0; i < prefixes.length; i++) {
+ if (src.indexOf(prefixes[i].filter) !== -1) {
+ return prefixes[i];
+ }
+ }
+ }
+ }
+
+ function showDialog() {
+ var win, width, height, data;
+
+ function recalcSize(e) {
+ var widthCtrl, heightCtrl, newWidth, newHeight;
+
+ widthCtrl = win.find('#width')[0];
+ heightCtrl = win.find('#height')[0];
+
+ newWidth = widthCtrl.value();
+ newHeight = heightCtrl.value();
+
+ if (win.find('#constrain')[0].checked() && width && height && newWidth && newHeight) {
+ if (e.control == widthCtrl) {
+ newHeight = Math.round((newWidth / width) * newHeight);
+ heightCtrl.value(newHeight);
+ } else {
+ newWidth = Math.round((newHeight / height) * newWidth);
+ widthCtrl.value(newWidth);
+ }
+ }
+
+ width = newWidth;
+ height = newHeight;
+ }
+
+ data = getData(editor.selection.getNode());
+ width = data.width;
+ height = data.height;
+
+ win = editor.windowManager.open({
+ title: 'Insert/edit video',
+ data: data,
+ bodyType: 'tabpanel',
+ body: [
+ {
+ title: 'General',
+ type: "form",
+ onShowTab: function() {
+ data = htmlToData(this.next().find('#embed').value());
+ this.fromJSON(data);
+ },
+ items: [
+ {name: 'source1', type: 'filepicker', filetype: 'media', size: 40, autofocus: true, label: 'Source'},
+ {name: 'source2', type: 'filepicker', filetype: 'media', size: 40, label: 'Alternative source'},
+ {name: 'poster', type: 'filepicker', filetype: 'image', size: 40, label: 'Poster'},
+ {
+ type: 'container',
+ label: 'Dimensions',
+ layout: 'flex',
+ align: 'center',
+ spacing: 5,
+ items: [
+ {name: 'width', type: 'textbox', maxLength: 3, size: 3, onchange: recalcSize},
+ {type: 'label', text: 'x'},
+ {name: 'height', type: 'textbox', maxLength: 3, size: 3, onchange: recalcSize},
+ {name: 'constrain', type: 'checkbox', checked: true, text: 'Constrain proportions'}
+ ]
+ }
+ ]
+ },
+
+ {
+ title: 'Embed',
+ type: "panel",
+ layout: 'flex',
+ direction: 'column',
+ align: 'stretch',
+ padding: 10,
+ spacing: 10,
+ onShowTab: function() {
+ this.find('#embed').value(dataToHtml(this.parent().toJSON()));
+ },
+ items: [
+ {
+ type: 'label',
+ text: 'Paste your embed code below:'
+ },
+ {
+ type: 'textbox',
+ flex: 1,
+ name: 'embed',
+ value: getSource(),
+ multiline: true,
+ label: 'Source'
+ }
+ ]
+ }
+ ],
+ onSubmit: function() {
+ editor.insertContent(dataToHtml(this.toJSON()));
+ }
+ });
+ }
+
+ function getSource() {
+ var elm = editor.selection.getNode();
+
+ if (elm.getAttribute('data-mce-object')) {
+ return editor.selection.getContent();
+ }
+ }
+
+ function dataToHtml(data) {
+ var html = '';
+
+ if (!data.source1) {
+ tinymce.extend(data, htmlToData(data.embed));
+ if (!data.source1) {
+ return '';
+ }
+ }
+
+ data.source1 = editor.convertURL(data.source1, "source");
+ data.source2 = editor.convertURL(data.source2, "source");
+ data.source1mime = guessMime(data.source1);
+ data.source2mime = guessMime(data.source2);
+ data.poster = editor.convertURL(data.poster, "poster");
+ data.flashPlayerUrl = editor.convertURL(url + '/moxieplayer.swf', "movie");
+
+ if (data.embed) {
+ html = updateHtml(data.embed, data, true);
+ } else {
+ tinymce.each(urlPatterns, function(pattern) {
+ var match, i, url;
+
+ if ((match = pattern.regex.exec(data.source1))) {
+ url = pattern.url;
+
+ for (i = 0; match[i]; i++) {
+ /*jshint loopfunc:true*/
+ url = url.replace('$' + i, function() {
+ return match[i];
+ });
+ }
+
+ data.source1 = url;
+ data.type = pattern.type;
+ data.width = pattern.w;
+ data.height = pattern.h;
+ }
+ });
+
+ var videoScript = getVideoScriptMatch(data.source1);
+ if (videoScript) {
+ data.type = 'script';
+ data.width = videoScript.width;
+ data.height = videoScript.height;
+ }
+
+ data.width = data.width || 300;
+ data.height = data.height || 150;
+
+ tinymce.each(data, function(value, key) {
+ data[key] = editor.dom.encode(value);
+ });
+
+ if (data.type == "iframe") {
+ html += '<iframe src="' + data.source1 + '" width="' + data.width + '" height="' + data.height + '"></iframe>';
+ } else if (data.source1mime == "application/x-shockwave-flash") {
+ html += '<object data="' + data.source1 + '" width="' + data.width + '" height="' + data.height + '" type="application/x-shockwave-flash">';
+
+ if (data.poster) {
+ html += '<img src="' + data.poster + '" width="' + data.width + '" height="' + data.height + '" />';
+ }
+
+ html += '</object>';
+ } else if (data.source1mime.indexOf('audio') != -1) {
+ if (editor.settings.audio_template_callback) {
+ html = editor.settings.audio_template_callback(data);
+ } else {
+ html += (
+ '<audio controls="controls" src="' + data.source1 + '">' +
+ (data.source2 ? '\n<source src="' + data.source2 + '"' + (data.source2mime ? ' type="' + data.source2mime + '"' : '') + ' />\n' : '') +
+ '</audio>'
+ );
+ }
+ } else if (data.type == "script") {
+ html += '<script src="' + data.source1 + '"></script>';
+ } else {
+ if (editor.settings.video_template_callback) {
+ html = editor.settings.video_template_callback(data);
+ } else {
+ html = (
+ '<video width="' + data.width + '" height="' + data.height + '"' + (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' +
+ '<source src="' + data.source1 + '"' + (data.source1mime ? ' type="' + data.source1mime + '"' : '') + ' />\n' +
+ (data.source2 ? '<source src="' + data.source2 + '"' + (data.source2mime ? ' type="' + data.source2mime + '"' : '') + ' />\n' : '') +
+ '</video>'
+ );
+ }
+ }
+ }
+
+ return html;
+ }
+
+ function htmlToData(html) {
+ var data = {};
+
+ new tinymce.html.SaxParser({
+ validate: false,
+ allow_conditional_comments: true,
+ special: 'script,noscript',
+ start: function(name, attrs) {
+ if (!data.source1 && name == "param") {
+ data.source1 = attrs.map.movie;
+ }
+
+ if (name == "iframe" || name == "object" || name == "embed" || name == "video" || name == "audio") {
+ if (!data.type) {
+ data.type = name;
+ }
+
+ data = tinymce.extend(attrs.map, data);
+ }
+
+ if (name == "script") {
+ var videoScript = getVideoScriptMatch(attrs.map.src);
+ if (!videoScript) {
+ return;
+ }
+
+ data = {
+ type: "script",
+ source1: attrs.map.src,
+ width: videoScript.width,
+ height: videoScript.height
+ };
+ }
+
+ if (name == "source") {
+ if (!data.source1) {
+ data.source1 = attrs.map.src;
+ } else if (!data.source2) {
+ data.source2 = attrs.map.src;
+ }
+ }
+
+ if (name == "img" && !data.poster) {
+ data.poster = attrs.map.src;
+ }
+ }
+ }).parse(html);
+
+ data.source1 = data.source1 || data.src || data.data;
+ data.source2 = data.source2 || '';
+ data.poster = data.poster || '';
+
+ return data;
+ }
+
+ function getData(element) {
+ if (element.getAttribute('data-mce-object')) {
+ return htmlToData(editor.serializer.serialize(element, {selection: true}));
+ }
+
+ return {};
+ }
+
+ function updateHtml(html, data, updateAll) {
+ var writer = new tinymce.html.Writer();
+ var sourceCount = 0, hasImage;
+
+ function setAttributes(attrs, updatedAttrs) {
+ var name, i, value, attr;
+
+ for (name in updatedAttrs) {
+ value = "" + updatedAttrs[name];
+
+ if (attrs.map[name]) {
+ i = attrs.length;
+ while (i--) {
+ attr = attrs[i];
+
+ if (attr.name == name) {
+ if (value) {
+ attrs.map[name] = value;
+ attr.value = value;
+ } else {
+ delete attrs.map[name];
+ attrs.splice(i, 1);
+ }
+ }
+ }
+ } else if (value) {
+ attrs.push({
+ name: name,
+ value: value
+ });
+
+ attrs.map[name] = value;
+ }
+ }
+ }
+
+ new tinymce.html.SaxParser({
+ validate: false,
+ allow_conditional_comments: true,
+ special: 'script,noscript',
+
+ comment: function(text) {
+ writer.comment(text);
+ },
+
+ cdata: function(text) {
+ writer.cdata(text);
+ },
+
+ text: function(text, raw) {
+ writer.text(text, raw);
+ },
+
+ start: function(name, attrs, empty) {
+ switch (name) {
+ case "video":
+ case "object":
+ case "embed":
+ case "img":
+ case "iframe":
+ setAttributes(attrs, {
+ width: data.width,
+ height: data.height
+ });
+ break;
+ }
+
+ if (updateAll) {
+ switch (name) {
+ case "video":
+ setAttributes(attrs, {
+ poster: data.poster,
+ src: ""
+ });
+
+ if (data.source2) {
+ setAttributes(attrs, {
+ src: ""
+ });
+ }
+ break;
+
+ case "iframe":
+ setAttributes(attrs, {
+ src: data.source1
+ });
+ break;
+
+ case "source":
+ sourceCount++;
+
+ if (sourceCount <= 2) {
+ setAttributes(attrs, {
+ src: data["source" + sourceCount],
+ type: data["source" + sourceCount + "mime"]
+ });
+
+ if (!data["source" + sourceCount]) {
+ return;
+ }
+ }
+ break;
+
+ case "img":
+ if (!data.poster) {
+ return;
+ }
+
+ hasImage = true;
+ break;
+ }
+ }
+
+ writer.start(name, attrs, empty);
+ },
+
+ end: function(name) {
+ if (name == "video" && updateAll) {
+ for (var index = 1; index <= 2; index++) {
+ if (data["source" + index]) {
+ var attrs = [];
+ attrs.map = {};
+
+ if (sourceCount < index) {
+ setAttributes(attrs, {
+ src: data["source" + index],
+ type: data["source" + index + "mime"]
+ });
+
+ writer.start("source", attrs, true);
+ }
+ }
+ }
+ }
+
+ if (data.poster && name == "object" && updateAll && !hasImage) {
+ var imgAttrs = [];
+ imgAttrs.map = {};
+
+ setAttributes(imgAttrs, {
+ src: data.poster,
+ width: data.width,
+ height: data.height
+ });
+
+ writer.start("img", imgAttrs, true);
+ }
+
+ writer.end(name);
+ }
+ }, new tinymce.html.Schema({})).parse(html);
+
+ return writer.getContent();
+ }
+
+ editor.on('ResolveName', function(e) {
+ var name;
+
+ if (e.target.nodeType == 1 && (name = e.target.getAttribute("data-mce-object"))) {
+ e.name = name;
+ }
+ });
+
+ editor.on('preInit', function() {
+ // Make sure that any messy HTML is retained inside these
+ var specialElements = editor.schema.getSpecialElements();
+ tinymce.each('video audio iframe object'.split(' '), function(name) {
+ specialElements[name] = new RegExp('<\/' + name + '[^>]*>','gi');
+ });
+
+ // Allow elements
+ editor.schema.addValidElements('object[id|style|width|height|classid|codebase|*],embed[id|style|width|height|type|src|*],video[*],audio[*]');
+
+ // Set allowFullscreen attribs as boolean
+ var boolAttrs = editor.schema.getBoolAttrs();
+ tinymce.each('webkitallowfullscreen mozallowfullscreen allowfullscreen'.split(' '), function(name) {
+ boolAttrs[name] = {};
+ });
+
+ // Converts iframe, video etc into placeholder images
+ editor.parser.addNodeFilter('iframe,video,audio,object,embed,script', function(nodes, name) {
+ var i = nodes.length, ai, node, placeHolder, attrName, attrValue, attribs, innerHtml;
+ var videoScript;
+
+ while (i--) {
+ node = nodes[i];
+
+ if (node.name == 'script') {
+ videoScript = getVideoScriptMatch(node.attr('src'));
+ if (!videoScript) {
+ continue;
+ }
+ }
+
+ placeHolder = new tinymce.html.Node('img', 1);
+ placeHolder.shortEnded = true;
+
+ if (videoScript) {
+ if (videoScript.width) {
+ node.attr('width', videoScript.width.toString());
+ }
+
+ if (videoScript.height) {
+ node.attr('height', videoScript.height.toString());
+ }
+ }
+
+ // Prefix all attributes except width, height and style since we
+ // will add these to the placeholder
+ attribs = node.attributes;
+ ai = attribs.length;
+ while (ai--) {
+ attrName = attribs[ai].name;
+ attrValue = attribs[ai].value;
+
+ if (attrName !== "width" && attrName !== "height" && attrName !== "style") {
+ if (attrName == "data" || attrName == "src") {
+ attrValue = editor.convertURL(attrValue, attrName);
+ }
+
+ placeHolder.attr('data-mce-p-' + attrName, attrValue);
+ }
+ }
+
+ // Place the inner HTML contents inside an escaped attribute
+ // This enables us to copy/paste the fake object
+ innerHtml = node.firstChild && node.firstChild.value;
+ if (innerHtml) {
+ placeHolder.attr("data-mce-html", escape(innerHtml));
+ placeHolder.firstChild = null;
+ }
+
+ placeHolder.attr({
+ width: node.attr('width') || "300",
+ height: node.attr('height') || (name == "audio" ? "30" : "150"),
+ style: node.attr('style'),
+ src: tinymce.Env.transparentSrc,
+ "data-mce-object": name,
+ "class": "mce-object mce-object-" + name
+ });
+
+ node.replace(placeHolder);
+ }
+ });
+
+ // Replaces placeholder images with real elements for video, object, iframe etc
+ editor.serializer.addAttributeFilter('data-mce-object', function(nodes, name) {
+ var i = nodes.length, node, realElm, ai, attribs, innerHtml, innerNode, realElmName;
+
+ while (i--) {
+ node = nodes[i];
+ realElmName = node.attr(name);
+ realElm = new tinymce.html.Node(realElmName, 1);
+
+ // Add width/height to everything but audio
+ if (realElmName != "audio" && realElmName != "script") {
+ realElm.attr({
+ width: node.attr('width'),
+ height: node.attr('height')
+ });
+ }
+
+ realElm.attr({
+ style: node.attr('style')
+ });
+
+ // Unprefix all placeholder attributes
+ attribs = node.attributes;
+ ai = attribs.length;
+ while (ai--) {
+ var attrName = attribs[ai].name;
+
+ if (attrName.indexOf('data-mce-p-') === 0) {
+ realElm.attr(attrName.substr(11), attribs[ai].value);
+ }
+ }
+
+ if (realElmName == "script") {
+ realElm.attr('type', 'text/javascript');
+ }
+
+ // Inject innerhtml
+ innerHtml = node.attr('data-mce-html');
+ if (innerHtml) {
+ innerNode = new tinymce.html.Node('#text', 3);
+ innerNode.raw = true;
+ innerNode.value = unescape(innerHtml);
+ realElm.append(innerNode);
+ }
+
+ node.replace(realElm);
+ }
+ });
+ });
+
+ editor.on('ObjectSelected', function(e) {
+ var objectType = e.target.getAttribute('data-mce-object');
+
+ if (objectType == "audio" || objectType == "script") {
+ e.preventDefault();
+ }
+ });
+
+ editor.on('objectResized', function(e) {
+ var target = e.target, html;
+
+ if (target.getAttribute('data-mce-object')) {
+ html = target.getAttribute('data-mce-html');
+ if (html) {
+ html = unescape(html);
+ target.setAttribute('data-mce-html', escape(
+ updateHtml(html, {
+ width: e.width,
+ height: e.height
+ })
+ ));
+ }
+ }
+ });
+
+ editor.addButton('media', {
+ tooltip: 'Insert/edit video',
+ onclick: showDialog,
+ stateSelector: 'img[data-mce-object=video]'
+ });
+
+ editor.addMenuItem('media', {
+ icon: 'media',
+ text: 'Insert video',
+ onclick: showDialog,
+ context: 'insert',
+ prependToContext: true
+ });
+});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsmediapluginminjsfromrev26862trunksrcwpincludesjstinymcepluginsmediaeditor_pluginjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/media/plugin.min.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/media/editor_plugin.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/media/plugin.min.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/media/plugin.min.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+tinymce.PluginManager.add("media",function(e,t){function i(e){return-1!=e.indexOf(".mp3")?"audio/mpeg":-1!=e.indexOf(".wav")?"audio/wav":-1!=e.indexOf(".mp4")?"video/mp4":-1!=e.indexOf(".webm")?"video/webm":-1!=e.indexOf(".ogg")?"video/ogg":-1!=e.indexOf(".swf")?"application/x-shockwave-flash":""}function r(t){var i=e.settings.media_scripts;if(i)for(var r=0;r<i.length;r++)if(-1!==t.indexOf(i[r].filter))return i[r]}function a(){function t(e){var t,o,c,n;t=i.find("#width")[0],o=i.find("#height")[0],c=t.value(),n=o.value(),i.find("#constrain")[0].checked()&&r&&a&&c&&n&&(e.control==t?(n=Math.round(c/r*n),o.value(n)):(c=Math.round(n/a*c),t.value(c))),r=c,a=n}var i,r,a,m;m=s(e.selection.getNode()),r=m.width,a=m.height,i=e.windowManager.open({title:"Insert/edit vi
deo",data:m,bodyType:"tabpanel",body:[{title:"General",type:"form",onShowTab:function(){m=n(this.next().find("#embed").value()),this.fromJSON(m)},items:[{name:"source1",type:"filepicker",filetype:"media",size:40,autofocus:!0,label:"Source"},{name:"source2",type:"filepicker",filetype:"media",size:40,label:"Alternative source"},{name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"},{type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:3,size:3,onchange:t},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:3,size:3,onchange:t},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"
;}]}]},{title:"Embed",type:"panel",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,onShowTab:function(){this.find("#embed").value(c(this.parent().toJSON()))},items:[{type:"label",text:"Paste your embed code below:"},{type:"textbox",flex:1,name:"embed",value:o(),multiline:!0,label:"Source"}]}],onSubmit:function(){e.insertContent(c(this.toJSON()))}})}function o(){var t=e.selection.getNode();return t.getAttribute("data-mce-object")?e.selection.getContent():void 0}function c(a){var o="";if(!a.source1&&(tinymce.extend(a,n(a.embed)),!a.source1))return"";if(a.source1=e.convertURL(a.source1,"source"),a.source2=e.convertURL(a.source2,"source"),a.source1mime=i(a.source1),a.source2mime=i(a.source2),a.poster=e.convertURL(a.poster,"poster"),a.flashPlayerUrl=e.convertURL(t+"/moxieplayer.swf&quo
t;,"movie"),a.embed)o=m(a.embed,a,!0);else{tinymce.each(d,function(e){var t,i,r;if(t=e.regex.exec(a.source1)){for(r=e.url,i=0;t[i];i++)r=r.replace("$"+i,function(){return t[i]});a.source1=r,a.type=e.type,a.width=e.w,a.height=e.h}});var c=r(a.source1);c&&(a.type="script",a.width=c.width,a.height=c.height),a.width=a.width||300,a.height=a.height||150,tinymce.each(a,function(t,i){a[i]=e.dom.encode(t)}),"iframe"==a.type?o+='<iframe src="'+a.source1+'" width="'+a.width+'" height="'+a.height+'"></iframe>':"application/x-shockwave-flash"==a.source1mime?(o+='<object data="'+a.source1+'" width="'+a.width+'" height="'+a.height+'" type="application/x-shockwave-flash">',a.poster&&(o+='<img src="'+a.poster+'" width="'+a.width+'" height="'+a.height+'" />'),o+="</object>"):-1!=a.source1mime.index
Of("audio")?e.settings.audio_template_callback?o=e.settings.audio_template_callback(a):o+='<audio controls="controls" src="'+a.source1+'">'+(a.source2?'\n<source src="'+a.source2+'"'+(a.source2mime?' type="'+a.source2mime+'"':"")+" />\n":"")+"</audio>":"script"==a.type?o+='<script src="'+a.source1+'"></script>':o=e.settings.video_template_callback?e.settings.video_template_callback(a):'<video width="'+a.width+'" height="'+a.height+'"'+(a.poster?' poster="'+a.poster+'"':"")+' controls="controls">\n<source src="'+a.source1+'"'+(a.source1mime?' type="'+a.source1mime+'"':"")+" />\n"+(a.source2?'<source src="'+a.source2+'"'+(a.source2mime?' type="'+a.source2mime+'"':"")+" />\n":"")+"</vi
deo>"}return o}function n(e){var t={};return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",start:function(e,i){if(t.source1||"param"!=e||(t.source1=i.map.movie),("iframe"==e||"object"==e||"embed"==e||"video"==e||"audio"==e)&&(t.type||(t.type=e),t=tinymce.extend(i.map,t)),"script"==e){var a=r(i.map.src);if(!a)return;t={type:"script",source1:i.map.src,width:a.width,height:a.height}}"source"==e&&(t.source1?t.source2||(t.source2=i.map.src):t.source1=i.map.src),"img"!=e||t.poster||(t.poster=i.map.src)}}).parse(e),t.source1=t.source1||t.src||t.data,t.source2=t.source2||"",t.poster=t.poster||"",t}function s(t){return t.getAttribute("data-mce-object")?n(e.serializer.serialize(t,{selection:!0})):{}}function m(e,t,i){function r(e,t){var i,r,a,o;for(i in t)if(a=""+t[i],e.ma
p[i])for(r=e.length;r--;)o=e[r],o.name==i&&(a?(e.map[i]=a,o.value=a):(delete e.map[i],e.splice(r,1)));else a&&(e.push({name:i,value:a}),e.map[i]=a)}var a,o=new tinymce.html.Writer,c=0;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",comment:function(e){o.comment(e)},cdata:function(e){o.cdata(e)},text:function(e,t){o.text(e,t)},start:function(e,n,s){switch(e){case"video":case"object":case"embed":case"img":case"iframe":r(n,{width:t.width,height:t.height})}if(i)switch(e){case"video":r(n,{poster:t.poster,src:""}),t.source2&&r(n,{src:""});break;case"iframe":r(n,{src:t.source1});break;case"source":if(c++,2>=c&&(r(n,{src:t["source"+c],type:t["source"+c+"mime"]}),!t["source"+c]))return;break;case"img":if(!t.poster)return;a=!0}o.start(e,n,s)},end:
function(e){if("video"==e&&i)for(var n=1;2>=n;n++)if(t["source"+n]){var s=[];s.map={},n>c&&(r(s,{src:t["source"+n],type:t["source"+n+"mime"]}),o.start("source",s,!0))}if(t.poster&&"object"==e&&i&&!a){var m=[];m.map={},r(m,{src:t.poster,width:t.width,height:t.height}),o.start("img",m,!0)}o.end(e)}},new tinymce.html.Schema({})).parse(e),o.getContent()}var d=[{regex:/youtu\.be\/([a-z1-9.-_]+)/,type:"iframe",w:425,h:350,url:"http://www.youtube.com/embed/$1"},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"http://www.youtube.com/embed/$2"},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"http://player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc"},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'h
ttp://maps.google.com/maps/ms?msid=$2&output=embed"'}];e.on("ResolveName",function(e){var t;1==e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}),e.on("preInit",function(){var t=e.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("</"+e+"[^>]*>","gi")}),e.schema.addValidElements("object[id|style|width|height|classid|codebase|*],embed[id|style|width|height|type|src|*],video[*],audio[*]");var i=e.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){i[e]={}}),e.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(t,i){for(var a,o,c,n,s,m,d,u,l=t.length;l--;)if(o=t[l],"script"!=o.name||(u=r(o.attr("src")))){for(c=new tinymce.html.Node("img",1
),c.shortEnded=!0,u&&(u.width&&o.attr("width",u.width.toString()),u.height&&o.attr("height",u.height.toString())),m=o.attributes,a=m.length;a--;)n=m[a].name,s=m[a].value,"width"!==n&&"height"!==n&&"style"!==n&&(("data"==n||"src"==n)&&(s=e.convertURL(s,n)),c.attr("data-mce-p-"+n,s));d=o.firstChild&&o.firstChild.value,d&&(c.attr("data-mce-html",escape(d)),c.firstChild=null),c.attr({width:o.attr("width")||"300",height:o.attr("height")||("audio"==i?"30":"150"),style:o.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":i,"class":"mce-object mce-object-"+i}),o.replace(c)}}),e.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var i,r,a,o,c,n,s,m=e.length;m--;){for(i=e[m],s=i.attr(t),r=new tinymc
e.html.Node(s,1),"audio"!=s&&"script"!=s&&r.attr({width:i.attr("width"),height:i.attr("height")}),r.attr({style:i.attr("style")}),o=i.attributes,a=o.length;a--;){var d=o[a].name;0===d.indexOf("data-mce-p-")&&r.attr(d.substr(11),o[a].value)}"script"==s&&r.attr("type","text/javascript"),c=i.attr("data-mce-html"),c&&(n=new tinymce.html.Node("#text",3),n.raw=!0,n.value=unescape(c),r.append(n)),i.replace(r)}})}),e.on("ObjectSelected",function(e){var t=e.target.getAttribute("data-mce-object");("audio"==t||"script"==t)&&e.preventDefault()}),e.on("objectResized",function(e){var t,i=e.target;i.getAttribute("data-mce-object")&&(t=i.getAttribute("data-mce-html"),t&&(t=unescape(t),i.setAttribute("data-mce-html",escape(m(t,{width:e.width,height:e
.height})))))}),e.addButton("media",{tooltip:"Insert/edit video",onclick:a,stateSelector:"img[data-mce-object=video]"}),e.addMenuItem("media",{icon:"media",text:"Insert video",onclick:a,context:"insert",prependToContext:!0})});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginspasteeditor_pluginjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/paste/editor_plugin.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/paste/editor_plugin.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/paste/editor_plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",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_max_consecutive_linebreaks:2,paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=
new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_blo
ck:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"pa
ste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:o.encode(r).replace(/\r?\n/g,"<br />")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste&qu
ot;);o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})
}else{u="<p>"+o.encode(r).replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br />")+"</p>"}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return fals
e})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9&&/<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(e.content)){d([[/(?:<br> [\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^&
gt;]*>)(?:<br> [\s\r\n]+|<br>)*/g,"$1"]]);d([[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*( )+/gi,/( |<br[^>]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>")}if(b(k,"paste_convert_middot_lists")){d([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|i
mg|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/<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(t,h,r){var u=[],o=0,q=n(f(r).replace(/"/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px&qu
ot;:""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-defau
lt-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/<h[1-6][^>]*>/gi,"<p><strong>"],[/<\/h[1-6][^>]*>/gi,"</strong></p>"]])}d([
[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is
(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l<d.length;l++){o=d[l];j=h.getStyle(m,o);if(j){n[o]=j;k++}}}h.setAttrib(m,"style","");if(d&&k>0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.no
deType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f<d){n=tinymce.inArray(m,f);o=i.getParents(h.parentNode,s);h=o[o.length-1-n]||h}}}c(i.select("span",t),function(v){var p=v.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\
s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(j){var h=this.editor,f=b(h,"paste_text_linebreaktype"),k=b(h,"paste_text_replacements"),g=tinymce.is;function e(m){c(m,function(n){if(n.constructor==RegExp){j=j.replace(n,"")}else{j=j.replace(n[0],n[1])}})}if((typeof(j)==="string")&&(j.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|c
enter)[^>]*>/i.test(j)){e([/[\n\r]+/g])}else{e([/\r+/g])}e([[/<\/(?: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,[/ /gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"]]);var d=Number(b(h,"paste_max_consecutive_linebreaks"));if(d>-1){var l=new RegExp("\n{"+(d+1)+",}","g");var i="";while(i.length<d){i+="\n"}e([[l,i]])}j=h.dom.decode(tinymce.html.Entities.encodeRaw(j));if(g(k,"array")){e(k)}else{if(g(k,"string")){e(new RegExp(k,"gi"))}}if(f=="none"){e([[/\n+/g," "]])}else{if(f=="br"){e([[/\n/g,"<br />"]])}else{if(f=="p"){e([[/\n+/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>
$1"]])}else{e([[/\n\n/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"],[/\n/g,"<br />"]])}}}h.execCommand("mceInsertContent",false,j)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginspasteeditor_plugin_srcjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/paste/editor_plugin_src.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/paste/editor_plugin_src.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/paste/editor_plugin_src.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,885 +0,0 @@
</span><del>-/**
- * editor_plugin_src.js
- *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
- *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
- */
-
-(function() {
- var each = tinymce.each,
- defs = {
- paste_auto_cleanup_on_paste : true,
- paste_enable_default_filters : true,
- paste_block_drop : false,
- paste_retain_style_properties : "none",
- paste_strip_class_attributes : "mso",
- 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_max_consecutive_linebreaks: 2,
- paste_text_use_dialog : false,
- paste_text_sticky : false,
- paste_text_sticky_default : false,
- paste_text_notifyalways : false,
- paste_text_linebreaktype : "combined",
- paste_text_replacements : [
- [/\u2026/g, "..."],
- [/[\x93\x94\u201c\u201d]/g, '"'],
- [/[\x60\x91\x92\u2018\u2019]/g, "'"]
- ]
- };
-
- function getParam(ed, name) {
- return ed.getParam(name, defs[name]);
- }
-
- tinymce.create('tinymce.plugins.PastePlugin', {
- init : function(ed, url) {
- var t = this;
-
- t.editor = ed;
- t.url = url;
-
- // Setup plugin events
- t.onPreProcess = new tinymce.util.Dispatcher(t);
- t.onPostProcess = new tinymce.util.Dispatcher(t);
-
- // Register default handlers
- t.onPreProcess.add(t._preProcess);
- t.onPostProcess.add(t._postProcess);
-
- // Register optional preprocess handler
- t.onPreProcess.add(function(pl, o) {
- ed.execCallback('paste_preprocess', pl, o);
- });
-
- // Register optional postprocess
- t.onPostProcess.add(function(pl, o) {
- ed.execCallback('paste_postprocess', pl, o);
- });
-
- ed.onKeyDown.addToTop(function(ed, e) {
- // Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that
- if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
- return false; // Stop other listeners
- });
-
- // Initialize plain text flag
- ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default');
-
- // This function executes the process handlers and inserts the contents
- // force_rich overrides plain text mode set by user, important for pasting with execCommand
- function process(o, force_rich) {
- var dom = ed.dom, rng;
-
- // Execute pre process handlers
- t.onPreProcess.dispatch(t, o);
-
- // Create DOM structure
- o.node = dom.create('div', 0, o.content);
-
- // If pasting inside the same element and the contents is only one block
- // remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element
- if (tinymce.isGecko) {
- rng = ed.selection.getRng(true);
- if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) {
- // Is only one block node and it doesn't contain word stuff
- if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1)
- dom.remove(o.node.firstChild, true);
- }
- }
-
- // Execute post process handlers
- t.onPostProcess.dispatch(t, o);
-
- // Serialize content
- o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''});
-
- // Plain text option active?
- if ((!force_rich) && (ed.pasteAsPlainText)) {
- t._insertPlainText(o.content);
-
- if (!getParam(ed, "paste_text_sticky")) {
- ed.pasteAsPlainText = false;
- ed.controlManager.setActive("pastetext", false);
- }
- } else {
- t._insert(o.content);
- }
- }
-
- // Add command for external usage
- ed.addCommand('mceInsertClipboardContent', function(u, o) {
- process(o, true);
- });
-
- if (!getParam(ed, "paste_text_use_dialog")) {
- ed.addCommand('mcePasteText', function(u, v) {
- var cookie = tinymce.util.Cookie;
-
- ed.pasteAsPlainText = !ed.pasteAsPlainText;
- ed.controlManager.setActive('pastetext', ed.pasteAsPlainText);
-
- if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) {
- if (getParam(ed, "paste_text_sticky")) {
- ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky'));
- } else {
- ed.windowManager.alert(ed.translate('paste.plaintext_mode'));
- }
-
- if (!getParam(ed, "paste_text_notifyalways")) {
- cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31))
- }
- }
- });
- }
-
- ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'});
- ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'});
-
- // This function grabs the contents from the clipboard by adding a
- // hidden div and placing the caret inside it and after the browser paste
- // is done it grabs that contents and processes that
- function grabContent(e) {
- var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent;
-
- // Check if browser supports direct plaintext access
- if (e.clipboardData || dom.doc.dataTransfer) {
- textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text');
-
- if (ed.pasteAsPlainText) {
- e.preventDefault();
- process({content : dom.encode(textContent).replace(/\r?\n/g, '<br />')});
- return;
- }
- }
-
- if (dom.get('_mcePaste'))
- return;
-
- // Create container to paste into
- n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF');
-
- // If contentEditable mode we need to find out the position of the closest element
- if (body != ed.getDoc().body)
- posY = dom.getPos(ed.selection.getStart(), body).y;
- else
- posY = body.scrollTop + dom.getViewPort(ed.getWin()).y;
-
- // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles
- // If also needs to be in view on IE or the paste would fail
- dom.setStyles(n, {
- position : 'absolute',
- left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div
- top : posY - 25,
- width : 1,
- height : 1,
- overflow : 'hidden'
- });
-
- if (tinymce.isIE) {
- // Store away the old range
- oldRng = sel.getRng();
-
- // Select the container
- rng = dom.doc.body.createTextRange();
- rng.moveToElementText(n);
- rng.execCommand('Paste');
-
- // Remove container
- dom.remove(n);
-
- // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due
- // to IE security settings so we pass the junk though better than nothing right
- if (n.innerHTML === '\uFEFF\uFEFF') {
- ed.execCommand('mcePasteWord');
- e.preventDefault();
- return;
- }
-
- // Restore the old range and clear the contents before pasting
- sel.setRng(oldRng);
- sel.setContent('');
-
- // For some odd reason we need to detach the the mceInsertContent call from the paste event
- // It's like IE has a reference to the parent element that you paste in and the selection gets messed up
- // when it tries to restore the selection
- setTimeout(function() {
- // Process contents
- process({content : n.innerHTML});
- }, 0);
-
- // Block the real paste event
- return tinymce.dom.Event.cancel(e);
- } else {
- function block(e) {
- e.preventDefault();
- };
-
- // Block mousedown and click to prevent selection change
- dom.bind(ed.getDoc(), 'mousedown', block);
- dom.bind(ed.getDoc(), 'keydown', block);
-
- or = ed.selection.getRng();
-
- // Move select contents inside DIV
- n = n.firstChild;
- rng = ed.getDoc().createRange();
- rng.setStart(n, 0);
- rng.setEnd(n, 2);
- sel.setRng(rng);
-
- // Wait a while and grab the pasted contents
- window.setTimeout(function() {
- var h = '', nl;
-
- // Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit
- if (!dom.select('div.mcePaste > div.mcePaste').length) {
- nl = dom.select('div.mcePaste');
-
- // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string
- each(nl, function(n) {
- var child = n.firstChild;
-
- // WebKit inserts a DIV container with lots of odd styles
- if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) {
- dom.remove(child, 1);
- }
-
- // Remove apply style spans
- each(dom.select('span.Apple-style-span', n), function(n) {
- dom.remove(n, 1);
- });
-
- // Remove bogus br elements
- each(dom.select('br[data-mce-bogus]', n), function(n) {
- dom.remove(n);
- });
-
- // WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV
- if (n.parentNode.className != 'mcePaste')
- h += n.innerHTML;
- });
- } else {
- // Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc
- // So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same
- h = '<p>' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '</p><p>').replace(/\r?\n/g, '<br />') + '</p>';
- }
-
- // Remove the nodes
- each(dom.select('div.mcePaste'), function(n) {
- dom.remove(n);
- });
-
- // Restore the old selection
- if (or)
- sel.setRng(or);
-
- process({content : h});
-
- // Unblock events ones we got the contents
- dom.unbind(ed.getDoc(), 'mousedown', block);
- dom.unbind(ed.getDoc(), 'keydown', block);
- }, 0);
- }
- }
-
- // Check if we should use the new auto process method
- if (getParam(ed, "paste_auto_cleanup_on_paste")) {
- // Is it's Opera or older FF use key handler
- if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {
- ed.onKeyDown.addToTop(function(ed, e) {
- if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
- grabContent(e);
- });
- } else {
- // Grab contents on paste event on Gecko and WebKit
- ed.onPaste.addToTop(function(ed, e) {
- return grabContent(e);
- });
- }
- }
-
- ed.onInit.add(function() {
- ed.controlManager.setActive("pastetext", ed.pasteAsPlainText);
-
- // Block all drag/drop events
- if (getParam(ed, "paste_block_drop")) {
- ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) {
- e.preventDefault();
- e.stopPropagation();
-
- return false;
- });
- }
- });
-
- // Add legacy support
- t._legacySupport();
- },
-
- 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(pl, o) {
- var ed = this.editor,
- h = o.content,
- grep = tinymce.grep,
- explode = tinymce.explode,
- trim = tinymce.trim,
- len, stripClass;
-
- //console.log('Before preprocess:' + o.content);
-
- function process(items) {
- each(items, function(v) {
- // Remove or replace
- if (v.constructor == RegExp)
- h = h.replace(v, '');
- else
- h = h.replace(v[0], v[1]);
- });
- }
-
- if (ed.settings.paste_enable_default_filters == false) {
- return;
- }
-
- // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser
- if (tinymce.isIE && document.documentMode >= 9 && /<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(o.content)) {
- // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser
- process([[/(?:<br> [\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br> [\s\r\n]+|<br>)*/g, '$1']]);
-
- // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break
- process([
- [/<br><br>/g, '<BR><BR>'], // Replace multiple BR elements with uppercase BR to keep them intact
- [/<br>/g, ' '], // Replace single br elements with space since they are word wrap BR:s
- [/<BR><BR>/g, '<br>'] // Replace back the double brs but into a single BR
- ]);
- }
-
- // Detect Word content and process it more aggressive
- if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) {
- o.wordContent = true; // Mark the pasted contents as word specific content
- //console.log('Word contents detected.');
-
- // Process away some basic content
- process([
- /^\s*( )+/gi, // entities at the start of contents
- /( |<br[^>]*>)+\s*$/gi // entities at the end of contents
- ]);
-
- if (getParam(ed, "paste_convert_headers_to_strong")) {
- h = h.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "<p><strong>$1</strong></p>");
- }
-
- if (getParam(ed, "paste_convert_middot_lists")) {
- process([
- [/<!--\[if !supportLists\]-->/gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker
- [/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers
- [/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF)
- ]);
- }
-
- process([
- // Word comments like conditional comments etc
- /<!--[\s\S]+?-->/gi,
-
- // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags
- /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
-
- // Convert <s> into <strike> for line-though
- [/<(\/?)s>/gi, "<$1strike>"],
-
- // Replace nsbp entites to char since it's easier to handle
- [/ /gi, "\u00a0"]
- ]);
-
- // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag.
- // 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.
- do {
- len = h.length;
- h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");
- } while (len != h.length);
-
- // Remove all spans if no styles is to be retained
- if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) {
- h = h.replace(/<\/?span[^>]*>/gi, "");
- } else {
- // We're keeping styles, so at least clean them up.
- // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx
-
- process([
- // Convert <span style="mso-spacerun:yes">___</span> to string of alternating breaking/non-breaking spaces of same length
- [/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
- function(str, spaces) {
- return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : "";
- }
- ],
-
- // Examine all styles: delete junk, transform some, and keep the rest
- [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,
- function(str, tag, style) {
- var n = [],
- i = 0,
- s = explode(trim(style).replace(/"/gi, "'"), ";");
-
- // Examine each style definition within the tag's style attribute
- each(s, function(v) {
- var name, value,
- parts = explode(v, ":");
-
- function ensureUnits(v) {
- return v + ((v !== "0") && (/\d$/.test(v)))? "px" : "";
- }
-
- if (parts.length == 2) {
- name = parts[0].toLowerCase();
- value = parts[1].toLowerCase();
-
- // Translate certain MS Office styles into their CSS equivalents
- switch (name) {
- 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":
- n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value);
- return;
-
- case "horiz-align":
- n[i++] = "text-align:" + value;
- return;
-
- case "vert-align":
- n[i++] = "vertical-align:" + value;
- return;
-
- case "font-color":
- case "mso-foreground":
- n[i++] = "color:" + value;
- return;
-
- case "mso-background":
- case "mso-highlight":
- n[i++] = "background:" + value;
- return;
-
- case "mso-default-height":
- n[i++] = "min-height:" + ensureUnits(value);
- return;
-
- case "mso-default-width":
- n[i++] = "min-width:" + ensureUnits(value);
- return;
-
- case "mso-padding-between-alt":
- n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value);
- return;
-
- case "text-line-through":
- if ((value == "single") || (value == "double")) {
- n[i++] = "text-decoration:line-through";
- }
- return;
-
- case "mso-zero-height":
- if (value == "yes") {
- n[i++] = "display:none";
- }
- return;
- }
-
- // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name
- 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)) {
- return;
- }
-
- // If it reached this point, it must be a valid CSS style
- n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case
- }
- });
-
- // If style attribute contained any valid styles the re-write it; otherwise delete style attribute.
- if (i > 0) {
- return tag + ' style="' + n.join(';') + '"';
- } else {
- return tag;
- }
- }
- ]
- ]);
- }
- }
-
- // Replace headers with <strong>
- if (getParam(ed, "paste_convert_headers_to_strong")) {
- process([
- [/<h[1-6][^>]*>/gi, "<p><strong>"],
- [/<\/h[1-6][^>]*>/gi, "</strong></p>"]
- ]);
- }
-
- process([
- // Copy paste from Java like Open Office will produce this junk on FF
- [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, '']
- ]);
-
- // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso").
- // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation.
- stripClass = getParam(ed, "paste_strip_class_attributes");
-
- if (stripClass !== "none") {
- function removeClasses(match, g1) {
- if (stripClass === "all")
- return '';
-
- var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "),
- function(v) {
- return (/^(?!mso)/i.test(v));
- }
- );
-
- return cls.length ? ' class="' + cls.join(" ") + '"' : '';
- };
-
- h = h.replace(/ class="([^"]+)"/gi, removeClasses);
- h = h.replace(/ class=([\-\w]+)/gi, removeClasses);
- }
-
- // Remove spans option
- if (getParam(ed, "paste_remove_spans")) {
- h = h.replace(/<\/?span[^>]*>/gi, "");
- }
-
- //console.log('After preprocess:' + h);
-
- o.content = h;
- },
-
- /**
- * Various post process items.
- */
- _postProcess : function(pl, o) {
- var t = this, ed = t.editor, dom = ed.dom, styleProps;
-
- if (ed.settings.paste_enable_default_filters == false) {
- return;
- }
-
- if (o.wordContent) {
- // Remove named anchors or TOC links
- each(dom.select('a', o.node), function(a) {
- if (!a.href || a.href.indexOf('#_Toc') != -1)
- dom.remove(a, 1);
- });
-
- if (getParam(ed, "paste_convert_middot_lists")) {
- t._convertLists(pl, o);
- }
-
- // Process styles
- styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties
-
- // Process only if a string was specified and not equal to "all" or "*"
- if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) {
- styleProps = tinymce.explode(styleProps.replace(/^none$/i, ""));
-
- // Retains some style properties
- each(dom.select('*', o.node), function(el) {
- var newStyle = {}, npc = 0, i, sp, sv;
-
- // Store a subset of the existing styles
- if (styleProps) {
- for (i = 0; i < styleProps.length; i++) {
- sp = styleProps[i];
- sv = dom.getStyle(el, sp);
-
- if (sv) {
- newStyle[sp] = sv;
- npc++;
- }
- }
- }
-
- // Remove all of the existing styles
- dom.setAttrib(el, 'style', '');
-
- if (styleProps && npc > 0)
- dom.setStyles(el, newStyle); // Add back the stored subset of styles
- else // Remove empty span tags that do not have class attributes
- if (el.nodeName == 'SPAN' && !el.className)
- dom.remove(el, true);
- });
- }
- }
-
- // Remove all style information or only specifically on WebKit to avoid the style bug on that browser
- if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) {
- each(dom.select('*[style]', o.node), function(el) {
- el.removeAttribute('style');
- el.removeAttribute('data-mce-style');
- });
- } else {
- if (tinymce.isWebKit) {
- // 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 ..." />
- // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles
- each(dom.select('*', o.node), function(el) {
- el.removeAttribute('data-mce-style');
- });
- }
- }
- },
-
- /**
- * Converts the most common bullet and number formats in Office into a real semantic UL/LI list.
- */
- _convertLists : function(pl, o) {
- var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html;
-
- // Convert middot lists into real semantic lists
- each(dom.select('p', o.node), function(p) {
- var sib, val = '', type, html, idx, parents;
-
- // Get text node value at beginning of paragraph
- for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling)
- val += sib.nodeValue;
-
- val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0');
-
- // Detect unordered lists look for bullets
- if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val))
- type = 'ul';
-
- // Detect ordered lists 1., a. or ixv.
- if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val))
- type = 'ol';
-
- // Check if node value matches the list pattern: o
- if (type) {
- margin = parseFloat(p.style.marginLeft || 0);
-
- if (margin > lastMargin)
- levels.push(margin);
-
- if (!listElm || type != lastType) {
- listElm = dom.create(type);
- dom.insertAfter(listElm, p);
- } else {
- // Nested list element
- if (margin > lastMargin) {
- listElm = li.appendChild(dom.create(type));
- } else if (margin < lastMargin) {
- // Find parent level based on margin value
- idx = tinymce.inArray(levels, margin);
- parents = dom.getParents(listElm.parentNode, type);
- listElm = parents[parents.length - 1 - idx] || listElm;
- }
- }
-
- // Remove middot or number spans if they exists
- each(dom.select('span', p), function(span) {
- var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, '');
-
- // Remove span with the middot or the number
- if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html))
- dom.remove(span);
- else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html))
- dom.remove(span);
- });
-
- html = p.innerHTML;
-
- // Remove middot/list items
- if (type == 'ul')
- html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, '');
- else
- html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, '');
-
- // Create li and add paragraph data into the new li
- li = listElm.appendChild(dom.create('li', 0, html));
- dom.remove(p);
-
- lastMargin = margin;
- lastType = type;
- } else
- listElm = lastMargin = 0; // End list element
- });
-
- // Remove any left over makers
- html = o.node.innerHTML;
- if (html.indexOf('__MCE_ITEM__') != -1)
- o.node.innerHTML = html.replace(/__MCE_ITEM__/g, '');
- },
-
- /**
- * Inserts the specified contents at the caret position.
- */
- _insert : function(h, skip_undo) {
- var ed = this.editor, r = ed.selection.getRng();
-
- // First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells.
- if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer)
- ed.getDoc().execCommand('Delete', false, null);
-
- ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo});
- },
-
- /**
- * Instead of the old plain text method which tried to re-create a paste operation, the
- * new approach adds a plain text mode toggle switch that changes the behavior of paste.
- * This function is passed the same input that the regular paste plugin produces.
- * It performs additional scrubbing and produces (and inserts) the plain text.
- * This approach leverages all of the great existing functionality in the paste
- * plugin, and requires minimal changes to add the new functionality.
- * Speednet - June 2009
- */
- _insertPlainText : function(content) {
- var ed = this.editor,
- linebr = getParam(ed, "paste_text_linebreaktype"),
- rl = getParam(ed, "paste_text_replacements"),
- is = tinymce.is;
-
- function process(items) {
- each(items, function(v) {
- if (v.constructor == RegExp)
- content = content.replace(v, "");
- else
- content = content.replace(v[0], v[1]);
- });
- };
-
- if ((typeof(content) === "string") && (content.length > 0)) {
- // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line
- if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) {
- process([
- /[\n\r]+/g
- ]);
- } else {
- // Otherwise just get rid of carriage returns (only need linefeeds)
- process([
- /\r+/g
- ]);
- }
-
- process([
- [/<\/(?: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
- [/<br[^>]*>|<\/tr>/gi, "\n"], // Single linebreak for <br /> tags and table rows
- [/<\/t[dh]>\s*<t[dh][^>]*>/gi, "\t"], // Table cells get tabs betweem them
- /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags
- [/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*)
- [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"] // Cool little RegExp deletes whitespace around linebreak chars.
- ]);
-
- var maxLinebreaks = Number(getParam(ed, "paste_max_consecutive_linebreaks"));
- if (maxLinebreaks > -1) {
- var maxLinebreaksRegex = new RegExp("\n{" + (maxLinebreaks + 1) + ",}", "g");
- var linebreakReplacement = "";
-
- while (linebreakReplacement.length < maxLinebreaks) {
- linebreakReplacement += "\n";
- }
-
- process([
- [maxLinebreaksRegex, linebreakReplacement] // Limit max consecutive linebreaks
- ]);
- }
-
- content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content));
-
- // Perform default or custom replacements
- if (is(rl, "array")) {
- process(rl);
- } else if (is(rl, "string")) {
- process(new RegExp(rl, "gi"));
- }
-
- // Treat paragraphs as specified in the config
- if (linebr == "none") {
- // Convert all line breaks to space
- process([
- [/\n+/g, " "]
- ]);
- } else if (linebr == "br") {
- // Convert all line breaks to <br />
- process([
- [/\n/g, "<br />"]
- ]);
- } else if (linebr == "p") {
- // Convert all line breaks to <p>...</p>
- process([
- [/\n+/g, "</p><p>"],
- [/^(.*<\/p>)(<p>)$/, '<p>$1']
- ]);
- } else {
- // defaults to "combined"
- // Convert single line breaks to <br /> and double line breaks to <p>...</p>
- process([
- [/\n\n/g, "</p><p>"],
- [/^(.*<\/p>)(<p>)$/, '<p>$1'],
- [/\n/g, "<br />"]
- ]);
- }
-
- ed.execCommand('mceInsertContent', false, content);
- }
- },
-
- /**
- * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine.
- */
- _legacySupport : function() {
- var t = this, ed = t.editor;
-
- // Register command(s) for backwards compatibility
- ed.addCommand("mcePasteWord", function() {
- ed.windowManager.open({
- file: t.url + "/pasteword.htm",
- width: parseInt(getParam(ed, "paste_dialog_width")),
- height: parseInt(getParam(ed, "paste_dialog_height")),
- inline: 1
- });
- });
-
- if (getParam(ed, "paste_text_use_dialog")) {
- ed.addCommand("mcePasteText", function() {
- ed.windowManager.open({
- file : t.url + "/pastetext.htm",
- width: parseInt(getParam(ed, "paste_dialog_width")),
- height: parseInt(getParam(ed, "paste_dialog_height")),
- inline : 1
- });
- });
- }
-
- // Register button for backwards compatibility
- ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"});
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin);
-})();
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginspastepastetexthtm"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/paste/pastetext.htm (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/paste/pastetext.htm 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/paste/pastetext.htm 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,27 +0,0 @@
</span><del>-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>{#paste.paste_text_desc}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=359-20131010"></script>
- <script type="text/javascript" src="js/pastetext.js?ver=359-20131010"></script>
-</head>
-<body onresize="PasteTextDialog.resize();" style="display:none; overflow:hidden;">
- <form name="source" onsubmit="return PasteTextDialog.insert();" action="#">
- <div style="float: left" class="title">{#paste.paste_text_desc}</div>
-
- <div style="float: right">
- <input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label>
- </div>
-
- <br style="clear: both" />
-
- <div>{#paste_dlg.text_title}</div>
-
- <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>
-
- <div class="mceActionPanel">
- <input type="submit" name="insert" value="{#insert}" id="insert" />
- <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
- </div>
- </form>
-</body>
-</html>
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginspastepastewordhtm"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/paste/pasteword.htm (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/paste/pasteword.htm 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/paste/pasteword.htm 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,21 +0,0 @@
</span><del>-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>{#paste.paste_word_desc}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=359-20131010"></script>
- <script type="text/javascript" src="js/pasteword.js?ver=359-20131010"></script>
-</head>
-<body onresize="PasteWordDialog.resize();" style="display:none; overflow:hidden;">
- <form name="source" onsubmit="return PasteWordDialog.insert();" action="#">
- <div class="title">{#paste.paste_word_desc}</div>
-
- <div>{#paste_dlg.word_title}</div>
-
- <div id="iframecontainer"></div>
-
- <div class="mceActionPanel">
- <input type="submit" id="insert" name="insert" value="{#insert}" />
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
- </div>
- </form>
-</body>
-</html>
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginspastepluginjsfromrev26862trunksrcwpincludesjstinymcepluginspasteeditor_plugin_srcjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/paste/plugin.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/paste/editor_plugin_src.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/paste/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/paste/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,1067 @@
</span><ins>+/**
+ * Compiled inline version. (Library mode)
+ */
+
+/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
+/*globals $code */
+
+(function(exports, undefined) {
+ "use strict";
+
+ var modules = {};
+
+ function require(ids, callback) {
+ var module, defs = [];
+
+ for (var i = 0; i < ids.length; ++i) {
+ module = modules[ids[i]] || resolve(ids[i]);
+ if (!module) {
+ throw 'module definition dependecy not found: ' + ids[i];
+ }
+
+ defs.push(module);
+ }
+
+ callback.apply(null, defs);
+ }
+
+ function define(id, dependencies, definition) {
+ if (typeof id !== 'string') {
+ throw 'invalid module definition, module id must be defined and be a string';
+ }
+
+ if (dependencies === undefined) {
+ throw 'invalid module definition, dependencies must be specified';
+ }
+
+ if (definition === undefined) {
+ throw 'invalid module definition, definition function must be specified';
+ }
+
+ require(dependencies, function() {
+ modules[id] = definition.apply(null, arguments);
+ });
+ }
+
+ function defined(id) {
+ return !!modules[id];
+ }
+
+ function resolve(id) {
+ var target = exports;
+ var fragments = id.split(/[.\/]/);
+
+ for (var fi = 0; fi < fragments.length; ++fi) {
+ if (!target[fragments[fi]]) {
+ return;
+ }
+
+ target = target[fragments[fi]];
+ }
+
+ return target;
+ }
+
+ function expose(ids) {
+ for (var i = 0; i < ids.length; i++) {
+ var target = exports;
+ var id = ids[i];
+ var fragments = id.split(/[.\/]/);
+
+ for (var fi = 0; fi < fragments.length - 1; ++fi) {
+ if (target[fragments[fi]] === undefined) {
+ target[fragments[fi]] = {};
+ }
+
+ target = target[fragments[fi]];
+ }
+
+ target[fragments[fragments.length - 1]] = modules[id];
+ }
+ }
+
+// Included from: js/tinymce/plugins/paste/classes/Utils.js
+
+/**
+ * Utils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contails various utility functions for the paste plugin.
+ *
+ * @class tinymce.pasteplugin.Clipboard
+ * @private
+ */
+define("tinymce/pasteplugin/Utils", [
+ "tinymce/util/Tools",
+ "tinymce/html/DomParser",
+ "tinymce/html/Schema"
+], function(Tools, DomParser, Schema) {
+ function filter(content, items) {
+ Tools.each(items, function(v) {
+ if (v.constructor == RegExp) {
+ content = content.replace(v, '');
+ } else {
+ content = content.replace(v[0], v[1]);
+ }
+ });
+
+ return content;
+ }
+
+ /**
+ * Gets the innerText of the specified element. It will handle edge cases
+ * and works better than textContent on Gecko.
+ *
+ * @param {String} html HTML string to get text from.
+ * @return {String} String of text with line feeds.
+ */
+ function innerText(html) {
+ var schema = new Schema(), domParser = new DomParser({}, schema), text = '';
+ var shortEndedElements = schema.getShortEndedElements();
+ var ignoreElements = Tools.makeMap('script noscript style textarea video audio iframe object', ' ');
+ var blockElements = schema.getBlockElements();
+
+ function walk(node) {
+ var name = node.name, currentNode = node;
+
+ if (name === 'br') {
+ text += '\n';
+ return;
+ }
+
+ // img/input/hr
+ if (shortEndedElements[name]) {
+ text += ' ';
+ }
+
+ // Ingore script, video contents
+ if (ignoreElements[name]) {
+ text += ' ';
+ return;
+ }
+
+ if (node.type == 3) {
+ text += node.value;
+ }
+
+ // Walk all children
+ if (!node.shortEnded) {
+ if ((node = node.firstChild)) {
+ do {
+ walk(node);
+ } while ((node = node.next));
+ }
+ }
+
+ // Add \n or \n\n for blocks or P
+ if (blockElements[name] && currentNode.next) {
+ text += '\n';
+
+ if (name == 'p') {
+ text += '\n';
+ }
+ }
+ }
+
+ walk(domParser.parse(html));
+
+ return text;
+ }
+
+ return {
+ filter: filter,
+ innerText: innerText
+ };
+});
+
+// Included from: js/tinymce/plugins/paste/classes/Clipboard.js
+
+/**
+ * Clipboard.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains logic for getting HTML contents out of the clipboard.
+ *
+ * We need to make a lot of ugly hacks to get the contents out of the clipboard since
+ * the W3C Clipboard API is broken in all browsers: Gecko/WebKit/Blink. We might rewrite
+ * this the way those API:s stabilize.
+ *
+ * Current implementation steps:
+ * 1. On keydown with paste keys Ctrl+V or Shift+Insert create
+ * a paste bin element and move focus to that element.
+ * 2. Wait for the browser to fire a "paste" event and get the contents out of the paste bin.
+ * 3. Check if the paste was successful if true, process the HTML.
+ * (4). If the paste was unsuccessful use IE execCommand, Clipboard API, document.dataTransfer old WebKit API etc.
+ *
+ * @class tinymce.pasteplugin.Clipboard
+ * @private
+ */
+define("tinymce/pasteplugin/Clipboard", [
+ "tinymce/Env",
+ "tinymce/util/VK",
+ "tinymce/pasteplugin/Utils"
+], function(Env, VK, Utils) {
+ return function(editor) {
+ var self = this, pasteBinElm, lastRng, keyboardPasteTimeStamp = 0;
+ var pasteBinDefaultContent = '%MCEPASTEBIN%', keyboardPastePlainTextState;
+
+ /**
+ * Pastes the specified HTML. This means that the HTML is filtered and then
+ * inserted at the current selection in the editor. It will also fire paste events
+ * for custom user filtering.
+ *
+ * @param {String} html HTML code to paste into the current selection.
+ */
+ function pasteHtml(html) {
+ var args, dom = editor.dom;
+
+ args = editor.fire('BeforePastePreProcess', {content: html}); // Internal event used by Quirks
+ args = editor.fire('PastePreProcess', args);
+ html = args.content;
+
+ if (!args.isDefaultPrevented()) {
+ // User has bound PastePostProcess events then we need to pass it through a DOM node
+ // This is not ideal but we don't want to let the browser mess up the HTML for example
+ // some browsers add to P tags etc
+ if (editor.hasEventListeners('PastePostProcess') && !args.isDefaultPrevented()) {
+ // We need to attach the element to the DOM so Sizzle selectors work on the contents
+ var tempBody = dom.add(editor.getBody(), 'div', {style: 'display:none'}, html);
+ args = editor.fire('PastePostProcess', {node: tempBody});
+ dom.remove(tempBody);
+ html = args.node.innerHTML;
+ }
+
+ if (!args.isDefaultPrevented()) {
+ editor.insertContent(html);
+ }
+ }
+ }
+
+ /**
+ * Pastes the specified text. This means that the plain text is processed
+ * and converted into BR and P elements. It will fire paste events for custom filtering.
+ *
+ * @param {String} text Text to paste as the current selection location.
+ */
+ function pasteText(text) {
+ text = editor.dom.encode(text).replace(/\r\n/g, '\n');
+
+ var startBlock = editor.dom.getParent(editor.selection.getStart(), editor.dom.isBlock);
+
+ // Create start block html for example <p attr="value">
+ var forcedRootBlockName = editor.settings.forced_root_block;
+ var forcedRootBlockStartHtml;
+ if (forcedRootBlockName) {
+ forcedRootBlockStartHtml = editor.dom.createHTML(forcedRootBlockName, editor.settings.forced_root_block_attrs);
+ forcedRootBlockStartHtml = forcedRootBlockStartHtml.substr(0, forcedRootBlockStartHtml.length - 3) + '>';
+ }
+
+ if ((startBlock && /^(PRE|DIV)$/.test(startBlock.nodeName)) || !forcedRootBlockName) {
+ text = Utils.filter(text, [
+ [/\n/g, "<br>"]
+ ]);
+ } else {
+ text = Utils.filter(text, [
+ [/\n\n/g, "</p>" + forcedRootBlockStartHtml],
+ [/^(.*<\/p>)(<p>)$/, forcedRootBlockStartHtml + '$1'],
+ [/\n/g, "<br />"]
+ ]);
+
+ if (text.indexOf('<p>') != -1) {
+ text = forcedRootBlockStartHtml + text;
+ }
+ }
+
+ pasteHtml(text);
+ }
+
+ /**
+ * Creates a paste bin element and moves the selection into that element. It will also move the element offscreen
+ * so that resize handles doesn't get produced on IE or Drag handles or Firefox.
+ */
+ function createPasteBin() {
+ var dom = editor.dom, body = editor.getBody(), viewport = editor.dom.getViewPort(editor.getWin());
+ var height = editor.inline ? body.clientHeight : viewport.h;
+
+ removePasteBin();
+
+ // Create a pastebin
+ pasteBinElm = dom.add(editor.getBody(), 'div', {
+ id: "mcepastebin",
+ contentEditable: true,
+ "data-mce-bogus": "1",
+ style: 'position: fixed; top: 20px;' +
+ 'width: 10px; height: ' + (height - 40) + 'px; overflow: hidden; opacity: 0'
+ }, pasteBinDefaultContent);
+
+ // Move paste bin out of sight since the controlSelection rect gets displayed otherwise
+ dom.setStyle(pasteBinElm, 'left', dom.getStyle(body, 'direction', true) == 'rtl' ? 0xFFFF : -0xFFFF);
+
+ // Prevent focus events from bubbeling fixed FocusManager issues
+ dom.bind(pasteBinElm, 'beforedeactivate focusin focusout', function(e) {
+ e.stopPropagation();
+ });
+
+ lastRng = editor.selection.getRng();
+ pasteBinElm.focus();
+ editor.selection.select(pasteBinElm, true);
+ }
+
+ /**
+ * Removes the paste bin if it exists.
+ */
+ function removePasteBin() {
+ if (pasteBinElm) {
+ editor.dom.unbind(pasteBinElm);
+ editor.dom.remove(pasteBinElm);
+
+ if (lastRng) {
+ editor.selection.setRng(lastRng);
+ }
+ }
+
+ keyboardPastePlainTextState = false;
+ pasteBinElm = lastRng = null;
+ }
+
+ /**
+ * Returns the contents of the paste bin as a HTML string.
+ *
+ * @return {String} Get the contents of the paste bin.
+ */
+ function getPasteBinHtml() {
+ return pasteBinElm ? pasteBinElm.innerHTML : pasteBinDefaultContent;
+ }
+
+ /**
+ * Gets various content types out of a datatransfer object.
+ *
+ * @param {DataTransfer} dataTransfer Event fired on paste.
+ * @return {Object} Object with mime types and data for those mime types.
+ */
+ function getDataTransferItems(dataTransfer) {
+ var data = {};
+
+ if (dataTransfer && dataTransfer.types) {
+ data['text/plain'] = dataTransfer.getData('Text');
+
+ for (var i = 0; i < dataTransfer.types.length; i++) {
+ var contentType = dataTransfer.types[i];
+ data[contentType] = dataTransfer.getData(contentType);
+ }
+ }
+
+ return data;
+ }
+
+ /**
+ * Gets various content types out of the Clipboard API. It will also get the
+ * plain text using older IE and WebKit API:s.
+ *
+ * @param {ClipboardEvent} clipboardEvent Event fired on paste.
+ * @return {Object} Object with mime types and data for those mime types.
+ */
+ function getClipboardContent(clipboardEvent) {
+ return getDataTransferItems(clipboardEvent.clipboardData || editor.getDoc().dataTransfer);
+ }
+
+ function getCaretRangeFromEvent(e) {
+ var doc = editor.getDoc(), rng;
+
+ if (doc.caretPositionFromPoint) {
+ var point = doc.caretPositionFromPoint(e.pageX, e.pageY);
+ rng = doc.createRange();
+ rng.setStart(point.offsetNode, point.offset);
+ rng.collapse(true);
+ } else if (doc.caretRangeFromPoint) {
+ rng = doc.caretRangeFromPoint(e.pageX, e.pageY);
+ }
+
+ return rng;
+ }
+
+ editor.on('keydown', function(e) {
+ if (e.isDefaultPrevented()) {
+ return;
+ }
+
+ // Ctrl+V or Shift+Insert
+ if ((VK.metaKeyPressed(e) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) {
+ keyboardPastePlainTextState = e.shiftKey && e.keyCode == 86;
+
+ // Prevent undoManager keydown handler from making an undo level with the pastebin in it
+ e.stopImmediatePropagation();
+
+ keyboardPasteTimeStamp = new Date().getTime();
+
+ // IE doesn't support Ctrl+Shift+V and it doesn't even produce a paste event
+ // so lets fake a paste event and let IE use the execCommand/dataTransfer methods
+ if (Env.ie && keyboardPastePlainTextState) {
+ e.preventDefault();
+ editor.fire('paste', {ieFake: true});
+ return;
+ }
+
+ createPasteBin();
+ }
+ });
+
+ editor.on('paste', function(e) {
+ var clipboardContent = getClipboardContent(e);
+ var isKeyBoardPaste = new Date().getTime() - keyboardPasteTimeStamp < 1000;
+ var plainTextMode = self.pasteFormat == "text" || keyboardPastePlainTextState;
+
+ // Not a keyboard paste prevent default paste and try to grab the clipboard contents using different APIs
+ if (!isKeyBoardPaste) {
+ e.preventDefault();
+ }
+
+ // Try IE only method if paste isn't a keyboard paste
+ if (Env.ie && (!isKeyBoardPaste || e.ieFake)) {
+ createPasteBin();
+
+ editor.dom.bind(pasteBinElm, 'paste', function(e) {
+ e.stopPropagation();
+ });
+
+ editor.getDoc().execCommand('Paste', false, null);
+ clipboardContent["text/html"] = getPasteBinHtml();
+ }
+
+ setTimeout(function() {
+ var html = getPasteBinHtml();
+
+ // WebKit has a nice bug where it clones the paste bin if you paste from for example notepad
+ if (pasteBinElm && pasteBinElm.firstChild && pasteBinElm.firstChild.id === 'mcepastebin') {
+ plainTextMode = true;
+ }
+
+ removePasteBin();
+
+ if (html == pasteBinDefaultContent || !isKeyBoardPaste) {
+ html = clipboardContent['text/html'] || clipboardContent['text/plain'] || pasteBinDefaultContent;
+
+ if (html == pasteBinDefaultContent) {
+ if (!isKeyBoardPaste) {
+ editor.windowManager.alert('Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.');
+ }
+
+ return;
+ }
+ }
+
+ if (plainTextMode) {
+ pasteText(clipboardContent['text/plain'] || Utils.innerText(html));
+ } else {
+ pasteHtml(html);
+ }
+ }, 0);
+ });
+
+ editor.on('dragstart', function(e) {
+ if (e.dataTransfer.types) {
+ e.dataTransfer.setData('mce-internal', editor.selection.getContent());
+ }
+ });
+
+ editor.on('drop', function(e) {
+ var rng = getCaretRangeFromEvent(e);
+
+ if (rng) {
+ var dropContent = getDataTransferItems(e.dataTransfer);
+ var content = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain'];
+
+ if (content) {
+ e.preventDefault();
+
+ editor.undoManager.transact(function() {
+ if (dropContent['mce-internal']) {
+ editor.execCommand('Delete');
+ }
+
+ editor.selection.setRng(rng);
+
+ if (!dropContent['text/html']) {
+ pasteText(content);
+ } else {
+ pasteHtml(content);
+ }
+ });
+ }
+ }
+ });
+
+ self.pasteHtml = pasteHtml;
+ self.pasteText = pasteText;
+
+ // Remove all data images from paste for example from Gecko
+ // except internal images like video elements
+ editor.on('preInit', function() {
+ editor.parser.addNodeFilter('img', function(nodes) {
+ if (!editor.settings.paste_data_images) {
+ var i = nodes.length;
+
+ while (i--) {
+ var src = nodes[i].attributes.map.src;
+ if (src && src.indexOf('data:image') === 0) {
+ if (!nodes[i].attr('data-mce-object') && src !== Env.transparentSrc) {
+ nodes[i].remove();
+ }
+ }
+ }
+ }
+ });
+ });
+
+ // Fix for #6504 we need to remove the paste bin on IE if the user paste in a file
+ editor.on('PreProcess', function() {
+ editor.dom.remove(editor.dom.get('mcepastebin'));
+ });
+ };
+});
+
+// Included from: js/tinymce/plugins/paste/classes/WordFilter.js
+
+/**
+ * WordFilter.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class parses word HTML into proper TinyMCE markup.
+ *
+ * @class tinymce.pasteplugin.Quirks
+ * @private
+ */
+define("tinymce/pasteplugin/WordFilter", [
+ "tinymce/util/Tools",
+ "tinymce/html/DomParser",
+ "tinymce/html/Schema",
+ "tinymce/html/Serializer",
+ "tinymce/html/Node",
+ "tinymce/pasteplugin/Utils"
+], function(Tools, DomParser, Schema, Serializer, Node, Utils) {
+ function isWordContent(content) {
+ return (/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i).test(content);
+ }
+
+ function WordFilter(editor) {
+ var settings = editor.settings;
+
+ editor.on('BeforePastePreProcess', function(e) {
+ var content = e.content, retainStyleProperties, validStyles;
+
+ retainStyleProperties = settings.paste_retain_style_properties;
+ if (retainStyleProperties) {
+ validStyles = Tools.makeMap(retainStyleProperties);
+ }
+
+ /**
+ * Converts fake bullet and numbered lists to real semantic OL/UL.
+ *
+ * @param {tinymce.html.Node} node Root node to convert children of.
+ */
+ function convertFakeListsToProperLists(node) {
+ var currentListNode, prevListNode, lastLevel = 1;
+
+ function convertParagraphToLi(paragraphNode, listStartTextNode, listName, start) {
+ var level = paragraphNode._listLevel || lastLevel;
+
+ // Handle list nesting
+ if (level != lastLevel) {
+ if (level < lastLevel) {
+ // Move to parent list
+ if (currentListNode) {
+ currentListNode = currentListNode.parent.parent;
+ }
+ } else {
+ // Create new list
+ prevListNode = currentListNode;
+ currentListNode = null;
+ }
+ }
+
+ if (!currentListNode || currentListNode.name != listName) {
+ prevListNode = prevListNode || currentListNode;
+ currentListNode = new Node(listName, 1);
+
+ if (start > 1) {
+ currentListNode.attr('start', '' + start);
+ }
+
+ paragraphNode.wrap(currentListNode);
+ } else {
+ currentListNode.append(paragraphNode);
+ }
+
+ paragraphNode.name = 'li';
+ listStartTextNode.value = '';
+
+ var nextNode = listStartTextNode.next;
+ if (nextNode && nextNode.type == 3) {
+ nextNode.value = nextNode.value.replace(/^\u00a0+/, '');
+ }
+
+ // Append list to previous list if it exists
+ if (level > lastLevel && prevListNode) {
+ prevListNode.lastChild.append(currentListNode);
+ }
+
+ lastLevel = level;
+ }
+
+ var paragraphs = node.getAll('p');
+
+ for (var i = 0; i < paragraphs.length; i++) {
+ node = paragraphs[i];
+
+ if (node.name == 'p' && node.firstChild) {
+ // Find first text node in paragraph
+ var nodeText = '';
+ var listStartTextNode = node.firstChild;
+
+ while (listStartTextNode) {
+ nodeText = listStartTextNode.value;
+ if (nodeText) {
+ break;
+ }
+
+ listStartTextNode = listStartTextNode.firstChild;
+ }
+
+ // Detect unordered lists look for bullets
+ if (/^\s*[\u2022\u00b7\u00a7\u00d8\u25CF]\s*$/.test(nodeText)) {
+ convertParagraphToLi(node, listStartTextNode, 'ul');
+ continue;
+ }
+
+ // Detect ordered lists 1., a. or ixv.
+ if (/^\s*\w+\.$/.test(nodeText)) {
+ // Parse OL start number
+ var matches = /([0-9])\./.exec(nodeText);
+ var start = 1;
+ if (matches) {
+ start = parseInt(matches[1], 10);
+ }
+
+ convertParagraphToLi(node, listStartTextNode, 'ol', start);
+ continue;
+ }
+
+ currentListNode = null;
+ }
+ }
+ }
+
+ function filterStyles(node, styleValue) {
+ // Parse out list indent level for lists
+ if (node.name === 'p') {
+ var matches = /mso-list:\w+ \w+([0-9]+)/.exec(styleValue);
+
+ if (matches) {
+ node._listLevel = parseInt(matches[1], 10);
+ }
+ }
+
+ if (editor.getParam("paste_retain_style_properties", "none")) {
+ var outputStyle = "";
+
+ Tools.each(editor.dom.parseStyle(styleValue), function(value, name) {
+ // Convert various MS styles to W3C styles
+ switch (name) {
+ case "horiz-align":
+ name = "text-align";
+ return;
+
+ case "vert-align":
+ name = "vertical-align";
+ return;
+
+ case "font-color":
+ case "mso-foreground":
+ name = "color";
+ return;
+
+ case "mso-background":
+ case "mso-highlight":
+ name = "background";
+ break;
+ }
+
+ // Output only valid styles
+ if (retainStyleProperties == "all" || (validStyles && validStyles[name])) {
+ outputStyle += name + ':' + value + ';';
+ }
+ });
+
+ if (outputStyle) {
+ return outputStyle;
+ }
+ }
+
+ return null;
+ }
+
+ if (settings.paste_enable_default_filters === false) {
+ return;
+ }
+
+ // Detect is the contents is Word junk HTML
+ if (isWordContent(e.content)) {
+ e.wordContent = true; // Mark it for other processors
+
+ // Remove basic Word junk
+ content = Utils.filter(content, [
+ // Word comments like conditional comments etc
+ /<!--[\s\S]+?-->/gi,
+
+ // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content,
+ // MS Office namespaced tags, and a few other tags
+ /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
+
+ // Convert <s> into <strike> for line-though
+ [/<(\/?)s>/gi, "<$1strike>"],
+
+ // Replace nsbp entites to char since it's easier to handle
+ [/ /gi, "\u00a0"],
+
+ // Convert <span style="mso-spacerun:yes">___</span> to string of alternating
+ // breaking/non-breaking spaces of same length
+ [/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
+ function(str, spaces) {
+ return (spaces.length > 0) ?
+ spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : "";
+ }
+ ]
+ ]);
+
+ var validElements = settings.paste_word_valid_elements;
+ if (!validElements) {
+ validElements = '@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' +
+ '-table,-tr,-td[colspan|rowspan],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br';
+ }
+
+ // Setup strict schema
+ var schema = new Schema({
+ valid_elements: validElements
+ });
+
+ // Parse HTML into DOM structure
+ var domParser = new DomParser({}, schema);
+
+ domParser.addAttributeFilter('style', function(nodes) {
+ var i = nodes.length, node;
+
+ while (i--) {
+ node = nodes[i];
+ node.attr('style', filterStyles(node, node.attr('style')));
+
+ // Remove pointess spans
+ if (node.name == 'span' && !node.attributes.length) {
+ node.unwrap();
+ }
+ }
+ });
+
+ domParser.addNodeFilter('a', function(nodes) {
+ var i = nodes.length, node, href, name;
+
+ while (i--) {
+ node = nodes[i];
+ href = node.attr('href');
+ name = node.attr('name');
+
+ if (href && href.indexOf('file://') === 0) {
+ href = href.split('#')[1];
+ if (href) {
+ href = '#' + href;
+ }
+ }
+
+ if (!href && !name) {
+ node.unwrap();
+ } else {
+ node.attr({
+ href: href,
+ name: name
+ });
+ }
+ }
+ });
+ // Parse into DOM structure
+ var rootNode = domParser.parse(content);
+
+ // Process DOM
+ convertFakeListsToProperLists(rootNode);
+
+ // Serialize DOM back to HTML
+ e.content = new Serializer({}, schema).serialize(rootNode);
+ }
+ });
+ }
+
+ WordFilter.isWordContent = isWordContent;
+
+ return WordFilter;
+});
+
+// Included from: js/tinymce/plugins/paste/classes/Quirks.js
+
+/**
+ * Quirks.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains various fixes for browsers. These issues can not be feature
+ * detected since we have no direct control over the clipboard. However we might be able
+ * to remove some of these fixes once the browsers gets updated/fixed.
+ *
+ * @class tinymce.pasteplugin.Quirks
+ * @private
+ */
+define("tinymce/pasteplugin/Quirks", [
+ "tinymce/Env",
+ "tinymce/util/Tools",
+ "tinymce/pasteplugin/WordFilter",
+ "tinymce/pasteplugin/Utils"
+], function(Env, Tools, WordFilter, Utils) {
+ "use strict";
+
+ return function(editor) {
+ function addPreProcessFilter(filterFunc) {
+ editor.on('BeforePastePreProcess', function(e) {
+ e.content = filterFunc(e.content);
+ });
+ }
+
+ /**
+ * Removes WebKit fragment comments and converted-space spans.
+ *
+ * This:
+ * <!--StartFragment-->a<span class="Apple-converted-space"> </span>b<!--EndFragment-->
+ *
+ * Becomes:
+ * a b
+ */
+ function removeWebKitFragments(html) {
+ html = Utils.filter(html, [
+ /^[\s\S]*<!--StartFragment-->|<!--EndFragment-->[\s\S]*$/g, // WebKit fragment
+ [/<span class="Apple-converted-space">\u00a0<\/span>/g, '\u00a0'], // WebKit
+ /<br>$/ // Traling BR elements
+ ]);
+
+ return html;
+ }
+
+ /**
+ * Removes BR elements after block elements. IE9 has a nasty bug where it puts a BR element after each
+ * block element when pasting from word. This removes those elements.
+ *
+ * This:
+ * <p>a</p><br><p>b</p>
+ *
+ * Becomes:
+ * <p>a</p><p>b</p>
+ */
+ function removeExplorerBrElementsAfterBlocks(html) {
+ // Only filter word specific content
+ if (!WordFilter.isWordContent(html)) {
+ return html;
+ }
+
+ // Produce block regexp based on the block elements in schema
+ var blockElements = [];
+
+ Tools.each(editor.schema.getBlockElements(), function(block, blockName) {
+ blockElements.push(blockName);
+ });
+
+ var explorerBlocksRegExp = new RegExp(
+ '(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*',
+ 'g'
+ );
+
+ // Remove BR:s from: <BLOCK>X</BLOCK><BR>
+ html = Utils.filter(html, [
+ [explorerBlocksRegExp, '$1']
+ ]);
+
+ // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break
+ html = Utils.filter(html, [
+ [/<br><br>/g, '<BR><BR>'], // Replace multiple BR elements with uppercase BR to keep them intact
+ [/<br>/g, ' '], // Replace single br elements with space since they are word wrap BR:s
+ [/<BR><BR>/g, '<br>'] // Replace back the double brs but into a single BR
+ ]);
+
+ return html;
+ }
+
+ /**
+ * WebKit has a nasty bug where the all runtime styles gets added to style attributes when copy/pasting contents.
+ * This fix solves that by simply removing the whole style attribute.
+ *
+ * Todo: This can be made smarter. Keeping styles that override existing ones etc.
+ *
+ * @param {String} content Content that needs to be processed.
+ * @return {String} Processed contents.
+ */
+ function removeWebKitStyles(content) {
+ if (editor.settings.paste_remove_styles || editor.settings.paste_remove_styles_if_webkit !== false) {
+ content = content.replace(/ style=\"[^\"]+\"/g, '');
+ }
+
+ return content;
+ }
+
+ // Sniff browsers and apply fixes since we can't feature detect
+ if (Env.webkit) {
+ addPreProcessFilter(removeWebKitStyles);
+ addPreProcessFilter(removeWebKitFragments);
+ }
+
+ if (Env.ie) {
+ addPreProcessFilter(removeExplorerBrElementsAfterBlocks);
+ }
+ };
+});
+
+// Included from: js/tinymce/plugins/paste/classes/Plugin.js
+
+/**
+ * Plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains the tinymce plugin logic for the paste plugin.
+ *
+ * @class tinymce.pasteplugin.Plugin
+ * @private
+ */
+define("tinymce/pasteplugin/Plugin", [
+ "tinymce/PluginManager",
+ "tinymce/pasteplugin/Clipboard",
+ "tinymce/pasteplugin/WordFilter",
+ "tinymce/pasteplugin/Quirks"
+], function(PluginManager, Clipboard, WordFilter, Quirks) {
+ var userIsInformed;
+
+ PluginManager.add('paste', function(editor) {
+ var self = this, clipboard, settings = editor.settings;
+
+ function togglePlainTextPaste() {
+ if (clipboard.pasteFormat == "text") {
+ this.active(false);
+ clipboard.pasteFormat = "html";
+ } else {
+ clipboard.pasteFormat = "text";
+ this.active(true);
+
+ if (!userIsInformed) {
+ editor.windowManager.alert(
+ 'Paste is now in plain text mode. Contents will now ' +
+ 'be pasted as plain text until you toggle this option off.'
+ );
+
+ userIsInformed = true;
+ }
+ }
+ }
+
+ self.clipboard = clipboard = new Clipboard(editor);
+ self.quirks = new Quirks(editor);
+ self.wordFilter = new WordFilter(editor);
+
+ if (editor.settings.paste_as_text) {
+ self.clipboard.pasteFormat = "text";
+ }
+
+ if (settings.paste_preprocess) {
+ editor.on('PastePreProcess', function(e) {
+ settings.paste_preprocess.call(self, self, e);
+ });
+ }
+
+ if (settings.paste_postprocess) {
+ editor.on('PastePostProcess', function(e) {
+ settings.paste_postprocess.call(self, self, e);
+ });
+ }
+
+ editor.addCommand('mceInsertClipboardContent', function(ui, value) {
+ if (value.content) {
+ self.clipboard.pasteHtml(value.content);
+ }
+
+ if (value.text) {
+ self.clipboard.pasteText(value.text);
+ }
+ });
+
+ // Block all drag/drop events
+ if (editor.paste_block_drop) {
+ editor.on('dragend dragover draggesture dragdrop drop drag', function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ });
+ }
+
+ // Prevent users from dropping data images on Gecko
+ if (!editor.settings.paste_data_images) {
+ editor.on('drop', function(e) {
+ var dataTransfer = e.dataTransfer;
+
+ if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) {
+ e.preventDefault();
+ }
+ });
+ }
+
+ editor.addButton('pastetext', {
+ icon: 'pastetext',
+ tooltip: 'Paste as text',
+ onclick: togglePlainTextPaste,
+ active: self.clipboard.pasteFormat == "text"
+ });
+
+ editor.addMenuItem('pastetext', {
+ text: 'Paste as text',
+ selectable: true,
+ active: clipboard.pasteFormat,
+ onclick: togglePlainTextPaste
+ });
+ });
+});
+
+expose(["tinymce/pasteplugin/Utils","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks","tinymce/pasteplugin/Plugin"]);
+})(this);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginspastepluginminjsfromrev26862trunksrcwpincludesjstinymcepluginspasteeditor_pluginjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/paste/plugin.min.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/paste/editor_plugin.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/paste/plugin.min.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/paste/plugin.min.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){for(var r=0;r<n.length;r++){for(var i=e,o=n[r],a=o.split(/[.\/]/),l=0;l<a.length-1;++l)i[a[l]]===t&&(i[a[l]]={}),i=i[a[l]];i[a[a.length-1]]=s[o]}}var s={},l="tinymce/pasteplugin/Utils",c="tinymce/util/Tools",d="tinymce/html/DomParser&quo
t;,u="tinymce/html/Schema",f="tinymce/pasteplugin/Clipboard",p="tinymce/Env",m="tinymce/util/VK",h="tinymce/pasteplugin/WordFilter",g="tinymce/html/Serializer",v="tinymce/html/Node",y="tinymce/pasteplugin/Quirks",b="tinymce/pasteplugin/Plugin",C="tinymce/PluginManager";r(l,[c,d,u],function(e,t,n){function r(t,n){return e.each(n,function(e){t=e.constructor==RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t}function i(r){function i(e){var t=e.name,n=e;if("br"===t)return s+="\n",void 0;if(l[t]&&(s+=" "),c[t])return s+=" ",void 0;if(3==e.type&&(s+=e.value),!e.shortEnded&&(e=e.firstChild))do i(e);while(e=e.next);d[t]&&n.next&&(s+="\n","p"==t&&(s+="\n"))}var o=new n,a=new t({},o),s="",l=o.getShortEndedElements(),c=e.makeMap("script noscript style texta
rea video audio iframe object"," "),d=o.getBlockElements();return i(a.parse(r)),s}return{filter:r,innerText:i}}),r(f,[p,m,l],function(e,t,n){return function(r){function i(e){var t,n=r.dom;if(t=r.fire("BeforePastePreProcess",{content:e}),t=r.fire("PastePreProcess",t),e=t.content,!t.isDefaultPrevented()){if(r.hasEventListeners("PastePostProcess")&&!t.isDefaultPrevented()){var i=n.add(r.getBody(),"div",{style:"display:none"},e);t=r.fire("PastePostProcess",{node:i}),n.remove(i),e=t.node.innerHTML}t.isDefaultPrevented()||r.insertContent(e)}}function o(e){e=r.dom.encode(e).replace(/\r\n/g,"\n");var t=r.dom.getParent(r.selection.getStart(),r.dom.isBlock),o=r.settings.forced_root_block,a;o&&(a=r.dom.createHTML(o,r.settings.forced_root_block_attrs),a=a.substr(0,a.length-3)+">"),t&&/^(PRE|DIV)$/.test(t.nodeName)||!o?e=n.filter(e,[[/\n/g,"<br>"]]):(e=n.filte
r(e,[[/\n\n/g,"</p>"+a],[/^(.*<\/p>)(<p>)$/,a+"$1"],[/\n/g,"<br />"]]),-1!=e.indexOf("<p>")&&(e=a+e)),i(e)}function a(){var e=r.dom,t=r.getBody(),n=r.dom.getViewPort(r.getWin()),i=r.inline?t.clientHeight:n.h;s(),p=e.add(r.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"1",style:"position: fixed; top: 20px;width: 10px; height: "+(i-40)+"px; overflow: hidden; opacity: 0"},g),e.setStyle(p,"left","rtl"==e.getStyle(t,"direction",!0)?65535:-65535),e.bind(p,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),m=r.selection.getRng(),p.focus(),r.selection.select(p,!0)}function s(){p&&(r.dom.unbind(p),r.dom.remove(p),m&&r.selection.setRng(m)),v=!1,p=m=null}function l(){return p?p.innerHTML:g}function c(e){var t={};if(e&&e.types){t["text/plain"]=
e.getData("Text");for(var n=0;n<e.types.length;n++){var r=e.types[n];t[r]=e.getData(r)}}return t}function d(e){return c(e.clipboardData||r.getDoc().dataTransfer)}function u(e){var t=r.getDoc(),n;if(t.caretPositionFromPoint){var i=t.caretPositionFromPoint(e.pageX,e.pageY);n=t.createRange(),n.setStart(i.offsetNode,i.offset),n.collapse(!0)}else t.caretRangeFromPoint&&(n=t.caretRangeFromPoint(e.pageX,e.pageY));return n}var f=this,p,m,h=0,g="%MCEPASTEBIN%",v;r.on("keydown",function(n){if(!n.isDefaultPrevented()&&(t.metaKeyPressed(n)&&86==n.keyCode||n.shiftKey&&45==n.keyCode)){if(v=n.shiftKey&&86==n.keyCode,n.stopImmediatePropagation(),h=(new Date).getTime(),e.ie&&v)return n.preventDefault(),r.fire("paste",{ieFake:!0}),void 0;a()}}),r.on("paste",function(t){var c=d(t),u=(new Date).getTime()-h<1e3,m="text"==f.pasteFormat||v;u||t.preventDefault(),!e.ie||u&&!t.ieFake||(a(
),r.dom.bind(p,"paste",function(e){e.stopPropagation()}),r.getDoc().execCommand("Paste",!1,null),c["text/html"]=l()),setTimeout(function(){var e=l();return p&&p.firstChild&&"mcepastebin"===p.firstChild.id&&(m=!0),s(),e!=g&&u||(e=c["text/html"]||c["text/plain"]||g,e!=g)?(m?o(c["text/plain"]||n.innerText(e)):i(e),void 0):(u||r.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."),void 0)},0)}),r.on("dragstart",function(e){e.dataTransfer.types&&e.dataTransfer.setData("mce-internal",r.selection.getContent())}),r.on("drop",function(e){var t=u(e);if(t){var n=c(e.dataTransfer),a=n["mce-internal"]||n["text/html"]||n["text/plain"];a&&(e.preventDefault(),r.undoManager.transact(function(){n["mce-internal"]&&r.execCommand("Delete"),r.selection.setRng(t
),n["text/html"]?i(a):o(a)}))}}),f.pasteHtml=i,f.pasteText=o,r.on("preInit",function(){r.parser.addNodeFilter("img",function(t){if(!r.settings.paste_data_images)for(var n=t.length;n--;){var i=t[n].attributes.map.src;i&&0===i.indexOf("data:image")&&(t[n].attr("data-mce-object")||i===e.transparentSrc||t[n].remove())}})}),r.on("PreProcess",function(){r.dom.remove(r.dom.get("mcepastebin"))})}}),r(h,[c,d,u,g,v,l],function(e,t,n,r,i,o){function a(e){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(e)}function s(s){var l=s.settings;s.on("BeforePastePreProcess",function(c){function d(e){function t(e,t,a,s){var l=e._listLevel||o;l!=o&&(o>l?n&&(n=n.parent.parent):(r=n,n=null)),n&&n.name==a?n.append(e):(r=r||n,n=new i(a,1),s>1&&n.attr("start",""+s),e.wrap(
n)),e.name="li",t.value="";var c=t.next;c&&3==c.type&&(c.value=c.value.replace(/^\u00a0+/,"")),l>o&&r&&r.lastChild.append(n),o=l}for(var n,r,o=1,a=e.getAll("p"),s=0;s<a.length;s++)if(e=a[s],"p"==e.name&&e.firstChild){for(var l="",c=e.firstChild;c&&!(l=c.value);)c=c.firstChild;if(/^\s*[\u2022\u00b7\u00a7\u00d8\u25CF]\s*$/.test(l)){t(e,c,"ul");continue}if(/^\s*\w+\.$/.test(l)){var d=/([0-9])\./.exec(l),u=1;d&&(u=parseInt(d[1],10)),t(e,c,"ol",u);continue}n=null}}function u(t,n){if("p"===t.name){var r=/mso-list:\w+ \w+([0-9]+)/.exec(n);r&&(t._listLevel=parseInt(r[1],10))}if(s.getParam("paste_retain_style_properties","none")){var i="";if(e.each(s.dom.parseStyle(n),function(e,t){switch(t){case"horiz-align":return t="text-align",void 0;case"vert-align":return t="vertic
al-align",void 0;case"font-color":case"mso-foreground":return t="color",void 0;case"mso-background":case"mso-highlight":t="background"}("all"==p||m&&m[t])&&(i+=t+":"+e+";")}),i)return i}return null}var f=c.content,p,m;if(p=l.paste_retain_style_properties,p&&(m=e.makeMap(p)),l.paste_enable_default_filters!==!1&&a(c.content)){c.wordContent=!0,f=o.filter(f,[/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var h=l.past
e_word_valid_elements;h||(h="@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-table,-tr,-td[colspan|rowspan],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br");var g=new n({valid_elements:h}),v=new t({},g);v.addAttributeFilter("style",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("style",u(n,n.attr("style"))),"span"!=n.name||n.attributes.length||n.unwrap()}),v.addNodeFilter("a",function(e){for(var t=e.length,n,r,i;t--;)n=e[t],r=n.attr("href"),i=n.attr("name"),r&&0===r.indexOf("file://")&&(r=r.split("#")[1],r&&(r="#"+r)),r||i?n.attr({href:r,name:i}):n.unwrap()});var y=v.parse(f);d(y),c.content=new r({},g).serialize(y)}})}return s.isWordContent=a,s}),r(y,[p,c,h,l],function(e,t,n,r){return function(i){function o(e){i.on("BeforePastePreProcess",function(t){t.content=e(t.content)})}function a(e){return e=r.filt
er(e,[/^[\s\S]*<!--StartFragment-->|<!--EndFragment-->[\s\S]*$/g,[/<span class="Apple-converted-space">\u00a0<\/span>/g,"\xa0"],/<br>$/])}function s(e){if(!n.isWordContent(e))return e;var o=[];t.each(i.schema.getBlockElements(),function(e,t){o.push(t)});var a=new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+o.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g");return e=r.filter(e,[[a,"$1"]]),e=r.filter(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function l(e){return(i.settings.paste_remove_styles||i.settings.paste_remove_styles_if_webkit!==!1)&&(e=e.replace(/ style=\"[^\"]+\"/g,"")),e}e.webkit&&(o(l),o(a)),e.ie&&o(s)}}),r(b,[C,f,h,y],function(e,t,n,r){var i;e.add("paste",function
(e){function o(){"text"==s.pasteFormat?(this.active(!1),s.pasteFormat="html"):(s.pasteFormat="text",this.active(!0),i||(e.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),i=!0))}var a=this,s,l=e.settings;a.clipboard=s=new t(e),a.quirks=new r(e),a.wordFilter=new n(e),e.settings.paste_as_text&&(a.clipboard.pasteFormat="text"),l.paste_preprocess&&e.on("PastePreProcess",function(e){l.paste_preprocess.call(a,a,e)}),l.paste_postprocess&&e.on("PastePostProcess",function(e){l.paste_postprocess.call(a,a,e)}),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&a.clipboard.pasteHtml(t.content),t.text&&a.clipboard.pasteText(t.text)}),e.paste_block_drop&&e.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),e.se
ttings.paste_data_images||e.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()}),e.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:o,active:"text"==a.clipboard.pasteFormat}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:s.pasteFormat,onclick:o})})}),a([l,f,h,y,b])}(this);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsspellcheckerconfigphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/spellchecker/config.php (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/spellchecker/config.php 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/spellchecker/config.php 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> * @package MCManager.includes
</span><span class="cx"> */
</span><span class="cx"> // General settings
</span><del>- $config['general.engine'] = 'GoogleSpell';
</del><ins>+// $config['general.engine'] = 'GoogleSpell';
</ins><span class="cx"> //$config['general.engine'] = 'PSpell';
</span><span class="cx"> //$config['general.engine'] = 'PSpellShell';
</span><span class="cx"> //$config['general.remote_rpc_url'] = 'http://some.other.site/some/url/rpc.php';
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsspellcheckereditor_pluginjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-(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;g.rpcUrl=e.getParam("spellchecker_rpc_url","{backend}");if(g.rpcUrl=="{backend}"){if(tinymce.isIE){return}g.hasSupport=true;e.onContextMenu.addToTop(function(h,i){if(g.active){return false}})}e.addCommand("mceSpellCheck",function(){if(g.rpcUrl=="{backend}"){g.editor.getBody().spellcheck=g.active=!g.active;return}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);if(e.getParam("spellchecker_report_no_misspellings",true)){e.windowManager.alert("spellchecker.no_mpell")}}})}else{g._done()}});if(e.settings.content_css!==false){e.contentCSS.push(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.selec
tedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h=="spellchecker"){if(f.rpcUrl=="{backend}"){if(f.hasSupport){g=d.createButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f})}return g}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);f.menuItems={};c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){if(n==f.selectedLang){return}f._updateMenu(l);f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);f.menuItems[n]=l;if(n==f.selectedLang){f.selectedItem=l}})});return g}},setLanguage:function(e){var d=this;if(e==d.selectedLang){return}if(tinymce.grep(d.languages,function(f){return f===e}).length===0){throw"Unknown language: "+e}d.selectedLang=e;if(d.menuItems){d._updateM
enu(d.menuItems[e])}if(d.active){d._done()}},_updateMenu:function(d){d.setSelected(1);this.selectedItem.setSelected(0);this.selectedItem=d},_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!"#$%&()*+,-./:;<=>?@[]^_{|}\xA7\xA9\xAB\xAE\xB1\xB6\xB7\xB8\xBB\xBC\xBD\xBE\xBF\xD7\xF7\xA4\u201d\u201c');for(d=0;d<f.length;d++){e+="\\"+f.charAt(d)}return e},_getWords:function(){var e=this.editor,g=[],d="",f={},h=[];this._walk(e.getBody(),function(i){if(i.nodeType==3){d+=i.nodeValue+" "}});if(e.getParam("spellchecker_word_pattern")){h=d.match("("+e.getParam("spellchecker_word_pattern")+")","gi")}else{d=d.repla
ce(new RegExp("([0-9]|["+this._getSeparators()+"])","g")," ");d=tinymce.trim(d.replace(/(\s+)/g," "));h=d.split(" ")}c(h,function(i){if(!f[i]){g.push(i);f[i]=1}});return g},_removeWords:function(d){var e=this.editor,h=e.dom,g=e.selection,f=g.getRng(true);c(h.select("span").reverse(),function(i){if(i&&(h.hasClass(i,"mceItemHiddenSpellWord")||h.hasClass(i,"mceItemHidden"))){if(!d||h.decode(i.innerHTML)==d){h.remove(i,1)}}});g.setRng(f)},_markWords:function(l){var h=this.editor,g=h.dom,j=h.getDoc(),i=h.selection,d=i.getRng(true),e=[],k=l.join("|"),m=this._getSeparators(),f=new RegExp("(^|["+m+"])("+k+")(?=["+m+"]|$)","g");this._walk(h.getBody(),function(o){if(o.nodeType==3){e.push(o)}});c(e,function(t){var r,q,o,s,p=t.nodeValue;f.lastIndex=0;if(f.test(p)){p=g.encode(p);q=g.create("span",{"class":"mceItemHi
dden"});if(tinymce.isIE){p=p.replace(f,"$1<mcespell>$2</mcespell>");while((s=p.indexOf("<mcespell>"))!=-1){o=p.substring(0,s);if(o.length){r=j.createTextNode(g.decode(o));q.appendChild(r)}p=p.substring(s+10);s=p.indexOf("</mcespell>");o=p.substring(0,s);p=p.substring(s+11);q.appendChild(g.create("span",{"class":"mceItemHiddenSpellWord"},o))}if(p.length){r=j.createTextNode(g.decode(p));q.appendChild(r)}}else{q.innerHTML=p.replace(f,'$1<span class="mceItemHiddenSpellWord">$2</span>')}g.replace(q,t)}});i.setRng(d)},_showMenu:function(h,j){var i=this,h=i.editor,d=i._menu,l,k=h.dom,g=k.getViewPort(h.getWin()),f=j.target;j=0;if(!d){d=h.controlManager.createDropMenu("spellcheckermenu",{"class":"mceNoIcons"});i._menu=d}if(k.hasClass(f,"mceItemHiddenSpellWord")){d.removeAll();d.add({title:"spellchecker.wait","class":"m
ceMenuItemTitle"}).setDisabled(1);i._sendRPC("getSuggestions",[i.selectedLang,k.decode(f.innerHTML)],function(m){var e;d.removeAll();if(m.length>0){d.add({title:"spellchecker.sug","class":"mceMenuItemTitle"}).setDisabled(1);c(m,function(n){d.add({title:n,onclick:function(){k.replace(h.getDoc().createTextNode(n),f);i._checkDone()}})});d.addSeparator()}else{d.add({title:"spellchecker.no_sug","class":"mceMenuItemTitle"}).setDisabled(1)}if(h.getParam("show_ignore_words",true)){e=i.editor.getParam("spellchecker_enable_ignore_rpc","");d.add({title:"spellchecker.ignore_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}}});d.add({title:"spellchecker.ignore_words",onclick:function(){var n=f.innerHTML;i._removeWords(k.decode(n));i
._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWords",[i.selectedLang,n],function(o){h.setProgressState(0)})}}})}if(i.editor.getParam("spellchecker_enable_learn_rpc")){d.add({title:"spellchecker.learn_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();h.setProgressState(1);i._sendRPC("learnWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}})}d.update()});l=b.getPos(h.getContentAreaContainer());d.settings.offset_x=l.x;d.settings.offset_y=l.y;h.selection.select(f);l=k.getPos(f);d.showMenu(l.x,l.y+f.offsetHeight-g.y);return tinymce.dom.Event.cancel(j)}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.nodeChange
d()}}},_sendRPC:function(e,g,d){var f=this;a.sendRPC({url:f.rpcUrl,method:e,params:g,success:d,error:function(i,h){f.editor.setProgressState(0);f.editor.windowManager.alert(i.errstr||("Error response: "+h.responseText))}})}});tinymce.PluginManager.add("spellchecker",tinymce.plugins.SpellcheckerPlugin)})();
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsspellcheckereditor_plugin_srcjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin_src.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin_src.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin_src.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,471 +0,0 @@
</span><del>-/**
- * editor_plugin_src.js
- *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
- *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
- */
-
-(function() {
- var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = 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(ed, url) {
- var t = this, cm;
-
- t.url = url;
- t.editor = ed;
- t.rpcUrl = ed.getParam("spellchecker_rpc_url", "{backend}");
-
- if (t.rpcUrl == '{backend}') {
- // Sniff if the browser supports native spellchecking (Don't know of a better way)
- if (tinymce.isIE)
- return;
-
- t.hasSupport = true;
-
- // Disable the context menu when spellchecking is active
- ed.onContextMenu.addToTop(function(ed, e) {
- if (t.active)
- return false;
- });
- }
-
- // Register commands
- ed.addCommand('mceSpellCheck', function() {
- if (t.rpcUrl == '{backend}') {
- // Enable/disable native spellchecker
- t.editor.getBody().spellcheck = t.active = !t.active;
- return;
- }
-
- if (!t.active) {
- ed.setProgressState(1);
- t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) {
- if (r.length > 0) {
- t.active = 1;
- t._markWords(r);
- ed.setProgressState(0);
- ed.nodeChanged();
- } else {
- ed.setProgressState(0);
-
- if (ed.getParam('spellchecker_report_no_misspellings', true))
- ed.windowManager.alert('spellchecker.no_mpell');
- }
- });
- } else
- t._done();
- });
-
- if (ed.settings.content_css !== false)
- ed.contentCSS.push(url + '/css/content.css');
-
- ed.onClick.add(t._showMenu, t);
- ed.onContextMenu.add(t._showMenu, t);
- ed.onBeforeGetContent.add(function() {
- if (t.active)
- t._removeWords();
- });
-
- ed.onNodeChange.add(function(ed, cm) {
- cm.setActive('spellchecker', t.active);
- });
-
- ed.onSetContent.add(function() {
- t._done();
- });
-
- ed.onBeforeGetContent.add(function() {
- t._done();
- });
-
- ed.onBeforeExecCommand.add(function(ed, cmd) {
- if (cmd == 'mceFullScreen')
- t._done();
- });
-
- // Find selected language
- t.languages = {};
- 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) {
- if (k.indexOf('+') === 0) {
- k = k.substring(1);
- t.selectedLang = v;
- }
-
- t.languages[k] = v;
- });
- },
-
- createControl : function(n, cm) {
- var t = this, c, ed = t.editor;
-
- if (n == 'spellchecker') {
- // Use basic button if we use the native spellchecker
- if (t.rpcUrl == '{backend}') {
- // Create simple toggle button if we have native support
- if (t.hasSupport)
- c = cm.createButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t});
-
- return c;
- }
-
- c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t});
-
- c.onRenderMenu.add(function(c, m) {
- m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
- t.menuItems = {};
- each(t.languages, function(v, k) {
- var o = {icon : 1}, mi;
-
- o.onclick = function() {
- if (v == t.selectedLang) {
- return;
- }
- t._updateMenu(mi);
- t.selectedLang = v;
- };
-
- o.title = k;
- mi = m.add(o);
- mi.setSelected(v == t.selectedLang);
- t.menuItems[v] = mi;
- if (v == t.selectedLang)
- t.selectedItem = mi;
- });
- });
-
-
-
- return c;
- }
- },
-
- setLanguage: function(lang) {
- var t = this;
-
- if (lang == t.selectedLang) {
- // allowed
- return;
- }
-
- if (tinymce.grep(t.languages, function(v) { return v === lang; }).length === 0) {
- throw "Unknown language: " + lang;
- }
-
- t.selectedLang = lang;
-
- // if the menu has been shown, update it as well
- if (t.menuItems) {
- t._updateMenu(t.menuItems[lang]);
- }
-
- if (t.active) {
- // clear error in the old language.
- t._done();
-
- // Don't immediately block the UI to check spelling in the new language, this is an API not a user action.
- }
- },
-
- // Internal functions
-
- _updateMenu: function(mi) {
- mi.setSelected(1);
- this.selectedItem.setSelected(0);
- this.selectedItem = mi;
- },
-
- _walk : function(n, f) {
- var d = this.editor.getDoc(), w;
-
- if (d.createTreeWalker) {
- w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);
-
- while ((n = w.nextNode()) != null)
- f.call(this, n);
- } else
- tinymce.walk(n, f, 'childNodes');
- },
-
- _getSeparators : function() {
- var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}\xA7\xA9\xAB\xAE\xB1\xB6\xB7\xB8\xBB\xBC\xBD\xBE\xBF\xD7\xF7\xA4\u201d\u201c');
-
- // Build word separator regexp
- for (i=0; i<str.length; i++)
- re += '\\' + str.charAt(i);
-
- return re;
- },
-
- _getWords : function() {
- var ed = this.editor, wl = [], tx = '', lo = {}, rawWords = [];
-
- // Get area text
- this._walk(ed.getBody(), function(n) {
- if (n.nodeType == 3)
- tx += n.nodeValue + ' ';
- });
-
- // split the text up into individual words
- if (ed.getParam('spellchecker_word_pattern')) {
- // look for words that match the pattern
- rawWords = tx.match('(' + ed.getParam('spellchecker_word_pattern') + ')', 'gi');
- } else {
- // Split words by separator
- tx = tx.replace(new RegExp('([0-9]|[' + this._getSeparators() + '])', 'g'), ' ');
- tx = tinymce.trim(tx.replace(/(\s+)/g, ' '));
- rawWords = tx.split(' ');
- }
-
- // Build word array and remove duplicates
- each(rawWords, function(v) {
- if (!lo[v]) {
- wl.push(v);
- lo[v] = 1;
- }
- });
-
- return wl;
- },
-
- _removeWords : function(w) {
- var ed = this.editor, dom = ed.dom, se = ed.selection, r = se.getRng(true);
-
- each(dom.select('span').reverse(), function(n) {
- if (n && (dom.hasClass(n, 'mceItemHiddenSpellWord') || dom.hasClass(n, 'mceItemHidden'))) {
- if (!w || dom.decode(n.innerHTML) == w)
- dom.remove(n, 1);
- }
- });
-
- se.setRng(r);
- },
-
- _markWords : function(wl) {
- var ed = this.editor, dom = ed.dom, doc = ed.getDoc(), se = ed.selection, r = se.getRng(true), nl = [],
- w = wl.join('|'), re = this._getSeparators(), rx = new RegExp('(^|[' + re + '])(' + w + ')(?=[' + re + ']|$)', 'g');
-
- // Collect all text nodes
- this._walk(ed.getBody(), function(n) {
- if (n.nodeType == 3) {
- nl.push(n);
- }
- });
-
- // Wrap incorrect words in spans
- each(nl, function(n) {
- var node, elem, txt, pos, v = n.nodeValue;
-
- rx.lastIndex = 0;
- if (rx.test(v)) {
- // Encode the content
- v = dom.encode(v);
- // Create container element
- elem = dom.create('span', {'class' : 'mceItemHidden'});
-
- // Following code fixes IE issues by creating text nodes
- // using DOM methods instead of innerHTML.
- // Bug #3124: <PRE> elements content is broken after spellchecking.
- // Bug #1408: Preceding whitespace characters are removed
- // @TODO: I'm not sure that both are still issues on IE9.
- if (tinymce.isIE) {
- // Enclose mispelled words with temporal tag
- v = v.replace(rx, '$1<mcespell>$2</mcespell>');
- // Loop over the content finding mispelled words
- while ((pos = v.indexOf('<mcespell>')) != -1) {
- // Add text node for the content before the word
- txt = v.substring(0, pos);
- if (txt.length) {
- node = doc.createTextNode(dom.decode(txt));
- elem.appendChild(node);
- }
- v = v.substring(pos+10);
- pos = v.indexOf('</mcespell>');
- txt = v.substring(0, pos);
- v = v.substring(pos+11);
- // Add span element for the word
- elem.appendChild(dom.create('span', {'class' : 'mceItemHiddenSpellWord'}, txt));
- }
- // Add text node for the rest of the content
- if (v.length) {
- node = doc.createTextNode(dom.decode(v));
- elem.appendChild(node);
- }
- } else {
- // Other browsers preserve whitespace characters on innerHTML usage
- elem.innerHTML = v.replace(rx, '$1<span class="mceItemHiddenSpellWord">$2</span>');
- }
-
- // Finally, replace the node with the container
- dom.replace(elem, n);
- }
- });
-
- se.setRng(r);
- },
-
- _showMenu : function(ed, e) {
- var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()), wordSpan = e.target;
-
- e = 0; // Fixes IE memory leak
-
- if (!m) {
- m = ed.controlManager.createDropMenu('spellcheckermenu', {'class' : 'mceNoIcons'});
- t._menu = m;
- }
-
- if (dom.hasClass(wordSpan, 'mceItemHiddenSpellWord')) {
- m.removeAll();
- m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
-
- t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(wordSpan.innerHTML)], function(r) {
- var ignoreRpc;
-
- m.removeAll();
-
- if (r.length > 0) {
- m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
- each(r, function(v) {
- m.add({title : v, onclick : function() {
- dom.replace(ed.getDoc().createTextNode(v), wordSpan);
- t._checkDone();
- }});
- });
-
- m.addSeparator();
- } else
- m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
-
- if (ed.getParam('show_ignore_words', true)) {
- ignoreRpc = t.editor.getParam("spellchecker_enable_ignore_rpc", '');
- m.add({
- title : 'spellchecker.ignore_word',
- onclick : function() {
- var word = wordSpan.innerHTML;
-
- dom.remove(wordSpan, 1);
- t._checkDone();
-
- // tell the server if we need to
- if (ignoreRpc) {
- ed.setProgressState(1);
- t._sendRPC('ignoreWord', [t.selectedLang, word], function(r) {
- ed.setProgressState(0);
- });
- }
- }
- });
-
- m.add({
- title : 'spellchecker.ignore_words',
- onclick : function() {
- var word = wordSpan.innerHTML;
-
- t._removeWords(dom.decode(word));
- t._checkDone();
-
- // tell the server if we need to
- if (ignoreRpc) {
- ed.setProgressState(1);
- t._sendRPC('ignoreWords', [t.selectedLang, word], function(r) {
- ed.setProgressState(0);
- });
- }
- }
- });
- }
-
- if (t.editor.getParam("spellchecker_enable_learn_rpc")) {
- m.add({
- title : 'spellchecker.learn_word',
- onclick : function() {
- var word = wordSpan.innerHTML;
-
- dom.remove(wordSpan, 1);
- t._checkDone();
-
- ed.setProgressState(1);
- t._sendRPC('learnWord', [t.selectedLang, word], function(r) {
- ed.setProgressState(0);
- });
- }
- });
- }
-
- m.update();
- });
-
- p1 = DOM.getPos(ed.getContentAreaContainer());
- m.settings.offset_x = p1.x;
- m.settings.offset_y = p1.y;
-
- ed.selection.select(wordSpan);
- p1 = dom.getPos(wordSpan);
- m.showMenu(p1.x, p1.y + wordSpan.offsetHeight - vp.y);
-
- return tinymce.dom.Event.cancel(e);
- } else
- m.hideMenu();
- },
-
- _checkDone : function() {
- var t = this, ed = t.editor, dom = ed.dom, o;
-
- each(dom.select('span'), function(n) {
- if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) {
- o = true;
- return false;
- }
- });
-
- if (!o)
- t._done();
- },
-
- _done : function() {
- var t = this, la = t.active;
-
- if (t.active) {
- t.active = 0;
- t._removeWords();
-
- if (t._menu)
- t._menu.hideMenu();
-
- if (la)
- t.editor.nodeChanged();
- }
- },
-
- _sendRPC : function(m, p, cb) {
- var t = this;
-
- JSONRequest.sendRPC({
- url : t.rpcUrl,
- method : m,
- params : p,
- success : cb,
- error : function(e, x) {
- t.editor.setProgressState(0);
- t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText));
- }
- });
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin);
-})();
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsspellcheckerpluginjsfromrev26862trunksrcwpincludesjstinymcepluginsspellcheckereditor_plugin_srcjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/spellchecker/plugin.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin_src.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/spellchecker/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/spellchecker/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,672 @@
</span><ins>+/**
+ * Compiled inline version. (Library mode)
+ */
+
+/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
+/*globals $code */
+
+(function(exports, undefined) {
+ "use strict";
+
+ var modules = {};
+
+ function require(ids, callback) {
+ var module, defs = [];
+
+ for (var i = 0; i < ids.length; ++i) {
+ module = modules[ids[i]] || resolve(ids[i]);
+ if (!module) {
+ throw 'module definition dependecy not found: ' + ids[i];
+ }
+
+ defs.push(module);
+ }
+
+ callback.apply(null, defs);
+ }
+
+ function define(id, dependencies, definition) {
+ if (typeof id !== 'string') {
+ throw 'invalid module definition, module id must be defined and be a string';
+ }
+
+ if (dependencies === undefined) {
+ throw 'invalid module definition, dependencies must be specified';
+ }
+
+ if (definition === undefined) {
+ throw 'invalid module definition, definition function must be specified';
+ }
+
+ require(dependencies, function() {
+ modules[id] = definition.apply(null, arguments);
+ });
+ }
+
+ function defined(id) {
+ return !!modules[id];
+ }
+
+ function resolve(id) {
+ var target = exports;
+ var fragments = id.split(/[.\/]/);
+
+ for (var fi = 0; fi < fragments.length; ++fi) {
+ if (!target[fragments[fi]]) {
+ return;
+ }
+
+ target = target[fragments[fi]];
+ }
+
+ return target;
+ }
+
+ function expose(ids) {
+ for (var i = 0; i < ids.length; i++) {
+ var target = exports;
+ var id = ids[i];
+ var fragments = id.split(/[.\/]/);
+
+ for (var fi = 0; fi < fragments.length - 1; ++fi) {
+ if (target[fragments[fi]] === undefined) {
+ target[fragments[fi]] = {};
+ }
+
+ target = target[fragments[fi]];
+ }
+
+ target[fragments[fragments.length - 1]] = modules[id];
+ }
+ }
+
+// Included from: js/tinymce/plugins/spellchecker/classes/DomTextMatcher.js
+
+/**
+ * DomTextMatcher.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class logic for filtering text and matching words.
+ *
+ * @class tinymce.spellcheckerplugin.TextFilter
+ * @private
+ */
+define("tinymce/spellcheckerplugin/DomTextMatcher", [], function() {
+ // Based on work developed by: James Padolsey http://james.padolsey.com
+ // released under UNLICENSE that is compatible with LGPL
+ // TODO: Handle contentEditable edgecase:
+ // <p>text<span contentEditable="false">text<span contentEditable="true">text</span>text</span>text</p>
+ return function(regex, node, schema) {
+ var m, matches = [], text, count = 0, doc;
+ var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap;
+
+ doc = node.ownerDocument;
+ blockElementsMap = schema.getBlockElements(); // H1-H6, P, TD etc
+ hiddenTextElementsMap = schema.getWhiteSpaceElements(); // TEXTAREA, PRE, STYLE, SCRIPT
+ shortEndedElementsMap = schema.getShortEndedElements(); // BR, IMG, INPUT
+
+ function getMatchIndexes(m) {
+ if (!m[0]) {
+ throw 'findAndReplaceDOMText cannot handle zero-length matches';
+ }
+
+ var index = m.index;
+
+ return [index, index + m[0].length, [m[0]]];
+ }
+
+ function getText(node) {
+ var txt;
+
+ if (node.nodeType === 3) {
+ return node.data;
+ }
+
+ if (hiddenTextElementsMap[node.nodeName] && !blockElementsMap[node.nodeName]) {
+ return '';
+ }
+
+ txt = '';
+
+ if (blockElementsMap[node.nodeName] || shortEndedElementsMap[node.nodeName]) {
+ txt += '\n';
+ }
+
+ if ((node = node.firstChild)) {
+ do {
+ txt += getText(node);
+ } while ((node = node.nextSibling));
+ }
+
+ return txt;
+ }
+
+ function stepThroughMatches(node, matches, replaceFn) {
+ var startNode, endNode, startNodeIndex,
+ endNodeIndex, innerNodes = [], atIndex = 0, curNode = node,
+ matchLocation = matches.shift(), matchIndex = 0;
+
+ out: while (true) {
+ if (blockElementsMap[curNode.nodeName] || shortEndedElementsMap[curNode.nodeName]) {
+ atIndex++;
+ }
+
+ if (curNode.nodeType === 3) {
+ if (!endNode && curNode.length + atIndex >= matchLocation[1]) {
+ // We've found the ending
+ endNode = curNode;
+ endNodeIndex = matchLocation[1] - atIndex;
+ } else if (startNode) {
+ // Intersecting node
+ innerNodes.push(curNode);
+ }
+
+ if (!startNode && curNode.length + atIndex > matchLocation[0]) {
+ // We've found the match start
+ startNode = curNode;
+ startNodeIndex = matchLocation[0] - atIndex;
+ }
+
+ atIndex += curNode.length;
+ }
+
+ if (startNode && endNode) {
+ curNode = replaceFn({
+ startNode: startNode,
+ startNodeIndex: startNodeIndex,
+ endNode: endNode,
+ endNodeIndex: endNodeIndex,
+ innerNodes: innerNodes,
+ match: matchLocation[2],
+ matchIndex: matchIndex
+ });
+
+ // replaceFn has to return the node that replaced the endNode
+ // and then we step back so we can continue from the end of the
+ // match:
+ atIndex -= (endNode.length - endNodeIndex);
+ startNode = null;
+ endNode = null;
+ innerNodes = [];
+ matchLocation = matches.shift();
+ matchIndex++;
+
+ if (!matchLocation) {
+ break; // no more matches
+ }
+ } else if ((!hiddenTextElementsMap[curNode.nodeName] || blockElementsMap[curNode.nodeName]) && curNode.firstChild) {
+ // Move down
+ curNode = curNode.firstChild;
+ continue;
+ } else if (curNode.nextSibling) {
+ // Move forward:
+ curNode = curNode.nextSibling;
+ continue;
+ }
+
+ // Move forward or up:
+ while (true) {
+ if (curNode.nextSibling) {
+ curNode = curNode.nextSibling;
+ break;
+ } else if (curNode.parentNode !== node) {
+ curNode = curNode.parentNode;
+ } else {
+ break out;
+ }
+ }
+ }
+ }
+
+ /**
+ * Generates the actual replaceFn which splits up text nodes
+ * and inserts the replacement element.
+ */
+ function genReplacer(nodeName) {
+ var makeReplacementNode;
+
+ if (typeof nodeName != 'function') {
+ var stencilNode = nodeName.nodeType ? nodeName : doc.createElement(nodeName);
+
+ makeReplacementNode = function(fill, matchIndex) {
+ var clone = stencilNode.cloneNode(false);
+
+ clone.setAttribute('data-mce-index', matchIndex);
+
+ if (fill) {
+ clone.appendChild(doc.createTextNode(fill));
+ }
+
+ return clone;
+ };
+ } else {
+ makeReplacementNode = nodeName;
+ }
+
+ return function replace(range) {
+ var before, after, parentNode, startNode = range.startNode,
+ endNode = range.endNode, matchIndex = range.matchIndex;
+
+ if (startNode === endNode) {
+ var node = startNode;
+
+ parentNode = node.parentNode;
+ if (range.startNodeIndex > 0) {
+ // Add `before` text node (before the match)
+ before = doc.createTextNode(node.data.substring(0, range.startNodeIndex));
+ parentNode.insertBefore(before, node);
+ }
+
+ // Create the replacement node:
+ var el = makeReplacementNode(range.match[0], matchIndex);
+ parentNode.insertBefore(el, node);
+ if (range.endNodeIndex < node.length) {
+ // Add `after` text node (after the match)
+ after = doc.createTextNode(node.data.substring(range.endNodeIndex));
+ parentNode.insertBefore(after, node);
+ }
+
+ node.parentNode.removeChild(node);
+
+ return el;
+ } else {
+ // Replace startNode -> [innerNodes...] -> endNode (in that order)
+ before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex));
+ after = doc.createTextNode(endNode.data.substring(range.endNodeIndex));
+ var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex);
+ var innerEls = [];
+
+ for (var i = 0, l = range.innerNodes.length; i < l; ++i) {
+ var innerNode = range.innerNodes[i];
+ var innerEl = makeReplacementNode(innerNode.data, matchIndex);
+ innerNode.parentNode.replaceChild(innerEl, innerNode);
+ innerEls.push(innerEl);
+ }
+
+ var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex);
+
+ parentNode = startNode.parentNode;
+ parentNode.insertBefore(before, startNode);
+ parentNode.insertBefore(elA, startNode);
+ parentNode.removeChild(startNode);
+
+ parentNode = endNode.parentNode;
+ parentNode.insertBefore(elB, endNode);
+ parentNode.insertBefore(after, endNode);
+ parentNode.removeChild(endNode);
+
+ return elB;
+ }
+ };
+ }
+
+ text = getText(node);
+ if (text && regex.global) {
+ while ((m = regex.exec(text))) {
+ matches.push(getMatchIndexes(m));
+ }
+ }
+
+ function filter(callback) {
+ var filteredMatches = [];
+
+ each(function(match, i) {
+ if (callback(match, i)) {
+ filteredMatches.push(match);
+ }
+ });
+
+ matches = filteredMatches;
+
+ /*jshint validthis:true*/
+ return this;
+ }
+
+ function each(callback) {
+ for (var i = 0, l = matches.length; i < l; i++) {
+ if (callback(matches[i], i) === false) {
+ break;
+ }
+ }
+
+ /*jshint validthis:true*/
+ return this;
+ }
+
+ function mark(replacementNode) {
+ if (matches.length) {
+ count = matches.length;
+ stepThroughMatches(node, matches, genReplacer(replacementNode));
+ }
+
+ /*jshint validthis:true*/
+ return this;
+ }
+
+ return {
+ text: text,
+ count: count,
+ matches: matches,
+ each: each,
+ filter: filter,
+ mark: mark
+ };
+ };
+});
+
+// Included from: js/tinymce/plugins/spellchecker/classes/Plugin.js
+
+/**
+ * Plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint camelcase:false */
+
+/**
+ * This class contains all core logic for the spellchecker plugin.
+ *
+ * @class tinymce.spellcheckerplugin.Plugin
+ * @private
+ */
+define("tinymce/spellcheckerplugin/Plugin", [
+ "tinymce/spellcheckerplugin/DomTextMatcher",
+ "tinymce/PluginManager",
+ "tinymce/util/Tools",
+ "tinymce/ui/Menu",
+ "tinymce/dom/DOMUtils",
+ "tinymce/util/JSONRequest",
+ "tinymce/util/URI"
+], function(DomTextMatcher, PluginManager, Tools, Menu, DOMUtils, JSONRequest, URI) {
+ PluginManager.add('spellchecker', function(editor, url) {
+ var lastSuggestions, started, suggestionsMenu, settings = editor.settings;
+
+ function isEmpty(obj) {
+ /*jshint unused:false*/
+ for (var name in obj) {
+ return false;
+ }
+
+ return true;
+ }
+
+ function showSuggestions(target, word) {
+ var items = [], suggestions = lastSuggestions[word];
+
+ Tools.each(suggestions, function(suggestion) {
+ items.push({
+ text: suggestion,
+ onclick: function() {
+ editor.insertContent(suggestion);
+ checkIfFinished();
+ }
+ });
+ });
+
+ items.push.apply(items, [
+ {text: '-'},
+
+ {text: 'Ignore', onclick: function() {
+ ignoreWord(target, word);
+ }},
+
+ {text: 'Ignore all', onclick: function() {
+ ignoreWord(target, word, true);
+ }},
+
+ {text: 'Finish', onclick: finish}
+ ]);
+
+ // Render menu
+ suggestionsMenu = new Menu({
+ items: items,
+ context: 'contextmenu',
+ onautohide: function(e) {
+ if (e.target.className.indexOf('spellchecker') != -1) {
+ e.preventDefault();
+ }
+ },
+ onhide: function() {
+ suggestionsMenu.remove();
+ suggestionsMenu = null;
+ }
+ });
+
+ suggestionsMenu.renderTo(document.body);
+
+ // Position menu
+ var pos = DOMUtils.DOM.getPos(editor.getContentAreaContainer());
+ var targetPos = editor.dom.getPos(target);
+
+ pos.x += targetPos.x;
+ pos.y += targetPos.y;
+
+ suggestionsMenu.moveTo(pos.x, pos.y + target.offsetHeight);
+ }
+
+ function spellcheck() {
+ var textFilter, words = [], uniqueWords = {};
+
+ if (started) {
+ finish();
+ return;
+ }
+
+ started = true;
+
+ function doneCallback(suggestions) {
+ editor.setProgressState(false);
+
+ if (isEmpty(suggestions)) {
+ editor.windowManager.alert('No misspellings found');
+ started = false;
+ return;
+ }
+
+ lastSuggestions = suggestions;
+
+ textFilter.filter(function(match) {
+ return !!suggestions[match[2][0]];
+ }).mark(editor.dom.create('span', {
+ "class": 'mce-spellchecker-word',
+ "data-mce-bogus": 1
+ }));
+
+ textFilter = null;
+ editor.fire('SpellcheckStart');
+ }
+
+ // Regexp for finding word specific characters this will split words by
+ // spaces, quotes, copy right characters etc. It's escaped with unicode characters
+ // to make it easier to output scripts on servers using different encodings
+ // so if you add any characters outside the 128 byte range make sure to escape it
+ var nonWordSeparatorCharacters = editor.getParam('spellchecker_wordchar_pattern') || new RegExp("[^" +
+ "\\s!\"#$%&()*+,-./:;<=>?@[\\]^_{|}`" +
+ "\u00a7\u00a9\u00ab\u00ae\u00b1\u00b6\u00b7\u00b8\u00bb" +
+ "\u00bc\u00bd\u00be\u00bf\u00d7\u00f7\u00a4\u201d\u201c\u201e" +
+ "]+", "g");
+
+ // Find all words and make an unique words array
+ textFilter = new DomTextMatcher(nonWordSeparatorCharacters, editor.getBody(), editor.schema).each(function(match) {
+ var word = match[2][0];
+
+ // TODO: Fix so it remembers correctly spelled words
+ if (!uniqueWords[word]) {
+ // Ignore numbers and single character words
+ if (/^\d+$/.test(word) || word.length == 1) {
+ return;
+ }
+
+ words.push(word);
+ uniqueWords[word] = true;
+ }
+ });
+
+ function defaultSpellcheckCallback(method, words, doneCallback) {
+ JSONRequest.sendRPC({
+ url: new URI(url).toAbsolute(settings.spellchecker_rpc_url),
+ method: method,
+ params: {
+ lang: settings.spellchecker_language || "en",
+ words: words
+ },
+ success: function(result) {
+ doneCallback(result);
+ },
+ error: function(error, xhr) {
+ if (error == "JSON Parse error.") {
+ error = "Non JSON response:" + xhr.responseText;
+ } else {
+ error = "Error: " + error;
+ }
+
+ editor.windowManager.alert(error);
+ editor.setProgressState(false);
+ textFilter = null;
+ started = false;
+ }
+ });
+ }
+
+ editor.setProgressState(true);
+
+ var spellCheckCallback = settings.spellchecker_callback || defaultSpellcheckCallback;
+ spellCheckCallback("spellcheck", words, doneCallback);
+ }
+
+ function checkIfFinished() {
+ if (!editor.dom.select('span.mce-spellchecker-word').length) {
+ finish();
+ }
+ }
+
+ function unwrap(node) {
+ var parentNode = node.parentNode;
+ parentNode.insertBefore(node.firstChild, node);
+ node.parentNode.removeChild(node);
+ }
+
+ function ignoreWord(target, word, all) {
+ if (all) {
+ Tools.each(editor.dom.select('span.mce-spellchecker-word'), function(item) {
+ var text = item.innerText || item.textContent;
+
+ if (text == word) {
+ unwrap(item);
+ }
+ });
+ } else {
+ unwrap(target);
+ }
+
+ checkIfFinished();
+ }
+
+ function finish() {
+ var i, nodes, node;
+
+ started = false;
+ node = editor.getBody();
+ nodes = node.getElementsByTagName('span');
+ i = nodes.length;
+ while (i--) {
+ node = nodes[i];
+ if (node.getAttribute('data-mce-index')) {
+ unwrap(node);
+ }
+ }
+
+ editor.fire('SpellcheckEnd');
+ }
+
+ function selectMatch(index) {
+ var nodes, i, spanElm, spanIndex = -1, startContainer, endContainer;
+
+ index = "" + index;
+ nodes = editor.getBody().getElementsByTagName("span");
+ for (i = 0; i < nodes.length; i++) {
+ spanElm = nodes[i];
+ if (spanElm.className == "mce-spellchecker-word") {
+ spanIndex = spanElm.getAttribute('data-mce-index');
+ if (spanIndex === index) {
+ spanIndex = index;
+
+ if (!startContainer) {
+ startContainer = spanElm.firstChild;
+ }
+
+ endContainer = spanElm.firstChild;
+ }
+
+ if (spanIndex !== index && endContainer) {
+ break;
+ }
+ }
+ }
+
+ var rng = editor.dom.createRng();
+ rng.setStart(startContainer, 0);
+ rng.setEnd(endContainer, endContainer.length);
+ editor.selection.setRng(rng);
+
+ return rng;
+ }
+
+ editor.on('click', function(e) {
+ if (e.target.className == "mce-spellchecker-word") {
+ e.preventDefault();
+
+ var rng = selectMatch(e.target.getAttribute('data-mce-index'));
+ showSuggestions(e.target, rng.toString());
+ }
+ });
+
+ editor.addMenuItem('spellchecker', {
+ text: 'Spellcheck',
+ context: 'tools',
+ onclick: spellcheck,
+ selectable: true,
+ onPostRender: function() {
+ var self = this;
+
+ editor.on('SpellcheckStart SpellcheckEnd', function() {
+ self.active(started);
+ });
+ }
+ });
+
+ editor.addButton('spellchecker', {
+ tooltip: 'Spellcheck',
+ onclick: spellcheck,
+ onPostRender: function() {
+ var self = this;
+
+ editor.on('SpellcheckStart SpellcheckEnd', function() {
+ self.active(started);
+ });
+ }
+ });
+
+ editor.on('remove', function() {
+ if (suggestionsMenu) {
+ suggestionsMenu.remove();
+ suggestionsMenu = null;
+ }
+ });
+ });
+});
+
+expose(["tinymce/spellcheckerplugin/DomTextMatcher","tinymce/spellcheckerplugin/Plugin"]);
+})(this);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsspellcheckerpluginminjsfromrev26862trunksrcwpincludesjstinymcepluginsspellcheckereditor_pluginjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/spellchecker/plugin.min.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/spellchecker/plugin.min.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/spellchecker/plugin.min.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+!function(e,t){"use strict";function n(e,t){for(var n,r=[],o=0;o<e.length;++o){if(n=c[e[o]]||i(e[o]),!n)throw"module definition dependecy not found: "+e[o];r.push(n)}t.apply(null,r)}function r(e,r,o){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(o===t)throw"invalid module definition, definition function must be specified";n(r,function(){c[e]=o.apply(null,arguments)})}function o(e){return!!c[e]}function i(t){for(var n=e,r=t.split(/[.\/]/),o=0;o<r.length;++o){if(!n[r[o]])return;n=n[r[o]]}return n}function a(n){for(var r=0;r<n.length;r++){for(var o=e,i=n[r],a=i.split(/[.\/]/),l=0;l<a.length-1;++l)o[a[l]]===t&&(o[a[l]]={}),o=o[a[l]];o[a[a.length-1]]=c[i]}}var c={},l="tinymce/spellcheckerplugin/DomTextMatcher",d="tinymce/spellcheckerplugin/Plugin",s=&
quot;tinymce/PluginManager",u="tinymce/util/Tools",f="tinymce/ui/Menu",h="tinymce/dom/DOMUtils",g="tinymce/util/JSONRequest",p="tinymce/util/URI";r(l,[],function(){return function(e,t,n){function r(e){if(!e[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var t=e.index;return[t,t+e[0].length,[e[0]]]}function o(e){var t;if(3===e.nodeType)return e.data;if(m[e.nodeName]&&!p[e.nodeName])return"";if(t="",(p[e.nodeName]||v[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=o(e);while(e=e.nextSibling);return t}function i(e,t,n){var r,o,i,a,c=[],l=0,d=e,s=t.shift(),u=0;e:for(;;){if((p[d.nodeName]||v[d.nodeName])&&l++,3===d.nodeType&&(!o&&d.length+l>=s[1]?(o=d,a=s[1]-l):r&&c.push(d),!r&&d.length+l>s[0]&&(r=d,i=s[0]-l),l+=d.length),r&&o){if(d=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:a,innerNodes:c,
match:s[2],matchIndex:u}),l-=o.length-a,r=null,o=null,c=[],s=t.shift(),u++,!s)break}else{if((!m[d.nodeName]||p[d.nodeName])&&d.firstChild){d=d.firstChild;continue}if(d.nextSibling){d=d.nextSibling;continue}}for(;;){if(d.nextSibling){d=d.nextSibling;break}if(d.parentNode===e)break e;d=d.parentNode}}}function a(e){var t;if("function"!=typeof e){var n=e.nodeType?e:g.createElement(e);t=function(e,t){var r=n.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(g.createTextNode(e)),r}}else t=e;return function r(e){var n,r,o,i=e.startNode,a=e.endNode,c=e.matchIndex;if(i===a){var l=i;o=l.parentNode,e.startNodeIndex>0&&(n=g.createTextNode(l.data.substring(0,e.startNodeIndex)),o.insertBefore(n,l));var d=t(e.match[0],c);return o.insertBefore(d,l),e.endNodeIndex<l.length&&(r=g.createTextNode(l.data.substring(e.endNodeIndex)),o.insertBefore(r,l)),l.parentNode.removeChild(l),d}n=g.createTextNode(i.data.substring(0,e.sta
rtNodeIndex)),r=g.createTextNode(a.data.substring(e.endNodeIndex));for(var s=t(i.data.substring(e.startNodeIndex),c),u=[],f=0,h=e.innerNodes.length;h>f;++f){var p=e.innerNodes[f],m=t(p.data,c);p.parentNode.replaceChild(m,p),u.push(m)}var v=t(a.data.substring(0,e.endNodeIndex),c);return o=i.parentNode,o.insertBefore(n,i),o.insertBefore(s,i),o.removeChild(i),o=a.parentNode,o.insertBefore(v,a),o.insertBefore(r,a),o.removeChild(a),v}}function c(e){var t=[];return l(function(n,r){e(n,r)&&t.push(n)}),u=t,this}function l(e){for(var t=0,n=u.length;n>t&&e(u[t],t)!==!1;t++);return this}function d(e){return u.length&&(h=u.length,i(t,u,a(e))),this}var s,u=[],f,h=0,g,p,m,v;if(g=t.ownerDocument,p=n.getBlockElements(),m=n.getWhiteSpaceElements(),v=n.getShortEndedElements(),f=o(t),f&&e.global)for(;s=e.exec(f);)u.push(r(s));return{text:f,count:h,matches:u,each:l,filter:c,mark:d}}}),r(d,[l,s,u,f,h,g,p],function(e,t,n,r,o,i,a){t.add("spellchecker",functi
on(t,c){function l(e){for(var t in e)return!1;return!0}function d(e,i){var a=[],c=m[i];n.each(c,function(e){a.push({text:e,onclick:function(){t.insertContent(e),u()}})}),a.push.apply(a,[{text:"-"},{text:"Ignore",onclick:function(){h(e,i)}},{text:"Ignore all",onclick:function(){h(e,i,!0)}},{text:"Finish",onclick:g}]),N=new r({items:a,context:"contextmenu",onautohide:function(e){-1!=e.target.className.indexOf("spellchecker")&&e.preventDefault()},onhide:function(){N.remove(),N=null}}),N.renderTo(document.body);var l=o.DOM.getPos(t.getContentAreaContainer()),d=t.dom.getPos(e);l.x+=d.x,l.y+=d.y,N.moveTo(l.x,l.y+e.offsetHeight)}function s(){function n(e){return t.setProgressState(!1),l(e)?(t.windowManager.alert("No misspellings found"),v=!1,void 0):(m=e,o.filter(function(t){return!!e[t[2][0]]}).mark(t.dom.create("span",{"class":"mce-spellchecker-word","data-mce-bogus":1}))
,o=null,t.fire("SpellcheckStart"),void 0)}function r(e,n,r){i.sendRPC({url:new a(c).toAbsolute(x.spellchecker_rpc_url),method:e,params:{lang:x.spellchecker_language||"en",words:n},success:function(e){r(e)},error:function(e,n){e="JSON Parse error."==e?"Non JSON response:"+n.responseText:"Error: "+e,t.windowManager.alert(e),t.setProgressState(!1),o=null,v=!1}})}var o,d=[],s={};if(v)return g(),void 0;v=!0;var u=t.getParam("spellchecker_wordchar_pattern")||new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e]+',"g");o=new e(u,t.getBody(),t.schema).each(function(e){var t=e[2][0];if(!s[t]){if(/^\d+$/.test(t)||1==t.length)return;d.push(t),s[t]=!0}}),t.setProgressState(!0);var f=x.spellchecker_callback||r;f("spellcheck",d,n)}function u(){t.dom.select("span.mce-spellchecker-word").length||g()}function f(e){var t
=e.parentNode;t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function h(e,r,o){o?n.each(t.dom.select("span.mce-spellchecker-word"),function(e){var t=e.innerText||e.textContent;t==r&&f(e)}):f(e),u()}function g(){var e,n,r;for(v=!1,r=t.getBody(),n=r.getElementsByTagName("span"),e=n.length;e--;)r=n[e],r.getAttribute("data-mce-index")&&f(r);t.fire("SpellcheckEnd")}function p(e){var n,r,o,i=-1,a,c;for(e=""+e,n=t.getBody().getElementsByTagName("span"),r=0;r<n.length&&(o=n[r],"mce-spellchecker-word"!=o.className||(i=o.getAttribute("data-mce-index"),i===e&&(i=e,a||(a=o.firstChild),c=o.firstChild),i===e||!c));r++);var l=t.dom.createRng();return l.setStart(a,0),l.setEnd(c,c.length),t.selection.setRng(l),l}var m,v,N,x=t.settings;t.on("click",function(e){if("mce-spellchecker-word"==e.target.className){e.preventDefault();var t=p(e.target.getAttribute(
"data-mce-index"));d(e.target,t.toString())}}),t.addMenuItem("spellchecker",{text:"Spellcheck",context:"tools",onclick:s,selectable:!0,onPostRender:function(){var e=this;t.on("SpellcheckStart SpellcheckEnd",function(){e.active(v)})}}),t.addButton("spellchecker",{tooltip:"Spellcheck",onclick:s,onPostRender:function(){var e=this;t.on("SpellcheckStart SpellcheckEnd",function(){e.active(v)})}}),t.on("remove",function(){N&&(N.remove(),N=null)})})}),a([l,d])}(this);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsspellcheckerrpcphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/spellchecker/rpc.php (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/spellchecker/rpc.php 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/spellchecker/rpc.php 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -96,9 +96,10 @@
</span><span class="cx"> if (isset($config['general.engine'])) {
</span><span class="cx"> $spellchecker = new $config['general.engine']($config);
</span><span class="cx"> $result = call_user_func_array(array($spellchecker, $input['method']), $input['params']);
</span><del>-} else
- die('{"result":null,"id":null,"error":{"errstr":"You must choose an spellchecker engine in the config.php file.","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}');
-
</del><ins>+} else {
+// die('{"result":null,"id":null,"error":{"errstr":"You must choose an spellchecker engine in the config.php file.","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}');
+ die('{"error":"You must choose spellchecker engine in the config.php file."}');
+}
</ins><span class="cx"> // Request and response id should always be the same
</span><span class="cx"> $output = array(
</span><span class="cx"> "id" => $input->id,
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginstabfocuseditor_pluginjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/tabfocus/editor_plugin.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/tabfocus/editor_plugin.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/tabfocus/editor_plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(t){n=c.select(":input:enabled,*[tabindex]:not(iframe)");function s(v){return v.nodeName==="BODY"||(v.type!="hidden"&&!(v.style.display=="none")&&!(v.style.visibility=="hidden")&&s(v.parentNode))}function i(v){return v.attributes.tabIndex.specified||v.nodeName=="INPUT"||v.nodeName=="TEXTAREA"}function u(){return tinymce.isIE6||tinymce.isIE7}function r(v){return((!u()||i(v)))&&v.getAttribute("tabindex")!="-1"&&s(v)}d(n,function(w,v){if(w.id==l.id){j=v;return false}});if(t>0){for(m=j+1;m<n.length;m++){if(r(n[m])){return n[m]}}}else{for(m=j-1;m>=0;m--){if(r(n[m])){return n[m]}}}return nu
ll}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})();
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginstabfocuseditor_plugin_srcjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/tabfocus/editor_plugin_src.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/tabfocus/editor_plugin_src.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/tabfocus/editor_plugin_src.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,122 +0,0 @@
</span><del>-/**
- * editor_plugin_src.js
- *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
- *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
- */
-
-(function() {
- var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode;
-
- tinymce.create('tinymce.plugins.TabFocusPlugin', {
- init : function(ed, url) {
- function tabCancel(ed, e) {
- if (e.keyCode === 9)
- return Event.cancel(e);
- }
-
- function tabHandler(ed, e) {
- var x, i, f, el, v;
-
- function find(d) {
- el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
-
- function canSelectRecursive(e) {
- return e.nodeName==="BODY" || (e.type != 'hidden' &&
- !(e.style.display == "none") &&
- !(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode));
- }
- function canSelectInOldIe(el) {
- return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA";
- }
- function isOldIe() {
- return tinymce.isIE6 || tinymce.isIE7;
- }
- function canSelect(el) {
- return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el);
- }
-
- each(el, function(e, i) {
- if (e.id == ed.id) {
- x = i;
- return false;
- }
- });
- if (d > 0) {
- for (i = x + 1; i < el.length; i++) {
- if (canSelect(el[i]))
- return el[i];
- }
- } else {
- for (i = x - 1; i >= 0; i--) {
- if (canSelect(el[i]))
- return el[i];
- }
- }
-
- return null;
- }
-
- if (e.keyCode === 9) {
- v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next')));
-
- if (v.length == 1) {
- v[1] = v[0];
- v[0] = ':prev';
- }
-
- // Find element to focus
- if (e.shiftKey) {
- if (v[0] == ':prev')
- el = find(-1);
- else
- el = DOM.get(v[0]);
- } else {
- if (v[1] == ':next')
- el = find(1);
- else
- el = DOM.get(v[1]);
- }
-
- if (el) {
- if (el.id && (ed = tinymce.get(el.id || el.name)))
- ed.focus();
- else
- window.setTimeout(function() {
- if (!tinymce.isWebKit)
- window.focus();
- el.focus();
- }, 10);
-
- return Event.cancel(e);
- }
- }
- }
-
- ed.onKeyUp.add(tabCancel);
-
- if (tinymce.isGecko) {
- ed.onKeyPress.add(tabHandler);
- ed.onKeyDown.add(tabCancel);
- } else
- ed.onKeyDown.add(tabHandler);
-
- },
-
- getInfo : function() {
- return {
- longname : 'Tabfocus',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin);
-})();
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginstabfocuspluginjsfromrev26862trunksrcwpincludesjstinymcepluginstabfocuseditor_plugin_srcjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/tabfocus/plugin.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/tabfocus/editor_plugin_src.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/tabfocus/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/tabfocus/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,122 @@
</span><ins>+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('tabfocus', function(editor) {
+ var DOM = tinymce.DOM, each = tinymce.each, explode = tinymce.explode;
+
+ function tabCancel(e) {
+ if (e.keyCode === 9) {
+ e.preventDefault();
+ }
+ }
+
+ function tabHandler(e) {
+ var x, el, v, i;
+
+ function find(direction) {
+ el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
+
+ function canSelectRecursive(e) {
+ return e.nodeName==="BODY" || (e.type != 'hidden' &&
+ e.style.display != "none" &&
+ e.style.visibility != "hidden" && canSelectRecursive(e.parentNode));
+ }
+
+ function canSelectInOldIe(el) {
+ return el.tabIndex || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA";
+ }
+
+ function canSelect(el) {
+ return ((!canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el);
+ }
+
+ each(el, function(e, i) {
+ if (e.id == editor.id) {
+ x = i;
+ return false;
+ }
+ });
+ if (direction > 0) {
+ for (i = x + 1; i < el.length; i++) {
+ if (canSelect(el[i])) {
+ return el[i];
+ }
+ }
+ } else {
+ for (i = x - 1; i >= 0; i--) {
+ if (canSelect(el[i])) {
+ return el[i];
+ }
+ }
+ }
+
+ return null;
+ }
+
+ if (e.keyCode === 9) {
+ v = explode(editor.getParam('tab_focus', editor.getParam('tabfocus_elements', ':prev,:next')));
+
+ if (v.length == 1) {
+ v[1] = v[0];
+ v[0] = ':prev';
+ }
+
+ // Find element to focus
+ if (e.shiftKey) {
+ if (v[0] == ':prev') {
+ el = find(-1);
+ } else {
+ el = DOM.get(v[0]);
+ }
+ } else {
+ if (v[1] == ':next') {
+ el = find(1);
+ } else {
+ el = DOM.get(v[1]);
+ }
+ }
+
+ if (el) {
+ var focusEditor = tinymce.get(el.id || el.name);
+
+ if (el.id && focusEditor) {
+ focusEditor.focus();
+ } else {
+ window.setTimeout(function() {
+ if (!tinymce.Env.webkit) {
+ window.focus();
+ }
+
+ el.focus();
+ }, 10);
+ }
+
+ e.preventDefault();
+ }
+ }
+ }
+
+ editor.on('init', function() {
+ if (editor.inline) {
+ // Remove default tabIndex in inline mode
+ tinymce.DOM.setAttrib(editor.getBody(), 'tabIndex', null);
+ }
+ });
+
+ editor.on('keyup', tabCancel);
+
+ if (tinymce.Env.gecko) {
+ editor.on('keypress keydown', tabHandler);
+ } else {
+ editor.on('keydown', tabHandler);
+ }
+});
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginstabfocuspluginminjsfromrev26862trunksrcwpincludesjstinymcepluginstabfocuseditor_pluginjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/tabfocus/plugin.min.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/tabfocus/editor_plugin.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/tabfocus/plugin.min.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/tabfocus/plugin.min.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+tinymce.PluginManager.add("tabfocus",function(e){function n(e){9===e.keyCode&&e.preventDefault()}function t(n){function t(n){function t(e){return"BODY"===e.nodeName||"hidden"!=e.type&&"none"!=e.style.display&&"hidden"!=e.style.visibility&&t(e.parentNode)}function r(e){return e.tabIndex||"INPUT"==e.nodeName||"TEXTAREA"==e.nodeName}function a(e){return!r(e)&&"-1"!=e.getAttribute("tabindex")&&t(e)}if(d=i.select(":input:enabled,*[tabindex]:not(iframe)"),o(d,function(n,t){return n.id==e.id?(u=t,!1):void 0}),n>0){for(c=u+1;c<d.length;c++)if(a(d[c]))return d[c]}else for(c=u-1;c>=0;c--)if(a(d[c]))return d[c];return null}var u,d,a,c;if(9===n.keyCode&&(a=r(e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))),1==a.length&&(a[1]=a[0],a[0]=":prev"),d=n.shif
tKey?":prev"==a[0]?t(-1):i.get(a[0]):":next"==a[1]?t(1):i.get(a[1]))){var f=tinymce.get(d.id||d.name);d.id&&f?f.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),d.focus()},10),n.preventDefault()}}var i=tinymce.DOM,o=tinymce.each,r=tinymce.explode;e.on("init",function(){e.inline&&tinymce.DOM.setAttrib(e.getBody(),"tabIndex",null)}),e.on("keyup",n),tinymce.Env.gecko?e.on("keypress keydown",t):e.on("keydown",t)});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginstextcolorpluginjs"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/plugins/textcolor/plugin.js (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/textcolor/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/textcolor/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,152 @@
</span><ins>+/**
+ * plugin.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.PluginManager.add('textcolor', function(editor) {
+ function mapColors() {
+ var i, colors = [], colorMap;
+
+ colorMap = editor.settings.textcolor_map || [
+ "000000", "Black",
+ "993300", "Burnt orange",
+ "333300", "Dark olive",
+ "003300", "Dark green",
+ "003366", "Dark azure",
+ "000080", "Navy Blue",
+ "333399", "Indigo",
+ "333333", "Very dark gray",
+ "800000", "Maroon",
+ "FF6600", "Orange",
+ "808000", "Olive",
+ "008000", "Green",
+ "008080", "Teal",
+ "0000FF", "Blue",
+ "666699", "Grayish blue",
+ "808080", "Gray",
+ "FF0000", "Red",
+ "FF9900", "Amber",
+ "99CC00", "Yellow green",
+ "339966", "Sea green",
+ "33CCCC", "Turquoise",
+ "3366FF", "Royal blue",
+ "800080", "Purple",
+ "999999", "Medium gray",
+ "FF00FF", "Magenta",
+ "FFCC00", "Gold",
+ "FFFF00", "Yellow",
+ "00FF00", "Lime",
+ "00FFFF", "Aqua",
+ "00CCFF", "Sky blue",
+ "993366", "Brown",
+ "C0C0C0", "Silver",
+ "FF99CC", "Pink",
+ "FFCC99", "Peach",
+ "FFFF99", "Light yellow",
+ "CCFFCC", "Pale green",
+ "CCFFFF", "Pale cyan",
+ "99CCFF", "Light sky blue",
+ "CC99FF", "Plum",
+ "FFFFFF", "White"
+ ];
+
+ for (i = 0; i < colorMap.length; i += 2) {
+ colors.push({
+ text: colorMap[i + 1],
+ color: colorMap[i]
+ });
+ }
+
+ return colors;
+ }
+
+ function renderColorPicker() {
+ var ctrl = this, colors, color, html, last, rows, cols, x, y, i;
+
+ colors = mapColors();
+
+ html = '<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="presentation" cellspacing="0"><tbody>';
+ last = colors.length - 1;
+ rows = editor.settings.textcolor_rows || 5;
+ cols = editor.settings.textcolor_cols || 8;
+
+ for (y = 0; y < rows; y++) {
+ html += '<tr>';
+
+ for (x = 0; x < cols; x++) {
+ i = y * cols + x;
+
+ if (i > last) {
+ html += '<td></td>';
+ } else {
+ color = colors[i];
+ html += (
+ '<td>' +
+ '<div id="' + ctrl._id + '-' + i + '"' +
+ ' data-mce-color="' + color.color + '"' +
+ ' role="option"' +
+ ' tabIndex="-1"' +
+ ' style="' + (color ? 'background-color: #' + color.color : '') + '"' +
+ ' title="' + color.text + '">' +
+ '</div>' +
+ '</td>'
+ );
+ }
+ }
+
+ html += '</tr>';
+ }
+
+ html += '</tbody></table>';
+
+ return html;
+ }
+
+ function onPanelClick(e) {
+ var buttonCtrl = this.parent(), value;
+
+ if ((value = e.target.getAttribute('data-mce-color'))) {
+ buttonCtrl.hidePanel();
+ value = '#' + value;
+ buttonCtrl.color(value);
+ editor.execCommand(buttonCtrl.settings.selectcmd, false, value);
+ }
+ }
+
+ function onButtonClick() {
+ var self = this;
+
+ if (self._color) {
+ editor.execCommand(self.settings.selectcmd, false, self._color);
+ }
+ }
+
+ editor.addButton('forecolor', {
+ type: 'colorbutton',
+ tooltip: 'Text color',
+ selectcmd: 'ForeColor',
+ panel: {
+ html: renderColorPicker,
+ onclick: onPanelClick
+ },
+ onclick: onButtonClick
+ });
+
+ editor.addButton('backcolor', {
+ type: 'colorbutton',
+ tooltip: 'Background color',
+ selectcmd: 'HiliteColor',
+ panel: {
+ html: renderColorPicker,
+ onclick: onPanelClick
+ },
+ onclick: onButtonClick
+ });
+});
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/plugins/textcolor/plugin.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymcepluginstextcolorpluginminjs"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/plugins/textcolor/plugin.min.js (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/textcolor/plugin.min.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/textcolor/plugin.min.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+tinymce.PluginManager.add("textcolor",function(e){function o(){var o,t,r=[];for(t=e.settings.textcolor_map||["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blu
e","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Brown","C0C0C0","Silver","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum","FFFFFF","White"],o=0;o<t.length;o+=2)r.push({text:t[o+1],color:t[o]});return r}function t(){var t,r,l,c,n,a,F,i,d,u=this;for(t=o(),l='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="presentation" cellspacing="0"><tbody>',c=t.length-1,n=e.set
tings.textcolor_rows||5,a=e.settings.textcolor_cols||8,i=0;n>i;i++){for(l+="<tr>",F=0;a>F;F++)d=i*a+F,d>c?l+="<td></td>":(r=t[d],l+='<td><div id="'+u._id+"-"+d+'"'+' data-mce-color="'+r.color+'"'+' role="option"'+' tabIndex="-1"'+' style="'+(r?"background-color: #"+r.color:"")+'"'+' title="'+r.text+'">'+"</div>"+"</td>");l+="</tr>"}return l+="</tbody></table>"}function r(o){var t,r=this.parent();(t=o.target.getAttribute("data-mce-color"))&&(r.hidePanel(),t="#"+t,r.color(t),e.execCommand(r.settings.selectcmd,!1,t))}function l(){var o=this;o._color&&e.execCommand(o.settings.selectcmd,!1,o._color)}e.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",selectcmd:"ForeColor",panel:{html:t
,onclick:r},onclick:l}),e.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",selectcmd:"HiliteColor",panel:{html:t,onclick:r},onclick:l})});
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/plugins/textcolor/plugin.min.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymcepluginswordpresseditor_plugin_srcjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,448 +0,0 @@
</span><del>-/* global tinymce, getUserSetting, setUserSetting, switchEditors, autosave */
-/**
- * WordPress plugin.
- */
-
-(function() {
- var DOM = tinymce.DOM;
-
- tinymce.create('tinymce.plugins.WordPress', {
- init : function(ed, url) {
- var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML, closeOnClick, mod_key, style;
- moreHTML = '<img src="' + url + '/img/trans.gif" class="mce-wp-more mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
- nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mce-wp-nextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
-
- if ( getUserSetting('hidetb', '0') == '1' )
- ed.settings.wordpress_adv_hidden = 0;
-
- // Hides the specified toolbar and resizes the iframe
- ed.onPostRender.add(function() {
- var adv_toolbar = ed.controlManager.get(tbId);
- if ( ed.getParam('wordpress_adv_hidden', 1) && adv_toolbar ) {
- DOM.hide(adv_toolbar.id);
- t._resizeIframe(ed, tbId, 28);
- }
- });
-
- // Register commands
- ed.addCommand('WP_More', function() {
- ed.execCommand('mceInsertContent', 0, moreHTML);
- });
-
- ed.addCommand('WP_Page', function() {
- ed.execCommand('mceInsertContent', 0, nextpageHTML);
- });
-
- ed.addCommand('WP_Help', function() {
- ed.windowManager.open({
- url : tinymce.baseURL + '/wp-mce-help.php',
- width : 450,
- height : 420,
- inline : 1
- });
- });
-
- ed.addCommand('WP_Adv', function() {
- var cm = ed.controlManager, id = cm.get(tbId).id;
-
- if ( 'undefined' == id )
- return;
-
- if ( DOM.isHidden(id) ) {
- cm.setActive('wp_adv', 1);
- DOM.show(id);
- t._resizeIframe(ed, tbId, -28);
- ed.settings.wordpress_adv_hidden = 0;
- setUserSetting('hidetb', '1');
- } else {
- cm.setActive('wp_adv', 0);
- DOM.hide(id);
- t._resizeIframe(ed, tbId, 28);
- ed.settings.wordpress_adv_hidden = 1;
- setUserSetting('hidetb', '0');
- }
- });
-
- ed.addCommand('WP_Medialib', function() {
- if ( typeof wp !== 'undefined' && wp.media && wp.media.editor )
- wp.media.editor.open( ed.id );
- });
-
- // Register buttons
- ed.addButton('wp_more', {
- title : 'wordpress.wp_more_desc',
- cmd : 'WP_More'
- });
-
- ed.addButton('wp_page', {
- title : 'wordpress.wp_page_desc',
- image : url + '/img/page.gif',
- cmd : 'WP_Page'
- });
-
- ed.addButton('wp_help', {
- title : 'wordpress.wp_help_desc',
- cmd : 'WP_Help'
- });
-
- ed.addButton('wp_adv', {
- title : 'wordpress.wp_adv_desc',
- cmd : 'WP_Adv'
- });
-
- // Add Media button
- ed.addButton('add_media', {
- title : 'wordpress.add_media',
- image : url + '/img/image.gif',
- cmd : 'WP_Medialib'
- });
-
- // Add Media buttons to fullscreen and handle align buttons for image captions
- ed.onBeforeExecCommand.add(function(ed, cmd, ui, val, o) {
- var DOM = tinymce.DOM, n, DL, DIV, cls, a, align;
- if ( 'mceFullScreen' == cmd ) {
- if ( 'mce_fullscreen' != ed.id && DOM.select('a.thickbox').length )
- ed.settings.theme_advanced_buttons1 += ',|,add_media';
- }
-
- if ( 'JustifyLeft' == cmd || 'JustifyRight' == cmd || 'JustifyCenter' == cmd ) {
- n = ed.selection.getNode();
-
- if ( n.nodeName == 'IMG' ) {
- align = cmd.substr(7).toLowerCase();
- a = 'align' + align;
- DL = ed.dom.getParent(n, 'dl.wp-caption');
- DIV = ed.dom.getParent(n, 'div.mceTemp');
-
- if ( DL && DIV ) {
- cls = ed.dom.hasClass(DL, a) ? 'alignnone' : a;
- DL.className = DL.className.replace(/align[^ '"]+\s?/g, '');
- ed.dom.addClass(DL, cls);
-
- if (cls == 'aligncenter')
- ed.dom.addClass(DIV, 'mceIEcenter');
- else
- ed.dom.removeClass(DIV, 'mceIEcenter');
-
- o.terminate = true;
- ed.execCommand('mceRepaint');
- } else {
- if ( ed.dom.hasClass(n, a) )
- ed.dom.addClass(n, 'alignnone');
- else
- ed.dom.removeClass(n, 'alignnone');
- }
- }
- }
-
- if ( tinymce.isWebKit && ( 'InsertUnorderedList' == cmd || 'InsertOrderedList' == cmd ) ) {
- if ( !style )
- style = ed.dom.create('style', {'type': 'text/css'}, '#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}');
-
- ed.getDoc().head.appendChild( style );
- }
- });
-
- ed.onExecCommand.add( function( ed, cmd ) {
- if ( tinymce.isWebKit && style && ( 'InsertUnorderedList' == cmd || 'InsertOrderedList' == cmd ) )
- ed.dom.remove( style );
- });
-
- ed.onInit.add(function(ed) {
- var bodyClass = ed.getParam('body_class', ''), body = ed.getBody();
-
- // add body classes
- if ( bodyClass )
- bodyClass = bodyClass.split(' ');
- else
- bodyClass = [];
-
- if ( ed.getParam('directionality', '') == 'rtl' )
- bodyClass.push('rtl');
-
- if ( tinymce.isIE9 )
- bodyClass.push('ie9');
- else if ( tinymce.isIE8 )
- bodyClass.push('ie8');
- else if ( tinymce.isIE7 )
- bodyClass.push('ie7');
-
- if ( ed.id != 'wp_mce_fullscreen' && ed.id != 'mce_fullscreen' )
- bodyClass.push('wp-editor');
- else if ( ed.id == 'mce_fullscreen' )
- bodyClass.push('mce-fullscreen');
-
- tinymce.each( bodyClass, function(cls){
- if ( cls )
- ed.dom.addClass(body, cls);
- });
-
- // make sure these run last
- ed.onNodeChange.add( function(ed, cm, e) {
- var DL;
-
- if ( e.nodeName == 'IMG' ) {
- DL = ed.dom.getParent(e, 'dl.wp-caption');
- } else if ( e.nodeName == 'DIV' && ed.dom.hasClass(e, 'mceTemp') ) {
- DL = e.firstChild;
-
- if ( ! ed.dom.hasClass(DL, 'wp-caption') )
- DL = false;
- }
-
- if ( DL ) {
- if ( ed.dom.hasClass(DL, 'alignleft') )
- cm.setActive('justifyleft', 1);
- else if ( ed.dom.hasClass(DL, 'alignright') )
- cm.setActive('justifyright', 1);
- else if ( ed.dom.hasClass(DL, 'aligncenter') )
- cm.setActive('justifycenter', 1);
- }
- });
-
- // remove invalid parent paragraphs when pasting HTML and/or switching to the HTML editor and back
- ed.onBeforeSetContent.add(function(ed, o) {
- if ( o.content ) {
- o.content = o.content.replace(/<p>\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)( [^>]*)?>/gi, '<$1$2>');
- o.content = o.content.replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)>\s*<\/p>/gi, '</$1>');
- }
- });
- });
-
- // Word count
- if ( 'undefined' != typeof(jQuery) ) {
- ed.onKeyUp.add(function(ed, e) {
- var k = e.keyCode || e.charCode;
-
- if ( k == last )
- return;
-
- if ( 13 == k || 8 == last || 46 == last )
- jQuery(document).triggerHandler('wpcountwords', [ ed.getContent({format : 'raw'}) ]);
-
- last = k;
- });
- }
-
- // keep empty paragraphs :(
- ed.onSaveContent.addToTop(function(ed, o) {
- o.content = o.content.replace(/<p>(<br ?\/?>|\u00a0|\uFEFF)?<\/p>/g, '<p> </p>');
- });
-
- // Fix bug in iOS Safari where it's impossible to type after a touchstart event on the parent document.
- // Happens after zooming in or out while the keyboard is open. See #25131.
- if ( tinymce.isIOS5 ) {
- ed.onKeyDown.add( function() {
- if ( document.activeElement == document.body ) {
- ed.getWin().focus();
- }
- });
- }
-
- ed.onSaveContent.add(function(ed, o) {
- // If editor is hidden, we just want the textarea's value to be saved
- if ( ed.isHidden() )
- o.content = o.element.value;
- else if ( ed.getParam('wpautop', true) && typeof(switchEditors) == 'object' )
- o.content = switchEditors.pre_wpautop(o.content);
- });
-
- /* disable for now
- ed.onBeforeSetContent.add(function(ed, o) {
- o.content = t._setEmbed(o.content);
- });
-
- ed.onPostProcess.add(function(ed, o) {
- if ( o.get )
- o.content = t._getEmbed(o.content);
- });
- */
-
- // Add listeners to handle more break
- t._handleMoreBreak(ed, url);
-
- // Add custom shortcuts
- mod_key = 'alt+shift';
-
- // if ( tinymce.isGecko ) // disable for mow, too many shortcuts conflicts
- // mod_key = 'ctrl+alt';
-
- ed.addShortcut(mod_key + '+c', 'justifycenter_desc', 'JustifyCenter');
- ed.addShortcut(mod_key + '+r', 'justifyright_desc', 'JustifyRight');
- ed.addShortcut(mod_key + '+l', 'justifyleft_desc', 'JustifyLeft');
- ed.addShortcut(mod_key + '+j', 'justifyfull_desc', 'JustifyFull');
- ed.addShortcut(mod_key + '+q', 'blockquote_desc', 'mceBlockQuote');
- ed.addShortcut(mod_key + '+u', 'bullist_desc', 'InsertUnorderedList');
- ed.addShortcut(mod_key + '+o', 'numlist_desc', 'InsertOrderedList');
- ed.addShortcut(mod_key + '+n', 'spellchecker.desc', 'mceSpellCheck');
- ed.addShortcut(mod_key + '+a', 'link_desc', 'WP_Link');
- ed.addShortcut(mod_key + '+s', 'unlink_desc', 'unlink');
- ed.addShortcut(mod_key + '+m', 'image_desc', 'WP_Medialib');
- ed.addShortcut(mod_key + '+z', 'wordpress.wp_adv_desc', 'WP_Adv');
- ed.addShortcut(mod_key + '+t', 'wordpress.wp_more_desc', 'WP_More');
- ed.addShortcut(mod_key + '+d', 'striketrough_desc', 'Strikethrough');
- ed.addShortcut(mod_key + '+h', 'help_desc', 'WP_Help');
- ed.addShortcut(mod_key + '+p', 'wordpress.wp_page_desc', 'WP_Page');
- ed.addShortcut('ctrl+s', 'save_desc', function(){if('function'==typeof autosave)autosave();});
-
- if ( /\bwpfullscreen\b/.test(ed.settings.plugins) )
- ed.addShortcut(mod_key + '+w', 'wordpress.wp_fullscreen_desc', 'wpFullScreen');
- else if ( /\bfullscreen\b/.test(ed.settings.plugins) )
- ed.addShortcut(mod_key + '+g', 'fullscreen.desc', 'mceFullScreen');
-
- // popup buttons for images and the gallery
- ed.onInit.add(function(ed) {
- tinymce.dom.Event.add(ed.getWin(), 'scroll', function() {
- ed.plugins.wordpress._hideButtons();
- });
- tinymce.dom.Event.add(ed.getBody(), 'dragstart', function() {
- ed.plugins.wordpress._hideButtons();
- });
- });
-
- ed.onBeforeExecCommand.add( function( ed ) {
- ed.plugins.wordpress._hideButtons();
- });
-
- ed.onSaveContent.add( function( ed ) {
- ed.plugins.wordpress._hideButtons();
- });
-
- ed.onMouseDown.add(function(ed, e) {
- if ( e.target.nodeName != 'IMG' )
- ed.plugins.wordpress._hideButtons();
- });
-
- ed.onKeyDown.add(function(ed, e){
- if ( e.which == tinymce.VK.DELETE || e.which == tinymce.VK.BACKSPACE )
- ed.plugins.wordpress._hideButtons();
- });
-
- closeOnClick = function(e){
- var id;
-
- if ( e.target.id == 'mceModalBlocker' || e.target.className == 'ui-widget-overlay' ) {
- for ( id in ed.windowManager.windows ) {
- ed.windowManager.close(null, id);
- }
- }
- };
-
- // close popups when clicking on the background
- tinymce.dom.Event.remove(document.body, 'click', closeOnClick);
- tinymce.dom.Event.add(document.body, 'click', closeOnClick);
- },
-
- getInfo : function() {
- return {
- longname : 'WordPress Plugin',
- author : 'WordPress', // add Moxiecode?
- authorurl : 'http://wordpress.org',
- infourl : 'http://wordpress.org',
- version : '3.0'
- };
- },
-
- // Internal functions
- _setEmbed : function(c) {
- return c.replace(/\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g, function(a,b){
- return '<img width="300" height="200" src="' + tinymce.baseURL + '/plugins/wordpress/img/trans.gif" class="wp-oembed mceItemNoResize" alt="'+b+'" title="'+b+'" />';
- });
- },
-
- _getEmbed : function(c) {
- return c.replace(/<img[^>]+>/g, function(a) {
- if ( a.indexOf('class="wp-oembed') != -1 ) {
- var u = a.match(/alt="([^\"]+)"/);
- if ( u[1] )
- a = '[embed]' + u[1] + '[/embed]';
- }
- return a;
- });
- },
-
- _showButtons : function(n, id) {
- var ed = tinymce.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y;
-
- vp = ed.dom.getViewPort(ed.getWin());
- p1 = DOM.getPos(ed.getContentAreaContainer());
- p2 = ed.dom.getPos(n);
-
- X = Math.max(p2.x - vp.x, 0) + p1.x;
- Y = Math.max(p2.y - vp.y, 0) + p1.y;
-
- DOM.setStyles(id, {
- 'top' : Y+5+'px',
- 'left' : X+5+'px',
- 'display' : 'block'
- });
- },
-
- _hideButtons : function() {
- var DOM = tinymce.DOM;
- DOM.hide( DOM.select('#wp_editbtns, #wp_gallerybtns') );
- },
-
- // Resizes the iframe by a relative height value
- _resizeIframe : function(ed, tb_id, dy) {
- var ifr = ed.getContentAreaContainer().firstChild;
-
- DOM.setStyle(ifr, 'height', ifr.clientHeight + dy); // Resize iframe
- ed.theme.deltaHeight += dy; // For resize cookie
- },
-
- _handleMoreBreak : function(ed, url) {
- var moreHTML, nextpageHTML;
-
- moreHTML = '<img src="' + url + '/img/trans.gif" alt="$1" class="mce-wp-more mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
- nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mce-wp-nextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
-
- // Display morebreak instead if img in element path
- ed.onPostRender.add(function() {
- if (ed.theme.onResolveName) {
- ed.theme.onResolveName.add(function(th, o) {
- if (o.node.nodeName == 'IMG') {
- if ( ed.dom.hasClass(o.node, 'mce-wp-more') )
- o.name = 'wpmore';
- if ( ed.dom.hasClass(o.node, 'mce-wp-nextpage') )
- o.name = 'wppage';
- }
-
- });
- }
- });
-
- // Replace morebreak with images
- ed.onBeforeSetContent.add(function(ed, o) {
- if ( o.content ) {
- o.content = o.content.replace(/<!--more(.*?)-->/g, moreHTML);
- o.content = o.content.replace(/<!--nextpage-->/g, nextpageHTML);
- }
- });
-
- // Replace images with morebreak
- ed.onPostProcess.add(function(ed, o) {
- if (o.get)
- o.content = o.content.replace(/<img[^>]+>/g, function(im) {
- if (im.indexOf('class="mce-wp-more') !== -1) {
- var m, moretext = (m = im.match(/alt="(.*?)"/)) ? m[1] : '';
- im = '<!--more'+moretext+'-->';
- }
- if (im.indexOf('class="mce-wp-nextpage') !== -1)
- im = '<!--nextpage-->';
-
- return im;
- });
- });
-
- // Set active buttons if user selected pagebreak or more break
- ed.onNodeChange.add(function(ed, cm, n) {
- cm.setActive('wp_page', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mce-wp-nextpage'));
- cm.setActive('wp_more', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mce-wp-more'));
- });
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('wordpress', tinymce.plugins.WordPress);
-})();
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswordpresspluginjsfromrev26862trunksrcwpincludesjstinymcepluginswordpresseditor_plugin_srcjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,417 @@
</span><ins>+/* global tinymce, autosave, getUserSetting, setUserSetting, switchEditors */
+tinymce.PluginManager.add( 'wordpress', function( editor ) {
+ var DOM = tinymce.DOM, wpAdvButton, modKey, style,
+ last = 0;
+
+ function toggleToolbars( state ) {
+ var iframe,
+ pixels = 0,
+ initial = state === 'hide',
+ toolbars = editor.theme.panel && editor.theme.panel.find('.toolbar');
+
+ if ( ! toolbars || toolbars.length < 2 || ( state === 'hide' && ! toolbars[1].visible() ) ) {
+ return;
+ }
+
+ if ( ! state && toolbars[1].visible() ) {
+ state = 'hide';
+ }
+
+ tinymce.each( toolbars, function( toolbar, i ) {
+ if ( i > 0 ) {
+ if ( state === 'hide' ) {
+ toolbar.hide();
+ pixels += 30;
+ } else {
+ toolbar.show();
+ pixels -= 30;
+ }
+ }
+ });
+
+ if ( pixels && ! initial ) {
+ iframe = editor.getContentAreaContainer().firstChild;
+ DOM.setStyle( iframe, 'height', iframe.clientHeight + pixels ); // Resize iframe
+
+ if ( state === 'hide' ) {
+ setUserSetting('hidetb', '1');
+ wpAdvButton && wpAdvButton.active( false );
+ } else {
+ setUserSetting('hidetb', '0');
+ wpAdvButton && wpAdvButton.active( true );
+ }
+ }
+ }
+
+ // Add the kitchen sink button :)
+ editor.addButton( 'wp_adv', {
+ tooltip: 'Toolbar Toggle',
+ cmd: 'WP_Adv',
+ onPostRender: function() {
+ wpAdvButton = this;
+ }
+ });
+
+ // Hide the toolbars after loading
+ editor.on( 'PostRender', function() {
+ if ( getUserSetting('hidetb', '1') === '1' ) {
+ toggleToolbars( 'hide' );
+ }
+ });
+
+ editor.addCommand( 'WP_Adv', function() {
+ toggleToolbars();
+ });
+
+ editor.on( 'focus', function() {
+ window.wpActiveEditor = editor.id;
+ });
+
+ // Replace Read More/Next Page tags with images
+ editor.on( 'BeforeSetContent', function( e ) {
+ if ( e.content ) {
+ if ( e.content.indexOf( '<!--more' ) !== -1 ) {
+ e.content = e.content.replace( /<!--more(.*?)-->/g, function( match, moretext ) {
+ return '<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="' + moretext + '" ' +
+ 'class="wp-more-tag mce-wp-more" title="Read More..." data-mce-resize="false" data-mce-placeholder="1" />';
+ });
+ }
+
+ if ( e.content.indexOf( '<!--nextpage-->' ) !== -1 ) {
+ e.content = e.content.replace( /<!--nextpage-->/g,
+ '<img src="' + tinymce.Env.transparentSrc + '" class="wp-more-tag mce-wp-nextpage" ' +
+ 'title="Page break" data-mce-resize="false" data-mce-placeholder="1" />' );
+ }
+ }
+ });
+
+ // Replace images with tags
+ editor.on( 'PostProcess', function( e ) {
+ if ( e.get ) {
+ e.content = e.content.replace(/<img[^>]+>/g, function( image ) {
+ var match, moretext = '';
+
+ if ( image.indexOf('wp-more-tag') !== -1 ) {
+ if ( image.indexOf('mce-wp-more') !== -1 ) {
+ if ( match = image.match( /data-wp-more="([^"]+)"/ ) ) {
+ moretext = match[1];
+ }
+
+ image = '<!--more' + moretext + '-->';
+ } else if ( image.indexOf('mce-wp-nextpage') !== -1 ) {
+ image = '<!--nextpage-->';
+ }
+ }
+
+ return image;
+ });
+ }
+ });
+
+ // Display the tag name instead of img in element path
+ editor.on( 'ResolveName', function( e ) {
+ var dom = editor.dom,
+ target = e.target;
+
+ if ( target.nodeName === 'IMG' && dom.hasClass( target, 'wp-more-tag' ) ) {
+ if ( dom.hasClass( target, 'mce-wp-more' ) ) {
+ e.name = 'more';
+ } else if ( dom.hasClass( target, 'mce-wp-nextpage' ) ) {
+ e.name = 'nextpage';
+ }
+ }
+ });
+
+ // Register commands
+ editor.addCommand( 'WP_More', function( tag ) {
+ var parent, html, title,
+ classname = 'wp-more-tag',
+ dom = editor.dom,
+ node = editor.selection.getNode();
+
+ tag = tag || 'more';
+ classname += ' mce-wp-' + tag;
+ title = tag === 'more' ? 'More...' : 'Next Page';
+ html = '<img src="' + tinymce.Env.transparentSrc + '" title="' + title + '" class="' + classname + '" data-mce-resize="false" data-mce-placeholder="1" />';
+
+ if ( node.nodeName === 'BODY' ) {
+ editor.insertContent( '<p>' + html + '</p>' );
+ return;
+ }
+
+ // Get the top level parent node
+ parent = dom.getParent( node, function( found ) {
+ if ( found.parentNode && found.parentNode.nodeName === 'BODY' ) {
+ return true;
+ }
+
+ return false;
+ }, editor.getBody() );
+
+ if ( parent ) {
+ dom.insertAfter( dom.create( 'p', null, html ), parent );
+ }
+ });
+
+ editor.addCommand( 'WP_Page', function() {
+ editor.execCommand( 'WP_More', 'nextpage' );
+ });
+
+ editor.addCommand( 'WP_Help', function() {
+ editor.windowManager.open({
+ url: tinymce.baseURL + '/wp-mce-help.php',
+ width: 450,
+ height: 420,
+ inline: 1
+ });
+ });
+
+ editor.addCommand( 'WP_Medialib', function() {
+ if ( typeof wp !== 'undefined' && wp.media && wp.media.editor ) {
+ wp.media.editor.open( editor.id );
+ }
+ });
+
+ // Register buttons
+ editor.addButton( 'wp_more', {
+ tooltip: 'Insert Read More tag',
+ onclick: function() {
+ editor.execCommand( 'WP_More', 'more' );
+ }
+ });
+
+ editor.addButton( 'wp_page', {
+ tooltip: 'Page break',
+ onclick: function() {
+ editor.execCommand( 'WP_More', 'nextpage' );
+ }
+ });
+
+ editor.addButton( 'wp_help', {
+ tooltip: 'Help',
+ cmd: 'WP_Help'
+ });
+
+ // Menubar
+ // Insert->Add Media
+ if ( typeof wp !== 'undefined' && wp.media && wp.media.editor ) {
+ editor.addMenuItem( 'add_media', {
+ text: 'Add Media',
+ context: 'insert',
+ cmd: 'WP_Medialib'
+ });
+ }
+
+ // Insert "Read More..."
+ editor.addMenuItem( 'wp_more', {
+ text: 'Insert Read More tag',
+ context: 'insert',
+ onclick: function() {
+ editor.execCommand( 'WP_More', 'more' );
+ }
+ });
+
+ // Insert "Next Page"
+ editor.addMenuItem( 'wp_page', {
+ text: 'Page break',
+ context: 'insert',
+ onclick: function() {
+ editor.execCommand( 'WP_More', 'nextpage' );
+ }
+ });
+
+ editor.on( 'BeforeExecCommand', function(e) {
+ if ( tinymce.Env.webkit && ( e.command === 'InsertUnorderedList' || e.command === 'InsertOrderedList' ) ) {
+ if ( ! style ) {
+ style = editor.dom.create( 'style', {'type': 'text/css'},
+ '#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}');
+ }
+
+ editor.getDoc().head.appendChild( style );
+ }
+ });
+
+ editor.on( 'ExecCommand', function( e ) {
+ if ( tinymce.Env.webkit && style &&
+ ( 'InsertUnorderedList' === e.command || 'InsertOrderedList' === e.command ) ) {
+
+ editor.dom.remove( style );
+ }
+ });
+
+ editor.on( 'init', function() {
+ var env = tinymce.Env,
+ bodyClass = ['mceContentBody'], // back-compat for themes that use this in editor-style.css...
+ body = editor.getBody();
+
+ if ( editor.getParam( 'directionality' ) === 'rtl' ) {
+ bodyClass.push('rtl');
+ }
+
+ if ( env.ie ) {
+ if ( parseInt( env.ie, 10 ) === 9 ) {
+ bodyClass.push('ie9');
+ } else if ( parseInt( env.ie, 10 ) === 8 ) {
+ bodyClass.push('ie8');
+ } else if ( env.ie < 8 ) {
+ bodyClass.push('ie7');
+ }
+ }
+
+ bodyClass.push('wp-editor');
+
+ tinymce.each( bodyClass, function( cls ) {
+ if ( cls ) {
+ editor.dom.addClass( body, cls );
+ }
+ });
+
+ // Remove invalid parent paragraphs when inserting HTML
+ // TODO: still needed?
+ editor.on( 'BeforeSetContent', function( e ) {
+ if ( e.content ) {
+ e.content = e.content.replace(/<p>\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)( [^>]*)?>/gi, '<$1$2>');
+ e.content = e.content.replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)>\s*<\/p>/gi, '</$1>');
+ }
+ });
+ });
+
+ // Word count
+ if ( typeof jQuery !== 'undefined' ) {
+ editor.on( 'keyup', function( e ) {
+ var key = e.keyCode || e.charCode;
+
+ if ( key === last ) {
+ return;
+ }
+
+ if ( 13 === key || 8 === last || 46 === last ) {
+ jQuery(document).triggerHandler( 'wpcountwords', [ editor.getContent({ format : 'raw' }) ] );
+ }
+
+ last = key;
+ });
+ }
+
+ editor.on( 'SaveContent', function( e ) {
+ // If editor is hidden, we just want the textarea's value to be saved
+ if ( editor.isHidden() ) {
+ e.content = e.element.value;
+ return;
+ }
+
+ // Keep empty paragraphs :(
+ e.content = e.content.replace( /<p>(<br ?\/?>|\u00a0|\uFEFF)?<\/p>/g, '<p> </p>' );
+
+ if ( editor.getParam( 'wpautop', true ) && typeof switchEditors !== 'undefined' ) {
+ e.content = switchEditors.pre_wpautop( e.content );
+ }
+ });
+
+ // Add custom shortcuts
+ modKey = 'alt+shift';
+
+ editor.addShortcut( modKey + '+c', '', 'JustifyCenter' );
+ editor.addShortcut( modKey + '+r', '', 'JustifyRight' );
+ editor.addShortcut( modKey + '+l', '', 'JustifyLeft' );
+ editor.addShortcut( modKey + '+j', '', 'JustifyFull' );
+ editor.addShortcut( modKey + '+q', '', 'mceBlockQuote' );
+ editor.addShortcut( modKey + '+u', '', 'InsertUnorderedList' );
+ editor.addShortcut( modKey + '+o', '', 'InsertOrderedList' );
+ editor.addShortcut( modKey + '+n', '', 'mceSpellCheck' );
+ editor.addShortcut( modKey + '+a', '', 'WP_Link' );
+ editor.addShortcut( modKey + '+s', '', 'unlink' );
+ editor.addShortcut( modKey + '+m', '', 'WP_Medialib' );
+ editor.addShortcut( modKey + '+z', '', 'WP_Adv' );
+ editor.addShortcut( modKey + '+t', '', 'WP_More' );
+ editor.addShortcut( modKey + '+d', '', 'Strikethrough' );
+ editor.addShortcut( modKey + '+h', '', 'WP_Help' );
+ editor.addShortcut( modKey + '+p', '', 'WP_Page' );
+ editor.addShortcut( 'ctrl+s', '', function() {
+ if ( typeof autosave === 'function' ) {
+ autosave();
+ }
+ });
+
+ // popup buttons for the gallery, etc.
+ editor.on( 'init', function() {
+ editor.dom.bind( editor.getWin(), 'scroll', function() {
+ _hideButtons();
+ });
+
+ editor.dom.bind( editor.getBody(), 'dragstart', function() {
+ _hideButtons();
+ });
+ });
+
+ editor.on( 'BeforeExecCommand', function() {
+ _hideButtons();
+ });
+
+ editor.on( 'SaveContent', function() {
+ _hideButtons();
+ });
+
+ editor.on( 'MouseDown', function( e ) {
+ if ( e.target.nodeName !== 'IMG' ) {
+ _hideButtons();
+ }
+ });
+
+ editor.on( 'keydown', function( e ) {
+ if ( e.which === tinymce.util.VK.DELETE || e.which === tinymce.util.VK.BACKSPACE ) {
+ _hideButtons();
+ }
+ });
+
+ // Internal functions
+ function _setEmbed( c ) {
+ return c.replace( /\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g, function( a, b ) {
+ return '<img width="300" height="200" src="' + tinymce.Env.transparentSrc + '" class="wp-oembed" ' +
+ 'alt="'+ b +'" title="'+ b +'" data-mce-resize="false" data-mce-placeholder="1" />';
+ });
+ }
+
+ function _getEmbed( c ) {
+ return c.replace( /<img[^>]+>/g, function( a ) {
+ if ( a.indexOf('class="wp-oembed') !== -1 ) {
+ var u = a.match( /alt="([^\"]+)"/ );
+
+ if ( u[1] ) {
+ a = '[embed]' + u[1] + '[/embed]';
+ }
+ }
+
+ return a;
+ });
+ }
+
+ function _showButtons( n, id ) {
+ var p1, p2, vp, X, Y;
+
+ vp = editor.dom.getViewPort( editor.getWin() );
+ p1 = DOM.getPos( editor.getContentAreaContainer() );
+ p2 = editor.dom.getPos( n );
+
+ X = Math.max( p2.x - vp.x, 0 ) + p1.x;
+ Y = Math.max( p2.y - vp.y, 0 ) + p1.y;
+
+ DOM.setStyles( id, {
+ 'top' : Y + 5 + 'px',
+ 'left' : X + 5 + 'px',
+ 'display': 'block'
+ });
+ }
+
+ function _hideButtons() {
+ DOM.hide( DOM.select( '#wp_editbtns, #wp_gallerybtns' ) );
+ }
+
+ // Expose some functions (back-compat)
+ return {
+ _showButtons: _showButtons,
+ _hideButtons: _hideButtons,
+ _setEmbed: _setEmbed,
+ _getEmbed: _getEmbed
+ };
+});
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpdialogseditor_plugin_srcjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin_src.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin_src.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin_src.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,71 +0,0 @@
</span><del>-/* global tinymce */
-(function() {
- tinymce.create('tinymce.plugins.WPDialogs', {
- init : function( ed ) {
- tinymce.create('tinymce.WPWindowManager:tinymce.InlineWindowManager', {
- WPWindowManager : function(ed) {
- this.parent(ed);
- },
-
- open : function(f, p) {
- var t = this, element;
-
- if ( ! f.wpDialog )
- return this.parent( f, p );
- else if ( ! f.id )
- return;
-
- element = jQuery('#' + f.id);
- if ( ! element.length )
- return;
-
- t.features = f;
- t.params = p;
- t.onOpen.dispatch(t, f, p);
- t.element = t.windows[ f.id ] = element;
-
- // Store selection
- t.bookmark = t.editor.selection.getBookmark(1);
-
- // Create the dialog if necessary
- if ( ! element.data('wpdialog') ) {
- element.wpdialog({
- title: f.title,
- width: f.width,
- height: f.height,
- modal: true,
- dialogClass: 'wp-dialog',
- zIndex: 300000
- });
- }
-
- element.wpdialog('open');
- },
- close : function() {
- if ( ! this.features.wpDialog )
- return this.parent.apply( this, arguments );
-
- this.element.wpdialog('close');
- }
- });
-
- // Replace window manager
- ed.onBeforeRenderUI.add(function() {
- ed.windowManager = new tinymce.WPWindowManager(ed);
- });
- },
-
- getInfo : function() {
- return {
- longname : 'WPDialogs',
- author : 'WordPress',
- authorurl : 'http://wordpress.org',
- infourl : 'http://wordpress.org',
- version : '0.1'
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('wpdialogs', tinymce.plugins.WPDialogs);
-})();
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpdialogspluginjsfromrev26862trunksrcwpincludesjstinymcepluginswpdialogseditor_plugin_srcjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin_src.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/* global tinymce */
+
+tinymce.WPWindowManager = function( editor ) {
+ var element;
+
+ this.parent = editor.windowManager;
+ this.editor = editor;
+
+ tinymce.extend( this, this.parent )
+
+ this.open = function( args, params ) {
+ var self = this, element;
+
+ if ( ! args.wpDialog )
+ return this.parent.open( args, params );
+ else if ( ! args.id )
+ return;
+
+ self.element = element = jQuery('#' + args.id);
+ if ( ! element.length )
+ return;
+
+ self.features = args;
+ self.params = params;
+ self.onOpen.dispatch( self, args, params );
+ self.windows.push( element );
+
+ // Store selection
+ // self.bookmark = self.editor.selection.getBookmark(1);
+
+ // Create the dialog if necessary
+ if ( ! element.data('wpdialog') ) {
+ element.wpdialog({
+ title: args.title,
+ width: args.width,
+ height: args.height,
+ modal: true,
+ dialogClass: 'wp-dialog',
+ zIndex: 300000
+ });
+ }
+
+ element.wpdialog('open');
+ };
+
+ this.close = function() {
+ if ( ! this.features.wpDialog )
+ return this.parent.close.apply( this, arguments );
+
+ this.element.wpdialog('close');
+ };
+}
+
+tinymce.PluginManager.add( 'wpdialogs', function( editor ) {
+ // Replace window manager
+ editor.on( 'init', function() {
+ editor.windowManager = new tinymce.WPWindowManager( editor );
+ });
+});
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpeditimageeditimagehtml"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,274 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<title></title>
-
-<link rel="stylesheet" href="css/editimage.css?ver=358-20121205" type="text/css" media="all" />
-<link rel="stylesheet" href="../../../../css/buttons.css?ver=358-20121205" type="text/css" media="all" />
-<script type="text/javascript" src="js/editimage.js?ver=358-20121205"></script>
-<script type="text/javascript" src="../../utils/form_utils.js?ver=358-20121205"></script>
-<base target="_self" />
-</head>
-
-<body id="media-upload" class="wp-core-ui" style="display:none;">
-<script type="text/javascript">
-if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') )
- document.body.className += ' rtl';
-</script>
-<div id="media-upload-header">
- <ul id="sidemenu">
- <li><a href="javascript:;" id="tab_basic" class="current" onclick="wpImage.setTabs(this);">{#wpeditimage.edit_img}</a></li>
- <li><a href="javascript:;" id="tab_advanced" onclick="wpImage.setTabs(this);">{#wpeditimage.adv_settings}</a></li>
- </ul>
-</div>
-
-<div id="img-edit">
-<form class="media-upload-form" action="" onsubmit="wpImage.update();">
- <div id="img_size_div">
- <div id="img_size_title">{#wpeditimage.size}</div>
- <div id="img_size" onmouseout="wpImage.showSizeRem()">
- <div id="s130" onmouseover="wpImage.showSize(this)" onclick="wpImage.imgEditSize(this)">{#wpeditimage.s130}</div>
- <div id="s120" onmouseover="wpImage.showSize(this)" onclick="wpImage.imgEditSize(this)">{#wpeditimage.s120}</div>
- <div id="s110" onmouseover="wpImage.showSize(this)" onclick="wpImage.imgEditSize(this)">{#wpeditimage.s110}</div>
- <div id="s100" onmouseover="wpImage.showSize(this)" onclick="wpImage.imgEditSize(this)">{#wpeditimage.s100}</div>
- <div id="s90" onmouseover="wpImage.showSize(this)" onclick="wpImage.imgEditSize(this)">{#wpeditimage.s90}</div>
- <div id="s80" onmouseover="wpImage.showSize(this)" onclick="wpImage.imgEditSize(this)">{#wpeditimage.s80}</div>
- <div id="s70" onmouseover="wpImage.showSize(this)" onclick="wpImage.imgEditSize(this)">{#wpeditimage.s70}</div>
- <div id="s60" onmouseover="wpImage.showSize(this)" onclick="wpImage.imgEditSize(this)">{#wpeditimage.s60}</div>
- </div>
- </div>
- <div class="show-align" id="show_align">
- <img id="img_demo" src="img/image.png" alt="" />
- <span id="img_demo_txt">
- Lorem ipsum dolor sit amet consectetuer velit pretium euismod ipsum enim. Mi cursus at a mollis senectus id arcu gravida quis urna. Sed et felis id tempus Morbi mauris tincidunt enim In mauris. Pede eu risus velit libero natoque enim lorem adipiscing ipsum consequat. In malesuada et sociis tincidunt tempus pellentesque cursus convallis ipsum Suspendisse. Risus In ac quis ut Nunc convallis laoreet ante Suspendisse Nam. Amet amet urna condimentum Vestibulum sem at Curabitur lorem et cursus. Sodales tortor fermentum leo dui habitant Nunc Sed Vestibulum.
- Ut lorem In penatibus libero id ipsum sagittis nec elit Sed. Condimentum eget Vivamus vel consectetuer lorem molestie turpis amet tellus id. Condimentum vel ridiculus Fusce sed pede Nam nunc sodales eros tempor. Sit lacus magna dictumst Curabitur fringilla auctor id vitae wisi facilisi. Fermentum eget turpis felis velit leo Nunc Proin orci molestie Praesent. Curabitur tellus scelerisque suscipit ut sem amet cursus mi Morbi eu. Donec libero Vestibulum augue et mollis accumsan ornare condimentum In enim. Leo eget ac consectetuer quis condimentum malesuada.
- Condimentum commodo et Lorem fringilla malesuada libero volutpat sem tellus enim. Tincidunt sed at Aenean nec nonummy porttitor Nam Sed Nulla ut. Auctor leo In aliquet Curabitur eros et velit Quisque justo morbi. Et vel mauris sit nulla semper vitae et quis at dui. Id at elit laoreet justo eu mauris Quisque et interdum pharetra. Nullam accumsan interdum Maecenas condimentum quis quis Fusce a sollicitudin Sed. Non Quisque Vivamus congue porttitor non semper ipsum porttitor quis vel. Donec eros lacus volutpat et tincidunt sem convallis id venenatis sit. Consectetuer odio.
- Semper faucibus Morbi nulla convallis orci Aliquam Sed porttitor et Pellentesque. Venenatis laoreet lorem id a a Morbi augue turpis id semper. Arcu volutpat ac mauris Vestibulum fringilla Aenean condimentum nibh sed id. Sagittis eu lacus orci urna tellus tellus pretium Curabitur dui nunc. Et nibh eu eu nibh adipiscing at lorem Vestibulum adipiscing augue. Magna convallis Phasellus dolor malesuada Curabitur ornare adipiscing tellus Aliquam tempus. Id Aliquam Integer augue Nulla consectetuer ac Donec Curabitur tincidunt et. Id vel Nunc amet lacus dui magna ridiculus penatibus laoreet Duis. Enim sagittis nibh quis Nulla nec laoreet vel Maecenas mattis vel.
- </span>
- </div>
-
- <div id="div_basic">
- <table id="basic" class="describe">
- <tbody>
-
- <tr class="align">
- <th valign="top" scope="row" class="label">
- <label for="img_align_td">
- <span class="alignleft">{#contextmenu.align}</span>
- </label>
- </th>
- <td class="field" id="img_align_td">
- <input type="radio" onclick="wpImage.imgAlignCls('alignnone')" name="img_align" id="alignnone" value="alignnone" />
- <label for="alignnone" class="align image-align-none-label">{#wpeditimage.none}</label>
-
- <input type="radio" onclick="wpImage.imgAlignCls('alignleft')" name="img_align" id="alignleft" value="alignleft" />
- <label for="alignleft" class="align image-align-left-label">{#contextmenu.left}</label>
-
- <input type="radio" onclick="wpImage.imgAlignCls('aligncenter')" name="img_align" id="aligncenter" value="aligncenter" />
- <label for="aligncenter" class="align image-align-center-label">{#contextmenu.center}</label>
-
- <input type="radio" onclick="wpImage.imgAlignCls('alignright')" name="img_align" id="alignright" value="alignright" />
- <label for="alignright" class="align image-align-right-label">{#contextmenu.right}</label>
- </td>
- </tr>
-
- <tr>
- <th valign="top" scope="row" class="label">
- <label for="img_title">
- <span class="alignleft">{#wpeditimage.img_title}</span>
- </label>
- </th>
- <td class="field">
- <input type="text" id="img_title" name="img_title" value="" aria-required="true" size="60" />
- </td>
- </tr>
-
- <tr>
- <th valign="top" scope="row" class="label">
- <label for="img_alt">
- <span class="alignleft">{#wpeditimage.alt}</span>
- </label>
- </th>
- <td class="field">
- <input type="text" id="img_alt" name="img_alt" value="" size="60" />
- </td>
- </tr>
-
- <tr id="cap_field">
- <th valign="top" scope="row" class="label">
- <label for="img_cap">
- <span class="alignleft">{#wpeditimage.caption}</span>
- </label>
- </th>
- <td class="field">
- <textarea id="img_cap_text"></textarea>
- </td>
- </tr>
-
- <tr>
- <th valign="top" scope="row" class="label">
- <label for="link_href">
- <span class="alignleft" id="lb_link_href">{#advanced_dlg.link_url}</span>
- </label>
- </th>
- <td class="field">
- <input type="text" id="link_href" name="link_href" value="" size="60" /><br />
- <input type="button" class="button" onclick="wpImage.I('link_href').value='';" value="{#wpeditimage.none}" />
- <input type="button" class="button" id="img_url_current" onclick="wpImage.img_seturl('current')" value="{#wpeditimage.current_link}" />
- <input type="button" class="button" id="img_url_img" onclick="wpImage.img_seturl('link')" value="{#wpeditimage.link_to_img}" />
- <p class="help">{#wpeditimage.link_help}</p>
- </td>
- </tr>
- </tbody>
- </table></div>
-
- <div id="div_advanced" style="display:none;">
- <h3>{#wpeditimage.adv_img_settings}</h3>
- <table id="adv_settings_img" class="describe">
- <tbody>
- <tr>
- <th valign="top" scope="row" class="label">
- <label for="img_src">
- <span class="alignleft">{#wpeditimage.source}</span>
- <span class="alignright"><abbr title="required" class="required">*</abbr></span>
- </label>
- </th>
- <td class="field">
- <input type="text" id="img_src" name="img_src" value="" onblur="wpImage.checkVal(this)" aria-required="true" size="60" />
- </td>
- </tr>
-
- <tr id="img_dim">
- <th valign="top" scope="row" class="label">
- <label>
- <span class="alignleft">{#wpeditimage.size}</span>
- </label>
- </th>
- <td class="field">
- <label for="width">{#wpeditimage.width}</label>
- <input type="text" maxlength="5" id="width" name="width" value="" />
-
- <label for="height">{#wpeditimage.height}</label>
- <input type="text" maxlength="5" id="height" name="height" value="" />
-
- <input type="button" class="button" id="orig_size" name="orig_size" value="{#wpeditimage.orig_size}" onclick="wpImage.origSize();" />
- </td>
- </tr>
-
- <tr>
- <th valign="top" scope="row" class="label">
- <label for="img_classes">
- <span class="alignleft">{#wpeditimage.css}</span>
- </label>
- </th>
- <td class="field">
- <input type="text" id="img_classes" name="img_classes" value="" size="60" />
- </td>
- </tr>
-
- <tr>
- <th valign="top" scope="row" class="label">
- <label for="img_style">
- <span class="alignleft">{#advanced.style_select}</span>
- </label>
- </th>
- <td class="field">
- <input type="text" id="img_style" name="img_style" value="" size="60" onblur="wpImage.demoSetStyle();" />
- </td>
- </tr>
-
- <tr id="img_prop">
- <th valign="top" scope="row" class="label">
- <label for="img_prop">
- <span class="alignleft">{#advanced.image_props_desc}</span>
- </label>
- </th>
- <td class="field">
- <label for="border">{#advanced_dlg.image_border}</label>
- <input type="text" maxlength="5" id="border" name="border" value="" onblur="wpImage.updateStyle('border')" />
-
- <label for="vspace">{#advanced_dlg.image_vspace}</label>
- <input type="text" maxlength="5" id="vspace" name="vspace" value="" onblur="wpImage.updateStyle('vspace')" />
-
- <label for="hspace">{#advanced_dlg.image_hspace}</label>
- <input type="text" maxlength="5" id="hspace" name="hspace" value="" onblur="wpImage.updateStyle('hspace')" />
- </td>
- </tr>
- </tbody>
- </table>
-
- <h3>{#wpeditimage.adv_link_settings}</h3>
- <table id="adv_settings_link" class="describe">
- <tbody>
- <tr>
- <th valign="top" scope="row" class="label">
- <label for="link_title">
- <span class="alignleft">{#advanced_dlg.link_titlefield}</span>
- </label>
- </th>
- <td class="field">
- <input type="text" id="link_title" name="link_title" value="" size="60" />
- </td>
- </tr>
-
- <tr>
- <th valign="top" scope="row" class="label">
- <label for="link_rel">
- <span class="alignleft">{#wpeditimage.link_rel}</span>
- </label>
- </th>
- <td class="field">
- <input type="text" id="link_rel" name="link_rel" value="" size="60" />
- </td>
- </tr>
-
- <tr>
- <th valign="top" scope="row" class="label">
- <label for="link_classes">
- <span class="alignleft">{#wpeditimage.css}</span>
- </label>
- </th>
- <td class="field">
- <input type="text" id="link_classes" name="link_classes" value="" size="60" />
- </td>
- </tr>
-
- <tr>
- <th valign="top" scope="row" class="label">
- <label for="link_style">
- <span class="alignleft">{#advanced.style_select}</span>
- </label>
- </th>
- <td class="field">
- <input type="text" id="link_style" name="link_style" value="" size="60" />
- </td>
- </tr>
-
- <tr>
- <th valign="top" scope="row" class="label">
- <label>
- <span class="alignleft">{#advanced_dlg.link_target}</span>
- </label>
- </th>
- <td class="field">
- <label for="link_target">
- {#advanced_dlg.link_target_blank}
- </label>
- <input type="checkbox" id="link_target" name="link_target" value="_blank" />
- </td>
- </tr>
- </tbody>
- </table></div>
-
- <div id="saveeditimg">
- <input type="hidden" id="align" name="align" value="" />
-
- <input type="submit" id="saveimg" class="button" value="{#update}" />
- <input type="button" class="button" id="cancelimg" name="cancelimg" value="{#cancel}" onclick="tinyMCEPopup.close();" />
- </div>
-</form>
-</div>
-
-</body>
-</html>
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpeditimageeditor_plugin_srcjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,328 +0,0 @@
</span><del>-/* global tinymce */
-(function() {
- var mouse = {};
-
- tinymce.create('tinymce.plugins.wpEditImage', {
- url: '',
- editor: {},
-
- init: function(ed, url) {
- var t = this;
-
- t.url = url;
- t.editor = ed;
- t._createButtons();
-
- ed.addCommand('WP_EditImage', t._editImage);
-
- ed.onInit.add(function(ed) {
- ed.dom.events.add(ed.getBody(), 'mousedown', function(e) {
- var parent;
-
- if ( e.target.nodeName == 'IMG' && ( parent = ed.dom.getParent(e.target, 'div.mceTemp') ) ) {
- if ( tinymce.isGecko )
- ed.selection.select(parent);
- else if ( tinymce.isWebKit )
- ed.dom.events.prevent(e);
- }
- });
-
- // when pressing Return inside a caption move the caret to a new parapraph under it
- ed.dom.events.add(ed.getBody(), 'keydown', function(e) {
- var n, DL, DIV, P;
-
- if ( e.keyCode == 13 ) {
- n = ed.selection.getNode();
- DL = ed.dom.getParent(n, 'dl.wp-caption');
-
- if ( DL )
- DIV = ed.dom.getParent(DL, 'div.mceTemp');
-
- if ( DIV ) {
- ed.dom.events.cancel(e);
- P = ed.dom.create('p', {}, '\uFEFF');
- ed.dom.insertAfter( P, DIV );
- ed.selection.setCursorLocation(P, 0);
- return false;
- }
- }
- });
-
- // iOS6 doesn't show the buttons properly on click, show them on 'touchstart'
- if ( 'ontouchstart' in window ) {
- ed.dom.events.add(ed.getBody(), 'touchstart', function(e){
- t._showButtons(e);
- });
- }
- });
-
- // resize the caption <dl> when the image is soft-resized by the user
- ed.onMouseUp.add(function(ed, e) {
- if ( tinymce.isWebKit || tinymce.isOpera )
- return;
-
- if ( mouse.x && (e.clientX != mouse.x || e.clientY != mouse.y) ) {
- var n = ed.selection.getNode();
-
- if ( 'IMG' == n.nodeName ) {
- window.setTimeout(function(){
- var DL = ed.dom.getParent(n, 'dl.wp-caption'), width;
-
- if ( n.width != mouse.img_w || n.height != mouse.img_h )
- n.className = n.className.replace(/size-[^ "']+/, '');
-
- if ( DL ) {
- width = ed.dom.getAttrib(n, 'width') || n.width;
- width = parseInt(width, 10);
- ed.dom.setStyle(DL, 'width', 10 + width);
- ed.execCommand('mceRepaint');
- }
- }, 100);
- }
- }
- mouse = {};
- });
-
- // show editimage buttons
- ed.onMouseDown.add(function(ed, e){
- t._showButtons(e);
- });
-
- ed.onBeforeSetContent.add(function(ed, o) {
- o.content = ed.wpSetImgCaption(o.content);
- });
-
- ed.onPostProcess.add(function(ed, o) {
- if (o.get)
- o.content = ed.wpGetImgCaption(o.content);
- });
-
- ed.wpSetImgCaption = function(content) {
- return t._do_shcode(content);
- };
-
- ed.wpGetImgCaption = function(content) {
- return t._get_shcode(content);
- };
-
- // When inserting content, if the caret is inside a caption create new paragraph under
- // and move the caret there
- ed.onBeforeExecCommand.add( function( ed, cmd ) {
- var node, p;
-
- if ( cmd == 'mceInsertContent' ) {
- node = ed.dom.getParent(ed.selection.getNode(), 'div.mceTemp');
-
- if ( !node )
- return;
-
- p = ed.dom.create('p');
- ed.dom.insertAfter( p, node );
- ed.selection.setCursorLocation(p, 0);
- }
- });
- },
-
- _do_shcode : function(content) {
- return content.replace(/(?:<p>)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g, function(a,b,c){
- var id, cls, w, cap, div_cls, img, trim = tinymce.trim;
-
- id = b.match(/id=['"]([^'"]*)['"] ?/);
- if ( id )
- b = b.replace(id[0], '');
-
- cls = b.match(/align=['"]([^'"]*)['"] ?/);
- if ( cls )
- b = b.replace(cls[0], '');
-
- w = b.match(/width=['"]([0-9]*)['"] ?/);
- if ( w )
- b = b.replace(w[0], '');
-
- c = trim(c);
- img = c.match(/((?:<a [^>]+>)?<img [^>]+>(?:<\/a>)?)([\s\S]*)/i);
-
- if ( img && img[2] ) {
- cap = trim( img[2] );
- img = trim( img[1] );
- } else {
- // old captions shortcode style
- cap = trim(b).replace(/caption=['"]/, '').replace(/['"]$/, '');
- img = c;
- }
-
- id = ( id && id[1] ) ? id[1] : '';
- cls = ( cls && cls[1] ) ? cls[1] : 'alignnone';
- w = ( w && w[1] ) ? w[1] : '';
-
- if ( !w || !cap )
- return c;
-
- div_cls = 'mceTemp';
- if ( cls == 'aligncenter' )
- div_cls += ' mceIEcenter';
-
- w = parseInt( w, 10 ) + 10;
- return '<div class="'+div_cls+'"><dl id="'+id+'" class="wp-caption '+cls+'" style="width: '+w+
- 'px"><dt class="wp-caption-dt">'+img+'</dt><dd class="wp-caption-dd">'+cap+'</dd></dl></div>';
- });
- },
-
- _get_shcode : function(content) {
- return content.replace(/<div (?:id="attachment_|class="mceTemp)[^>]*>([\s\S]+?)<\/div>/g, function(a, b){
- var ret = b.replace(/<dl ([^>]+)>\s*<dt [^>]+>([\s\S]+?)<\/dt>\s*<dd [^>]+>([\s\S]*?)<\/dd>\s*<\/dl>/gi, function(a,b,c,cap){
- var id, cls, w;
-
- w = c.match(/width="([0-9]*)"/);
- w = ( w && w[1] ) ? w[1] : '';
-
- if ( !w || !cap )
- return c;
-
- id = b.match(/id="([^"]*)"/);
- id = ( id && id[1] ) ? id[1] : '';
-
- cls = b.match(/class="([^"]*)"/);
- cls = ( cls && cls[1] ) ? cls[1] : '';
- cls = cls.match(/align[a-z]+/) || 'alignnone';
-
- cap = cap.replace(/\r\n|\r/g, '\n').replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g, function(a){
- // no line breaks inside HTML tags
- return a.replace(/[\r\n\t]+/, ' ');
- });
-
- // convert remaining line breaks to <br>
- cap = cap.replace(/\s*\n\s*/g, '<br />');
-
- return '[caption id="'+id+'" align="'+cls+'" width="'+w+'"]'+c+' '+cap+'[/caption]';
- });
-
- if ( ret.indexOf('[caption') !== 0 ) {
- // the caption html seems brocken, try to find the image that may be wrapped in a link
- // and may be followed by <p> with the caption text.
- ret = b.replace(/[\s\S]*?((?:<a [^>]+>)?<img [^>]+>(?:<\/a>)?)(<p>[\s\S]*<\/p>)?[\s\S]*/gi, '<p>$1</p>$2');
- }
-
- return ret;
- });
- },
-
- _createButtons : function() {
- var t = this, ed = tinymce.activeEditor, DOM = tinymce.DOM, editButton, dellButton, isRetina;
-
- if ( DOM.get('wp_editbtns') )
- return;
-
- isRetina = ( window.devicePixelRatio && window.devicePixelRatio > 1 ) || // WebKit, Opera
- ( window.matchMedia && window.matchMedia('(min-resolution:130dpi)').matches ); // Firefox, IE10, Opera
-
- DOM.add(document.body, 'div', {
- id : 'wp_editbtns',
- style : 'display:none;'
- });
-
- editButton = DOM.add('wp_editbtns', 'img', {
- src : isRetina ? t.url+'/img/image-2x.png' : t.url+'/img/image.png',
- id : 'wp_editimgbtn',
- width : '24',
- height : '24',
- title : ed.getLang('wpeditimage.edit_img')
- });
-
- tinymce.dom.Event.add(editButton, 'mousedown', function() {
- t._editImage();
- ed.plugins.wordpress._hideButtons();
- });
-
- dellButton = DOM.add('wp_editbtns', 'img', {
- src : isRetina ? t.url+'/img/delete-2x.png' : t.url+'/img/delete.png',
- id : 'wp_delimgbtn',
- width : '24',
- height : '24',
- title : ed.getLang('wpeditimage.del_img')
- });
-
- tinymce.dom.Event.add(dellButton, 'mousedown', function() {
- var ed = tinymce.activeEditor, el = ed.selection.getNode(), parent;
-
- if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('mceItem') == -1 ) {
- if ( (parent = ed.dom.getParent(el, 'div')) && ed.dom.hasClass(parent, 'mceTemp') ) {
- ed.dom.remove(parent);
- } else {
- if ( el.parentNode.nodeName == 'A' && el.parentNode.childNodes.length == 1 )
- el = el.parentNode;
-
- if ( el.parentNode.nodeName == 'P' && el.parentNode.childNodes.length == 1 )
- el = el.parentNode;
-
- ed.dom.remove(el);
- }
-
- ed.execCommand('mceRepaint');
- return false;
- }
- ed.plugins.wordpress._hideButtons();
- });
- },
-
- _editImage : function() {
- var ed = tinymce.activeEditor, url = this.url, el = ed.selection.getNode(), vp, H, W, cls = el.className;
-
- if ( cls.indexOf('mceItem') != -1 || cls.indexOf('wpGallery') != -1 || el.nodeName != 'IMG' )
- return;
-
- vp = tinymce.DOM.getViewPort();
- H = 680 < (vp.h - 70) ? 680 : vp.h - 70;
- W = 650 < vp.w ? 650 : vp.w;
-
- ed.windowManager.open({
- file: url + '/editimage.html',
- width: W+'px',
- height: H+'px',
- inline: true
- });
- },
-
- _showButtons : function(e) {
- var ed = this.editor, target = e.target;
-
- if ( target.nodeName != 'IMG' ) {
- if ( target.firstChild && target.firstChild.nodeName == 'IMG' && target.childNodes.length == 1 ) {
- target = target.firstChild;
- } else {
- ed.plugins.wordpress._hideButtons();
- return;
- }
- }
-
- if ( ed.dom.getAttrib(target, 'class').indexOf('mceItem') == -1 ) {
- mouse = {
- x: e.clientX,
- y: e.clientY,
- img_w: target.clientWidth,
- img_h: target.clientHeight
- };
-
- if ( e.type == 'touchstart' ) {
- ed.selection.select(target);
- ed.dom.events.cancel(e);
- }
-
- ed.plugins.wordpress._hideButtons();
- ed.plugins.wordpress._showButtons(target, 'wp_editbtns');
- }
- },
-
- getInfo : function() {
- return {
- longname : 'Edit Image',
- author : 'WordPress',
- authorurl : 'http://wordpress.org',
- infourl : '',
- version : '1.0'
- };
- }
- });
-
- tinymce.PluginManager.add('wpeditimage', tinymce.plugins.wpEditImage);
-})();
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpeditimagepluginjsfromrev26862trunksrcwpincludesjstinymcepluginswpeditimageeditor_plugin_srcjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,431 @@
</span><ins>+/* global tinymce */
+tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
+ function parseShortcode( content ) {
+ return content.replace( /(?:<p>)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g, function( a, b, c ) {
+ var id, cls, w, cap, img, width,
+ trim = tinymce.trim;
+
+ id = b.match( /id=['"]([^'"]*)['"] ?/ );
+ if ( id ) {
+ b = b.replace( id[0], '' );
+ }
+
+ cls = b.match( /align=['"]([^'"]*)['"] ?/ );
+ if ( cls ) {
+ b = b.replace( cls[0], '' );
+ }
+
+ w = b.match( /width=['"]([0-9]*)['"] ?/ );
+ if ( w ) {
+ b = b.replace( w[0], '' );
+ }
+
+ c = trim( c );
+ img = c.match( /((?:<a [^>]+>)?<img [^>]+>(?:<\/a>)?)([\s\S]*)/i );
+
+ if ( img && img[2] ) {
+ cap = trim( img[2] );
+ img = trim( img[1] );
+ } else {
+ // old captions shortcode style
+ cap = trim( b ).replace( /caption=['"]/, '' ).replace( /['"]$/, '' );
+ img = c;
+ }
+
+ id = ( id && id[1] ) ? id[1] : '';
+ cls = ( cls && cls[1] ) ? cls[1] : 'alignnone';
+ w = ( w && w[1] ) ? w[1] : '';
+
+ if ( ! w || ! cap ) {
+ return c;
+ }
+
+ width = parseInt( w, 10 ) + 10;
+
+ return '<div class="mceTemp" draggable="true"><dl id="'+ id +'" class="wp-caption '+ cls +'" style="width: '+ width +'px">' +
+ '<dt class="wp-caption-dt">'+ img +'</dt><dd class="wp-caption-dd">'+ cap +'</dd></dl></div>';
+ });
+ }
+
+ function getShortcode( content ) {
+ return content.replace( /<div (?:id="attachment_|class="mceTemp)[^>]*>([\s\S]+?)<\/div>/g, function( a, b ) {
+ var ret = b.replace( /<dl ([^>]+)>\s*<dt [^>]+>([\s\S]+?)<\/dt>\s*<dd [^>]+>([\s\S]*?)<\/dd>\s*<\/dl>/gi, function( a, b, c, cap ) {
+ var id, cls, w;
+
+ w = c.match( /width="([0-9]*)"/ );
+ w = ( w && w[1] ) ? w[1] : '';
+
+ if ( ! w || ! cap ) {
+ return c;
+ }
+
+ id = b.match( /id="([^"]*)"/ );
+ id = ( id && id[1] ) ? id[1] : '';
+
+ cls = b.match( /class="([^"]*)"/ );
+ cls = ( cls && cls[1] ) ? cls[1] : '';
+ cls = cls.match( /align[a-z]+/ ) || 'alignnone';
+
+ cap = cap.replace( /\r\n|\r/g, '\n' ).replace( /<[a-zA-Z0-9]+( [^<>]+)?>/g, function( a ) {
+ // no line breaks inside HTML tags
+ return a.replace( /[\r\n\t]+/, ' ' );
+ });
+
+ // convert remaining line breaks to <br>
+ cap = cap.replace( /\s*\n\s*/g, '<br />' );
+
+ return '[caption id="'+ id +'" align="'+ cls +'" width="'+ w +'"]'+ c +' '+ cap +'[/caption]';
+ });
+
+ if ( ret.indexOf('[caption') !== 0 ) {
+ // the caption html seems brocken, try to find the image that may be wrapped in a link
+ // and may be followed by <p> with the caption text.
+ ret = b.replace( /[\s\S]*?((?:<a [^>]+>)?<img [^>]+>(?:<\/a>)?)(<p>[\s\S]*<\/p>)?[\s\S]*/gi, '<p>$1</p>$2' );
+ }
+
+ return ret;
+ });
+ }
+
+ editor.on( 'init', function() {
+ var dom = editor.dom;
+
+ // Add caption field to the default image dialog
+ editor.on( 'wpLoadImageForm', function( e ) {
+ if ( editor.getParam( 'wpeditimage_disable_captions' ) ) {
+ return;
+ }
+
+ var captionField = {
+ type: 'textbox',
+ flex: 1,
+ name: 'caption',
+ minHeight: 60,
+ multiline: true,
+ scroll: true,
+ label: 'Image caption'
+ };
+
+ e.data.splice( e.data.length - 1, 0, captionField );
+ });
+
+ // Fix caption parent width for images added from URL
+ editor.on( 'wpNewImageRefresh', function( e ) {
+ var parent, captionWidth;
+
+ if ( parent = dom.getParent( e.node, 'dl.wp-caption' ) ) {
+ if ( ! parent.style.width ) {
+ captionWidth = parseInt( e.node.clientWidth, 10 ) + 10;
+ captionWidth = captionWidth ? captionWidth + 'px' : '50%';
+ dom.setStyle( parent, 'width', captionWidth );
+ }
+ }
+ });
+
+ editor.on( 'wpImageFormSubmit', function( e ) {
+ var data = e.imgData.data,
+ imgNode = e.imgData.node,
+ caption = e.imgData.caption,
+ captionId = '',
+ captionAlign = '',
+ captionWidth = '',
+ wrap, parent, html, P, imgId;
+
+ // Temp image id so we can find the node later
+ data.id = '__wp-temp-img-id';
+ // Cancel the original callback
+ e.imgData.cancel = true;
+
+ if ( ! data.style ) {
+ data.style = null;
+ }
+
+ if ( ! data.src ) {
+ // Delete the image and the caption
+ if ( imgNode ) {
+ if ( wrap = dom.getParent( imgNode, 'div.mceTemp' ) ) {
+ dom.remove( wrap );
+ } else if ( imgNode.parentNode.nodeName === 'A' ) {
+ dom.remove( imgNode.parentNode );
+ } else {
+ dom.remove( imgNode );
+ }
+
+ editor.nodeChanged();
+ }
+ return;
+ }
+
+ if ( ! imgNode ) {
+ // New image inserted
+ html = dom.createHTML( 'img', data );
+
+ if ( caption ) {
+ node = editor.selection.getNode();
+
+ if ( data.width ) {
+ captionWidth = parseInt( data.width, 10 ) + 10;
+ captionWidth = ' style="width: '+ captionWidth +'px"';
+ }
+
+ html = '<dl class="wp-caption alignnone"' + captionWidth + '>' +
+ '<dt class="wp-caption-dt">'+ html +'</dt><dd class="wp-caption-dd">'+ caption +'</dd></dl>';
+
+ if ( node.nodeName === 'P' ) {
+ parent = node;
+ } else {
+ parent = dom.getParent( node, 'p' );
+ }
+
+ if ( parent && parent.nodeName === 'P' ) {
+ wrap = dom.create( 'div', { 'class': 'mceTemp' }, html );
+ dom.insertAfter( wrap, parent );
+ editor.selection.select( wrap );
+ editor.nodeChanged();
+
+ if ( dom.isEmpty( parent ) ) {
+ dom.remove( parent );
+ }
+ } else {
+ editor.selection.setContent( '<div class="mceTemp">' + html + '</div>' );
+ }
+ } else {
+ editor.selection.setContent( html );
+ }
+ } else {
+ // Edit existing image
+
+ // Store the original image id if any
+ imgId = imgNode.id || null;
+ // Update the image node
+ dom.setAttribs( imgNode, data );
+ wrap = dom.getParent( imgNode, 'dl.wp-caption' );
+
+ if ( caption ) {
+ if ( wrap ) {
+ if ( parent = dom.select( 'dd.wp-caption-dd', wrap )[0] ) {
+ parent.innerHTML = caption;
+ }
+ } else {
+ if ( imgNode.className ) {
+ captionId = imgNode.className.match( /wp-image-([0-9]+)/ );
+ captionAlign = imgNode.className.match( /align(left|right|center|none)/ );
+ }
+
+ if ( captionAlign ) {
+ captionAlign = captionAlign[0];
+ imgNode.className = imgNode.className.replace( /align(left|right|center|none)/g, '' );
+ } else {
+ captionAlign = 'alignnone';
+ }
+
+ captionAlign = ' class="wp-caption ' + captionAlign + '"';
+
+ if ( captionId ) {
+ captionId = ' id="attachment_' + captionId[1] + '"';
+ }
+
+ captionWidth = data.width || imgNode.clientWidth;
+
+ if ( captionWidth ) {
+ captionWidth = parseInt( captionWidth, 10 ) + 10;
+ captionWidth = ' style="width: '+ captionWidth +'px"';
+ }
+
+ if ( imgNode.parentNode && imgNode.parentNode.nodeName === 'A' ) {
+ html = dom.getOuterHTML( imgNode.parentNode );
+ node = imgNode.parentNode;
+ } else {
+ html = dom.getOuterHTML( imgNode );
+ node = imgNode;
+ }
+
+ html = '<dl ' + captionId + captionAlign + captionWidth + '>' +
+ '<dt class="wp-caption-dt">'+ html +'</dt><dd class="wp-caption-dd">'+ caption +'</dd></dl>';
+
+ if ( parent = dom.getParent( imgNode, 'p' ) ) {
+ wrap = dom.create( 'div', { 'class': 'mceTemp' }, html );
+ dom.insertAfter( wrap, parent );
+ editor.selection.select( wrap );
+ editor.nodeChanged();
+
+ // Delete the old image node
+ dom.remove( node );
+
+ if ( dom.isEmpty( parent ) ) {
+ dom.remove( parent );
+ }
+ } else {
+ editor.selection.setContent( '<div class="mceTemp">' + html + '</div>' );
+ }
+ }
+ } else {
+ if ( wrap ) {
+ // Remove the caption wrapper and place the image in new paragraph
+ if ( imgNode.parentNode.nodeName === 'A' ) {
+ html = dom.getOuterHTML( imgNode.parentNode );
+ } else {
+ html = dom.getOuterHTML( imgNode );
+ }
+
+ parent = dom.create( 'p', {}, html );
+ dom.insertAfter( parent, wrap.parentNode );
+ editor.selection.select( parent );
+ editor.nodeChanged();
+ dom.remove( wrap.parentNode );
+ }
+ }
+ }
+
+ imgNode = dom.get('__wp-temp-img-id');
+ dom.setAttrib( imgNode, 'id', imgId );
+ e.imgData.node = imgNode;
+ });
+
+ editor.on( 'wpLoadImageData', function( e ) {
+ var parent,
+ data = e.imgData.data
+ imgNode = e.imgData.node;
+
+ if ( parent = dom.getParent( imgNode, 'dl.wp-caption' ) ) {
+ parent = dom.select( 'dd.wp-caption-dd', parent )[0];
+ data.caption = parent ? parent.innerHTML : '';
+ }
+ });
+
+ // Prevent dragging images out of the caption elements
+ dom.bind( editor.getDoc(), 'dragstart', function( event ) {
+ var node = editor.selection.getNode();
+
+ if ( node.nodeName === 'IMG' && dom.getParent( node, '.wp-caption' ) ) {
+ event.preventDefault();
+ }
+ });
+ });
+
+ editor.on( 'BeforeExecCommand', function( e ) {
+ var node, p, DL, align,
+ cmd = e.command,
+ dom = editor.dom;
+
+ if ( cmd === 'mceInsertContent' ) {
+ // When inserting content, if the caret is inside a caption create new paragraph under
+ // and move the caret there
+ if ( node = dom.getParent( editor.selection.getNode(), 'div.mceTemp' ) ) {
+ p = dom.create( 'p' );
+ dom.insertAfter( p, node );
+ editor.selection.setCursorLocation( p, 0 );
+ editor.nodeChanged();
+
+ if ( tinymce.Env.ie > 8 ) {
+ setTimeout( function() {
+ editor.selection.setCursorLocation( p, 0 );
+ editor.selection.setContent( e.value );
+ }, 500 );
+
+ return false;
+ }
+ }
+ } else if ( cmd === 'JustifyLeft' || cmd === 'JustifyRight' || cmd === 'JustifyCenter' ) {
+ // When inside an image caption, set the align* class on dt.wp-caption
+ node = editor.selection.getNode();
+ align = cmd.substr(7).toLowerCase();
+ align = 'align' + align;
+
+ if ( dom.is( node, 'dl.wp-caption' ) ) {
+ DL = node;
+ } else {
+ DL = dom.getParent( node, 'dl.wp-caption' );
+ }
+
+ if ( DL ) {
+ if ( dom.hasClass( DL, align ) ) {
+ dom.removeClass( DL, align );
+ dom.addClass( DL, 'alignnone' );
+ } else {
+ DL.className = DL.className.replace( /align[^ ]+/g, '' );
+ dom.addClass( DL, align );
+ }
+
+ return false;
+ }
+ }
+ });
+
+ editor.on( 'keydown', function( e ) {
+ var node, wrap, P, spacer,
+ selection = editor.selection,
+ dom = editor.dom;
+
+ if ( e.keyCode === tinymce.util.VK.ENTER ) {
+ // When pressing Enter inside a caption move the caret to a new parapraph under it
+ wrap = dom.getParent( editor.selection.getNode(), 'div.mceTemp' );
+
+ if ( wrap ) {
+ dom.events.cancel(e); // Doesn't cancel all :(
+
+ // Remove any extra dt and dd cleated on pressing Enter...
+ tinymce.each( dom.select( 'dt, dd', wrap ), function( element ) {
+ if ( dom.isEmpty( element ) ) {
+ dom.remove( element );
+ }
+ });
+
+ spacer = tinymce.Env.ie ? '' : '<br data-mce-bogus="1" />';
+ P = dom.create( 'p', null, spacer );
+ dom.insertAfter( P, wrap );
+ selection.setCursorLocation( P, 0 );
+ editor.nodeChanged();
+ }
+ } else if ( e.keyCode === tinymce.util.VK.DELETE || e.keyCode === tinymce.util.VK.BACKSPACE ) {
+ node = selection.getNode();
+
+ if ( node.nodeName === 'DIV' && dom.hasClass( node, 'mceTemp' ) ) {
+ wrap = node;
+ } else if ( node.nodeName === 'IMG' || node.nodeName === 'DT' || node.nodeName === 'A' ) {
+ wrap = dom.getParent( node, 'div.mceTemp' );
+ }
+
+ if ( wrap ) {
+ dom.events.cancel(e);
+
+ if ( wrap.nextSibling ) {
+ selection.select( wrap.nextSibling );
+ } else if ( wrap.previousSibling ) {
+ selection.select( wrap.previousSibling );
+ } else {
+ selection.select( wrap.parentNode );
+ }
+
+ selection.collapse( true );
+ editor.nodeChanged();
+ dom.remove( wrap );
+ wrap = null;
+ return false;
+ }
+ }
+ });
+
+ editor.wpSetImgCaption = function( content ) {
+ return parseShortcode( content );
+ };
+
+ editor.wpGetImgCaption = function( content ) {
+ return getShortcode( content );
+ };
+
+ editor.on( 'BeforeSetContent', function( e ) {
+ e.content = editor.wpSetImgCaption( e.content );
+ });
+
+ editor.on( 'PostProcess', function( e ) {
+ if ( e.get ) {
+ e.content = editor.wpGetImgCaption( e.content );
+ }
+ });
+
+ return {
+ _do_shcode: parseShortcode,
+ _get_shcode: getShortcode
+ };
+});
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpfullscreeneditor_plugin_srcjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,190 +0,0 @@
</span><del>-/* global tinymce:false, switchEditors, fullscreen */
-/**
- * WP Fullscreen TinyMCE plugin
- *
- * Contains code from Moxiecode Systems AB released under LGPL http://tinymce.moxiecode.com/license
- */
-
-(function() {
- tinymce.create('tinymce.plugins.wpFullscreenPlugin', {
- resize_timeout: false,
-
- init : function( ed ) {
- var t = this, s = {}, DOM = tinymce.DOM;
-
- // Register commands
- ed.addCommand('wpFullScreenClose', function() {
- // this removes the editor, content has to be saved first with tinymce.execCommand('wpFullScreenSave');
- if ( ed.getParam('wp_fullscreen_is_enabled') ) {
- DOM.win.setTimeout(function() {
- tinymce.remove(ed);
- DOM.remove('wp_mce_fullscreen_parent');
- tinymce.settings = tinymce.oldSettings; // Restore old settings
- }, 10);
- }
- });
-
- ed.addCommand('wpFullScreenSave', function() {
- var ed = tinymce.get('wp_mce_fullscreen'), edd;
-
- ed.focus();
- edd = tinymce.get( ed.getParam('wp_fullscreen_editor_id') );
-
- edd.setContent( ed.getContent({format : 'raw'}), {format : 'raw'} );
- });
-
- ed.addCommand('wpFullScreenInit', function() {
- var d, b, fsed;
-
- ed = tinymce.activeEditor;
- d = ed.getDoc();
- b = d.body;
-
- tinymce.oldSettings = tinymce.settings; // Store old settings
-
- tinymce.each(ed.settings, function(v, n) {
- s[n] = v;
- });
-
- s.id = 'wp_mce_fullscreen';
- s.wp_fullscreen_is_enabled = true;
- s.wp_fullscreen_editor_id = ed.id;
- s.theme_advanced_resizing = false;
- s.theme_advanced_statusbar_location = 'none';
- s.content_css = s.content_css ? s.content_css + ',' + s.wp_fullscreen_content_css : s.wp_fullscreen_content_css;
- s.height = tinymce.isIE ? b.scrollHeight : b.offsetHeight;
-
- tinymce.each(ed.getParam('wp_fullscreen_settings'), function(v, k) {
- s[k] = v;
- });
-
- fsed = new tinymce.Editor('wp_mce_fullscreen', s);
- fsed.onInit.add(function(edd) {
- var DOM = tinymce.DOM, buttons = DOM.select('a.mceButton', DOM.get('wp-fullscreen-buttons'));
-
- if ( !ed.isHidden() )
- edd.setContent( ed.getContent() );
- else
- edd.setContent( switchEditors.wpautop( edd.getElement().value ) );
-
- setTimeout(function(){ // add last
- edd.onNodeChange.add( function() {
- tinymce.each(buttons, function(c) {
- var btn, cls;
-
- if ( btn = DOM.get( 'wp_mce_fullscreen_' + c.id.substr(6) ) ) {
- cls = btn.className;
-
- if ( cls )
- c.className = cls;
- }
- });
- });
- }, 1000);
-
- edd.dom.addClass(edd.getBody(), 'wp-fullscreen-editor');
- edd.focus();
- });
-
- fsed.render();
-
- if ( 'undefined' != fullscreen ) {
- fsed.dom.bind( fsed.dom.doc, 'mousemove', function(e){
- fullscreen.bounder( 'showToolbar', 'hideToolbar', 2000, e );
- });
- }
- });
-
- ed.addCommand('wpFullScreen', function() {
- if ( typeof(fullscreen) == 'undefined' )
- return;
-
- if ( 'wp_mce_fullscreen' == ed.id )
- fullscreen.off();
- else
- fullscreen.on();
- });
-
- // Register buttons
- ed.addButton('wp_fullscreen', {
- title : 'wordpress.wp_fullscreen_desc',
- cmd : 'wpFullScreen'
- });
-
- // END fullscreen
-//----------------------------------------------------------------
- // START autoresize
-
- if ( ed.getParam('fullscreen_is_enabled') || !ed.getParam('wp_fullscreen_is_enabled') )
- return;
-
- /**
- * This method gets executed each time the editor needs to resize.
- */
- function resize(editor, e) {
- var DOM = tinymce.DOM, body = ed.getBody(), ifr = DOM.get(ed.id + '_ifr'), height, y = ed.dom.win.scrollY;
-
- if ( t.resize_timeout )
- return;
-
- // sometimes several events are fired few ms apart, trottle down resizing a little
- t.resize_timeout = true;
- setTimeout(function(){
- t.resize_timeout = false;
- }, 500);
-
- height = body.scrollHeight > 300 ? body.scrollHeight : 300;
-
- if ( height != ifr.scrollHeight ) {
- DOM.setStyle(ifr, 'height', height + 'px');
- ed.getWin().scrollTo(0, 0); // iframe window object, make sure there's no scrolling
- }
-
- // WebKit scrolls to top on paste...
- if ( e && e.type == 'paste' && tinymce.isWebKit ) {
- setTimeout(function(){
- ed.dom.win.scrollTo(0, y);
- }, 40);
- }
- }
-
- // Add appropriate listeners for resizing content area
- ed.onInit.add( function( ed ) {
- ed.onChange.add(resize);
- ed.onSetContent.add(resize);
- ed.onPaste.add(resize);
- ed.onKeyUp.add(resize);
- ed.onPostRender.add(resize);
-
- ed.getBody().style.overflowY = 'hidden';
- });
-
- if ( ed.getParam('autoresize_on_init', true) ) {
- ed.onLoadContent.add( function() {
- // 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();
- }, 1200);
- });
- }
-
- // Register the command so that it can be invoked by using tinymce.activeEditor.execCommand('mceExample');
- ed.addCommand('wpAutoResize', resize);
- },
-
- getInfo : function() {
- return {
- longname : 'WP Fullscreen',
- author : 'WordPress',
- authorurl : 'http://wordpress.org',
- infourl : '',
- version : '1.0'
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('wpfullscreen', tinymce.plugins.wpFullscreenPlugin);
-})();
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpfullscreenpluginjsfromrev26862trunksrcwpincludesjstinymcepluginswpfullscreeneditor_plugin_srcjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,104 @@
</span><ins>+/* global tinymce */
+/**
+ * WP Fullscreen (Distraction Free Writing) TinyMCE plugin
+ */
+tinymce.PluginManager.add( 'wpfullscreen', function( editor ) {
+ var settings = editor.settings,
+ oldSize = 0;
+
+ function resize( e ) {
+ var deltaSize, myHeight,
+ d = editor.getDoc(),
+ body = d.body,
+ de = d.documentElement,
+ DOM = tinymce.DOM
+ resizeHeight = 250;
+
+ if ( ( e && e.type == 'setcontent' && e.initial ) || editor.settings.inline ) {
+ return;
+ }
+
+ // Get height differently depending on the browser used
+ myHeight = tinymce.Env.ie ? body.scrollHeight : ( tinymce.Env.webkit && body.clientHeight === 0 ? 0 : body.offsetHeight );
+
+ // Don't make it smaller than 250px
+ if ( myHeight > 250 ) {
+ resizeHeight = myHeight;
+ }
+
+ body.scrollTop = 0;
+
+ // Resize content element
+ if ( resizeHeight !== oldSize ) {
+ deltaSize = resizeHeight - oldSize;
+ DOM.setStyle( DOM.get( editor.id + '_ifr' ), 'height', resizeHeight + 'px' );
+ oldSize = resizeHeight;
+
+ // WebKit doesn't decrease the size of the body element until the iframe gets resized
+ // So we need to continue to resize the iframe down until the size gets fixed
+ if ( tinymce.isWebKit && deltaSize < 0 ) {
+ resize( e );
+ }
+ }
+ }
+
+ // Register the command
+ editor.addCommand( 'wpAutoResize', resize );
+
+ function fullscreenOn() {
+ settings.wp_fullscreen = true;
+ editor.dom.addClass( editor.getDoc().documentElement, 'wp-fullscreen' );
+ // Add listeners for auto-resizing
+ editor.on( 'change setcontent paste keyup', resize );
+ }
+
+ function fullscreenOff() {
+ settings.wp_fullscreen = false;
+ editor.dom.removeClass( editor.getDoc().documentElement, 'wp-fullscreen' );
+ // Remove listeners for auto-resizing
+ editor.off( 'change setcontent paste keyup', resize );
+ oldSize = 0;
+ }
+
+ // For use from outside the editor.
+ editor.addCommand( 'wpFullScreenOn', fullscreenOn );
+ editor.addCommand( 'wpFullScreenOff', fullscreenOff );
+
+ function toggleFullscreen() {
+ // Toggle DFW mode. For use from inside the editor.
+ if ( typeof wp === 'undefined' || ! wp.editor || ! wp.editor.fullscreen ) {
+ return;
+ }
+
+ if ( editor.getParam('wp_fullscreen') ) {
+ wp.editor.fullscreen.off();
+ } else {
+ wp.editor.fullscreen.on();
+ }
+ }
+
+ editor.addCommand( 'wpFullScreen', toggleFullscreen );
+
+ editor.on( 'init', function() {
+ // Set the editor when initializing from whitin DFW
+ if ( editor.getParam('wp_fullscreen') ) {
+ fullscreenOn();
+ }
+
+ editor.addShortcut( 'alt+shift+w', '', 'wpFullScreen' );
+ });
+
+ // Register buttons
+ editor.addButton( 'wp_fullscreen', {
+ tooltip: 'Distraction Free Writing',
+ shortcut: 'Alt+Shift+W',
+ onclick: toggleFullscreen
+ });
+
+ editor.addMenuItem( 'wp_fullscreen', {
+ text: 'Distraction Free Writing',
+ shortcut: 'Alt+Shift+W',
+ context: 'view',
+ onclick: toggleFullscreen
+ });
+});
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpgalleryeditor_plugin_srcjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin_src.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin_src.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin_src.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,156 +0,0 @@
</span><del>-/* global tinymce */
-(function() {
- tinymce.create('tinymce.plugins.wpGallery', {
-
- init : function(ed, url) {
- var t = this;
-
- t.url = url;
- t.editor = ed;
- t._createButtons();
-
- // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...');
- ed.addCommand('WP_Gallery', function() {
- if ( tinymce.isIE )
- ed.selection.moveToBookmark( ed.wpGalleryBookmark );
-
- var el = ed.selection.getNode(),
- gallery = wp.media.gallery,
- frame;
-
- // Check if the `wp.media.gallery` API exists.
- if ( typeof wp === 'undefined' || ! wp.media || ! wp.media.gallery )
- return;
-
- // Make sure we've selected a gallery node.
- if ( el.nodeName != 'IMG' || ed.dom.getAttrib(el, 'class').indexOf('wp-gallery') == -1 )
- return;
-
- frame = gallery.edit( '[' + ed.dom.getAttrib( el, 'title' ) + ']' );
-
- frame.state('gallery-edit').on( 'update', function( selection ) {
- var shortcode = gallery.shortcode( selection ).string().slice( 1, -1 );
- ed.dom.setAttrib( el, 'title', shortcode );
- });
- });
-
- ed.onInit.add(function(ed) {
- // iOS6 doesn't show the buttons properly on click, show them on 'touchstart'
- if ( 'ontouchstart' in window ) {
- ed.dom.events.add(ed.getBody(), 'touchstart', function(e){
- var target = e.target;
-
- if ( target.nodeName == 'IMG' && ed.dom.hasClass(target, 'wp-gallery') ) {
- ed.selection.select(target);
- ed.dom.events.cancel(e);
- ed.plugins.wordpress._hideButtons();
- ed.plugins.wordpress._showButtons(target, 'wp_gallerybtns');
- }
- });
- }
- });
-
- ed.onMouseDown.add(function(ed, e) {
- if ( e.target.nodeName == 'IMG' && ed.dom.hasClass(e.target, 'wp-gallery') ) {
- ed.plugins.wordpress._hideButtons();
- ed.plugins.wordpress._showButtons(e.target, 'wp_gallerybtns');
- }
- });
-
- ed.onBeforeSetContent.add(function(ed, o) {
- o.content = t._do_gallery(o.content);
- });
-
- ed.onPostProcess.add(function(ed, o) {
- if (o.get)
- o.content = t._get_gallery(o.content);
- });
- },
-
- _do_gallery : function(co) {
- return co.replace(/\[gallery([^\]]*)\]/g, function(a,b){
- return '<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="wp-gallery mceItem" title="gallery'+tinymce.DOM.encode(b)+'" />';
- });
- },
-
- _get_gallery : function(co) {
-
- function getAttr(s, n) {
- n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s);
- return n ? tinymce.DOM.decode(n[1]) : '';
- }
-
- return co.replace(/(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g, function(a,im) {
- var cls = getAttr(im, 'class');
-
- if ( cls.indexOf('wp-gallery') != -1 )
- return '<p>['+tinymce.trim(getAttr(im, 'title'))+']</p>';
-
- return a;
- });
- },
-
- _createButtons : function() {
- var t = this, ed = tinymce.activeEditor, DOM = tinymce.DOM, editButton, dellButton, isRetina;
-
- if ( DOM.get('wp_gallerybtns') )
- return;
-
- isRetina = ( window.devicePixelRatio && window.devicePixelRatio > 1 ) || // WebKit, Opera
- ( window.matchMedia && window.matchMedia('(min-resolution:130dpi)').matches ); // Firefox, IE10, Opera
-
- DOM.add(document.body, 'div', {
- id : 'wp_gallerybtns',
- style : 'display:none;'
- });
-
- editButton = DOM.add('wp_gallerybtns', 'img', {
- src : isRetina ? t.url+'/img/edit-2x.png' : t.url+'/img/edit.png',
- id : 'wp_editgallery',
- width : '24',
- height : '24',
- title : ed.getLang('wordpress.editgallery')
- });
-
- tinymce.dom.Event.add( editButton, 'mousedown', function() {
- var ed = tinymce.activeEditor;
- ed.wpGalleryBookmark = ed.selection.getBookmark('simple');
- ed.execCommand('WP_Gallery');
- ed.plugins.wordpress._hideButtons();
- });
-
- dellButton = DOM.add('wp_gallerybtns', 'img', {
- src : isRetina ? t.url+'/img/delete-2x.png' : t.url+'/img/delete.png',
- id : 'wp_delgallery',
- width : '24',
- height : '24',
- title : ed.getLang('wordpress.delgallery')
- });
-
- tinymce.dom.Event.add(dellButton, 'mousedown', function(e) {
- var ed = tinymce.activeEditor, el = ed.selection.getNode();
-
- if ( el.nodeName == 'IMG' && ed.dom.hasClass(el, 'wp-gallery') ) {
- ed.dom.remove(el);
-
- ed.execCommand('mceRepaint');
- ed.dom.events.cancel(e);
- }
-
- ed.plugins.wordpress._hideButtons();
- });
- },
-
- getInfo : function() {
- return {
- longname : 'Gallery Settings',
- author : 'WordPress',
- authorurl : 'http://wordpress.org',
- infourl : '',
- version : '1.0'
- };
- }
- });
-
- tinymce.PluginManager.add('wpgallery', tinymce.plugins.wpGallery);
-})();
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpgallerypluginjsfromrev26862trunksrcwpincludesjstinymcepluginswpgalleryeditor_plugin_srcjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin_src.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,111 @@
</span><ins>+/* global tinymce */
+tinymce.PluginManager.add('wpgallery', function( editor, url ) {
+
+ function parseGallery( content ) {
+ return content.replace( /\[gallery([^\]]*)\]/g, function( match, attr ) {
+ var data = tinymce.DOM.encode( attr );
+
+ return '<img src="' + tinymce.Env.transparentSrc + '" class="wp-gallery mceItem" ' +
+ 'title="gallery' + data + '" data-mce-resize="false" data-mce-placeholder="1" />';
+ });
+ }
+
+ function getGallery( content ) {
+ function getAttr( str, name ) {
+ name = new RegExp( name + '=\"([^\"]+)\"', 'g' ).exec( str );
+ return name ? tinymce.DOM.decode( name[1] ) : '';
+ }
+
+ return content.replace( /(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g, function( match, image ) {
+ var cls = getAttr( image, 'class' );
+
+ if ( cls.indexOf('wp-gallery') !== -1 ) {
+ return '<p>['+ tinymce.trim( getAttr( image, 'title' ) ) +']</p>';
+ }
+
+ return match;
+ });
+ }
+
+ // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...');
+ editor.addCommand( 'WP_Gallery', function() {
+ var gallery, frame, node;
+
+ // Check if the `wp.media.gallery` API exists.
+ if ( typeof wp === 'undefined' || ! wp.media || ! wp.media.gallery ) {
+ return;
+ }
+
+ node = editor.selection.getNode();
+ gallery = wp.media.gallery;
+
+ // Make sure we've selected a gallery node.
+ if ( node.nodeName === 'IMG' && editor.dom.hasClass( node, 'wp-gallery' ) ) {
+ frame = gallery.edit( '[' + editor.dom.getAttrib( node, 'title' ) + ']' );
+
+ frame.state('gallery-edit').on( 'update', function( selection ) {
+ var shortcode = gallery.shortcode( selection ).string().slice( 1, -1 );
+ editor.dom.setAttrib( node, 'title', shortcode );
+ });
+ }
+ });
+/*
+ editor.on( 'init', function( e ) {
+ // _createButtons()
+
+ // iOS6 doesn't show the buttons properly on click, show them on 'touchstart'
+ if ( 'ontouchstart' in window ) {
+ editor.dom.events.bind( editor.getBody(), 'touchstart', function( e ) {
+ var target = e.target;
+
+ if ( target.nodeName == 'IMG' && editor.dom.hasClass( target, 'wp-gallery' ) ) {
+ editor.selection.select( target );
+ editor.dom.events.cancel( e );
+ editor.plugins.wordpress._hideButtons();
+ editor.plugins.wordpress._showButtons( target, 'wp_gallerybtns' );
+ }
+ });
+ }
+ });
+*/
+ editor.on( 'mouseup', function( e ) {
+ if ( e.target.nodeName == 'IMG' && editor.dom.hasClass( e.target, 'wp-gallery' ) ) {
+ // Don't trigger on right-click
+ if ( e.button !== 2 ) {
+ if ( editor.dom.hasClass( e.target, 'wp-gallery-selected' ) ) {
+ editor.execCommand('WP_Gallery');
+ editor.dom.removeClass( e.target, 'wp-gallery-selected' );
+ } else {
+ editor.dom.addClass( e.target, 'wp-gallery-selected' );
+ }
+ }
+ } else {
+ editor.dom.removeClass( editor.dom.select( 'img.wp-gallery-selected' ), 'wp-gallery-selected' );
+ }
+ });
+
+ // Display 'gallery' instead of img in element path
+ editor.on( 'ResolveName', function( e ) {
+ var dom = editor.dom,
+ target = e.target;
+
+ if ( target.nodeName === 'IMG' && dom.hasClass( target, 'wp-gallery' ) ) {
+ e.name = 'gallery';
+ }
+ });
+
+ editor.on( 'BeforeSetContent', function( e ) {
+ e.content = parseGallery( e.content );
+ });
+
+ editor.on( 'PostProcess', function( e ) {
+ if ( e.get ) {
+ e.content = getGallery( e.content );
+ }
+ });
+
+ return {
+ _do_gallery: parseGallery,
+ _get_gallery: getGallery
+ };
+});
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswplinkeditor_plugin_srcjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/wplink/editor_plugin_src.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wplink/editor_plugin_src.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/wplink/editor_plugin_src.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,61 +0,0 @@
</span><del>-/* global tinymce */
-
-(function() {
- tinymce.create('tinymce.plugins.wpLink', {
- /**
- * Initializes the plugin, this will be executed after the plugin has been created.
- * This call is done before the editor instance has finished its 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 disabled = true;
-
- // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
- ed.addCommand('WP_Link', function() {
- if ( disabled )
- return;
- ed.windowManager.open({
- id : 'wp-link',
- width : 480,
- height : 'auto',
- wpDialog : true,
- title : ed.getLang('advlink.link_desc')
- }, {
- plugin_url : url // Plugin absolute URL
- });
- });
-
- // Register example button
- ed.addButton('link', {
- title : 'advanced.link_desc',
- cmd : 'WP_Link'
- });
-
- ed.onNodeChange.add(function(ed, cm, n, co) {
- disabled = co && n.nodeName != 'A';
- });
- },
- /**
- * 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 : 'WordPress Link Dialog',
- author : 'WordPress',
- authorurl : 'http://wordpress.org',
- infourl : '',
- version : '1.0'
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('wplink', tinymce.plugins.wpLink);
-})();
-
</del></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswplinkpluginjsfromrev26862trunksrcwpincludesjstinymcepluginswplinkeditor_plugin_srcjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/wplink/plugin.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/wplink/editor_plugin_src.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wplink/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/wplink/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+/* global tinymce */
+tinymce.PluginManager.add( 'wplink', function( editor ) {
+ // Register a command so that it can be invoked by using tinyMCE.activeEditor.execCommand( 'WP_Link' );
+ editor.addCommand( 'WP_Link', function() {
+ if ( typeof window.wpLink !== 'undefined' ) {
+ window.wpLink.open( editor.id );
+ }
+ });
+
+ editor.addButton( 'link', {
+ icon: 'link',
+ tooltip: 'Insert/edit link',
+ shortcut: 'Alt+Shift+A',
+ cmd: 'WP_Link',
+ stateSelector: 'a[href]'
+ });
+
+ editor.addMenuItem( 'link', {
+ icon: 'link',
+ text: 'Insert link',
+ shortcut: 'Alt+Shift+A',
+ cmd: 'WP_Link',
+ stateSelector: 'a[href]',
+ context: 'insert',
+ prependToContext: true
+ });
+});
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpvieweditor_plugin_srcjs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/plugins/wpview/editor_plugin_src.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpview/editor_plugin_src.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpview/editor_plugin_src.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,189 +0,0 @@
</span><del>-/* global tinymce */
-/**
- * WordPress View plugin.
- */
-
-(function() {
- var VK = tinymce.VK,
- TreeWalker = tinymce.dom.TreeWalker,
- selected;
-
- tinymce.create('tinymce.plugins.wpView', {
- init : function( editor ) {
- var wpView = this;
-
- // Check if the `wp.mce` API exists.
- if ( typeof wp === 'undefined' || ! wp.mce )
- return;
-
- editor.onPreInit.add( function( editor ) {
- // Add elements so we can set `contenteditable` to false.
- editor.schema.addValidElements('div[*],span[*]');
- });
-
- // When the editor's content changes, scan the new content for
- // matching view patterns, and transform the matches into
- // view wrappers. Since the editor's DOM is outdated at this point,
- // we'll wait to render the views.
- editor.onBeforeSetContent.add( function( editor, o ) {
- if ( ! o.content )
- return;
-
- o.content = wp.mce.view.toViews( o.content );
- });
-
- // When the editor's content has been updated and the DOM has been
- // processed, render the views in the document.
- editor.onSetContent.add( function( editor ) {
- wp.mce.view.render( editor.getDoc() );
- });
-
- editor.onInit.add( function( editor ) {
-
- // When a view is selected, ensure content that is being pasted
- // or inserted is added to a text node (instead of the view).
- editor.selection.onBeforeSetContent.add( function( selection ) {
- var view = wpView.getParentView( selection.getNode() ),
- walker, target;
-
- // If the selection is not within a view, bail.
- if ( ! view )
- return;
-
- // If there are no additional nodes or the next node is a
- // view, create a text node after the current view.
- if ( ! view.nextSibling || wpView.isView( view.nextSibling ) ) {
- target = editor.getDoc().createTextNode('');
- editor.dom.insertAfter( target, view );
-
- // Otherwise, find the next text node.
- } else {
- walker = new TreeWalker( view.nextSibling, view.nextSibling );
- target = walker.next();
- }
-
- // Select the `target` text node.
- selection.select( target );
- selection.collapse( true );
- });
-
- // When the selection's content changes, scan any new content
- // for matching views and immediately render them.
- //
- // Runs on paste and on inserting nodes/html.
- editor.selection.onSetContent.add( function( selection, o ) {
- if ( ! o.context )
- return;
-
- var node = selection.getNode();
-
- if ( ! node.innerHTML )
- return;
-
- node.innerHTML = wp.mce.view.toViews( node.innerHTML );
- wp.mce.view.render( node );
- });
- });
-
- // When the editor's contents are being accessed as a string,
- // transform any views back to their text representations.
- editor.onPostProcess.add( function( editor, o ) {
- if ( ( ! o.get && ! o.save ) || ! o.content )
- return;
-
- o.content = wp.mce.view.toText( o.content );
- });
-
- // Triggers when the selection is changed.
- // Add the event handler to the top of the stack.
- editor.onNodeChange.addToTop( function( editor, controlManager, node ) {
- var view = wpView.getParentView( node );
-
- // Update the selected view.
- if ( view ) {
- wpView.select( view );
-
- // Prevent the selection from propagating to other plugins.
- return false;
-
- // If we've clicked off of the selected view, deselect it.
- } else {
- wpView.deselect();
- }
- });
-
- editor.onKeyDown.addToTop( function( editor, event ) {
- var keyCode = event.keyCode,
- view, instance;
-
- // If a view isn't selected, let the event go on its merry way.
- if ( ! selected )
- return;
-
- // If the caret is not within the selected view, deselect the
- // view and bail.
- view = wpView.getParentView( editor.selection.getNode() );
- if ( view !== selected ) {
- wpView.deselect();
- return;
- }
-
- // If delete or backspace is pressed, delete the view.
- if ( keyCode === VK.DELETE || keyCode === VK.BACKSPACE ) {
- if ( (instance = wp.mce.view.instance( selected )) ) {
- instance.remove();
- wpView.deselect();
- }
- }
-
- // Let keypresses that involve the command or control keys through.
- // Also, let any of the F# keys through.
- if ( event.metaKey || event.ctrlKey || ( keyCode >= 112 && keyCode <= 123 ) )
- return;
-
- event.preventDefault();
- });
- },
-
- getParentView : function( node ) {
- while ( node ) {
- if ( this.isView( node ) )
- return node;
-
- node = node.parentNode;
- }
- },
-
- isView : function( node ) {
- return (/(?:^|\s)wp-view-wrap(?:\s|$)/).test( node.className );
- },
-
- select : function( view ) {
- if ( view === selected )
- return;
-
- this.deselect();
- selected = view;
- wp.mce.view.select( selected );
- },
-
- deselect : function() {
- if ( selected )
- wp.mce.view.deselect( selected );
- selected = null;
- },
-
- getInfo : function() {
- return {
- longname : 'WordPress Views',
- author : 'WordPress',
- authorurl : 'http://wordpress.org',
- infourl : 'http://wordpress.org',
- version : '1.0'
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add( 'wpview', tinymce.plugins.wpView );
-})();
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpviewpluginjsfromrev26862trunksrcwpincludesjstinymcepluginswpvieweditor_plugin_srcjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js (from rev 26862, trunk/src/wp-includes/js/tinymce/plugins/wpview/editor_plugin_src.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,179 @@
</span><ins>+/* global tinymce */
+/**
+ * WordPress View plugin.
+ */
+
+(function() {
+ var VK = tinymce.VK,
+ TreeWalker = tinymce.dom.TreeWalker,
+ selected;
+
+ tinymce.create('tinymce.plugins.wpView', {
+ init : function( editor ) {
+ var wpView = this;
+
+ // Check if the `wp.mce` API exists.
+ if ( typeof wp === 'undefined' || ! wp.mce )
+ return;
+
+ editor.on( 'PreInit', function() {
+ // Add elements so we can set `contenteditable` to false.
+ editor.schema.addValidElements('div[*],span[*]');
+ });
+
+ // When the editor's content changes, scan the new content for
+ // matching view patterns, and transform the matches into
+ // view wrappers. Since the editor's DOM is outdated at this point,
+ // we'll wait to render the views.
+ editor.on( 'BeforeSetContent', function( e ) {
+ if ( ! e.content )
+ return;
+
+ e.content = wp.mce.view.toViews( e.content );
+ });
+
+ // When the editor's content has been updated and the DOM has been
+ // processed, render the views in the document.
+ editor.on( 'SetContent', function() {
+ wp.mce.view.render( editor.getDoc() );
+ });
+
+ editor.on( 'init', function() {
+ var selection = editor.selection;
+ // When a view is selected, ensure content that is being pasted
+ // or inserted is added to a text node (instead of the view).
+ editor.on( 'BeforeSetContent', function( e ) {
+ var walker, target,
+ view = wpView.getParentView( selection.getNode() );
+
+ // If the selection is not within a view, bail.
+ if ( ! view )
+ return;
+
+ // If there are no additional nodes or the next node is a
+ // view, create a text node after the current view.
+ if ( ! view.nextSibling || wpView.isView( view.nextSibling ) ) {
+ target = editor.getDoc().createTextNode('');
+ editor.dom.insertAfter( target, view );
+
+ // Otherwise, find the next text node.
+ } else {
+ walker = new TreeWalker( view.nextSibling, view.nextSibling );
+ target = walker.next();
+ }
+
+ // Select the `target` text node.
+ selection.select( target );
+ selection.collapse( true );
+ });
+
+ // When the selection's content changes, scan any new content
+ // for matching views and immediately render them.
+ //
+ // Runs on paste and on inserting nodes/html.
+ editor.on( 'SetContent', function( e ) {
+ if ( ! e.context )
+ return;
+
+ var node = selection.getNode();
+
+ if ( ! node.innerHTML )
+ return;
+
+ node.innerHTML = wp.mce.view.toViews( node.innerHTML );
+ wp.mce.view.render( node );
+ });
+ });
+
+ // When the editor's contents are being accessed as a string,
+ // transform any views back to their text representations.
+ editor.on( 'PostProcess', function( e ) {
+ if ( ( ! e.get && ! e.save ) || ! e.content )
+ return;
+
+ e.content = wp.mce.view.toText( e.content );
+ });
+
+ // Triggers when the selection is changed.
+ // Add the event handler to the top of the stack.
+ editor.on( 'NodeChange', function( e ) {
+ var view = wpView.getParentView( node );
+
+ // Update the selected view.
+ if ( view ) {
+ wpView.select( view );
+
+ // Prevent the selection from propagating to other plugins.
+ return false;
+
+ // If we've clicked off of the selected view, deselect it.
+ } else {
+ wpView.deselect();
+ }
+ });
+
+ editor.on( 'keydown', function( event ) {
+ var keyCode = event.keyCode,
+ view, instance;
+
+ // If a view isn't selected, let the event go on its merry way.
+ if ( ! selected )
+ return;
+
+ // If the caret is not within the selected view, deselect the
+ // view and bail.
+ view = wpView.getParentView( selection.getNode() );
+ if ( view !== selected ) {
+ wpView.deselect();
+ return;
+ }
+
+ // If delete or backspace is pressed, delete the view.
+ if ( keyCode === VK.DELETE || keyCode === VK.BACKSPACE ) {
+ if ( (instance = wp.mce.view.instance( selected )) ) {
+ instance.remove();
+ wpView.deselect();
+ }
+ }
+
+ // Let keypresses that involve the command or control keys through.
+ // Also, let any of the F# keys through.
+ if ( event.metaKey || event.ctrlKey || ( keyCode >= 112 && keyCode <= 123 ) )
+ return;
+
+ event.preventDefault();
+ });
+ },
+
+ getParentView : function( node ) {
+ while ( node ) {
+ if ( this.isView( node ) )
+ return node;
+
+ node = node.parentNode;
+ }
+ },
+
+ isView : function( node ) {
+ return (/(?:^|\s)wp-view-wrap(?:\s|$)/).test( node.className );
+ },
+
+ select : function( view ) {
+ if ( view === selected )
+ return;
+
+ this.deselect();
+ selected = view;
+ wp.mce.view.select( selected );
+ },
+
+ deselect : function() {
+ if ( selected )
+ wp.mce.view.deselect( selected );
+ selected = null;
+ }
+ });
+
+ // Register plugin
+ tinymce.PluginManager.add( 'wpview', tinymce.plugins.wpView );
+})();
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymceskinslightgraycontentinlinemincss"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/content.inline.min.css (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/skins/lightgray/content.inline.min.css (rev 0)
+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/content.inline.min.css 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{background:url(img/wline.gif) repeat-x bottom left;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymceskinslightgraycontentmincss"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/content.min.css (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/skins/lightgray/content.min.css (rev 0)
+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/content.min.css 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+body{background-color:#FFFFFF;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor
:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{background:url(img/wline.gif) repeat-x bottom left;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymceskinslightgrayfontsreadmemd"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/readme.md (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/readme.md (rev 0)
+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/readme.md 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Icons are generated and provided by the http://icomoon.io service.
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymceskinslightgrayfontstinymcesmalleot"></a>
<div class="binary"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.eot</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.eot
</span><span class="cx">===================================================================
</span><del>--- trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.eot 2013-12-28 05:24:32 UTC (rev 26875)
</del><ins>+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.eot 2013-12-28 23:52:04 UTC (rev 26876)
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.eot
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceskinslightgrayfontstinymcesmallsvg"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.svg (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.svg (rev 0)
+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.svg 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,175 @@
</span><ins>+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata>
+This is a custom SVG font generated by IcoMoon.
+<iconset grid="16"></iconset>
+</metadata>
+<defs>
+<font id="tinymce-small" horiz-adv-x="512" >
+<font-face units-per-em="512" ascent="480" descent="-32" />
+<missing-glyph horiz-adv-x="512" />
+<glyph class="hidden" unicode="" d="M0,480L 512 -32L0 -32 z" horiz-adv-x="0" />
+<glyph unicode="" d="M 352,64l0,18.502 c 75.674,30.814, 128,96.91, 128,173.498c0,106.039-100.288,192-224,192S 32,362.039, 32,256
+ c0-76.588, 52.327-142.684, 128-173.498L 160,64 L 64,64 l-32,48l0-112 l 160,0 L 192,111.406 c-50.45,25.681-85.333,80.77-85.333,144.594
+ c0,88.366, 66.859,160, 149.333,160c 82.474,0, 149.333-71.634, 149.333-160c0-63.824-34.883-118.913-85.333-144.594L 320,0 l 160,0 L 480,112 l-32-48
+ L 352,64 z" />
+<glyph unicode="" d="M 128,448l0-448 l 128,128l 128-128L 384,448 L 128,448 z M 352,85.255l-96,96l-96-96L 160,416 l 192,0 L 352,85.255 z" />
+<glyph unicode="" d="M 463.637,364.892l-66.745,66.744C 386.34,442.188, 372.276,448, 357.293,448s-29.047-5.812-39.598-16.363l-82.746-82.745
+ c-21.834-21.834-21.834-57.362,0-79.196l 1.373-1.373l 33.941,33.941l-1.373,1.373c-3.066,3.066-3.066,8.247,0,11.313l 82.746,82.746
+ C 353.641,399.7, 356.040,400, 357.292,400s 3.651-0.299, 5.656-2.305l 66.745-66.744c 3.066-3.067, 3.066-8.249, 0.001-11.314l-82.747-82.747
+ c-2.004-2.004-4.403-2.304-5.655-2.304s-3.651,0.3-5.656,2.306l-1.373,1.373l-33.94-33.942l 1.371-1.371
+ c 10.553-10.554, 24.615-16.364, 39.6-16.364s 29.047,5.812, 39.598,16.363l 82.747,82.746C 485.47,307.53, 485.47,343.057, 463.637,364.892
+ zM 275.678,179.678l-33.941-33.941l 1.373-1.373c 2.004-2.004, 2.305-4.403, 2.305-5.655c0-1.253-0.299-3.651-2.303-5.657
+ l-82.747-82.745c-2.005-2.005-4.405-2.305-5.657-2.305s-3.652,0.3-5.657,2.305L 82.305,117.050C 80.3,119.055, 80,121.455, 80,122.707
+ s 0.299,3.65, 2.305,5.656l 82.745,82.744c 2.005,2.006, 4.405,2.306, 5.657,2.306s 3.652-0.3, 5.657-2.306l 1.373-1.371l 33.941,33.94
+ l-1.373,1.373c-10.552,10.552-24.615,16.363-39.598,16.363s-29.046-5.812-39.598-16.363l-82.744-82.743
+ C 37.812,151.754, 32,137.689, 32,122.707s 5.812-29.047, 16.363-39.599l 66.745-66.745C 125.661,5.812, 139.724,0, 154.707,0
+ s 29.046,5.812, 39.598,16.363l 82.747,82.746c 10.552,10.552, 16.361,24.615, 16.361,39.598s-5.812,29.047-16.363,39.598
+ L 275.678,179.678zM 400,61c-4.862,0-9.725,1.854-13.435,5.565l-64,63.999c-7.422,7.42-7.422,19.449,0,26.869
+ c 7.42,7.422, 19.448,7.422, 26.868,0l 64-64c 7.422-7.42, 7.422-19.448,0-26.868C 409.725,62.854, 404.862,61, 400,61zM 304,0c-8.837,0-16,7.163-16,16l0,64 c0,8.837, 7.163,16, 16,16s 16-7.163, 16-16l0-64 C 320,7.163, 312.837,0, 304,0zM 464,160l-64,0 c-8.837,0-16,7.163-16,16s 7.163,16, 16,16l 64,0 c 8.837,0, 16-7.163, 16-16S 472.837,160, 464,160zM 112,387c 4.862,0, 9.725-1.854, 13.435-5.565l 64-64c 7.421-7.42, 7.421-19.449,0-26.869c-7.42-7.422-19.449-7.422-26.869,0
+ l-64,64c-7.421,7.42-7.421,19.449,0,26.869C 102.275,385.146, 107.138,387, 112,387zM 208,448c 8.837,0, 16-7.163, 16-16l0-64 c0-8.837-7.163-16-16-16s-16,7.163-16,16L 192,432 C 192,440.837, 199.163,448, 208,448zM 48,288l 64,0 c 8.837,0, 16-7.163, 16-16s-7.163-16-16-16L 48,256 c-8.837,0-16,7.163-16,16S 39.163,288, 48,288z" />
+<glyph unicode="" d="M 463.637,364.892l-66.745,66.744C 386.34,442.188, 372.276,448, 357.293,448s-29.047-5.812-39.598-16.363l-82.746-82.745
+ c-21.834-21.834-21.834-57.362,0-79.196l 1.373-1.373l 33.941,33.941l-1.373,1.373c-3.066,3.066-3.066,8.247,0,11.313l 82.746,82.746
+ C 353.641,399.7, 356.040,400, 357.292,400s 3.651-0.299, 5.656-2.305l 66.745-66.744c 3.066-3.067, 3.066-8.249, 0.001-11.314l-82.747-82.747
+ c-2.004-2.004-4.403-2.304-5.655-2.304s-3.651,0.3-5.656,2.306l-1.373,1.373l-33.94-33.942l 1.371-1.371
+ c 10.553-10.554, 24.615-16.364, 39.6-16.364s 29.047,5.812, 39.598,16.363l 82.747,82.746C 485.47,307.53, 485.47,343.057, 463.637,364.892
+ zM 275.678,179.678l-33.941-33.941l 1.373-1.373c 2.004-2.004, 2.305-4.403, 2.305-5.655c0-1.253-0.299-3.651-2.303-5.657
+ l-82.747-82.745c-2.005-2.005-4.405-2.305-5.657-2.305s-3.652,0.3-5.657,2.305L 82.305,117.050C 80.3,119.055, 80,121.455, 80,122.707
+ s 0.299,3.65, 2.305,5.656l 82.745,82.744c 2.005,2.006, 4.405,2.306, 5.657,2.306s 3.652-0.3, 5.657-2.306l 1.373-1.371l 33.941,33.94
+ l-1.373,1.373c-10.552,10.552-24.615,16.363-39.598,16.363s-29.046-5.812-39.598-16.363l-82.744-82.743
+ C 37.812,151.754, 32,137.689, 32,122.707s 5.812-29.047, 16.363-39.599l 66.745-66.745C 125.661,5.812, 139.724,0, 154.707,0
+ s 29.046,5.812, 39.598,16.363l 82.747,82.746c 10.552,10.552, 16.361,24.615, 16.361,39.598s-5.812,29.047-16.363,39.598
+ L 275.678,179.678zM 176,125c-4.862,0-9.725,1.855-13.435,5.564c-7.42,7.42-7.42,19.449,0,26.869l 160,160c 7.42,7.42, 19.448,7.42, 26.868,0
+ c 7.422-7.42, 7.422-19.45,0-26.87l-160-160C 185.725,126.855, 180.862,125, 176,125z" />
+<glyph unicode="" d="M 288,339.337L 288,448 l 168.001-168L 288,112L 288,223.048 C 92.547,227.633, 130.5,99.5, 160,0C 16,160, 53.954,345.437, 288,339.337z" />
+<glyph unicode="" d="M 352,0c 29.5,99.5, 67.453,227.633-128,223.048L 224,112 L 55.999,280L 224,448l0-108.663 C 458.046,345.437, 496,160, 352,0z" />
+<glyph unicode="" d="M 128.214,267.637c 52.9,0, 95.786-45.585, 95.786-101.819C 224,109.586, 181.114,64, 128.214,64
+ c-52.901,0-95.786,45.585-95.786,101.818L 32,180.364C 32,292.829, 117.77,384, 223.572,384l0-58.182 c-36.55,0-70.913-15.13-96.758-42.602
+ c-4.977-5.289-9.517-10.917-13.612-16.828C 118.094,267.208, 123.105,267.637, 128.214,267.637zM 384.214,267.637c 52.9,0, 95.786-45.585, 95.786-101.819C 480,109.586, 437.114,64, 384.214,64
+ c-52.901,0-95.786,45.585-95.786,101.818L 288,180.364C 288,292.829, 373.77,384, 479.572,384l0-58.182 c-36.55,0-70.913-15.13-96.758-42.602
+ c-4.978-5.289-9.518-10.917-13.612-16.828C 374.094,267.208, 379.105,267.637, 384.214,267.637z" />
+<glyph unicode="" d="M 32,384L 480,384L 480,320L 32,320zM 192,192L 480,192L 480,128L 192,128zM 192,288L 480,288L 480,224L 192,224zM 32,96L 480,96L 480,32L 32,32zM 32,288L 144,208L 32,128 z" />
+<glyph unicode="" d="M 32,384L 480,384L 480,320L 32,320zM 32,192L 320,192L 320,128L 32,128zM 32,288L 320,288L 320,224L 32,224zM 32,96L 480,96L 480,32L 32,32zM 480,288L 368,208L 480,128 z" />
+<glyph unicode="" d="M 192,416L 480,416L 480,352L 192,352zM 192,256L 480,256L 480,192L 192,192zM 192,96L 480,96L 480,32L 192,32zM 160,215L 160,288L 128,288L 128,448L 64,448L 64,416L 96,416L 96,288L 64,288L 64,256L 128,256L 128,231L 64,201L 64,128L 128,128L 128,96L 64,96L 64,64L 128,64L 128,32L 64,32L 64,0L 160,0L 160,160L 96,160L 96,185 z" />
+<glyph unicode="" d="M 192,416L 480,416L 480,352L 192,352zM 192,256L 480,256L 480,192L 192,192zM 192,96L 480,96L 480,32L 192,32zM 64,384A32,32 2700 1 1 128,384A32,32 2700 1 1 64,384zM 64,224A32,32 2700 1 1 128,224A32,32 2700 1 1 64,224zM 64,64A32,32 2700 1 1 128,64A32,32 2700 1 1 64,64z" />
+<glyph unicode="" d="M 444,288l-28,0 L 416,416 l 32,0 L 448,448 L 288,448 l0-32 l 32,0 l0-128 L 192,288 L 192,416 l 32,0 L 224,448 L 64,448 l0-32 l 32,0 l0-128 L 68,288 c-19.8,0-36-16.2-36-36l0-216 c0-19.8, 16.2-36, 36-36l 120,0
+ c 19.8,0, 36,16.2, 36,36L 224,192 l 64,0 l0-156 c0-19.8, 16.2-36, 36-36l 120,0 c 19.8,0, 36,16.2, 36,36L 480,252 C 480,271.8, 463.8,288, 444,288z M 174,32L 82,32
+ c-9.9,0-18,7.2-18,16s 8.1,16, 18,16l 92,0 c 9.9,0, 18-7.2, 18-16S 183.9,32, 174,32z M 272,224l-32,0 c-8.8,0-16,7.2-16,16s 7.2,16, 16,16l 32,0
+ c 8.8,0, 16-7.2, 16-16S 280.8,224, 272,224z M 430,32l-92,0 c-9.9,0-18,7.2-18,16s 8.1,16, 18,16l 92,0 c 9.9,0, 18-7.2, 18-16S 439.9,32, 430,32z" />
+<glyph unicode="" d="M 352,288l0,80 c0,8.8-7.2,16-16,16l-80,0 L 256,416 c0,17.6-14.4,32-32,32l-64,0 c-17.602,0-32-14.4-32-32l0-32 L 48,384 c-8.801,0-16-7.2-16-16l0-256
+ c0-8.8, 7.199-16, 16-16l 112,0 l0-96 l 192,0 l 96,96L 448,288 L 352,288 z M 160,415.943c 0.017,0.019, 0.036,0.039, 0.057,0.057l 63.884,0
+ c 0.021-0.018, 0.041-0.038, 0.059-0.057L 224,384 l-64,0 L 160,415.943 L 160,415.943z M 96,320l0,32 l 192,0 l0-32 L 96,320 z M 352,45.255L 352,96 l 50.745,0 L 352,45.255z
+ M 416,128l-96,0 l0-96 L 192,32 L 192,256 l 224,0 L 416,128 z" />
+<glyph unicode="" d="M 416,320l-96,0 l0,32 l-96,96L 32,448 l0-352 l 192,0 l0-96 l 288,0 L 512,224 L 416,320z M 416,274.745L 466.745,224L 416,224 L 416,274.745 z M 224,402.745L 274.745,352
+ L 224,352 L 224,402.745 z M 64,416l 128,0 l0-96 l 96,0 l0-192 L 64,128 L 64,416 z M 480,32L 256,32 l0,64 l 64,0 L 320,288 l 64,0 l0-96 l 96,0 L 480,32 z" />
+<glyph unicode="" d="M 432.204,144.934c-23.235,23.235-53.469,34.002-80.541,31.403L 320,208l 96,96c0,0, 64,64,0,128L 256,272L 96,432
+ c-64-64,0-128,0-128l 96-96l-31.663-31.663c-27.072,2.599-57.305-8.169-80.54-31.403c-37.49-37.49-42.556-93.209-11.313-124.45
+ c 31.241-31.241, 86.96-26.177, 124.45,11.313c 23.235,23.234, 34.001,53.469, 31.403,80.54L 256,144l 31.664-31.664
+ c-2.598-27.072, 8.168-57.305, 31.403-80.539c 37.489-37.49, 93.209-42.556, 124.449-11.313
+ C 474.76,51.725, 469.694,107.443, 432.204,144.934z M 176.562,100.711c-1.106-12.166-7.51-24.913-17.57-34.973
+ C 147.886,54.631, 133.452,48, 120.383,48c-5.262,0-12.649,1.114-17.958,6.424c-10.703,10.702-8.688,36.566, 11.313,56.568
+ c 11.106,11.107, 25.54,17.738, 38.609,17.738c 5.262,0, 12.649-1.114, 17.958-6.424C 176.861,115.751, 177.040,105.962, 176.562,100.711z
+ M 256,176c-17.673,0-32,14.327-32,32s 14.327,32, 32,32s 32-14.327, 32-32S 273.673,176, 256,176z M 409.576,54.424
+ c-5.31-5.31-12.696-6.424-17.958-6.424c-13.069,0-27.503,6.631-38.609,17.738c-10.061,10.060-16.464,22.807-17.569,34.973
+ c-0.479,5.251-0.3,15.040, 6.257,21.596c 5.309,5.311, 12.695,6.424, 17.958,6.424c 13.068,0, 27.503-6.631, 38.608-17.737
+ C 418.265,90.99, 420.279,65.126, 409.576,54.424z" />
+<glyph unicode="" d="M 32,384L 480,384L 480,320L 32,320zM 32,192L 480,192L 480,128L 32,128zM 32,288L 480,288L 480,224L 32,224zM 32,96L 480,96L 480,32L 32,32z" />
+<glyph unicode="" d="M 32,384L 480,384L 480,320L 32,320zM 32,192L 480,192L 480,128L 32,128zM 128,288L 384,288L 384,224L 128,224zM 128,96L 384,96L 384,32L 128,32z" />
+<glyph unicode="" d="M 32,384L 480,384L 480,320L 32,320zM 32,192L 480,192L 480,128L 32,128zM 192,288L 480,288L 480,224L 192,224zM 192,96L 480,96L 480,32L 192,32z" />
+<glyph unicode="" d="M 32,384L 480,384L 480,320L 32,320zM 32,192L 480,192L 480,128L 32,128zM 32,288L 320,288L 320,224L 32,224zM 32,96L 320,96L 320,32L 32,32z" />
+<glyph unicode="" d="M 480,224l-4.571,0 L 347.062,224 c-25.039,17.71-57.215,27.43-91.062,27.43c-44.603,0-82.286,25.121-82.286,54.856
+ c0,29.735, 37.683,54.857, 82.286,54.857c 37.529,0, 70.154-17.788, 79.56-41.143l 56.508,0 c-3.965,25.322-18.79,48.984-42.029,66.413
+ C 324.599,405.493, 291.201,416, 256,416c-35.202,0-68.598-10.507-94.037-29.587c-27.394-20.545-43.106-49.751-43.106-80.127
+ s 15.712-59.582, 43.106-80.127c 0.978-0.733, 1.971-1.449, 2.973-2.158L 36.571,224.001 L 32,224.001 l0-32 l 256.266,0 c 29.104-8.553, 50.021-28.135, 50.021-50.286
+ c0-29.734-37.684-54.855-82.286-54.855c-37.53,0-70.154,17.787-79.559,41.143l-56.508,0 c 3.965-25.32, 18.791-48.984, 42.030-66.413
+ C 187.402,42.508, 220.798,32, 256,32c 35.201,0, 68.599,10.508, 94.037,29.587c 27.395,20.545, 43.104,49.751, 43.104,80.127
+ c0,17.649-5.327,34.896-15.147,50.286L 480,192 L 480,224 z" />
+<glyph unicode="" d="M 96,64l 288,0 l0-32 L 96,32 L 96,64 zM 320,416l0-192 c0-15.656-7.35-30.812-20.695-42.676C 283.834,167.573, 262.771,160, 240,160c-22.772,0-43.834,7.573-59.304,21.324
+ C 167.35,193.188, 160,208.344, 160,224L 160,416 L 96,416 l0-192 c0-70.691, 64.471-128, 144-128c 79.529,0, 144,57.309, 144,128L 384,416 L 320,416 z" />
+<glyph unicode="" d="M 416,416l0-32 l-72,0 L 216,64l 72,0 l0-32 L 64,32 l0,32 l 72,0 L 264,384l-72,0 L 192,416 L 416,416 z" />
+<glyph unicode="" d="M 312.721,232.909C 336.758,251.984, 352,280.337, 352,312c0,57.438-50.145,104-112,104L 128,416 l0-384 l 144,0
+ c 61.856,0, 112,46.562, 112,104C 384,180.098, 354.441,217.781, 312.721,232.909z M 192,328c0,13.255, 10.745,24, 24,24l 33.602,0
+ C 270.809,352, 288,330.51, 288,304s-17.191-48-38.398-48L 192,256 L 192,328 z M 273.6,96L 216,96 c-13.255,0-24,10.745-24,24l0,72 l 81.6,0
+ c 21.209,0, 38.4-21.49, 38.4-48S 294.809,96, 273.6,96z" />
+<glyph unicode="" d="M 425.373,358.627l-66.746,66.745C 346.183,437.818, 321.6,448, 304,448L 96,448 c-17.6,0-32-14.4-32-32l0-384 c0-17.6, 14.4-32, 32-32l 320,0
+ c 17.6,0, 32,14.4, 32,32L 448,304 C 448,321.6, 437.817,346.182, 425.373,358.627z M 402.745,336.001c 3.396-3.398, 6.896-9.581, 9.447-16.001L 320,320
+ L 320,412.193 c 6.42-2.55, 12.602-6.050, 16-9.448L 402.745,336.001z M 415.942,32L 96.057,32 c-0.020,0.017-0.041,0.038-0.057,0.058L 96,415.943
+ c 0.017,0.020, 0.038,0.041, 0.057,0.057L 288,416 l0-128 l 128,0 l0-255.942 C 415.983,32.038, 415.962,32.017, 415.942,32z" />
+<glyph unicode="" d="M 480,40L 480,335.969 L 368.031,448L 72,448 c-22.091,0-40-17.908-40-40l0-368 c0-22.092, 17.909-40, 40-40l 368,0
+ C 462.092,0, 480,17.908, 480,40z M 288,384l 32,0 l0-96 l-32,0 L 288,384 z M 352,64L 160,64 L 160,191.941 c 0.017,0.021, 0.038,0.041, 0.058,0.059l 191.885,0
+ c 0.020-0.018, 0.041-0.038, 0.058-0.059L 352,64L 352,64z M 416,64l-32,0 L 384,192 c0,17.6-14.4,32-32,32L 160,224 c-17.6,0-32-14.4-32-32l0-128 L 96,64 L 96,384
+ l 32,0 l0-96 c0-17.6, 14.4-32, 32-32l 160,0 c 17.6,0, 32,14.4, 32,32l0,85.505 l 64-64.036L 416,64 z" />
+<glyph unicode="" d="M 32,384l0-352 l 448,0 L 480,384 L 32,384 z M 192,160l0,64 l 128,0 l0-64 L 192,160 z M 320,128l0-64 L 192,64 l0,64 L 320,128 z M 320,320l0-64 L 192,256 l0,64 L 320,320 z M 160,320l0-64 L 64,256 l0,64 L 160,320
+ z M 64,224l 96,0 l0-64 L 64,160 L 64,224 z M 352,224l 96,0 l0-64 l-96,0 L 352,224 z M 352,256l0,64 l 96,0 l0-64 L 352,256 z M 64,128l 96,0 l0-64 L 64,64 L 64,128 z M 352,64l0,64 l 96,0 l0-64 L 352,64 z" />
+<glyph unicode="" d="M 256,410c 49.683,0, 96.391-19.347, 131.521-54.478S 442,273.683, 442,224s-19.348-96.391-54.479-131.521S 305.683,38, 256,38
+ s-96.391,19.348-131.522,54.479S 70,174.317, 70,224s 19.347,96.391, 54.478,131.522S 206.317,410, 256,410 M 256,448
+ C 132.288,448, 32,347.712, 32,224s 100.288-224, 224-224s 224,100.288, 224,224S 379.712,448, 256,448L 256,448zM 160,288A32,32 2700 1 1 224,288A32,32 2700 1 1 160,288zM 288,288A32,32 2700 1 1 352,288A32,32 2700 1 1 288,288zM 256,152c-50.92,0-96.28,18.437-125.583,47.164C 141.98,140.36, 193.806,96, 256,96c 62.194,0, 114.020,44.36, 125.584,103.164
+ C 352.28,170.437, 306.92,152, 256,152z" />
+<glyph unicode="" d="M 240,288L 144,384L 208,448L 32,448L 32,272L 96,336L 192,240 zM 320,240L 416,336L 480,272L 480,448L 304,448L 368,384L 272,288 zM 272,160L 368,64L 304,0L 480,0L 480,176L 416,112L 320,208 zM 192,208L 96,112L 32,176L 32,0L 208,0L 144,64L 240,160 z" />
+<glyph unicode="" d="M 32,256L 480,256L 480,192L 32,192z" />
+<glyph unicode="" d="M 32,96l 256,0 l0-64 L 32,32 L 32,96 z M 384,384L 273.721,384 l-91.883-256l-66.144,0 l 91.881,256L 96,384 L 96,448 l 288,0 L 384,384 z M 464.887,32L 400,96.887
+ L 335.113,32L 304,63.113L 368.887,128L 304,192.887L 335.113,224L 400,159.113L 464.887,224L 496,192.887L 431.113,128L 496,63.113
+ L 464.887,32z" />
+<glyph unicode="" d="M 128,416l 256,0 l0-64 L 128,352 L 128,416 z M 448,320L 64,320 c-17.6,0-32-14.4-32-32l0-128 c0-17.6, 14.398-32, 32-32l 64,0 l0-96 l 256,0 l0,96 l 64,0
+ c 17.6,0, 32,14.4, 32,32L 480,288 C 480,305.6, 465.6,320, 448,320z M 352,64L 160,64 L 160,192 l 192,0 L 352,64 z M 455.2,272c0-12.813-10.387-23.2-23.199-23.2
+ S 408.8,259.187, 408.8,272s 10.389,23.2, 23.201,23.2C 444.814,295.2, 455.2,284.813, 455.2,272z" />
+<glyph unicode="" d="M 192,416c-61.856,0-112-50.144-112-112s 50.144-112, 112-112l0-160 l 64,0 L 256,352 l 32,0 l0-320 l 64,0 L 352,352 l 64,0 L 416,416 L 192,416 z" />
+<glyph unicode="" d="M 224,416c-61.856,0-112-50.144-112-112s 50.144-112, 112-112l0-160 l 64,0 L 288,352 l 32,0 l0-320 l 64,0 L 384,352 l 64,0 L 448,416 L 224,416 zM 32,32L 144,128L 32,224 z" />
+<glyph unicode="" d="M 160,416C 98.144,416, 48,365.856, 48,304s 50.144-112, 112-112l0-160 l 64,0 L 224,352 l 32,0 l0-320 l 64,0 L 320,352 l 64,0 L 384,416 L 160,416 zM 480,224L 368,128L 480,32 z" />
+<glyph unicode="" d="M 256,288L 320,288L 320,256L 256,256zM 256,96L 320,96L 320,64L 256,64zM 288,192L 352,192L 352,160L 288,160zM 384,192L 384,96L 352,96L 352,64L 416,64L 416,192 zM 192,192L 256,192L 256,160L 192,160zM 160,96L 224,96L 224,64L 160,64zM 160,288L 224,288L 224,256L 160,256zM 96,384L 96,256L 128,256L 128,352L 160,352L 160,384 zM 352,256L 416,256L 416,384L 384,384L 384,288L 352,288 zM 32,448l0-448 l 448,0 L 480,448 L 32,448 z M 448,32L 64,32 L 64,416 l 384,0 L 448,32 zM 96,192L 96,64L 128,64L 128,160L 160,160L 160,192 zM 288,384L 352,384L 352,352L 288,352zM 192,384L 256,384L 256,352L 192,352z" />
+<glyph unicode="" d="M 408,448l 8-192L 96,256 l 8,192l 16,0 l 8-160l 256,0 l 8,160L 408,448 z M 104,0l-8,160l 320,0 l-8-160l-16,0 l-8,128L 128,128 l-8-128L 104,0 zM 32,224L 96,224L 96,192L 32,192zM 128,224L 192,224L 192,192L 128,192zM 224,224L 288,224L 288,192L 224,192zM 320,224L 384,224L 384,192L 320,192zM 416,224L 480,224L 480,192L 416,192z" />
+<glyph unicode="" d="M 480,416L 480,448 l-96,0 c-17.601,0-32-14.4-32-32l0-160 c0-7.928, 2.929-15.201, 7.748-20.807L 208,105l-71,74l-41-35l 112-144l 208,224l 64,0
+ l0,32 l-96,0 L 384,416 L 480,416 zM 128,224l 32,0 L 160,416 c0,17.6-14.4,32-32,32L 64,448 c-17.6,0-32-14.4-32-32l0-192 l 32,0 l0,96 l 64,0 L 128,224 z M 64,352L 64,416 l 64,0 l0-64 L 64,352 zM 320,256l0,48 c0,17.6-4.4,32-22,32c 17.6,0, 22,14.4, 22,32L 320,416 c0,17.6-14.4,32-32,32l-96,0 l0-224 l 96,0 C 305.6,224, 320,238.4, 320,256z
+ M 224,416l 64,0 l0-64 l-64,0 L 224,416 z M 224,320l 64,0 l0-64 l-64,0 L 224,320 z" />
+<glyph unicode="" d="M 224,224l-64,0 l0,64 l 64,0 l0,64 l 64,0 l0-64 l 64,0 l0-64 l-64,0 l0-64 l-64,0 L 224,224 z M 480,192l0-160 L 32,32 L 32,192 l 64,0 l0-96 l 320,0 l0,96 L 480,192 z" />
+<glyph unicode="" d="M 208,128L 112,224L 208,320L 176,352L 48,224L 176,96 zM 336,352L 304,320L 400,224L 304,128L 336,96L 464,224 z" />
+<glyph unicode="" d="M 224,128l 64,0 l0-64 l-64,0 L 224,128 z M 352,352c 17.673,0, 32-14.327, 32-32l0-83 l-114-77l-46,0 l0,32 l 96,64l0,32 L 160,288 l0,64 L 352,352 z M 256,448
+ c-59.833,0-116.083-23.3-158.392-65.608C 55.301,340.083, 32,283.833, 32,224c0-59.832, 23.301-116.084, 65.608-158.392
+ C 139.917,23.3, 196.167,0, 256,0c 59.832,0, 116.084,23.3, 158.392,65.608C 456.7,107.916, 480,164.168, 480,224
+ c0,59.833-23.3,116.083-65.608,158.392C 372.084,424.7, 315.832,448, 256,448z" />
+<glyph unicode="" d="M 448,416L 64,416 c-17.6,0-32-14.4-32-32l0-320 c0-17.6, 14.4-32, 32-32l 384,0 c 17.6,0, 32,14.4, 32,32L 480,384 C 480,401.6, 465.6,416, 448,416z
+ M 448,64.058c-0.006-0.007-0.015-0.014-0.021-0.021L 352,224l-80-64L 160,304L 64.016,64.042c-0.005,0.005-0.011,0.011-0.016,0.016
+ L 64,383.943 c 0.017,0.020, 0.038,0.041, 0.057,0.057l 383.885,0 c 0.020-0.017, 0.041-0.038, 0.058-0.058L 448,64.058 zM 320,304A48,48 2700 1 1 416,304A48,48 2700 1 1 320,304z" />
+<glyph unicode="" d="M 448,416L 64,416 c-17.6,0-32-14.4-32-32l0-320 c0-17.6, 14.4-32, 32-32l 384,0 c 17.6,0, 32,14.4, 32,32L 480,384 C 480,401.6, 465.6,416, 448,416z
+ M 128,64L 64,64 l0,64 l 64,0 L 128,64 z M 128,192L 64,192 l0,64 l 64,0 L 128,192 z M 128,320L 64,320 L 64,384 l 64,0 L 128,320 z M 352,64L 160,64 L 160,384 l 192,0 L 352,64 z M 448,64l-64,0 l0,64 l 64,0 L 448,64 z
+ M 448,192l-64,0 l0,64 l 64,0 L 448,192 z M 448,320l-64,0 L 384,384 l 64,0 L 448,320 zM 192,320L 192,128L 336,224 z" />
+<glyph unicode="" d="M 38.899,327.688l 40.707-25.441C 105.007,342.804, 144,373.974, 190.21,389.37l-15.183,45.547
+ C 118.153,415.968, 70.163,377.604, 38.899,327.688zM 336.973,434.917L 321.79,389.37c 46.211-15.396, 85.202-46.566, 110.604-87.124l 40.706,25.441
+ C 441.837,377.604, 393.847,415.968, 336.973,434.917zM 303.987,127.996c-2.404,0-4.846,0.545-7.143,1.693L 224,166.111L 224,272 c0,8.836, 7.164,16, 16,16s 16-7.164, 16-16l0-86.111
+ l 55.155-27.578c 7.903-3.951, 11.107-13.562, 7.155-21.466C 315.508,131.238, 309.856,127.997, 303.987,127.996zM 256,384C 149.961,384, 64,298.039, 64,192c0-106.039, 85.961-192, 192-192c 106.039,0, 192,85.961, 192,192
+ C 448,298.039, 362.039,384, 256,384z M 256,48c-79.529,0-144,64.471-144,144c0,79.529, 64.471,144, 144,144c 79.529,0, 144-64.471, 144-144
+ C 400,112.471, 335.529,48, 256,48z" />
+<glyph unicode="" d="M 32,252.127c 22.659,24.96, 48.581,46.18, 76.636,62.562C 153.802,341.061, 204.759,355, 256,355
+ c 51.24,0, 102.198-13.939, 147.363-40.312c 28.056-16.382, 53.978-37.602, 76.637-62.562l0,58.716
+ c-16.505,14.059-34.062,26.57-52.434,37.297C 375.063,378.796, 315.737,395, 256,395s-119.064-16.204-171.567-46.86
+ C 66.062,337.413, 48.505,324.901, 32,310.842L 32,252.127 zM 256,320c-91.598,0-172.919-50.278-224-128c 51.081-77.724, 132.402-128, 224-128c 91.598,0, 172.919,50.276, 224,128
+ C 428.919,269.722, 347.598,320, 256,320z M 256,224c0-17.673-14.327-32-32-32s-32,14.327-32,32c0,17.674, 14.327,32, 32,32
+ S 256,241.674, 256,224z M 364.033,131.669C 330.316,111.982, 293.969,102, 256,102s-74.316,9.982-108.033,29.669
+ C 122.19,146.721, 98.659,167.324, 78.91,192c 19.749,24.675, 43.28,45.279, 69.058,60.33c 6.638,3.876, 13.379,7.37, 20.213,10.491
+ C 162.925,250.95, 160,237.817, 160,224c0-53.020, 42.981-96, 96-96c 53.020,0, 96,42.98, 96,96c0,13.817-2.925,26.95-8.18,38.821
+ c 6.834-3.122, 13.575-6.615, 20.213-10.491c 25.777-15.051, 49.308-35.655, 69.058-60.33
+ C 413.342,167.324, 389.811,146.721, 364.033,131.669z" />
+<glyph unicode="" d="M 325.584,338.083C 313.278,379.064, 311.146,384, 272,384l-32,0 c-39.809,0-41.332-5.076-54.209-48c0-0.001,0-0.001-0.001-0.002
+ L 113.791,96l 56.818,0 l 28.8,96l 113.183,0 l 28.8-96l 56.815,0 L 325.584,338.083z M 218.609,256l 19.2,68c 5.043,16.809, 18.19,15, 18.19,15
+ s 13.147,1.809, 18.19-15l 0.002,0 l 19.2-68L 218.609,256 z" />
+<glyph unicode="" d="M 288,448 C 411.712,448 512,347.712 512,224 C 512,100.288 411.712,0 288,0 L 288,48 C 335.012,48 379.209,66.307 412.451,99.549 C 445.693,132.791 464,176.988 464,224 C 464,271.011 445.693,315.209 412.451,348.451 C 379.209,381.693 335.012,400 288,400 C 240.989,400 196.791,381.693 163.549,348.451 C 137.979,322.882 121.258,290.828 114.896,256 L 208,256 L 96,128 L -16,256 L 66.285,256 C 81.815,364.551 175.154,448 288,448 ZM 384,256 L 384,192 L 256,192 L 256,352 L 320,352 L 320,256 Z" />
+<glyph unicode="" d="M 512,183.771l0,80.458 l-79.572,7.957c-4.093,15.021-10.044,29.274-17.605,42.49l 52.298,63.919L 410.595,435.12l-63.918-52.298
+ c-13.217,7.562-27.471,13.513-42.491,17.604L 296.229,480l-80.458,0 l-7.957-79.573c-15.021-4.093-29.274-10.043-42.49-17.604
+ L 101.405,435.12L 44.88,378.595l 52.298-63.918c-7.562-13.216-13.513-27.47-17.605-42.49L0,264.229l0-80.458 l 79.573-7.957
+ c 4.093-15.021, 10.043-29.274, 17.605-42.491L 44.88,69.405l 56.524-56.524l 63.919,52.298c 13.216-7.562, 27.47-13.514, 42.49-17.605
+ L 215.771-32l 80.458,0 l 7.957,79.572c 15.021,4.093, 29.274,10.044, 42.491,17.605l 63.918-52.298l 56.524,56.524l-52.298,63.918
+ c 7.562,13.217, 13.514,27.471, 17.605,42.49L 512,183.771z M 352,192l-64-64l-64,0 l-64,64l0,64 l 64,64l 64,0 l 64-64L 352,192 z" />
+<glyph unicode="" d="M 384,377 L 384,352 L 448,352 L 448,320 L 352,320 L 352,393 L 416,423 L 416,448 L 352,448 L 352,480 L 448,480 L 448,407 ZM 338,352L 270,352L 176,258L 82,352L 14,352L 142,224L 14,96L 82,96L 176,190L 270,96L 338,96L 210,224 z" />
+<glyph unicode="" d="M 384,25 L 384,0 L 448,0 L 448-32 L 352-32 L 352,41 L 416,71 L 416,96 L 352,96 L 352,128 L 448,128 L 448,55 ZM 338,352L 270,352L 176,258L 82,352L 14,352L 142,224L 14,96L 82,96L 176,190L 270,96L 338,96L 210,224 z" />
+<glyph unicode="" d="M 352,288l0,80 c0,8.8-7.2,16-16,16l-80,0 L 256,416 c0,17.6-14.4,32-32,32l-64,0 c-17.602,0-32-14.4-32-32l0-32 L 48,384 c-8.801,0-16-7.2-16-16
+ l0-256 c0-8.8, 7.199-16, 16-16l 112,0 l0-96 l 288,0 L 448,288 L 352,288 z M 160,415.943c 0.017,0.019, 0.036,0.039, 0.057,0.057l 63.884,0
+ c 0.021-0.018, 0.041-0.038, 0.059-0.057L 224,384 l-64,0 L 160,415.943 z M 96,320l0,32 l 192,0 l0-32 L 96,320 z M 416,32L 192,32 L 192,256 l 224,0 L 416,32 zM 224,224L 224,160L 240,160L 256,192L 288,192L 288,96L 264,96L 264,64L 344,64L 344,96L 320,96L 320,192L 352,192L 368,160L 384,160L 384,224 z" />
+<glyph unicode="" d="M 384,352L 416,352L 416,320L 384,320zM 320,288L 352,288L 352,256L 320,256zM 320,224L 352,224L 352,192L 320,192zM 320,160L 352,160L 352,128L 320,128zM 256,224L 288,224L 288,192L 256,192zM 256,160L 288,160L 288,128L 256,128zM 192,160L 224,160L 224,128L 192,128zM 384,288L 416,288L 416,256L 384,256zM 384,224L 416,224L 416,192L 384,192zM 384,160L 416,160L 416,128L 384,128zM 384,96L 416,96L 416,64L 384,64zM 320,96L 352,96L 352,64L 320,64zM 256,96L 288,96L 288,64L 256,64zM 192,96L 224,96L 224,64L 192,64zM 128,96L 160,96L 160,64L 128,64z" />
+<glyph unicode="" d="M 464,416L 256,416L 240,448L 64,448L 32,384L 480,384 zM 420.17,128L 464,128 l 16,224L 32,352 l 32-320l 178.040,0 C 189.599,50.888, 152,101.133, 152,160c0,74.991, 61.009,136, 136,136
+ c 74.99,0, 136-61.009, 136-136C 424,149.161, 422.689,138.425, 420.17,128zM 437.498,55.125l-67.248,55.346C 378.977,124.932, 384,141.878, 384,160c0,53.020-42.98,96-96,96s-96-42.98-96-96
+ s 42.98-96, 96-96c 18.122,0, 35.069,5.023, 49.529,13.75l 55.346-67.248c 11.481-13.339, 31.059-14.070, 43.503-1.626l 2.746,2.746
+ C 451.568,24.066, 450.837,43.644, 437.498,55.125z M 288,98c-34.242,0-62,27.758-62,62s 27.758,62, 62,62s 62-27.758, 62-62
+ S 322.242,98, 288,98z" />
+<glyph unicode=" " horiz-adv-x="256" />
+</font></defs></svg>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymceskinslightgrayfontstinymcesmallttf"></a>
<div class="binary"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf
</span><span class="cx">===================================================================
</span><del>--- trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf 2013-12-28 05:24:32 UTC (rev 26875)
</del><ins>+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf 2013-12-28 23:52:04 UTC (rev 26876)
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceskinslightgrayfontstinymcesmallwoff"></a>
<div class="binary"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.woff</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.woff
</span><span class="cx">===================================================================
</span><del>--- trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.woff 2013-12-28 05:24:32 UTC (rev 26875)
</del><ins>+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.woff 2013-12-28 23:52:04 UTC (rev 26876)
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.woff
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceskinslightgrayfontstinymceeot"></a>
<div class="binary"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.eot</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.eot
</span><span class="cx">===================================================================
</span><del>--- trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.eot 2013-12-28 05:24:32 UTC (rev 26875)
</del><ins>+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.eot 2013-12-28 23:52:04 UTC (rev 26876)
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.eot
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceskinslightgrayfontstinymcesvg"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.svg (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.svg (rev 0)
+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.svg 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,153 @@
</span><ins>+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata>
+This is a custom SVG font generated by IcoMoon.
+<iconset grid="16"></iconset>
+</metadata>
+<defs>
+<font id="tinymce" horiz-adv-x="512" >
+<font-face units-per-em="512" ascent="480" descent="-32" />
+<missing-glyph horiz-adv-x="512" />
+<glyph class="hidden" unicode="" d="M0,480L 512 -32L0 -32 z" horiz-adv-x="0" />
+<glyph unicode="" d="M 464,416L 256,416L 240,448L 64,448L 32,384L 480,384 zM 452.17,128l 37.43,0 L 512,352L0,352 l 32-320l 242.040,0 C 221.599,50.888, 184,101.133, 184,160c0,74.991, 61.009,136, 136,136
+ c 74.99,0, 136-61.009, 136-136C 456,149.161, 454.689,138.425, 452.17,128zM 501.498,23.125l-99.248,87.346C 410.977,124.931, 416,141.878, 416,160c0,53.020-42.98,96-96,96s-96-42.98-96-96
+ s 42.98-96, 96-96c 18.122,0, 35.069,5.023, 49.529,13.75l 87.346-99.248c 11.481-13.339, 31.059-14.070, 43.503-1.626l 2.746,2.746
+ C 515.568-7.934, 514.837,11.644, 501.498,23.125z M 320,98c-34.242,0-62,27.758-62,62s 27.758,62, 62,62s 62-27.758, 62-62
+ S 354.242,98, 320,98z" />
+<glyph unicode="" d="M 384,352L 416,352L 416,320L 384,320zM 320,288L 352,288L 352,256L 320,256zM 320,224L 352,224L 352,192L 320,192zM 320,160L 352,160L 352,128L 320,128zM 256,224L 288,224L 288,192L 256,192zM 256,160L 288,160L 288,128L 256,128zM 192,160L 224,160L 224,128L 192,128zM 384,288L 416,288L 416,256L 384,256zM 384,224L 416,224L 416,192L 384,192zM 384,160L 416,160L 416,128L 384,128zM 384,96L 416,96L 416,64L 384,64zM 320,96L 352,96L 352,64L 320,64zM 256,96L 288,96L 288,64L 256,64zM 192,96L 224,96L 224,64L 192,64zM 128,96L 160,96L 160,64L 128,64z" />
+<glyph unicode="" d="M 416,352l-96,0 L 320,384 L 224,480L0,480 l0-384 l 192,0 l0-128 l 320,0 L 512,256 L 416,352z M 416,306.745L 466.745,256L 416,256 L 416,306.745 z M 224,434.745L 274.745,384L 224,384
+ L 224,434.745 z M 32,448l 160,0 l0-96 l 96,0 l0-224 L 32,128 L 32,448 z M 480,0L 224,0 l0,96 l 96,0 L 320,320 l 64,0 l0-96 l 96,0 L 480,0 z" />
+<glyph unicode="" d="M 128,448 L 384,448 L 384,384 L 320,384 L 320,0 L 256,0 L 256,384 L 192,384 L 192,0 L 128,0 L 128,224 C 66.144,224 16,274.144 16,336 C 16,397.856 66.144,448 128,448 ZM 480,32L 352,144L 480,256 z" />
+<glyph unicode="" d="M 224,448 L 480,448 L 480,384 L 416,384 L 416,0 L 352,0 L 352,384 L 288,384 L 288,0 L 224,0 L 224,224 C 162.144,224 112,274.144 112,336 C 112,397.856 162.144,448 224,448 ZM 32,256L 160,144L 32,32 z" />
+<glyph unicode="" d="M 192,448 L 448,448 L 448,384 L 384,384 L 384,0 L 320,0 L 320,384 L 256,384 L 256,0 L 192,0 L 192,224 C 130.144,224 80,274.144 80,336 C 80,397.856 130.144,448 192,448 Z" />
+<glyph unicode="" d="M 365.71,221.482 C 397.67,197.513 416,163.439 416,128 C 416,92.561 397.67,58.487 365.71,34.518 C 336.031,12.259 297.068,0 256,0 C 214.931,0 175.969,12.259 146.29,34.518 C 114.33,58.487 96,92.561 96,128 L 160,128 C 160,93.309 203.963,64 256,64 C 308.037,64 352,93.309 352,128 C 352,162.691 308.037,192 256,192 C 214.931,192 175.969,204.259 146.29,226.518 C 114.33,250.488 96,284.561 96,320 C 96,355.439 114.33,389.512 146.29,413.482 C 175.969,435.741 214.931,448 256,448 C 297.068,448 336.031,435.741 365.71,413.482 C 397.67,389.512 416,355.439 416,320 L 352,320 C 352,354.691 308.037,384 256,384 C 203.963,384 160,354.691 160,320 C 160,285.309 203.963,256 256,256 C 297.068,256 336.031,243.741 365.71,221.482 ZM0,224L 512,224L 512,192L0,192z" />
+<glyph unicode="" d="M 352,448 L 416,448 L 416,240 C 416,160.471 344.366,96 256,96 C 167.635,96 96,160.471 96,240 L 96,448 L 160,448 L 160,240 C 160,219.917 169.119,200.648 185.677,185.747 C 204.125,169.145 229.1,160 256,160 C 282.9,160 307.875,169.145 326.323,185.747 C 342.881,200.648 352,219.917 352,240 L 352,448 ZM 96,64L 416,64L 416,0L 96,0z" />
+<glyph unicode="" d="M 448,448 L 448,416 L 384,416 L 224,32 L 288,32 L 288,0 L 64,0 L 64,32 L 128,32 L 288,416 L 224,416 L 224,448 Z" />
+<glyph unicode="" d="M 353.94,237.674C 372.689,259.945, 384,288.678, 384,320c0,70.58-57.421,128-128,128l-64,0 l-64,0 L 96,448 l0-448 l 32,0 l 64,0 l 96,0
+ c 70.579,0, 128,57.421, 128,128C 416,174.478, 391.101,215.248, 353.94,237.674z M 192,384l 50.75,0 c 27.984,0, 50.75-28.71, 50.75-64
+ s-22.766-64-50.75-64L 192,256 L 192,384 z M 271.5,64L 192,64 L 192,192 l 79.5,0 c 29.225,0, 53-28.71, 53-64S 300.725,64, 271.5,64z" />
+<glyph unicode="" d="M 192,64L 288,64L 288-32L 192-32zM 400,448 C 426.51,448 448,426.51 448,400 L 448,256 L 288,160 L 288,96 L 192,96 L 192,192 L 352,288 L 352,352 L 96,352 L 96,448 L 400,448 Z" />
+<glyph unicode="" d="M 288,448 C 411.712,448 512,347.712 512,224 C 512,100.288 411.712,0 288,0 L 288,48 C 335.012,48 379.209,66.307 412.451,99.549 C 445.693,132.791 464,176.988 464,224 C 464,271.011 445.693,315.209 412.451,348.451 C 379.209,381.693 335.012,400 288,400 C 240.989,400 196.791,381.693 163.549,348.451 C 137.979,322.882 121.258,290.828 114.896,256 L 208,256 L 96,128 L -16,256 L 66.285,256 C 81.815,364.551 175.154,448 288,448 ZM 384,256 L 384,192 L 256,192 L 256,352 L 320,352 L 320,256 Z" />
+<glyph unicode="" d="M0,224L 64,224L 64,192L0,192zM 96,224L 192,224L 192,192L 96,192zM 224,224L 288,224L 288,192L 224,192zM 320,224L 416,224L 416,192L 320,192zM 448,224L 512,224L 512,192L 448,192zM 440,480 L 448,256 L 64,256 L 72,480 L 88,480 L 96,288 L 416,288 L 424,480 ZM 72-32 L 64,160 L 448,160 L 440-32 L 424-32 L 416,128 L 96,128 L 88-32 Z" />
+<glyph unicode="" d="M 192,384L 256,384L 256,352L 192,352zM 288,384L 352,384L 352,352L 288,352zM 448,384 L 448,256 L 352,256 L 352,288 L 416,288 L 416,352 L 384,352 L 384,384 ZM 160,288L 224,288L 224,256L 160,256zM 256,288L 320,288L 320,256L 256,256zM 96,352 L 96,288 L 128,288 L 128,256 L 64,256 L 64,384 L 160,384 L 160,352 ZM 192,192L 256,192L 256,160L 192,160zM 288,192L 352,192L 352,160L 288,160zM 448,192 L 448,64 L 352,64 L 352,96 L 416,96 L 416,160 L 384,160 L 384,192 ZM 160,96L 224,96L 224,64L 160,64zM 256,96L 320,96L 320,64L 256,64zM 96,160 L 96,96 L 128,96 L 128,64 L 64,64 L 64,192 L 160,192 L 160,160 ZM 480,448 L 32,448 L 32,0 L 480,0 L 480,448 Z M 512,480 L 512,480 L 512-32 L 0-32 L 0,480 L 512,480 Z" />
+<glyph unicode="" d="M 224,192 L 128,192 L 128,256 L 224,256 L 224,352 L 288,352 L 288,256 L 384,256 L 384,192 L 288,192 L 288,96 L 224,96 ZM 512,160 L 512-32 L 0-32 L 0,160 L 64,160 L 64,32 L 448,32 L 448,160 Z" />
+<glyph unicode="" d="M 64,352l 64,0 l0-96 l 32,0 L 160,448 c0,17.6-14.4,32-32,32L 64,480 C 46.4,480, 32,465.6, 32,448l0-192 l 32,0 L 64,352 z M 64,448l 64,0 l0-64 L 64,384 L 64,448 z M 480,448L 480,480 l-96,0
+ c-17.601,0-32-14.4-32-32l0-160 c0-17.6, 14.399-32, 32-32l 96,0 l0,32 l-96,0 L 384,448 L 480,448 z M 320,400L 320,448 c0,17.6-14.4,32-32,32l-96,0 l0-224 l 96,0
+ c 17.6,0, 32,14.4, 32,32l0,48 c0,17.6-4.4,32-22,32C 315.6,368, 320,382.4, 320,400z M 288,288l-64,0 l0,64 l 64,0 L 288,288 z M 288,384l-64,0 L 224,448 l 64,0 L 288,384 zM 416,192 L 208-32 L 96,112 L 137,147 L 208,73 L 384,224 Z" />
+<glyph unicode="" d="M 512,480 L 512,288 L 442.87,357.13 L 336.87,251.13 L 283.13,304.87 L 389.13,410.87 L 320,480 ZM 122.87,410.87 L 228.87,304.87 L 175.13,251.13 L 69.13,357.13 L 0,288 L 0,480 L 192,480 ZM 442.87,90.87 L 512,160 L 512-32 L 320-32 L 389.13,37.13 L 283.13,143.13 L 336.87,196.87 ZM 228.87,143.13 L 122.87,37.13 L 192-32 L 0-32 L 0,160 L 69.13,90.87 L 175.13,196.87 Z" />
+<glyph unicode="" d="M 128,448L 384,448L 384,384L 128,384zM 480,352L 32,352 C 14.4,352,0,337.6,0,320l0-160 c0-17.6, 14.398-32, 32-32l 96,0 l0-128 l 256,0 L 384,128 l 96,0 c 17.6,0, 32,14.4, 32,32L 512,320
+ C 512,337.6, 497.6,352, 480,352z M 352,32L 160,32 L 160,192 l 192,0 L 352,32 z M 487.2,304c0-12.813-10.387-23.2-23.199-23.2
+ c-12.813,0-23.201,10.387-23.201,23.2s 10.388,23.2, 23.201,23.2C 476.814,327.2, 487.2,316.813, 487.2,304z" />
+<glyph unicode="" d="M 256,480C 114.615,480,0,365.386,0,224c0-141.385, 114.614-256, 256-256c 141.385,0, 256,114.615, 256,256
+ C 512,365.386, 397.385,480, 256,480z M 256,8c-119.293,0-216,96.706-216,216c0,119.293, 96.707,216, 216,216c 119.295,0, 216-96.707, 216-216
+ C 472,104.706, 375.295,8, 256,8z M 192,320c0-17.673-14.327-32-32-32s-32,14.327-32,32s 14.327,32, 32,32S 192,337.673, 192,320z
+ M 384,320c0-17.673-14.326-32-32-32s-32,14.327-32,32s 14.326,32, 32,32S 384,337.673, 384,320zM 256,154 C 326.537,154 387.344,182.766 415.231,215.596 C 404.795,129.986 337.087,64 256,64 C 174.941,64 107.251,130.013 96.778,215.584 C 124.671,182.761 185.471,154 256,154 Z" />
+<glyph unicode="" d="M 352,32 L 480,32 L 512,96 L 512-32 L 320-32 L 320,75.107 C 385.556,103.349 432,173.688 432,256 C 432,363.216 353.201,447.133 256,447.133 C 158.797,447.133 80,363.217 80,256 C 80,173.688 126.443,103.349 192,75.107 L 192-32 L 0-32 L 0,96 L 32,32 L 160,32 L 160,48.295 C 66.185,81.525 0,161.996 0,256 C 0,379.712 114.615,480 256,480 C 397.385,480 512,379.712 512,256 C 512,161.996 445.815,81.525 352,48.295 L 352,32 Z" />
+<glyph unicode="" d="M 384,377 L 384,352 L 448,352 L 448,320 L 352,320 L 352,393 L 416,423 L 416,448 L 352,448 L 352,480 L 448,480 L 448,407 ZM 338,352L 270,352L 176,258L 82,352L 14,352L 142,224L 14,96L 82,96L 176,190L 270,96L 338,96L 210,224 z" />
+<glyph unicode="" d="M 384,25 L 384,0 L 448,0 L 448-32 L 352-32 L 352,41 L 416,71 L 416,96 L 352,96 L 352,128 L 448,128 L 448,55 ZM 338,352L 270,352L 176,258L 82,352L 14,352L 142,224L 14,96L 82,96L 176,190L 270,96L 338,96L 210,224 z" />
+<glyph unicode="" d="M0,32L 288,32L 288-32L0-32zM 96,480L 448,480L 448,416L 96,416zM 138.694,64 L 241.038,456.082 L 302.963,439.918 L 204.838,64 ZM 464.887-32 L 400,32.887 L 335.113-32 L 304-0.887 L 368.887,64 L 304,128.887 L 335.113,160 L 400,95.113 L 464.887,160 L 496,128.887 L 431.113,64 L 496-0.887 Z" />
+<glyph unicode="" d="M0,256L 512,256L 512,192L0,192z" />
+<glyph unicode="" d="M0,448l0-448 l 512,0 L 512,448 L0,448 z M 192,160l0,96 l 128,0 l0-96 L 192,160 z M 320,128l0-96 L 192,32 l0,96 L 320,128 z M 320,384l0-96 L 192,288 L 192,384 L 320,384 z M 160,384l0-96 L 32,288 L 32,384 L 160,384 z
+ M 32,256l 128,0 l0-96 L 32,160 L 32,256 z M 352,256l 128,0 l0-96 L 352,160 L 352,256 z M 352,288L 352,384 l 128,0 l0-96 L 352,288 z M 32,128l 128,0 l0-96 L 32,32 L 32,128 z M 352,32l0,96 l 128,0 l0-96 L 352,32 z" />
+<glyph unicode="" d="M 161.009,64l 28.8,96l 132.382,0 l 28.8-96l 56.816,0 L 311.809,384L 200.191,384 l-96-320L 161.009,64 z M 237.809,320l 36.382,0 l 28.8-96l-93.982,0
+ L 237.809,320z" />
+<glyph unicode="" d="M 256,320C 151.316,320, 58.378,269.722,0,192c 58.378-77.723, 151.316-128, 256-128c 104.684,0, 197.622,50.277, 256,128
+ C 453.622,269.722, 360.684,320, 256,320z M 224,256c 17.673,0, 32-14.327, 32-32s-14.327-32-32-32s-32,14.327-32,32S 206.327,256, 224,256z
+ M 386.808,127.352c-19.824-10.129-40.826-17.931-62.423-23.188C 302.141,98.746, 279.134,96, 256,96
+ c-23.133,0-46.141,2.746-68.384,8.162c-21.597,5.259-42.599,13.061-62.423,23.188c-31.51,16.101-60.111,38.205-83.82,64.649
+ c 23.709,26.444, 52.31,48.55, 83.82,64.649c 16.168,8.261, 33.121,14.973, 50.541,20.020C 165.79,261.547, 160,243.451, 160,224
+ c0-53.020, 42.981-96, 96-96c 53.019,0, 96,42.98, 96,96c0,19.451-5.791,37.547-15.733,52.67c 17.419-5.048, 34.372-11.76, 50.541-20.021
+ c 31.511-16.099, 60.109-38.204, 83.819-64.649C 446.917,165.557, 418.318,143.45, 386.808,127.352z M 430.459,358.139
+ C 376.099,385.916, 317.403,400, 256,400c-61.403,0-120.099-14.084-174.459-41.861C 52.155,343.123, 24.675,324.187,0,302.101l0-54.603
+ c 27.669,29.283, 60.347,53.877, 96.097,72.145C 145.907,345.095, 199.706,358, 256,358s 110.093-12.905, 159.902-38.358
+ c 35.751-18.268, 68.429-42.862, 96.098-72.145L 512,302.1 C 487.325,324.187, 459.846,343.123, 430.459,358.139z" />
+<glyph unicode="" d="M 256,384C 149.962,384, 64,298.039, 64,192s 85.961-192, 192-192c 106.037,0, 192,85.961, 192,192S 362.037,384, 256,384z
+ M 357.822,90.177C 330.626,62.979, 294.464,48, 256,48s-74.625,14.979-101.823,42.177C 126.979,117.374, 112,153.536, 112,192
+ s 14.979,74.625, 42.177,101.823C 181.375,321.021, 217.536,336, 256,336s 74.626-14.979, 101.821-42.177
+ C 385.022,266.625, 400,230.464, 400,192S 385.021,117.374, 357.822,90.177zM 162.965,378.069l-21.47,42.939C 92.058,396.24, 51.76,355.942, 26.992,306.504l 42.938-21.47
+ C 90.054,325.202, 122.796,357.945, 162.965,378.069zM 442.067,285.035l 42.939,21.469C 460.24,355.942, 419.943,396.24, 370.504,421.008l-21.472-42.939
+ C 389.201,357.945, 421.944,325.203, 442.067,285.035zM 256,288l-32,0 l0-96 c0-5.055, 2.35-9.555, 6.011-12.486l-0.006-0.008l 80-64l 19.988,24.988L 256,199.689L 256,288 z" />
+<glyph unicode="" d="M 160,352L 32,224L 160,96L 224,96L 96,224L 224,352 zM 352,352L 288,352L 416,224L 288,96L 352,96L 480,224 z" />
+<glyph unicode="" d="M 224,128L 288,128L 288,64L 224,64zM 352,352 C 369.673,352 384,337.673 384,320 L 384,224 L 288,160 L 224,160 L 224,192 L 320,256 L 320,288 L 160,288 L 160,352 L 352,352 ZM 256,432 C 200.441,432 148.208,410.364 108.922,371.078 C 69.636,331.792 48,279.559 48,224 C 48,168.441 69.636,116.208 108.922,76.922 C 148.208,37.636 200.441,16 256,16 C 311.559,16 363.792,37.636 403.078,76.922 C 442.364,116.208 464,168.441 464,224 C 464,279.559 442.364,331.792 403.078,371.078 C 363.792,410.364 311.559,432 256,432 Z M 256,480 L 256,480 C 397.385,480 512,365.385 512,224 C 512,82.615 397.385-32 256-32 C 114.615-32 0,82.615 0,224 C 0,365.385 114.615,480 256,480 Z" />
+<glyph unicode="" d="M0,416l0-384 l 512,0 L 512,416 L0,416 z M 96,64L 32,64 l0,64 l 64,0 L 96,64 z M 96,192L 32,192 l0,64 l 64,0 L 96,192 z M 96,320L 32,320 L 32,384 l 64,0 L 96,320 z M 384,64L 128,64 L 128,384 l 256,0 L 384,64 z
+ M 480,64l-64,0 l0,64 l 64,0 L 480,64 z M 480,192l-64,0 l0,64 l 64,0 L 480,192 z M 480,320l-64,0 L 416,384 l 64,0 L 480,320 zM 192,320L 192,128L 320,224 z" />
+<glyph unicode="" d="M0,416l0-416 l 512,0 L 512,416 L0,416 z M 480,32L 32,32 L 32,384 l 448,0 L 480,32 zM 352,304A48,48 3060 1 0 448,304A48,48 3060 1 0 352,304zM 448,64 L 64,64 L 160,320 L 288,160 L 352,208 Z" />
+<glyph unicode="" d="M 96,480l0-512 l 160,160l 160-160L 416,480 L 96,480 z M 384,45.255l-128,128l-128-128L 128,448 l 256,0 L 384,45.255 z" />
+<glyph unicode="" d="M 238.444,142.443c 2.28-4.524, 3.495-9.579, 3.495-14.848c0-8.808-3.372-17.029-9.496-23.154l-81.69-81.69
+ c-6.124-6.124-14.348-9.496-23.154-9.496s-17.030,3.372-23.154,9.496l-49.69,49.69c-6.124,6.125-9.496,14.348-9.496,23.154
+ s 3.372,17.030, 9.496,23.154l 81.69,81.691c 6.124,6.123, 14.348,9.496, 23.154,9.496c 5.269,0, 10.322-1.215, 14.848-3.494l 32.669,32.668
+ c-13.935,10.705-30.72,16.080-47.517,16.080c-19.993,0-39.986-7.583-55.154-22.751l-81.69-81.691
+ c-30.335-30.335-30.335-79.975,0-110.309l 49.69-49.691c 15.167-15.166, 35.16-22.75, 55.153-22.75
+ c 19.994,0, 39.987,7.584, 55.154,22.751l 81.69,81.69c 27.91,27.91, 30.119,72.149, 6.672,102.673L 238.444,142.443zM 489.248,407.558l-49.69,49.691C 424.391,472.417, 404.398,480, 384.404,480c-19.993,0-39.985-7.583-55.153-22.751l-81.691-81.691
+ c-27.91-27.91-30.119-72.149-6.671-102.671l 32.669,32.67c-2.279,4.525-3.494,9.58-3.494,14.847c0,8.808, 3.372,17.030, 9.496,23.154
+ l 81.691,81.691c 6.123,6.124, 14.347,9.497, 23.153,9.497c 8.808,0, 17.030-3.373, 23.154-9.497l 49.69-49.691
+ c 6.124-6.124, 9.496-14.347, 9.496-23.154c0-8.807-3.372-17.030-9.496-23.154l-81.69-81.691c-6.124-6.124-14.347-9.496-23.154-9.496
+ c-5.268,0-10.322,1.215-14.848,3.495l-32.669-32.669c 13.936-10.705, 30.72-16.080, 47.517-16.080c 19.994,0, 39.987,7.584, 55.154,22.752
+ l 81.69,81.69C 519.584,327.584, 519.584,377.223, 489.248,407.558zM 116.684,340.688L 20.687,436.685L 43.315,459.313L 139.312,363.316zM 192,480L 224,480L 224,384L 192,384zM0,288L 96,288L 96,256L0,256zM 395.316,107.312L 491.314,11.314L 468.686-11.314L 372.688,84.684zM 288,64L 320,64L 320-32L 288-32zM 416,192L 512,192L 512,160L 416,160z" />
+<glyph unicode="" d="M 160,128c 8.8-8.8, 23.637-8.363, 32.971,0.971L 351.030,287.029C 360.364,296.363, 360.8,311.2, 352,320
+ s-23.637,8.363-32.971-0.971L 160.971,160.971C 151.637,151.637, 151.2,136.8, 160,128zM 238.444,142.444c 2.28-4.525, 3.495-9.58, 3.495-14.848c0-8.808-3.372-17.030-9.496-23.154l-81.691-81.691
+ c-6.124-6.124-14.347-9.496-23.154-9.496s-17.030,3.372-23.154,9.496l-49.691,49.691c-6.124,6.124-9.496,14.347-9.496,23.154
+ s 3.372,17.030, 9.496,23.154l 81.691,81.691c 6.124,6.124, 14.347,9.497, 23.154,9.497c 5.268,0, 10.322-1.215, 14.848-3.495l 32.669,32.669
+ c-13.935,10.705-30.72,16.080-47.517,16.080c-19.993,0-39.986-7.583-55.154-22.751l-81.691-81.691
+ c-30.335-30.335-30.335-79.974,0-110.309l 49.691-49.691C 87.611-24.416, 107.604-32, 127.597-32
+ c 19.994,0, 39.987,7.584, 55.154,22.751l 81.691,81.691c 27.91,27.91, 30.119,72.149, 6.672,102.672L 238.444,142.444zM 489.249,407.558l-49.691,49.691C 424.391,472.417, 404.398,480, 384.404,480c-19.993,0-39.986-7.583-55.154-22.751l-81.691-81.691
+ c-27.91-27.91-30.119-72.149-6.671-102.671l 32.669,32.67c-2.279,4.525-3.494,9.58-3.494,14.847c0,8.808, 3.372,17.030, 9.496,23.154
+ l 81.691,81.691c 6.124,6.124, 14.347,9.497, 23.154,9.497s 17.030-3.373, 23.154-9.497l 49.691-49.691
+ c 6.124-6.124, 9.496-14.347, 9.496-23.154s-3.372-17.030-9.496-23.154l-81.691-81.691c-6.124-6.124-14.347-9.496-23.154-9.496
+ c-5.268,0-10.322,1.215-14.848,3.495l-32.669-32.669c 13.936-10.705, 30.72-16.080, 47.517-16.080c 19.994,0, 39.987,7.584, 55.154,22.751
+ l 81.691,81.691C 519.584,327.584, 519.584,377.223, 489.249,407.558z" />
+<glyph unicode="" d="M 288,355.814L 288,480 l 192-192L 288,96L 288,222.912 C 64.625,228.153, 74.206,71.016, 131.070-32
+ C-9.286,119.707, 20.52,362.785, 288,355.814z" />
+<glyph unicode="" d="M 380.931-32C 437.794,71.016, 447.375,228.153, 224,222.912L 224,96 L 32,288L 224,480l0-124.186
+ C 491.481,362.785, 521.285,119.707, 380.931-32z" />
+<glyph unicode="" d="M 112.5,256 C 174.356,256 224.5,205.855 224.5,144 C 224.5,82.144 174.356,32 112.5,32 C 50.644,32 0.5,82.144 0.5,144 L 0,160 C 0,283.712 100.288,384 224,384 L 224,320 C 181.263,320 141.083,303.357 110.863,273.137 C 105.046,267.319 99.737,261.129 94.948,254.627 C 100.667,255.527 106.528,256 112.5,256 ZM 400.5,256 C 462.355,256 512.5,205.855 512.5,144 C 512.5,82.144 462.355,32 400.5,32 C 338.645,32 288.5,82.144 288.5,144 L 288,160 C 288,283.712 388.288,384 512,384 L 512,320 C 469.263,320 429.083,303.357 398.863,273.137 C 393.045,267.319 387.736,261.129 382.947,254.627 C 388.667,255.527 394.527,256 400.5,256 Z" />
+<glyph unicode="" d="M0,448L 512,448L 512,384L0,384zM 192,352L 512,352L 512,288L 192,288zM 192,256L 512,256L 512,192L 192,192zM 192,160L 512,160L 512,96L 192,96zM0,64L 512,64L 512,0L0,0zM 128,320 L 128,128 L 0,224 Z" />
+<glyph unicode="" d="M0,448L 512,448L 512,384L0,384zM 192,352L 512,352L 512,288L 192,288zM 192,256L 512,256L 512,192L 192,192zM 192,160L 512,160L 512,96L 192,96zM0,64L 512,64L 512,0L0,0zM 0,128 L 0,320 L 128,224 Z" />
+<glyph unicode="" d="M 192,64L 512,64L 512,0L 192,0zM 192,256L 512,256L 512,192L 192,192zM 192,448L 512,448L 512,384L 192,384zM 96,480 L 96,352 L 64,352 L 64,448 L 32,448 L 32,480 ZM 64,217 L 64,192 L 128,192 L 128,160 L 32,160 L 32,233 L 96,263 L 96,288 L 32,288 L 32,320 L 128,320 L 128,247 ZM 128,128 L 128-32 L 32-32 L 32,0 L 96,0 L 96,32 L 32,32 L 32,64 L 96,64 L 96,96 L 32,96 L 32,128 Z" />
+<glyph unicode="" d="M 192,448l 320,0 l0-64 L 192,384 L 192,448 z M 192,256l 320,0 l0-64 L 192,192 L 192,256 z M 192,64l 320,0 l0-64 L 192,0 L 192,64 zM0,416A64,64 3060 1 0 128,416A64,64 3060 1 0 0,416zM0,224A64,64 3060 1 0 128,224A64,64 3060 1 0 0,224zM0,32A64,64 3060 1 0 128,32A64,64 3060 1 0 0,32z" />
+<glyph unicode="" d="M 32,480L 224,480L 224,448L 32,448zM 288,480L 480,480L 480,448L 288,448zM 476,320l-28,0 L 448,448 L 320,448 l0-128 L 192,320 L 192,448 L 64,448 l0-128 L 36,320 c-19.8,0-36-16.2-36-36l0-280 c0-19.8, 16.2-36, 36-36l 152,0 c 19.8,0, 36,16.2, 36,36L 224,192 l 64,0
+ l0-188 c0-19.8, 16.2-36, 36-36l 152,0 c 19.8,0, 36,16.2, 36,36L 512,284 C 512,303.8, 495.8,320, 476,320z M 174,0L 50,0 c-9.9,0-18,7.2-18,16
+ s 8.1,16, 18,16l 124,0 c 9.9,0, 18-7.2, 18-16S 183.9,0, 174,0z M 272,224l-32,0 c-8.8,0-16,7.2-16,16s 7.2,16, 16,16l 32,0 c 8.8,0, 16-7.2, 16-16
+ S 280.8,224, 272,224z M 462,0L 338,0 c-9.9,0-18,7.2-18,16s 8.1,16, 18,16l 124,0 c 9.9,0, 18-7.2, 18-16S 471.9,0, 462,0z" />
+<glyph unicode="" d="M 416,320L 416,400 c0,8.8-7.2,16-16,16L 288,416 L 288,448 c0,17.6-14.4,32-32,32l-64,0 c-17.602,0-32-14.4-32-32l0-32 L 48,416 c-8.801,0-16-7.2-16-16l0-320
+ c0-8.8, 7.199-16, 16-16l 144,0 l0-96 l 224,0 l 96,96L 512,320 L 416,320 z M 192,447.943c 0.017,0.019, 0.036,0.039, 0.057,0.057l 63.884,0
+ c 0.021-0.018, 0.041-0.038, 0.059-0.057L 256,416 l-64,0 L 192,447.943 z M 96,352L 96,384 l 256,0 l0-32 L 96,352 z M 416,13.255L 416,64 l 50.745,0 L 416,13.255z M 480,96l-96,0 l0-96
+ L 224,0 L 224,288 l 256,0 L 480,96 z" />
+<glyph unicode="" d="M 445.387,125.423c-22.827,22.778-51.864,34.536-78.973,34.536l-14.556,0 l-31.952,32.004l 127.81,128.019
+ c 31.952,32.005, 31.952,96.014,0,128.019L 256.001,255.973L 64.285,448c-31.952-32.004-31.952-96.014,0-128.019l 127.811-128.017
+ l-31.953-32.004l-14.557,0 c-27.11,0-56.146-11.759-78.974-34.538c-40.811-40.721-46.325-101.242-12.315-135.175
+ C 69.282-24.704, 89.441-32, 110.795-32c 27.108,0, 56.145,11.757, 78.973,34.536c 26.792,26.732, 38.371,62, 33.542,92.674l 32.692,32.744
+ l 32.688-32.744c-4.828-30.674, 6.753-65.941, 33.542-92.674C 345.063-20.243, 374.098-32, 401.206-32
+ c 21.354,0, 41.512,7.296, 56.497,22.248C 491.713,24.181, 486.197,84.702, 445.387,125.423z M 176.512,57.231
+ c-3.849-8.941-9.505-17.173-16.813-24.463c-7.318-7.302-15.586-12.959-24.574-16.812c-8.066-3.458-16.48-5.284-24.331-5.284
+ c-7.573,0-18.306,1.701-26.431,9.806c-8.068,8.052-9.76,18.659-9.76,26.144c0,7.771, 1.821,16.105, 5.263,24.106
+ c 3.85,8.942, 9.507,17.173, 16.813,24.463c 7.317,7.303, 15.586,12.957, 24.575,16.812c 8.067,3.457, 16.48,5.284, 24.332,5.284
+ c 7.573,0, 18.306-1.7, 26.429-9.807c 8.067-8.049, 9.761-18.658, 9.761-26.142C 181.777,73.567, 179.957,65.23, 176.512,57.231z
+ M 256.002,146.702c-24.957,0-45.188,20.266-45.188,45.263c0,24.996, 20.231,45.26, 45.188,45.26s 45.186-20.264, 45.186-45.26
+ C 301.188,166.966, 280.958,146.702, 256.002,146.702z M 427.636,20.479c-8.124-8.104-18.856-9.806-26.43-9.806
+ c-7.852,0-16.265,1.826-24.333,5.284c-8.986,3.853-17.254,9.51-24.571,16.812c-7.307,7.29-12.963,15.521-16.813,24.463
+ c-3.443,7.999-5.263,16.336-5.263,24.106c0,7.483, 1.692,18.094, 9.76,26.143c 8.123,8.104, 18.856,9.807, 26.43,9.807
+ c 7.85,0, 16.265-1.827, 24.33-5.284c 8.989-3.854, 17.258-9.509, 24.575-16.812c 7.305-7.29, 12.962-15.521, 16.813-24.463
+ c 3.442-7.999, 5.263-16.335, 5.263-24.106C 437.396,39.138, 435.702,28.53, 427.636,20.479z" />
+<glyph unicode="" d="M0,448L 512,448L 512,384L0,384zM0,352L 512,352L 512,288L0,288zM0,256L 512,256L 512,192L0,192zM0,160L 512,160L 512,96L0,96zM0,64L 512,64L 512,0L0,0z" />
+<glyph unicode="" d="M0,448L 512,448L 512,384L0,384zM 192,352L 512,352L 512,288L 192,288zM 192,160L 512,160L 512,96L 192,96zM0,256L 512,256L 512,192L0,192zM0,64L 512,64L 512,0L0,0z" />
+<glyph unicode="" d="M0,448L 512,448L 512,384L0,384zM 96,352L 416,352L 416,288L 96,288zM 96,160L 416,160L 416,96L 96,96zM0,256L 512,256L 512,192L0,192zM0,64L 512,64L 512,0L0,0z" />
+<glyph unicode="" d="M0,448L 512,448L 512,384L0,384zM0,352L 320,352L 320,288L0,288zM0,160L 320,160L 320,96L0,96zM0,256L 512,256L 512,192L0,192zM0,64L 512,64L 512,0L0,0z" />
+<glyph unicode="" d="M 512,183.771l0,80.458 l-79.572,7.957c-4.093,15.021-10.044,29.274-17.605,42.49l 52.298,63.919L 410.595,435.12l-63.918-52.298
+ c-13.217,7.562-27.471,13.513-42.491,17.604L 296.229,480l-80.458,0 l-7.957-79.573c-15.021-4.093-29.274-10.043-42.49-17.604
+ L 101.405,435.12L 44.88,378.595l 52.298-63.918c-7.562-13.216-13.513-27.47-17.605-42.49L0,264.229l0-80.458 l 79.573-7.957
+ c 4.093-15.021, 10.043-29.274, 17.605-42.491L 44.88,69.405l 56.524-56.524l 63.919,52.298c 13.216-7.562, 27.47-13.514, 42.49-17.605
+ L 215.771-32l 80.458,0 l 7.957,79.572c 15.021,4.093, 29.274,10.044, 42.491,17.605l 63.918-52.298l 56.524,56.524l-52.298,63.918
+ c 7.562,13.217, 13.514,27.471, 17.605,42.49L 512,183.771z M 352,192l-64-64l-64,0 l-64,64l0,64 l 64,64l 64,0 l 64-64L 352,192 z" />
+<glyph unicode="" d="M 451.716,380.285l-71.432,71.431C 364.728,467.272, 334,480, 312,480L 72,480 C 50,480, 32,462, 32,440l0-432 c0-22, 18-40, 40-40l 368,0 c 22,0, 40,18, 40,40
+ L 480,312 C 480,334, 467.272,364.729, 451.716,380.285z M 429.089,357.657c 1.565-1.565, 3.125-3.487, 4.64-5.657L 352,352 L 352,433.728
+ c 2.17-1.515, 4.092-3.075, 5.657-4.64L 429.089,357.657z M 448,8c0-4.336-3.664-8-8-8L 72,0 c-4.336,0-8,3.664-8,8L 64,440 c0,4.336, 3.664,8, 8,8
+ l 240,0 c 2.416,0, 5.127-0.305, 8-0.852L 320,320 l 127.148,0 c 0.547-2.873, 0.852-5.583, 0.852-8L 448,8 z" />
+<glyph unicode="" d="M 448,480L0,480 l0-512 l 512,0 L 512,416 L 448,480z M 256,416l 64,0 l0-128 l-64,0 L 256,416 z M 448,32L 64,32 L 64,416 l 32,0 l0-160 l 288,0 L 384,416 l 37.489,0 L 448,389.491L 448,32 z" />
+<glyph unicode="" d="M 64,208L 208,64L 448,304L 384,368L 208,192L 128,272 z" />
+<glyph unicode="" d="M 256,224L 256,160L 272,160L 288,192L 320,192L 320,64L 296,64L 296,32L 408,32L 408,64L 384,64L 384,192L 416,192L 432,160L 448,160L 448,224 zM 416,320L 416,400 c0,8.8-7.2,16-16,16L 288,416 L 288,448 c0,17.6-14.4,32-32,32l-64,0 c-17.602,0-32-14.4-32-32l0-32 L 48,416 c-8.801,0-16-7.2-16-16l0-320
+ c0-8.8, 7.199-16, 16-16l 144,0 l0-96 l 320,0 L 512,320 L 416,320 z M 192,447.943c 0.017,0.019, 0.036,0.039, 0.057,0.057l 63.884,0
+ c 0.021-0.018, 0.041-0.038, 0.059-0.057L 256,416 l-64,0 L 192,447.943 z M 96,352L 96,384 l 256,0 l0-32 L 96,352 z M 480,0L 224,0 L 224,288 l 256,0 L 480,0 z" />
+<glyph unicode=" " horiz-adv-x="256" />
+</font></defs></svg>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymceskinslightgrayfontstinymcettf"></a>
<div class="binary"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.ttf</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.ttf
</span><span class="cx">===================================================================
</span><del>--- trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.ttf 2013-12-28 05:24:32 UTC (rev 26875)
</del><ins>+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.ttf 2013-12-28 23:52:04 UTC (rev 26876)
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.ttf
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceskinslightgrayfontstinymcewoff"></a>
<div class="binary"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.woff</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.woff
</span><span class="cx">===================================================================
</span><del>--- trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.woff 2013-12-28 05:24:32 UTC (rev 26875)
</del><ins>+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.woff 2013-12-28 23:52:04 UTC (rev 26876)
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.woff
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceskinslightgrayimganchorgif"></a>
<div class="binary"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/img/anchor.gif</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/src/wp-includes/js/tinymce/skins/lightgray/img/anchor.gif
</span><span class="cx">===================================================================
</span><del>--- trunk/src/wp-includes/js/tinymce/skins/lightgray/img/anchor.gif 2013-12-28 05:24:32 UTC (rev 26875)
</del><ins>+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/img/anchor.gif 2013-12-28 23:52:04 UTC (rev 26876)
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/skins/lightgray/img/anchor.gif
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+image/gif
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceskinslightgrayimgloadergif"></a>
<div class="binary"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/img/loader.gif</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/src/wp-includes/js/tinymce/skins/lightgray/img/loader.gif
</span><span class="cx">===================================================================
</span><del>--- trunk/src/wp-includes/js/tinymce/skins/lightgray/img/loader.gif 2013-12-28 05:24:32 UTC (rev 26875)
</del><ins>+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/img/loader.gif 2013-12-28 23:52:04 UTC (rev 26876)
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/skins/lightgray/img/loader.gif
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+image/gif
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceskinslightgrayimgobjectgif"></a>
<div class="binary"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/img/object.gif</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/src/wp-includes/js/tinymce/skins/lightgray/img/object.gif
</span><span class="cx">===================================================================
</span><del>--- trunk/src/wp-includes/js/tinymce/skins/lightgray/img/object.gif 2013-12-28 05:24:32 UTC (rev 26875)
</del><ins>+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/img/object.gif 2013-12-28 23:52:04 UTC (rev 26876)
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/skins/lightgray/img/object.gif
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+image/gif
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceskinslightgrayimgtransgif"></a>
<div class="binary"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/img/trans.gif</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/src/wp-includes/js/tinymce/skins/lightgray/img/trans.gif
</span><span class="cx">===================================================================
</span><del>--- trunk/src/wp-includes/js/tinymce/skins/lightgray/img/trans.gif 2013-12-28 05:24:32 UTC (rev 26875)
</del><ins>+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/img/trans.gif 2013-12-28 23:52:04 UTC (rev 26876)
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/skins/lightgray/img/trans.gif
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+image/gif
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceskinslightgrayimgwlinegif"></a>
<div class="binary"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/img/wline.gif</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/src/wp-includes/js/tinymce/skins/lightgray/img/wline.gif
</span><span class="cx">===================================================================
</span><del>--- trunk/src/wp-includes/js/tinymce/skins/lightgray/img/wline.gif 2013-12-28 05:24:32 UTC (rev 26875)
</del><ins>+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/img/wline.gif 2013-12-28 23:52:04 UTC (rev 26876)
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/skins/lightgray/img/wline.gif
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+image/gif
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceskinslightgrayskinie7mincss"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css (rev 0)
+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+.mce-container,.mce-container *,.mce-widget,.mce-widget *{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-container ::-webkit-scrollbar{width:8px;height:8px;-webkit-border-radius:4px}.mce-container ::-webkit-scrollbar-track,.mce-container ::-webkit-scrollbar-track-piece{background-color:transparent}.mce-container ::-webkit-scroll
bar-thumb{background-color:rgba(53,57,71,0.3);width:6px;height:6px;-webkit-border-radius:4px}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:visible !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #9e9e9e;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:
hover{background:#d9d9d9}.mce-grid td div{border:1px solid #d6d6d6;width:12px;height:12px;margin:2px;cursor:pointer}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover{border-color:#a1a1a1}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#a1a1a1;background:#c8def4}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-toolbar-grp{padding-bottom:2px}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}
.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scroll{position:relative}.mce-panel{border:0 solid #9e9e9e;background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fdfdfd, #ddd);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fdfdfd), to(#ddd));background-image:-webkit-linear-gradient(top, #fdfdfd, #ddd);background-image:-o-linear-gradient(top, #fdfdfd, #ddd);background-image:linear-gradient(to bottom, #fdfdfd, #ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd', endColorstr='#ffdddddd', GradientType=0);zoom:1
}.mce-floatpanel{position:absolute;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2)}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);top:0;left:0;background:#fff;border:1px solid #9e9e9e;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-botto
m>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#9e9e9e;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#fff;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-bo
x-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#fff;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #c5c5c5;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px
}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px
#000000;-moz-box-shadow:0 0 5px #000000;box-shadow:0 0 5px #000000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:t
ransparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-sha
dow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1}.mce-btn:hover,.mce-btn:focus{color:#333;background-color:#e3e3e3;background-image:-moz-linear-gradient(top, #f2f2f2, #ccc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#ccc));background-image:-webkit-linear-gradient(top, #f2f2f2, #ccc);
background-image:-o-linear-gradient(top, #f2f2f2, #ccc);background-image:linear-gradient(to bottom, #f2f2f2, #ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffcccccc', GradientType=0);zoom:1}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zo
om:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn:not(.mce-disabled):active{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0,
0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{min-width:50px;color:#fff;border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top, #08c, #04c);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));background-image:-webkit-linear-gradient(top, #08c, #04c);background-image:-o-linear-gradient(top, #08c, #04c);background-image:linear-gradient(to bottom, #08c, #04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);zoom:1}.mce-primary:hover,.mce-primary:focus{background-color:#005fb3;background-imag
e:-moz-linear-gradient(top, #0077b3, #003cb3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0077b3), to(#003cb3));background-image:-webkit-linear-gradient(top, #0077b3, #003cb3);background-image:-o-linear-gradient(top, #0077b3, #003cb3);background-image:linear-gradient(to bottom, #0077b3, #003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3', endColorstr='#ff003cb3', GradientType=0);zoom:1}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#005299;background-image:-moz-linear-gradient(top, #069, #039);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#069), to(#039));background-image:-webkit-linear-gradient(top, #069, #039);background-image:-o-linear-gradi
ent(top, #069, #039);background-image:linear-gradient(to bottom, #069, #039);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006699', endColorstr='#ff003399', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px #333}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inli
ne-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-rtl .mce-btn button{direction:rtl}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-first{border-left:1px solid #b1b1b1;border-left:1px solid rgba(0,0,0,0.25);-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #b1b1b1;border-right:1px solid rgba(0,0,0,0.1);-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{curso
r:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#
333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:
0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:4px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);*height:32px}.mce-combobox input{borde
r:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disable
d .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);border:0;overflow:hidden}.mce-label.mce-autoscro
ll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #c4c4c4}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn.mce-disabled span{color:#aaa}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn
.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled
:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .
mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top, #08c, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0077b3));background-image:-webkit-linear-gradient(top, #08c, #0077b3);background-image:-o-linear-gradient(top, #08c, #0077b3);background-image:linear-gradient(to bottom, #08c, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);zoom:1}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-m
enu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{m
argin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-r
tl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);display:inl
ine-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#333}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') for
mat('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce';font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#333;-ie7-icon:' '}.mce-btn-small .mce-ico{font-family:'tinymce-small'}.mce-ico,i.mce-i-checkbox{zoom:expression(this.runtimeStyle['zoom'] = '1', this.innerHTML = this.currentStyle['-ie7-icon'].substr(1, 1) + ' ')}.mc
e-i-save{-ie7-icon:"\e000"}.mce-i-newdocument{-ie7-icon:"\e001"}.mce-i-fullpage{-ie7-icon:"\e002"}.mce-i-alignleft{-ie7-icon:"\e003"}.mce-i-aligncenter{-ie7-icon:"\e004"}.mce-i-alignright{-ie7-icon:"\e005"}.mce-i-alignjustify{-ie7-icon:"\e006"}.mce-i-cut{-ie7-icon:"\e007"}.mce-i-paste{-ie7-icon:"\e008"}.mce-i-searchreplace{-ie7-icon:"\e009"}.mce-i-bullist{-ie7-icon:"\e00a"}.mce-i-numlist{-ie7-icon:"\e00b"}.mce-i-indent{-ie7-icon:"\e00c"}.mce-i-outdent{-ie7-icon:"\e00d"}.mce-i-blockquote{-ie7-icon:"\e00e"}.mce-i-undo{-ie7-icon:"\e00f"}.mce-i-redo{-ie7-icon:"\e010"}.mce-i-link{-ie7-icon:"\e011"}.mce-i-unlink{-ie7-icon:"\e012"}.mce-i-anchor{-ie7-icon:"\e013"}.mce-i-image{-ie7-icon:"\e014"}.mce-i-media{-ie7-icon:"\e015"}.mce-i-help{-ie7-icon:"\e016"}.mce-i-code
{-ie7-icon:"\e017"}.mce-i-inserttime{-ie7-icon:"\e018"}.mce-i-preview{-ie7-icon:"\e019"}.mce-i-forecolor{-ie7-icon:"\e01a"}.mce-i-backcolor{-ie7-icon:"\e01a"}.mce-i-table{-ie7-icon:"\e01b"}.mce-i-hr{-ie7-icon:"\e01c"}.mce-i-removeformat{-ie7-icon:"\e01d"}.mce-i-subscript{-ie7-icon:"\e01e"}.mce-i-superscript{-ie7-icon:"\e01f"}.mce-i-charmap{-ie7-icon:"\e020"}.mce-i-emoticons{-ie7-icon:"\e021"}.mce-i-print{-ie7-icon:"\e022"}.mce-i-fullscreen{-ie7-icon:"\e023"}.mce-i-spellchecker{-ie7-icon:"\e024"}.mce-i-nonbreaking{-ie7-icon:"\e025"}.mce-i-template{-ie7-icon:"\e026"}.mce-i-pagebreak{-ie7-icon:"\e027"}.mce-i-restoredraft{-ie7-icon:"\e028"}.mce-i-untitled{-ie7-icon:"\e029"}.mce-i-bold{-ie7-icon:"\e02a"}.mce-i-italic{-ie7-icon:"\e02b"}.mce-i-underline{-ie7-icon:"\e02
c"}.mce-i-strikethrough{-ie7-icon:"\e02d"}.mce-i-visualchars{-ie7-icon:"\e02e"}.mce-i-ltr{-ie7-icon:"\e02f"}.mce-i-rtl{-ie7-icon:"\e030"}.mce-i-copy{-ie7-icon:"\e031"}.mce-i-resize{-ie7-icon:"\e032"}.mce-i-browse{-ie7-icon:"\e034"}.mce-i-pastetext{-ie7-icon:"\e035"}.mce-i-checkbox,.mce-i-selected{-ie7-icon:"\e033"}.mce-i-selected{visibility:hidden}.mce-i-backcolor{background:#BBB}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymceskinslightgrayskinmincss"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/lightgray/skin.min.css (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/skins/lightgray/skin.min.css (rev 0)
+++ trunk/src/wp-includes/js/tinymce/skins/lightgray/skin.min.css 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+.mce-container,.mce-container *,.mce-widget,.mce-widget *{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-container ::-webkit-scrollbar{width:8px;height:8px;-webkit-border-radius:4px}.mce-container ::-webkit-scrollbar-track,.mce-container ::-webkit-scrollbar-track-piece{background-color:transparent}.mce-container ::-webkit-scroll
bar-thumb{background-color:rgba(53,57,71,0.3);width:6px;height:6px;-webkit-border-radius:4px}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:visible !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #9e9e9e;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:
hover{background:#d9d9d9}.mce-grid td div{border:1px solid #d6d6d6;width:12px;height:12px;margin:2px;cursor:pointer}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover{border-color:#a1a1a1}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#a1a1a1;background:#c8def4}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-toolbar-grp{padding-bottom:2px}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}
.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scroll{position:relative}.mce-panel{border:0 solid #9e9e9e;background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fdfdfd, #ddd);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fdfdfd), to(#ddd));background-image:-webkit-linear-gradient(top, #fdfdfd, #ddd);background-image:-o-linear-gradient(top, #fdfdfd, #ddd);background-image:linear-gradient(to bottom, #fdfdfd, #ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd', endColorstr='#ffdddddd', GradientType=0);zoom:1
}.mce-floatpanel{position:absolute;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2)}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);top:0;left:0;background:#fff;border:1px solid #9e9e9e;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-botto
m>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#9e9e9e;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#fff;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-bo
x-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#fff;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #c5c5c5;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px
}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px
#000000;-moz-box-shadow:0 0 5px #000000;box-shadow:0 0 5px #000000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:t
ransparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-sha
dow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1}.mce-btn:hover,.mce-btn:focus{color:#333;background-color:#e3e3e3;background-image:-moz-linear-gradient(top, #f2f2f2, #ccc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#ccc));background-image:-webkit-linear-gradient(top, #f2f2f2, #ccc);
background-image:-o-linear-gradient(top, #f2f2f2, #ccc);background-image:linear-gradient(to bottom, #f2f2f2, #ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffcccccc', GradientType=0);zoom:1}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zo
om:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn:not(.mce-disabled):active{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0,
0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{min-width:50px;color:#fff;border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top, #08c, #04c);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));background-image:-webkit-linear-gradient(top, #08c, #04c);background-image:-o-linear-gradient(top, #08c, #04c);background-image:linear-gradient(to bottom, #08c, #04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);zoom:1}.mce-primary:hover,.mce-primary:focus{background-color:#005fb3;background-imag
e:-moz-linear-gradient(top, #0077b3, #003cb3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0077b3), to(#003cb3));background-image:-webkit-linear-gradient(top, #0077b3, #003cb3);background-image:-o-linear-gradient(top, #0077b3, #003cb3);background-image:linear-gradient(to bottom, #0077b3, #003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3', endColorstr='#ff003cb3', GradientType=0);zoom:1}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#005299;background-image:-moz-linear-gradient(top, #069, #039);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#069), to(#039));background-image:-webkit-linear-gradient(top, #069, #039);background-image:-o-linear-gradi
ent(top, #069, #039);background-image:linear-gradient(to bottom, #069, #039);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006699', endColorstr='#ff003399', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px #333}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inli
ne-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-rtl .mce-btn button{direction:rtl}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-first{border-left:1px solid #b1b1b1;border-left:1px solid rgba(0,0,0,0.25);-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #b1b1b1;border-right:1px solid rgba(0,0,0,0.1);-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{curso
r:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#
333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:
0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:4px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);*height:32px}.mce-combobox input{borde
r:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disable
d .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);border:0;overflow:hidden}.mce-label.mce-autoscro
ll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #c4c4c4}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn.mce-disabled span{color:#aaa}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn
.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled
:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .
mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top, #08c, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0077b3));background-image:-webkit-linear-gradient(top, #08c, #0077b3);background-image:-o-linear-gradient(top, #08c, #0077b3);background-image:linear-gradient(to bottom, #08c, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);zoom:1}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-m
enu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{m
argin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-r
tl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);display:inl
ine-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#333}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') for
mat('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce',Arial;font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#333}.mce-btn-small .mce-ico{font-family:'tinymce-small',Arial}.mce-i-save:before{content:"\e000"}.mce-i-newdocument:before{content:"\e001"}.mce-i-fullpage:before{content:"\e002"}.mce-i-alig
nleft:before{content:"\e003"}.mce-i-aligncenter:before{content:"\e004"}.mce-i-alignright:before{content:"\e005"}.mce-i-alignjustify:before{content:"\e006"}.mce-i-cut:before{content:"\e007"}.mce-i-paste:before{content:"\e008"}.mce-i-searchreplace:before{content:"\e009"}.mce-i-bullist:before{content:"\e00a"}.mce-i-numlist:before{content:"\e00b"}.mce-i-indent:before{content:"\e00c"}.mce-i-outdent:before{content:"\e00d"}.mce-i-blockquote:before{content:"\e00e"}.mce-i-undo:before{content:"\e00f"}.mce-i-redo:before{content:"\e010"}.mce-i-link:before{content:"\e011"}.mce-i-unlink:before{content:"\e012"}.mce-i-anchor:before{content:"\e013"}.mce-i-image:before{content:"\e014"}.mce-i-media:before{content:"\e015"}.mce-i-help:before{content:"\e016"}.mce-i-code:before{content:"\e017"}.mce-
i-inserttime:before{content:"\e018"}.mce-i-preview:before{content:"\e019"}.mce-i-forecolor:before{content:"\e01a"}.mce-i-backcolor:before{content:"\e01a"}.mce-i-table:before{content:"\e01b"}.mce-i-hr:before{content:"\e01c"}.mce-i-removeformat:before{content:"\e01d"}.mce-i-subscript:before{content:"\e01e"}.mce-i-superscript:before{content:"\e01f"}.mce-i-charmap:before{content:"\e020"}.mce-i-emoticons:before{content:"\e021"}.mce-i-print:before{content:"\e022"}.mce-i-fullscreen:before{content:"\e023"}.mce-i-spellchecker:before{content:"\e024"}.mce-i-nonbreaking:before{content:"\e025"}.mce-i-template:before{content:"\e026"}.mce-i-pagebreak:before{content:"\e027"}.mce-i-restoredraft:before{content:"\e028"}.mce-i-untitled:before{content:"\e029"}.mce-i-bold:before{content:"\e02a"}.mce-i-italic
:before{content:"\e02b"}.mce-i-underline:before{content:"\e02c"}.mce-i-strikethrough:before{content:"\e02d"}.mce-i-visualchars:before{content:"\e02e"}.mce-i-visualblocks:before{content:"\e02e"}.mce-i-ltr:before{content:"\e02f"}.mce-i-rtl:before{content:"\e030"}.mce-i-copy:before{content:"\e031"}.mce-i-resize:before{content:"\e032"}.mce-i-browse:before{content:"\e034"}.mce-i-pastetext:before{content:"\e035"}.mce-i-checkbox:before,.mce-i-selected:before{content:"\e033"}.mce-i-selected{visibility:hidden}i.mce-i-backcolor{text-shadow:none;background:#bbb}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymceskinswordpressimagesembeddedpng"></a>
<div class="binary"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/wordpress/images/embedded.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/src/wp-includes/js/tinymce/skins/wordpress/images/embedded.png
</span><span class="cx">===================================================================
</span><del>--- trunk/src/wp-includes/js/tinymce/skins/wordpress/images/embedded.png 2013-12-28 05:24:32 UTC (rev 26875)
</del><ins>+++ trunk/src/wp-includes/js/tinymce/skins/wordpress/images/embedded.png 2013-12-28 23:52:04 UTC (rev 26876)
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/skins/wordpress/images/embedded.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+image/png
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceskinswordpressimagesgallery2xpng"></a>
<div class="binary"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/wordpress/images/gallery-2x.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/src/wp-includes/js/tinymce/skins/wordpress/images/gallery-2x.png
</span><span class="cx">===================================================================
</span><del>--- trunk/src/wp-includes/js/tinymce/skins/wordpress/images/gallery-2x.png 2013-12-28 05:24:32 UTC (rev 26875)
</del><ins>+++ trunk/src/wp-includes/js/tinymce/skins/wordpress/images/gallery-2x.png 2013-12-28 23:52:04 UTC (rev 26876)
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/skins/wordpress/images/gallery-2x.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+image/png
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceskinswordpressimagesgallerypng"></a>
<div class="binary"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/wordpress/images/gallery.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/src/wp-includes/js/tinymce/skins/wordpress/images/gallery.png
</span><span class="cx">===================================================================
</span><del>--- trunk/src/wp-includes/js/tinymce/skins/wordpress/images/gallery.png 2013-12-28 05:24:32 UTC (rev 26875)
</del><ins>+++ trunk/src/wp-includes/js/tinymce/skins/wordpress/images/gallery.png 2013-12-28 23:52:04 UTC (rev 26876)
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/skins/wordpress/images/gallery.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+image/png
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceskinswordpresswpcontentcss"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css (rev 0)
+++ trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,132 @@
</span><ins>+/* Additional default styles for the editor */
+body {
+ font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+ font-size: 13px;
+ line-height: 19px;
+ color: #333;
+ margin: 10px;
+}
+
+/* DFW mode */
+html.wp-fullscreen,
+html.wp-fullscreen body {
+ background: transparent;
+ width: auto;
+ max-width: none;
+ min-height: 0;
+ overflow: hidden;
+}
+
+.aligncenter,
+dl.aligncenter {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.alignleft {
+ float: left;
+}
+
+.alignright {
+ float: right;
+}
+
+.wp-caption {
+ border: 1px solid #ddd;
+ text-align: center;
+ background-color: #f3f3f3;
+ padding-top: 4px;
+ margin: 10px 0;
+}
+
+.mceIEcenter {
+ text-align: center;
+}
+
+.wp-caption img {
+ margin: 0;
+ padding: 0;
+ border: 0 none;
+}
+
+.wp-caption img,
+.wp-caption a {
+ -webkit-user-drag: none;
+}
+
+.wp-caption-dd {
+ font-size: 11px;
+ line-height: 17px;
+ padding: 0 4px 5px;
+ margin: 0;
+}
+
+pre {
+ font: 12px/18px Consolas, Monaco, monospace;
+}
+
+td {
+ color: #000;
+ font-size: 11px;
+ margin: 8px;
+}
+
+/* Styles for the WordPress plugins */
+.mce-content-body img.mce-wp-nextpage,
+.mce-content-body img.mce-wp-more {
+ border: 0;
+ width: 95%;
+ height: 10px;
+ display: block;
+ margin: 15px auto 0;
+ outline: 0;
+ cursor: default;
+}
+
+/* Remove blue highlighting of selected images in WebKit */
+img::selection {
+ background-color: transparent;
+}
+
+.mce-content-body img.mce-wp-nextpage[data-mce-selected],
+.mce-content-body img.mce-wp-more[data-mce-selected] {
+ background-color: rgba(128,128,128,0.2);
+ outline: 1px dotted #888;
+ border-color: transparent;
+}
+
+.mce-content-body img.mce-wp-more {
+ border-top: 2px dashed #bbb;
+}
+
+.mce-content-body img.mce-wp-nextpage {
+ border-top: 3px dotted #bbb;
+}
+
+.mce-content-body img.wp-gallery {
+ border: 1px dashed #888;
+ background: #f2f2f2 url("images/gallery.png") no-repeat scroll center center;
+ width: 99%;
+ height: 250px;
+ outline: 0;
+ cursor: pointer;
+}
+
+.mce-content-body img.wp-gallery:hover {
+ background-color: #ededed;
+ border-style: solid;
+}
+
+.mce-content-body img.wp-gallery.wp-gallery-selected {
+ background-color: #d8d8d8;
+ border-style: solid;
+}
+
+img.wp-oembed {
+ border: 1px dashed #888;
+ background: #f7f5f2 url("images/embedded.png") no-repeat scroll center center;
+ width: 300px;
+ height: 250px;
+ outline: 0;
+}
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcethemesmodernthemejs"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/themes/modern/theme.js (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/themes/modern/theme.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/themes/modern/theme.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,577 @@
</span><ins>+/**
+ * theme.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+tinymce.ThemeManager.add('modern', function(editor) {
+ var self = this, settings = editor.settings, Factory = tinymce.ui.Factory, each = tinymce.each, DOM = tinymce.DOM;
+
+ // Default menus
+ var defaultMenus = {
+ file: {title: 'File', items: 'newdocument'},
+ edit: {title: 'Edit', items: 'undo redo | cut copy paste pastetext | selectall'},
+ insert: {title: 'Insert', items: '|'},
+ view: {title: 'View', items: 'visualaid |'},
+ format: {title: 'Format', items: 'bold italic underline strikethrough superscript subscript | formats | removeformat'},
+ table: {title: 'Table'},
+ tools: {title: 'Tools'}
+ };
+
+ var defaultToolbar = "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | " +
+ "bullist numlist outdent indent | link image";
+
+ /**
+ * Creates the toolbars from config and returns a toolbar array.
+ *
+ * @return {Array} Array with toolbars.
+ */
+ function createToolbars() {
+ var toolbars = [];
+
+ function addToolbar(items) {
+ var toolbarItems = [], buttonGroup;
+
+ if (!items) {
+ return;
+ }
+
+ each(items.split(/[ ,]/), function(item) {
+ var itemName;
+
+ function bindSelectorChanged() {
+ var selection = editor.selection;
+
+ if (itemName == "bullist") {
+ selection.selectorChanged('ul > li', function(state, args) {
+ var nodeName, i = args.parents.length;
+
+ while (i--) {
+ nodeName = args.parents[i].nodeName;
+ if (nodeName == "OL" || nodeName == "UL") {
+ break;
+ }
+ }
+
+ item.active(state && nodeName == "UL");
+ });
+ }
+
+ if (itemName == "numlist") {
+ selection.selectorChanged('ol > li', function(state, args) {
+ var nodeName, i = args.parents.length;
+
+ while (i--) {
+ nodeName = args.parents[i].nodeName;
+ if (nodeName == "OL" || nodeName == "UL") {
+ break;
+ }
+ }
+
+ item.active(state && nodeName == "OL");
+ });
+ }
+
+ if (item.settings.stateSelector) {
+ selection.selectorChanged(item.settings.stateSelector, function(state) {
+ item.active(state);
+ }, true);
+ }
+
+ if (item.settings.disabledStateSelector) {
+ selection.selectorChanged(item.settings.disabledStateSelector, function(state) {
+ item.disabled(state);
+ });
+ }
+ }
+
+ if (item == "|") {
+ buttonGroup = null;
+ } else {
+ if (Factory.has(item)) {
+ item = {type: item};
+
+ if (settings.toolbar_items_size) {
+ item.size = settings.toolbar_items_size;
+ }
+
+ toolbarItems.push(item);
+ buttonGroup = null;
+ } else {
+ if (!buttonGroup) {
+ buttonGroup = {type: 'buttongroup', items: []};
+ toolbarItems.push(buttonGroup);
+ }
+
+ if (editor.buttons[item]) {
+ // TODO: Move control creation to some UI class
+ itemName = item;
+ item = editor.buttons[itemName];
+
+ if (typeof(item) == "function") {
+ item = item();
+ }
+
+ item.type = item.type || 'button';
+
+ if (settings.toolbar_items_size) {
+ item.size = settings.toolbar_items_size;
+ }
+
+ item = Factory.create(item);
+ buttonGroup.items.push(item);
+
+ if (editor.initialized) {
+ bindSelectorChanged();
+ } else {
+ editor.on('init', bindSelectorChanged);
+ }
+ }
+ }
+ }
+ });
+
+ toolbars.push({type: 'toolbar', layout: 'flow', items: toolbarItems});
+
+ return true;
+ }
+
+ // Generate toolbar<n>
+ for (var i = 1; i < 10; i++) {
+ if (!addToolbar(settings["toolbar" + i])) {
+ break;
+ }
+ }
+
+ // Generate toolbar or default toolbar
+ if (!toolbars.length) {
+ addToolbar(settings.toolbar || defaultToolbar);
+ }
+
+ return toolbars;
+ }
+
+ /**
+ * Creates the menu buttons based on config.
+ *
+ * @return {Array} Menu buttons array.
+ */
+ function createMenuButtons() {
+ var name, menuButtons = [];
+
+ function createMenuItem(name) {
+ var menuItem;
+
+ if (name == '|') {
+ return {text: '|'};
+ }
+
+ menuItem = editor.menuItems[name];
+
+ return menuItem;
+ }
+
+ function createMenu(context) {
+ var menuButton, menu, menuItems, isUserDefined, removedMenuItems;
+
+ removedMenuItems = tinymce.makeMap((settings.removed_menuitems || '').split(/[ ,]/));
+
+ // User defined menu
+ if (settings.menu) {
+ menu = settings.menu[context];
+ isUserDefined = true;
+ } else {
+ menu = defaultMenus[context];
+ }
+
+ if (menu) {
+ menuButton = {text: menu.title};
+ menuItems = [];
+
+ // Default/user defined items
+ each((menu.items || '').split(/[ ,]/), function(item) {
+ var menuItem = createMenuItem(item);
+
+ if (menuItem && !removedMenuItems[item]) {
+ menuItems.push(createMenuItem(item));
+ }
+ });
+
+ // Added though context
+ if (!isUserDefined) {
+ each(editor.menuItems, function(menuItem) {
+ if (menuItem.context == context) {
+ if (menuItem.separator == 'before') {
+ menuItems.push({text: '|'});
+ }
+
+ if (menuItem.prependToContext) {
+ menuItems.unshift(menuItem);
+ } else {
+ menuItems.push(menuItem);
+ }
+
+ if (menuItem.separator == 'after') {
+ menuItems.push({text: '|'});
+ }
+ }
+ });
+ }
+
+ for (var i = 0; i < menuItems.length; i++) {
+ if (menuItems[i].text == '|') {
+ if (i === 0 || i == menuItems.length - 1) {
+ menuItems.splice(i, 1);
+ }
+ }
+ }
+
+ menuButton.menu = menuItems;
+
+ if (!menuButton.menu.length) {
+ return null;
+ }
+ }
+
+ return menuButton;
+ }
+
+ var defaultMenuBar = [];
+ if (settings.menu) {
+ for (name in settings.menu) {
+ defaultMenuBar.push(name);
+ }
+ } else {
+ for (name in defaultMenus) {
+ defaultMenuBar.push(name);
+ }
+ }
+
+ var enabledMenuNames = typeof(settings.menubar) == "string" ? settings.menubar.split(/[ ,]/) : defaultMenuBar;
+ for (var i = 0; i < enabledMenuNames.length; i++) {
+ var menu = enabledMenuNames[i];
+ menu = createMenu(menu);
+
+ if (menu) {
+ menuButtons.push(menu);
+ }
+ }
+
+ return menuButtons;
+ }
+
+ /**
+ * Adds accessibility shortcut keys to panel.
+ *
+ * @param {tinymce.ui.Panel} panel Panel to add focus to.
+ */
+ function addAccessibilityKeys(panel) {
+ function focus(type) {
+ var item = panel.find(type)[0];
+
+ if (item) {
+ item.focus();
+ }
+ }
+
+ editor.shortcuts.add('Alt+F9', '', function() {
+ focus('menubar');
+ });
+
+ editor.shortcuts.add('Alt+F10', '', function() {
+ focus('toolbar');
+ });
+
+ editor.shortcuts.add('Alt+F11', '', function() {
+ focus('elementpath');
+ });
+
+ panel.on('cancel', function() {
+ editor.focus();
+ });
+ }
+
+ /**
+ * Resizes the editor to the specified width, height.
+ */
+ function resizeTo(width, height) {
+ var containerElm, iframeElm, containerSize, iframeSize;
+
+ function getSize(elm) {
+ return {
+ width: elm.clientWidth,
+ height: elm.clientHeight
+ };
+ }
+
+ containerElm = editor.getContainer();
+ iframeElm = editor.getContentAreaContainer().firstChild;
+ containerSize = getSize(containerElm);
+ iframeSize = getSize(iframeElm);
+
+ if (width !== null) {
+ width = Math.max(settings.min_width || 100, width);
+ width = Math.min(settings.max_width || 0xFFFF, width);
+
+ DOM.css(containerElm, 'width', width + (containerSize.width - iframeSize.width));
+ DOM.css(iframeElm, 'width', width);
+ }
+
+ height = Math.max(settings.min_height || 100, height);
+ height = Math.min(settings.max_height || 0xFFFF, height);
+ DOM.css(iframeElm, 'height', height);
+
+ editor.fire('ResizeEditor');
+ }
+
+ function resizeBy(dw, dh) {
+ var elm = editor.getContentAreaContainer();
+ self.resizeTo(elm.clientWidth + dw, elm.clientHeight + dh);
+ }
+
+ /**
+ * Renders the inline editor UI.
+ *
+ * @return {Object} Name/value object with theme data.
+ */
+ function renderInlineUI() {
+ var panel, inlineToolbarContainer;
+
+ if (settings.fixed_toolbar_container) {
+ inlineToolbarContainer = DOM.select(settings.fixed_toolbar_container)[0];
+ }
+
+ function reposition() {
+ if (panel && panel.moveRel && panel.visible() && !panel._fixed) {
+ // TODO: This is kind of ugly and doesn't handle multiple scrollable elements
+ var scrollContainer = editor.selection.getScrollContainer(), body = editor.getBody();
+ var deltaX = 0, deltaY = 0;
+
+ if (scrollContainer) {
+ var bodyPos = DOM.getPos(body), scrollContainerPos = DOM.getPos(scrollContainer);
+
+ deltaX = Math.max(0, scrollContainerPos.x - bodyPos.x);
+ deltaY = Math.max(0, scrollContainerPos.y - bodyPos.y);
+ }
+
+ panel.fixed(false).moveRel(body, editor.rtl ? ['tr-br', 'br-tr'] : ['tl-bl', 'bl-tl']).moveBy(deltaX, deltaY);
+ }
+ }
+
+ function show() {
+ if (panel) {
+ panel.show();
+ reposition();
+ DOM.addClass(editor.getBody(), 'mce-edit-focus');
+ }
+ }
+
+ function hide() {
+ if (panel) {
+ panel.hide();
+ DOM.removeClass(editor.getBody(), 'mce-edit-focus');
+ }
+ }
+
+ function render() {
+ if (panel) {
+ if (!panel.visible()) {
+ show();
+ }
+
+ return;
+ }
+
+ // Render a plain panel inside the inlineToolbarContainer if it's defined
+ panel = self.panel = Factory.create({
+ type: inlineToolbarContainer ? 'panel' : 'floatpanel',
+ classes: 'tinymce tinymce-inline',
+ layout: 'flex',
+ direction: 'column',
+ align: 'stretch',
+ autohide: false,
+ autofix: true,
+ fixed: !!inlineToolbarContainer,
+ border: 1,
+ items: [
+ settings.menubar === false ? null : {type: 'menubar', border: '0 0 1 0', items: createMenuButtons()},
+ settings.toolbar === false ? null : {
+ type: 'panel', layout: 'stack', classes: "toolbar-grp", items: createToolbars()
+ }
+ ]
+ });
+
+ // Add statusbar
+ /*if (settings.statusbar !== false) {
+ panel.add({type: 'panel', classes: 'statusbar', layout: 'flow', border: '1 0 0 0', items: [
+ {type: 'elementpath'}
+ ]});
+ }*/
+
+ editor.fire('BeforeRenderUI');
+ panel.renderTo(inlineToolbarContainer || document.body).reflow();
+
+ addAccessibilityKeys(panel);
+ show();
+
+ editor.on('nodeChange', reposition);
+ editor.on('activate', show);
+ editor.on('deactivate', hide);
+ }
+
+ settings.content_editable = true;
+
+ editor.on('focus', render);
+ editor.on('blur', hide);
+
+ // Remove the panel when the editor is removed
+ editor.on('remove', function() {
+ if (panel) {
+ panel.remove();
+ panel = null;
+ }
+ });
+
+ return {};
+ }
+
+ /**
+ * Renders the iframe editor UI.
+ *
+ * @param {Object} args Details about target element etc.
+ * @return {Object} Name/value object with theme data.
+ */
+ function renderIframeUI(args) {
+ var panel, resizeHandleCtrl, startSize;
+
+ // Basic UI layout
+ panel = self.panel = Factory.create({
+ type: 'panel',
+ classes: 'tinymce',
+ style: 'visibility: hidden',
+ layout: 'stack',
+ border: 1,
+ items: [
+ settings.menubar === false ? null : {type: 'menubar', border: '0 0 1 0', items: createMenuButtons()},
+ settings.toolbar === false ? null : {type: 'panel', layout: 'stack', classes: "toolbar-grp", items: createToolbars()},
+ {type: 'panel', name: 'iframe', layout: 'stack', classes: 'edit-area', html: '', border: '1 0 0 0'}
+ ]
+ });
+
+ if (settings.resize !== false) {
+ resizeHandleCtrl = {
+ type: 'resizehandle',
+ direction: settings.resize,
+
+ onResizeStart: function() {
+ var elm = editor.getContentAreaContainer().firstChild;
+
+ startSize = {
+ width: elm.clientWidth,
+ height: elm.clientHeight
+ };
+ },
+
+ onResize: function(e) {
+ if (settings.resize == 'both') {
+ resizeTo(startSize.width + e.deltaX, startSize.height + e.deltaY);
+ } else {
+ resizeTo(null, startSize.height + e.deltaY);
+ }
+ }
+ };
+ }
+
+ // Add statusbar if needed
+ if (settings.statusbar !== false) {
+ panel.add({type: 'panel', name: 'statusbar', classes: 'statusbar', layout: 'flow', border: '1 0 0 0', items: [
+ {type: 'elementpath'},
+ resizeHandleCtrl
+ ]});
+ }
+
+ if (settings.readonly) {
+ panel.find('*').disabled(true);
+ }
+
+ editor.fire('BeforeRenderUI');
+ panel.renderBefore(args.targetNode).reflow();
+
+ if (settings.width) {
+ tinymce.DOM.setStyle(panel.getEl(), 'width', settings.width);
+ }
+
+ // Remove the panel when the editor is removed
+ editor.on('remove', function() {
+ panel.remove();
+ panel = null;
+ });
+
+ // Add accesibility shortkuts
+ addAccessibilityKeys(panel);
+
+ return {
+ iframeContainer: panel.find('#iframe')[0].getEl(),
+ editorContainer: panel.getEl()
+ };
+ }
+
+ /**
+ * Renders the UI for the theme. This gets called by the editor.
+ *
+ * @param {Object} args Details about target element etc.
+ * @return {Object} Theme UI data items.
+ */
+ self.renderUI = function(args) {
+ var skin = settings.skin !== false ? settings.skin || 'lightgray' : false;
+
+ if (skin) {
+ var skinUrl = settings.skin_url;
+
+ if (skinUrl) {
+ skinUrl = editor.documentBaseURI.toAbsolute(skinUrl);
+ } else {
+ skinUrl = tinymce.baseURL + '/skins/' + skin;
+ }
+
+ // Load special skin for IE7
+ // TODO: Remove this when we drop IE7 support
+ if (tinymce.Env.documentMode <= 7) {
+ tinymce.DOM.loadCSS(skinUrl + '/skin.ie7.min.css');
+ } else {
+ tinymce.DOM.loadCSS(skinUrl + '/skin.min.css');
+ }
+
+ // Load content.min.css or content.inline.min.css
+ editor.contentCSS.push(skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css');
+ }
+
+ // Handle editor setProgressState change
+ editor.on('ProgressState', function(e) {
+ self.throbber = self.throbber || new tinymce.ui.Throbber(self.panel.getEl('body'));
+
+ if (e.state) {
+ self.throbber.show(e.time);
+ } else {
+ self.throbber.hide();
+ }
+ });
+
+ // Render inline UI
+ if (settings.inline) {
+ return renderInlineUI(args);
+ }
+
+ // Render iframe UI
+ return renderIframeUI(args);
+ };
+
+ self.resizeTo = resizeTo;
+ self.resizeBy = resizeBy;
+});
</ins><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/themes/modern/theme.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymcethemesmodernthememinjs"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/themes/modern/theme.min.js (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/themes/modern/theme.min.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/themes/modern/theme.min.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+tinymce.ThemeManager.add("modern",function(e){function t(){function t(t){var i,o=[];if(t)return d(t.split(/[ ,]/),function(t){function n(){var n=e.selection;"bullist"==r&&n.selectorChanged("ul > li",function(e,n){for(var i,o=n.parents.length;o--&&(i=n.parents[o].nodeName,"OL"!=i&&"UL"!=i););t.active(e&&"UL"==i)}),"numlist"==r&&n.selectorChanged("ol > li",function(e,n){for(var i,o=n.parents.length;o--&&(i=n.parents[o].nodeName,"OL"!=i&&"UL"!=i););t.active(e&&"OL"==i)}),t.settings.stateSelector&&n.selectorChanged(t.settings.stateSelector,function(e){t.active(e)},!0),t.settings.disabledStateSelector&&n.selectorChanged(t.settings.disabledStateSelector,function(e){t.disabled(e)})}var r;"|"==t?i=null:c.has(t)?(t={type:t},u.toolbar_items_size&&(t.size=u.toolbar_items_
size),o.push(t),i=null):(i||(i={type:"buttongroup",items:[]},o.push(i)),e.buttons[t]&&(r=t,t=e.buttons[r],"function"==typeof t&&(t=t()),t.type=t.type||"button",u.toolbar_items_size&&(t.size=u.toolbar_items_size),t=c.create(t),i.items.push(t),e.initialized?n():e.on("init",n)))}),n.push({type:"toolbar",layout:"flow",items:o}),!0}for(var n=[],i=1;10>i&&t(u["toolbar"+i]);i++);return n.length||t(u.toolbar||f),n}function n(){function t(t){var n;return"|"==t?{text:"|"}:n=e.menuItems[t]}function n(n){var i,o,r,a,s;if(s=tinymce.makeMap((u.removed_menuitems||"").split(/[ ,]/)),u.menu?(o=u.menu[n],a=!0):o=h[n],o){i={text:o.title},r=[],d((o.items||"").split(/[ ,]/),function(e){var n=t(e);n&&!s[e]&&r.push(t(e))}),a||d(e.menuItems,function(e){e.context==n&&("before"==e.separator&&r.push({text:"|"}),e.pr
ependToContext?r.unshift(e):r.push(e),"after"==e.separator&&r.push({text:"|"}))});for(var l=0;l<r.length;l++)"|"==r[l].text&&(0===l||l==r.length-1)&&r.splice(l,1);if(i.menu=r,!i.menu.length)return null}return i}var i,o=[],r=[];if(u.menu)for(i in u.menu)r.push(i);else for(i in h)r.push(i);for(var a="string"==typeof u.menubar?u.menubar.split(/[ ,]/):r,s=0;s<a.length;s++){var l=a[s];l=n(l),l&&o.push(l)}return o}function i(t){function n(e){var n=t.find(e)[0];n&&n.focus()}e.shortcuts.add("Alt+F9","",function(){n("menubar")}),e.shortcuts.add("Alt+F10","",function(){n("toolbar")}),e.shortcuts.add("Alt+F11","",function(){n("elementpath")}),t.on("cancel",function(){e.focus()})}function o(t,n){function i(e){return{width:e.clientWidth,height:e.clientHeight}}var o,r,a,s;o=e.getContainer(),r=e.getContentAreaConta
iner().firstChild,a=i(o),s=i(r),null!==t&&(t=Math.max(u.min_width||100,t),t=Math.min(u.max_width||65535,t),m.css(o,"width",t+(a.width-s.width)),m.css(r,"width",t)),n=Math.max(u.min_height||100,n),n=Math.min(u.max_height||65535,n),m.css(r,"height",n),e.fire("ResizeEditor")}function r(t,n){var i=e.getContentAreaContainer();l.resizeTo(i.clientWidth+t,i.clientHeight+n)}function a(){function o(){if(d&&d.moveRel&&d.visible()&&!d._fixed){var t=e.selection.getScrollContainer(),n=e.getBody(),i=0,o=0;if(t){var r=m.getPos(n),a=m.getPos(t);i=Math.max(0,a.x-r.x),o=Math.max(0,a.y-r.y)}d.fixed(!1).moveRel(n,e.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl"]).moveBy(i,o)}}function r(){d&&(d.show(),o(),m.addClass(e.getBody(),"mce-edit-focus"))}function a(){d&&(d.hide(),m.removeClass(e.getBody(),"mce-edit-focus"))}function s(){return d?(d.visible()||r(),void 0):(d
=l.panel=c.create({type:h?"panel":"floatpanel",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!!h,border:1,items:[u.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:n()},u.toolbar===!1?null:{type:"panel",layout:"stack",classes:"toolbar-grp",items:t()}]}),e.fire("BeforeRenderUI"),d.renderTo(h||document.body).reflow(),i(d),r(),e.on("nodeChange",o),e.on("activate",r),e.on("deactivate",a),void 0)}var d,h;return u.fixed_toolbar_container&&(h=m.select(u.fixed_toolbar_container)[0]),u.content_editable=!0,e.on("focus",s),e.on("blur",a),e.on("remove",function(){d&&(d.remove(),d=null)}),{}}function s(r){var a,s,d;return a=l.panel=c.create({type:"panel",classes:"tinymce",style:"visibility: hidden",lay
out:"stack",border:1,items:[u.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:n()},u.toolbar===!1?null:{type:"panel",layout:"stack",classes:"toolbar-grp",items:t()},{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",html:"",border:"1 0 0 0"}]}),u.resize!==!1&&(s={type:"resizehandle",direction:u.resize,onResizeStart:function(){var t=e.getContentAreaContainer().firstChild;d={width:t.clientWidth,height:t.clientHeight}},onResize:function(e){"both"==u.resize?o(d.width+e.deltaX,d.height+e.deltaY):o(null,d.height+e.deltaY)}}),u.statusbar!==!1&&a.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",items:[{type:"elementpath"},s]}),u.readonly&&a.find("*").disabled(!0),e.fire("BeforeRenderUI"),a.rend
erBefore(r.targetNode).reflow(),u.width&&tinymce.DOM.setStyle(a.getEl(),"width",u.width),e.on("remove",function(){a.remove(),a=null}),i(a),{iframeContainer:a.find("#iframe")[0].getEl(),editorContainer:a.getEl()}}var l=this,u=e.settings,c=tinymce.ui.Factory,d=tinymce.each,m=tinymce.DOM,h={file:{title:"File",items:"newdocument"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},insert:{title:"Insert",items:"|"},view:{title:"View",items:"visualaid |"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript | formats | removeformat"},table:{title:"Table"},tools:{title:"Tools"}},f="undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image";l.renderUI=function(t){var n=u.skin!==!1?u.skin||&quo
t;lightgray":!1;if(n){var i=u.skin_url;i=i?e.documentBaseURI.toAbsolute(i):tinymce.baseURL+"/skins/"+n,tinymce.Env.documentMode<=7?tinymce.DOM.loadCSS(i+"/skin.ie7.min.css"):tinymce.DOM.loadCSS(i+"/skin.min.css"),e.contentCSS.push(i+"/content"+(e.inline?".inline":"")+".min.css")}return e.on("ProgressState",function(e){l.throbber=l.throbber||new tinymce.ui.Throbber(l.panel.getEl("body")),e.state?l.throbber.show(e.time):l.throbber.hide()}),u.inline?a(t):s(t)},l.resizeTo=o,l.resizeBy=r});
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/themes/modern/theme.min.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymcetiny_mcejs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/tiny_mce.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/tiny_mce.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/tiny_mce.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-(function(e){var a=/^\s*|\s*$/g,b,d="B".replace(/A(.)|B/,"$1")==="$1";var c={majorVersion:"3",minorVersion:"5.9",releaseDate:"2013-10-18",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isIE11=g.indexOf("Trident/")!=-1&&(g.indexOf("rv:")!=-1||o.appName.indexOf("Netscape")!=-1);s.isOpera=e.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName)||s.isIE11;s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&!s.isIE11&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWe
bKit\/(\d*)/)[1]>=534;if(e.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m<f.length;m++){r=f[m].href;if(r){if(/^https?:\/\/[^\/]+$/.test(r)){r+="/"}k=r?r.match(/.*\//)[0]:""}}function h(i){if(i.src&&/tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(i.src)){if(/_(src|dev)\.js/g.test(i.src)){s.suffix="_src"}if((j=i.src.indexOf("?"))!=-1){s.query=i.src.substring(j+1)}s.baseURL=i.src.substring(0,i.src.lastIndexOf("/"));if(k&&s.baseURL.indexOf("://")==-1&&s.baseURL.indexOf("/")!==0){s.baseURL=k+s.baseURL}return s.baseURL}return null}f=q.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}l=q.getElementsByTagName("head")[0];if(l){f=l.getElementsByTagName("script");for(m=0;m<f.lengt
h;m++){if(h(f[m])){return}}}return},is:function(g,f){if(!f){return g!==b}if(f=="array"&&c.isArray(g)){return true}return typeof(g)==f},isArray:Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"},makeMap:function(f,j,h){var g;f=f||[];j=j||",";if(typeof(f)=="string"){f=f.split(j)}h=h||{};g=f.length;while(g--){h[f[g]]={}}return h},each:function(i,f,h){var j,g;if(!i){return 0}h=h||i;if(i.length!==b){for(j=0,g=i.length;j<g;j++){if(f.call(h,i[j],j,i)===false){return 0}}}else{for(j in i){if(i.hasOwnProperty(j)){if(f.call(h,i[j],j,i)===false){return 0}}}}return 1},map:function(g,h){var i=[];c.each(g,function(f){i.push(h(f))});return i},grep:function(g,h){var i=[];c.each(g,function(f){if(!h||h(f)){i.push(f)}});return i},inArray:function(g,h){var j,f;if(g){for(j=0,f=g.length;j<f;j++){if(g[j]===h){return j}}}return -1},extend:function(n,k){var j,f,h,g=arguments,m;for(j=1,f=g.length;j<f;j++){k=g[j];for(
h in k){if(k.hasOwnProperty(h)){m=k[h];if(m!==b){n[h]=m}}}}return n},trim:function(f){return(f?""+f:"").replace(a,"")},create:function(o,f,j){var n=this,g,i,k,l,h,m=0;o=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(o);k=o[3].match(/(^|\.)(\w+)$/i)[2];i=n.createNS(o[3].replace(/\.\w+$/,""),j);if(i[k]){return}if(o[2]=="static"){i[k]=f;if(this.onCreate){this.onCreate(o[2],o[3],i[k])}return}if(!f[k]){f[k]=function(){};m=1}i[k]=f[k];n.extend(i[k].prototype,f);if(o[5]){g=n.resolve(o[5]).prototype;l=o[5].match(/\.(\w+)$/i)[1];h=i[k];if(m){i[k]=function(){return g[l].apply(this,arguments)}}else{i[k]=function(){this.parent=g[l];return h.apply(this,arguments)}}i[k].prototype[k]=i[k];n.each(g,function(p,q){i[k].prototype[q]=g[q]});n.each(f,function(p,q){if(g[q]){i[k].prototype[q]=function(){this.parent=g[q];return p.apply(this,arguments)}}else{if(q!=k){i[k].prototype[q]=p}}})}n.each(f["static"],function(p,q){i[k][q]=p});if(this.onCreate){t
his.onCreate(o[2],o[3],i[k].prototype)}},walk:function(i,h,j,g){g=g||this;if(i){if(j){i=i[j]}c.each(i,function(k,f){if(h.call(g,k,f,j)===false){return false}c.walk(k,h,j,g)})}},createNS:function(j,h){var g,f;h=h||e;j=j.split(".");for(g=0;g<j.length;g++){f=j[g];if(!h[f]){h[f]={}}h=h[f]}return h},resolve:function(j,h){var g,f;h=h||e;j=j.split(".");for(g=0,f=j.length;g<f;g++){h=h[j[g]];if(!h){break}}return h},addUnload:function(j,i){var h=this,g;g=function(){var f=h.unloads,l,m;if(f){for(m in f){l=f[m];if(l&&l.func){l.func.call(l.scope,1)}}if(e.detachEvent){e.detachEvent("onbeforeunload",k);e.detachEvent("onunload",g)}else{if(e.removeEventListener){e.removeEventListener("unload",g,false)}}h.unloads=l=f=w=g=0;if(e.CollectGarbage){CollectGarbage()}}};function k(){var l=document;function f(){l.detachEvent("onstop",f);if(g){g()}l=0}if(l.readyState=="interactive"){if(l){l.attachEvent("onstop",f)}e.
setTimeout(function(){if(l){l.detachEvent("onstop",f)}},0)}}j={func:j,scope:i||this};if(!h.unloads){if(e.attachEvent){e.attachEvent("onunload",g);e.attachEvent("onbeforeunload",k)}else{if(e.addEventListener){e.addEventListener("unload",g,false)}}h.unloads=[j]}else{h.unloads.push(j)}return j},removeUnload:function(i){var g=this.unloads,h=null;c.each(g,function(j,f){if(j&&j.func==i){g.splice(f,1);h=i;return false}});return h},explode:function(f,g){if(!f||c.is(f,"array")){return f}return c.map(f.split(g||","),c.trim)},_addVer:function(g){var f;if(!this.query){return g}f=(g.indexOf("?")==-1?"?":"&")+this.query;if(g.indexOf("#")==-1){return g+f}return g.replace("#",f+"#")},_replace:function(h,f,g){if(d){return g.replace(h,function(){var l=f,j=arguments,k;for(k=0;k<j.length-2;k++){if(j[k]===b){l=l.replace(new RegExp("\\$"+k,"g"),"&
quot;)}else{l=l.replace(new RegExp("\\$"+k,"g"),j[k])}}return l})}return g.replace(h,f)}};c._init();e.tinymce=e.tinyMCE=c})(window);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,inDispatch:false,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(b,a){this.listeners.push({cb:b,scope:a||this.scope});return b},addToTop:function(d,b){var a=this,c={cb:d,scope:b||a.scope};if(a.inDispatch){a.listeners=[c].concat(a.listeners)}else{a.listeners.unshift(c)}return d},remove:function(c){var b=this.listeners,a=null;tinymce.each(b,function(e,d){if(c==e.cb){a=e;b.splice(d,1);return false}});return a},dispatch:function(){var a=this,e,b=arguments,c,d=a.listeners,f;a.inDispatch=true;for(c=0;c<d.length;c++){f=d[c];e=f.cb.apply(f.scope,b.length>0?b:[f.scope]);if(e===false){break}}a.inDispatch=false;return e}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=
tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/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)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,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&q
uot;],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});c=g.base_uri;if(c){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 d=this,f;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:d});if((b.host!="mce_host"&&d.host!=b.host&&b.host)||d.port!=b.port||d.protocol!=b.protocol){return b.getURI()}var c=d.getURI(),e=b.getURI();if(c==e||(c.charAt(c.length-1)=="/"&&c.substr(0,c.length-1)==e)){return c}f=d.toRelPath(d.path,b.path);if(b.query){f+="?"+b.query}if(b.anchor){f+="#"+b.anchor}return f},toAbsolute:function(b,c){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=d
ocument.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(c,e,d){var b=new Date();b.setTime(b.getTime()-1000);this.set(c,"",b,e,d)}})})();(function(){function serialize(o,quote){var i,v,t,name;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.cha
rCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&Object.prototype.toString.call(o)==="[object Array]"){for(i=0,v="[";i<o.length;i++){v+=(i>0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(name in o){if(o.hasOwnProperty(name)){v+=typeof o[name]!="function"?(v.length>1?","+quote:quote)+name+quote+":"+serialize(o[name],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,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;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.er
ror.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}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);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:functio
n(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){if(e){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(a){a.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(b){return b.shiftKey||b.ctrlKey||b.altKey},metaKeyPressed:function(b){return a.isMac?b.metaKey:b.ctrlKey&&!b.altKey}}})(tinymce);tinymce.util.Quirks=function(a){var j=tinymce.VK,f=j.BACKSPACE,k=j.DELETE,e=a.dom,m=a.selection,I=a.settings,x=a.parser,p=a.serializer,F=tinymce.each;function B(O
,N){try{a.getDoc().execCommand(O,false,N)}catch(M){}}function o(){var M=a.getDoc().documentMode;return M?M:6}function A(M){return M.isDefaultPrevented()}function K(){function M(S){var O,Q,N,T,P,R,U;function V(){if(P.nodeType==3){if(S&&R==P.length){return true}if(!S&&R===0){return true}}}O=m.getRng();var W=[O.startContainer,O.startOffset,O.endContainer,O.endOffset];if(!O.collapsed){S=true}P=O[(S?"start":"end")+"Container"];R=O[(S?"start":"end")+"Offset"];if(P.nodeType==3){Q=e.getParent(O.startContainer,e.isBlock);if(S){Q=e.getNext(Q,e.isBlock)}if(Q&&(V()||!O.collapsed)){N=e.create("em",{id:"__mceDel"});F(tinymce.grep(Q.childNodes),function(X){N.appendChild(X)});Q.appendChild(N)}}O=e.createRng();O.setStart(W[0],W[1]);O.setEnd(W[2],W[3]);m.setRng(O);a.getDoc().execCommand(S?"ForwardDelete":"Delete",false,null);if(N){T=m.getBookmark();while(U=e.get("__mceDel&q
uot;)){e.remove(U,true)}m.moveToBookmark(T)}}a.onKeyDown.add(function(N,P){var O;O=P.keyCode==k;if(!A(P)&&(O||P.keyCode==f)&&!j.modifierPressed(P)){P.preventDefault();M(O)}});a.addCommand("Delete",function(){M()})}function r(){function M(P){var O=e.create("body");var Q=P.cloneContents();O.appendChild(Q);return m.serializer.serialize(O,{format:"html"})}function N(O){var Q=M(O);var R=e.createRng();R.selectNode(a.getBody());var P=M(R);return Q===P}a.onKeyDown.add(function(P,R){var Q=R.keyCode,O;if(!A(R)&&(Q==k||Q==f)){O=P.selection.isCollapsed();if(O&&!e.isEmpty(P.getBody())){return}if(tinymce.isIE&&!O){return}if(!O&&!N(P.selection.getRng())){return}P.setContent("");P.selection.setCursorLocation(P.getBody(),0);P.nodeChanged()}})}function J(){a.onKeyDown.add(function(M,N){if(!A(N)&&N.keyCode==65&&j.metaKeyPressed(N)){N.preventDefault();M.execCommand("SelectAll")}})}function
L(){if(!a.settings.content_editable){e.bind(a.getDoc(),"focusin",function(M){m.setRng(m.getRng())});e.bind(a.getDoc(),"mousedown",function(M){if(M.target==a.getDoc().documentElement){a.getWin().focus();m.setRng(m.getRng())}})}}function C(){a.onKeyDown.add(function(M,P){if(!A(P)&&P.keyCode===f){if(m.isCollapsed()&&m.getRng(true).startOffset===0){var O=m.getNode();var N=O.previousSibling;if(N&&N.nodeName&&N.nodeName.toLowerCase()==="hr"){e.remove(N);tinymce.dom.Event.cancel(P)}}}})}function z(){if(!Range.prototype.getClientRects){a.onMouseDown.add(function(N,O){if(!A(O)&&O.target.nodeName==="HTML"){var M=N.getBody();M.blur();setTimeout(function(){M.focus()},0)}})}}function h(){a.onClick.add(function(M,N){N=N.target;if(/^(IMG|HR)$/.test(N.nodeName)){m.getSel().setBaseAndExtent(N,0,N,1)}if(N.nodeName=="A"&&e.hasClass(N,"mceItemAnchor")){m.select(N)}M.nodeChanged()})}function c(){f
unction N(){var P=e.getAttribs(m.getStart().cloneNode(false));return function(){var Q=m.getStart();if(Q!==a.getBody()){e.setAttrib(Q,"style",null);F(P,function(R){Q.setAttributeNode(R.cloneNode(true))})}}}function M(){return !m.isCollapsed()&&e.getParent(m.getStart(),e.isBlock)!=e.getParent(m.getEnd(),e.isBlock)}function O(P,Q){Q.preventDefault();return false}a.onKeyPress.add(function(P,R){var Q;if(!A(R)&&(R.keyCode==8||R.keyCode==46)&&M()){Q=N();P.getDoc().execCommand("delete",false,null);Q();R.preventDefault();return false}});e.bind(a.getDoc(),"cut",function(Q){var P;if(!A(Q)&&M()){P=N();a.onKeyUp.addToTop(O);setTimeout(function(){P();a.onKeyUp.remove(O)},0)}})}function b(){var N,M;e.bind(a.getDoc(),"selectionchange",function(){if(M){clearTimeout(M);M=0}M=window.setTimeout(function(){var O=m.getRng();if(!N||!tinymce.dom.RangeUtils.compareRanges(O,N)){a.nodeChanged();N=O}},50)})}function y(){document.body.setAt
tribute("role","application")}function u(){a.onKeyDown.add(function(M,O){if(!A(O)&&O.keyCode===f){if(m.isCollapsed()&&m.getRng(true).startOffset===0){var N=m.getNode().previousSibling;if(N&&N.nodeName&&N.nodeName.toLowerCase()==="table"){return tinymce.dom.Event.cancel(O)}}}})}function D(){if(o()>7){return}B("RespectVisibilityInDesign",true);a.contentStyles.push(".mceHideBrInPre pre br {display: none}");e.addClass(a.getBody(),"mceHideBrInPre");x.addNodeFilter("pre",function(M,O){var P=M.length,R,N,S,Q;while(P--){R=M[P].getAll("br");N=R.length;while(N--){S=R[N];Q=S.prev;if(Q&&Q.type===3&&Q.value.charAt(Q.value-1)!="\n"){Q.value+="\n"}else{S.parent.insert(new tinymce.html.Node("#text",3),S,true).value="\n"}}}});p.addNodeFilter("pre",function(M,O){var P=M.length,R,N,S,Q;while(P--){R=M[P].getAll("br"
;);N=R.length;while(N--){S=R[N];Q=S.prev;if(Q&&Q.type==3){Q.value=Q.value.replace(/\r?\n$/,"")}}}})}function g(){e.bind(a.getBody(),"mouseup",function(O){var N,M=m.getNode();if(M.nodeName=="IMG"){if(N=e.getStyle(M,"width")){e.setAttrib(M,"width",N.replace(/[^0-9%]+/g,""));e.setStyle(M,"width","")}if(N=e.getStyle(M,"height")){e.setAttrib(M,"height",N.replace(/[^0-9%]+/g,""));e.setStyle(M,"height","")}}})}function d(){a.onKeyDown.add(function(S,T){var R,M,N,P,Q,U,O;R=T.keyCode==k;if(!A(T)&&(R||T.keyCode==f)&&!j.modifierPressed(T)){M=m.getRng();N=M.startContainer;P=M.startOffset;O=M.collapsed;if(N.nodeType==3&&N.nodeValue.length>0&&((P===0&&!O)||(O&&P===(R?0:1)))){U=N.previousSibling;if(U&&U.nodeName=="IMG"){return}nonEmptyElements=S.schema.getNonEmptyElements();T.preventDefault();Q
=e.create("br",{id:"__tmp"});N.parentNode.insertBefore(Q,N);S.getDoc().execCommand(R?"ForwardDelete":"Delete",false,null);N=m.getRng().startContainer;U=N.previousSibling;if(U&&U.nodeType==1&&!e.isBlock(U)&&e.isEmpty(U)&&!nonEmptyElements[U.nodeName.toLowerCase()]){e.remove(U)}e.remove("__tmp")}}})}function H(){a.onKeyDown.add(function(Q,R){var O,N,S,M,P;if(A(R)||R.keyCode!=j.BACKSPACE){return}O=m.getRng();N=O.startContainer;S=O.startOffset;M=e.getRoot();P=N;if(!O.collapsed||S!==0){return}while(P&&P.parentNode&&P.parentNode.firstChild==P&&P.parentNode!=M){P=P.parentNode}if(P.tagName==="BLOCKQUOTE"){Q.formatter.toggle("blockquote",null,P);O=e.createRng();O.setStart(N,0);O.setEnd(N,0);m.setRng(O)}})}function G(){function M(){a._refreshContentEditable();B("StyleWithCSS",false);B("enableInlineTableEditing",false);if(!I.object_resizing){B("
enableObjectResizing",false)}}if(!I.readonly){a.onBeforeExecCommand.add(M);a.onMouseDown.add(M)}}function t(){function M(N,O){F(e.select("a"),function(R){var P=R.parentNode,Q=e.getRoot();if(P.lastChild===R){while(P&&!e.isBlock(P)){if(P.parentNode.lastChild!==P||P===Q){return}P=P.parentNode}e.add(P,"br",{"data-mce-bogus":1})}})}a.onExecCommand.add(function(N,O){if(O==="CreateLink"){M(N)}});a.onSetContent.add(m.onSetContent.add(M))}function n(){if(I.forced_root_block){a.onInit.add(function(){B("DefaultParagraphSeparator",I.forced_root_block)})}}function q(){function M(O,N){if(!O||!N.initial){a.execCommand("mceRepaint")}}a.onUndo.add(M);a.onRedo.add(M);a.onSetContent.add(M)}function i(){a.onKeyDown.add(function(N,O){var M;if(!A(O)&&O.keyCode==f){M=N.getDoc().selection.createRange();if(M&&M.item){O.preventDefault();N.undoManager.beforeChange();e.remove(M.item(0));N.undoManager.add()}}})}function s()
{var M;if(o()>=10){M="";F("p div h1 h2 h3 h4 h5 h6".split(" "),function(N,O){M+=(O>0?",":"")+N+":empty"});a.contentStyles.push(M+"{padding-right: 1px !important}")}}function v(){var O,N,ae,M,Z,ac,aa,ad,P,Q,ab,X,W,Y=document,U=a.getDoc();if(!I.object_resizing||I.webkit_fake_resize===false){return}B("enableObjectResizing",false);ab={n:[0.5,0,0,-1],e:[1,0.5,1,0],s:[0.5,1,0,1],w:[0,0.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};function S(ai){var ah,ag;ah=ai.screenX-ac;ag=ai.screenY-aa;X=ah*Z[2]+ad;W=ag*Z[3]+P;X=X<5?5:X;W=W<5?5:W;if(j.modifierPressed(ai)||(ae.nodeName=="IMG"&&Z[2]*Z[3]!==0)){X=Math.round(W/Q);W=Math.round(X*Q)}e.setStyles(M,{width:X,height:W});if(Z[2]<0&&M.clientWidth<=X){e.setStyle(M,"left",O+(ad-X))}if(Z[3]<0&&M.clientHeight<=W){e.setStyle(M,"top",N+(P-W))}}function af(){function ag(ah,ai){if(
ai){if(ae.style[ah]||!a.schema.isValid(ae.nodeName.toLowerCase(),ah)){e.setStyle(ae,ah,ai)}else{e.setAttrib(ae,ah,ai)}}}ag("width",X);ag("height",W);e.unbind(U,"mousemove",S);e.unbind(U,"mouseup",af);if(Y!=U){e.unbind(Y,"mousemove",S);e.unbind(Y,"mouseup",af)}e.remove(M);R(ae)}function R(aj){var ah,ai,ag;T();ah=e.getPos(aj);O=ah.x;N=ah.y;ai=aj.offsetWidth;ag=aj.offsetHeight;if(ae!=aj){ae=aj;X=W=0}F(ab,function(am,ak){var al;al=e.get("mceResizeHandle"+ak);if(!al){al=e.add(U.documentElement,"div",{id:"mceResizeHandle"+ak,"class":"mceResizeHandle",style:"cursor:"+ak+"-resize; margin:0; padding:0"});e.bind(al,"mousedown",function(an){an.preventDefault();af();ac=an.screenX;aa=an.screenY;ad=ae.clientWidth;P=ae.clientHeight;Q=P/ad;Z=am;M=ae.cloneNode(true);e.addClass(M,"mceClonedResizable");e.setStyles(M,{left:O,top:N,margin:0});U.documentEle
ment.appendChild(M);e.bind(U,"mousemove",S);e.bind(U,"mouseup",af);if(Y!=U){e.bind(Y,"mousemove",S);e.bind(Y,"mouseup",af)}})}else{e.show(al)}e.setStyles(al,{left:(ai*am[0]+O)-(al.offsetWidth/2),top:(ag*am[1]+N)-(al.offsetHeight/2)})});if(!tinymce.isOpera&&ae.nodeName=="IMG"){ae.setAttribute("data-mce-selected","1")}}function T(){if(ae){ae.removeAttribute("data-mce-selected")}for(var ag in ab){e.hide("mceResizeHandle"+ag)}}a.contentStyles.push(".mceResizeHandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}.mceResizeHandle:hover {background: #000}img[data-mce-selected] {outline: 1px solid black}img.mceClonedResizable, table.mceClonedResizable {position: absolute;outline: 1px dashed black;opacity: .5;z-index: 10000}");function V(){var ag=e.getParent(m.getNode(),"table,img");F(e.select("img[data-mce-selected]&qu
ot;),function(ah){ah.removeAttribute("data-mce-selected")});if(ag){R(ag)}else{T()}}a.onNodeChange.add(V);e.bind(U,"selectionchange",V);a.serializer.addAttributeFilter("data-mce-selected",function(ag,ah){var ai=ag.length;while(ai--){ag[ai].attr(ah,null)}})}function E(){if(o()<9){x.addNodeFilter("noscript",function(M){var N=M.length,O,P;while(N--){O=M[N];P=O.firstChild;if(P){O.attr("data-mce-innertext",P.value)}}});p.addNodeFilter("noscript",function(M){var N=M.length,O,Q,P;while(N--){O=M[N];Q=M[N].firstChild;if(Q){Q.value=tinymce.html.Entities.decode(Q.value)}else{P=O.attributes.map["data-mce-innertext"];if(P){O.attr("data-mce-innertext",null);Q=new tinymce.html.Node("#text",3);Q.value=P;Q.raw=true;O.append(Q)}}}})}}function l(){a.contentStyles.push("body {min-height: 100px}");a.onClick.add(function(M,N){if(N.target.nodeName=="HTML"){a.execCommand("SelectAll");a.
selection.collapse(true);a.nodeChanged()}})}u();H();r();if(tinymce.isWebKit){d();K();L();h();n();if(tinymce.isIDevice){b()}else{v();J()}}if(tinymce.isIE&&!tinymce.isIE11){C();y();D();g();i();s();E()}if(tinymce.isIE11){l()}if(tinymce.isGecko&&!tinymce.isIE11){C();z();c();G();t();q()}if(tinymce.isOpera){v()}};(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2
013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n<m.length;n+=2){o=String.fromCharCode(parseInt(m[n],p));if(!g[o]){l="&"+m[n+1]+";";q[o]=l;q[l]=o}}return q}}a=e("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,o
rdf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,be
ta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,l
rm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);j.html=j.html||{};j.html.Entities={encodeRaw:function(m,l){return m.replace(l?k:b,function(n){return g[n]||n})},encodeAllRaw:function(l){return(""+l).replace(f,function(m){return g[m]||m})},encodeNumeric:function(m,l){return m.replace(l?k:b,function(n){if(n.length>1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&am
p;l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g<j.length;g++){a[j[g]]="\uFEFF"+g;a["\uFEFF"+g]=j[g]}function c(n,q,p,i){function o(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}return"#"+o(q)+o(p)
+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(s){var z={},q,n,x,r,v=d.url_converter,y=d.url_converter_scope||this;function p(D,G){var F,C,B,E;if(z["border-image"]==="none"){delete z["border-image"]}F=z[D+"-top"+G];if(!F){return}C=z[D+"-right"+G];if(F!=C){return}B=z[D+"-bottom"+G];if(C!=B){return}E=z[D+"-left"+G];if(B!=E){return}z[D+G]=E;delete z[D+"-top"+G];delete z[D+"-right"+G];delete z[D+"-bottom"+G];delete z[D+"-left"+G]}function u(C){var D=z[C],B;if(!D||D.indexOf(" ")<0){return}D=D.split(" ");B=D.length;while(B--){if(D[B]!==D[0]){return false}}z[C]=D[0];return true}function A(D,C,B,E){if(!u(C)){return}if(!u(B)){return}if(!u(E)){return}z[D]=z[C]+" "+z[B]+" "+z[E];delete z[C];delete z[B];delete z[E]}function t(B){r=true;return a[B]}function i(C,B){if(r){C=C.replace(/\uFEFF[0-9]/g,function(D){return a[D]})}i
f(!B){C=C.replace(/\\([\'\";:])/g,"$1")}return C}function o(C,B,F,E,G,D){G=G||D;if(G){G=i(G);return"'"+G.replace(/\'/g,"\\'")+"'"}B=i(B||F||E);if(v){B=v.call(y,B,"style")}return"url('"+B.replace(/\'/g,"\\'")+"')"}if(s){s=s.replace(/\\[\"\';:\uFEFF]/g,t).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(B){return B.replace(/[;:]/g,t)});while(q=b.exec(s)){n=q[1].replace(l,"").toLowerCase();x=q[2].replace(l,"");if(n&&x.length>0){if(n==="font-weight"&&x==="700"){x="bold"}else{if(n==="color"||n==="background-color"){x=x.toLowerCase()}}x=x.replace(k,c);x=x.replace(h,o);z[n]=r?i(x,true):x}b.lastIndex=q.index+q[0].length}p("border","");p("border","-width");p("border","-color");p("border","-style");p("padding","&quo
t;);p("margin","");A("border","border-width","border-style","border-color");if(z.border==="medium none"){delete z.border}}return z},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u<s;u++){t=x[u];v=p[t];if(v!==e&&v.length>0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(f){var a={},e=f.makeMap,g=f.each;function d(j,i){return j.split(i||",")}function h(m,l){var j,k={};function i(n){return n.replace(/[A-Z]+/g,function(o){return i(m[o])})}for(j in m){if(m.hasOwnProperty(j)){m[j]=i(m[j])}}i(l).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(q,o,n,p){
n=d(n,"|");k[o]={attributes:e(n),attributesOrder:n,children:e(p,"|",{"#comment":{}})}});return k}function b(){var i=a.html5;if(!i){i=a.html5=h({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video|wbr",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ru
by|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"},"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][B]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[
A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend|figcaption]figcaption[A][C]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|autofocus|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|na
me][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|border][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]wbr[A][]")}return i}function c(){var i=a.html4;if(!i){i=a.html4=h({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isi
ndex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",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",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|o
nmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]base
font[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#
|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")}return i}f.html.Schema=function(A){var u=this,s={},k={},j=[],D,y;var o,q,z,r,v,n,p={};function m(F,E,H){var G=A[F];if(!G){G=a[F];if(!G){G=e(E," ",e(E.toUpperCase()," "));G=f.extend(G,H);a[F]=G}}else{G=e(G,",",e(G.toUpperCase()," "))}return G}A=A||{};y=A.schema=="html5"?b():c();if(A.verify_html===false){A.valid_eleme
nts="*[*]"}if(A.valid_styles){D={};g(A.valid_styles,function(F,E){D[E]=f.explode(F)})}o=m("whitespace_elements","pre script noscript style textarea");q=m("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr");z=m("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr");r=m("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");n=m("non_empty_elements","td th iframe video audio object script",z);textBlockElementsMap=m("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure");v=m("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex samp
option datalist select optgroup",textBlockElementsMap);function i(E){return new RegExp("^"+E.replace(/([?+*])/g,".$1")+"$")}function C(L){var K,G,Z,V,aa,F,I,U,X,Q,Y,ac,O,J,W,E,S,H,ab,ad,P,T,N=/^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,R=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(L){L=d(L);if(s["@"]){S=s["@"].attributes;H=s["@"].attributesOrder}for(K=0,G=L.length;K<G;K++){F=N.exec(L[K]);if(F){W=F[1];Q=F[2];E=F[3];X=F[4];O={};J=[];I={attributes:O,attributesOrder:J};if(W==="#"){I.paddEmpty=true}if(W==="-"){I.removeEmpty=true}if(S){for(ad in S){O[ad]=S[ad]}J.push.apply(J,H)}if(X){X=d(X,"|");for(Z=0,V=X.length;Z<V;Z++){F=R.exec(X[Z]);if(F){U={};ac=F[1];Y=F[2].replace(/::/g,":");W=F[3];T=F[4];if(ac==="!"){I.attributesRequired=I.attributesRequired||[];I.attributesRequired.push(Y);U.required=true}if(ac==="-"){delete O[Y];J.s
plice(f.inArray(J,Y),1);continue}if(W){if(W==="="){I.attributesDefault=I.attributesDefault||[];I.attributesDefault.push({name:Y,value:T});U.defaultValue=T}if(W===":"){I.attributesForced=I.attributesForced||[];I.attributesForced.push({name:Y,value:T});U.forcedValue=T}if(W==="<"){U.validValues=e(T,"?")}}if(M.test(Y)){I.attributePatterns=I.attributePatterns||[];U.pattern=i(Y);I.attributePatterns.push(U)}else{if(!O[Y]){J.push(Y)}O[Y]=U}}}}if(!S&&Q=="@"){S=O;H=J}if(E){I.outputName=Q;s[E]=I}if(M.test(Q)){I.pattern=i(Q);j.push(I)}else{s[Q]=I}}}}}function t(E){s={};j=[];C(E);g(y,function(G,F){k[F]=G.children})}function l(F){var E=/^(~)?(.+)$/;if(F){g(d(F),function(J){var H=E.exec(J),I=H[1]==="~",K=I?"span":"div",G=H[2];k[G]=k[K];p[G]=K;if(!I){v[G.toUpperCase()]={};v[G]={}}if(!s[G]){s[G]=s[K]}g(k,function(L,M){if(L[K]){L[G]=L[K]}})})}}function x(F){var E=/^([+\-]?)(\w+)\[([^\]]+)\]$/;if(F){g(d(F),funct
ion(J){var I=E.exec(J),G,H;if(I){H=I[1];if(H){G=k[I[2]]}else{G=k[I[2]]={"#comment":{}}}G=k[I[2]];g(d(I[3],"|"),function(K){if(H==="-"){delete G[K]}else{G[K]={}}})}})}}function B(E){var G=s[E],F;if(G){return G}F=j.length;while(F--){G=j[F];if(G.pattern.test(E)){return G}}}if(!A.valid_elements){g(y,function(F,E){s[E]={attributes:F.attributes,attributesOrder:F.attributesOrder};k[E]=F.children});if(A.schema!="html5"){g(d("strong/b,em/i"),function(E){E=d(E,"/");s[E[1]].outputName=E[0]})}s.img.attributesDefault=[{name:"alt",value:""}];g(d("ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr,strong,em,b,i"),function(E){if(s[E]){s[E].removeEmpty=true}});g(d("p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption"),function(E){s[E].paddEmpty=true})}else{t(A.valid_elements)}l(A.custom_elements);x(A.valid_children);C(A.extended_valid_elements);x("+ol[ul|ol],+ul[ul|ol]");if(A.invalid_elements
){f.each(f.explode(A.invalid_elements),function(E){if(s[E]){delete s[E]}})}if(!B("span")){C("span[!data-mce-type|*]")}u.children=k;u.styles=D;u.getBoolAttrs=function(){return r};u.getBlockElements=function(){return v};u.getTextBlockElements=function(){return textBlockElementsMap};u.getShortEndedElements=function(){return z};u.getSelfClosingElements=function(){return q};u.getNonEmptyElements=function(){return n};u.getWhiteSpaceElements=function(){return o};u.isValidChild=function(E,G){var F=k[E];return !!(F&&F[G])};u.isValid=function(F,E){var H,G,I=B(F);if(I){if(E){if(I.attributes[E]){return true}H=I.attributePatterns;if(H){G=H.length;while(G--){if(H[G].pattern.test(F)){return true}}}}else{return true}}return false};u.getElementRule=B;u.getCustomElements=function(){return p};u.addValidElements=C;u.setValidElements=t;u.addCustomElements=l;u.addValidChildren=x;u.elements=s}})(tinymce);(function(a){a.html.SaxParser=function(c,e){var b=this,d=function(){};c=c|
|{};b.schema=e=e||new a.html.Schema();if(c.fix_self_closing!==false){c.fix_self_closing=true}a.each("comment cdata text start end pi doctype".split(" "),function(f){if(f){b[f]=c[f]||d}});b.parse=function(E){var n=this,g,G=0,I,B,A=[],N,Q,C,r,z,s,M,H,O,v,m,k,t,R,o,P,F,S,L,f,J,l,D,K,h,x=0,j=a.html.Entities.decode,y,q;function u(T){var V,U;V=A.length;while(V--){if(A[V].name===T){break}}if(V>=0){for(U=A.length-1;U>=V;U--){T=A[U];if(T.valid){n.end(T.name)}}A.length=V}}function p(U,T,Y,X,W){var Z,V;T=T.toLowerCase();Y=T in H?T:j(Y||X||W||"");if(v&&!z&&T.indexOf("data-")!==0){Z=P[T];if(!Z&&F){V=F.length;while(V--){Z=F[V];if(Z.pattern.test(T)){break}}if(V===-1){Z=null}}if(!Z){return}if(Z.validValues&&!(Y in Z.validValues)){return}}N.map[T]=Y;N.push({name:T,value:Y})}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\
\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;K={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};M=e.getShortEndedElements();J=c.self_closing_elements||e.getSelfClosingElements();H=e.getBoolAttrs();v=c.validate;s=c.remove_internals;y=c.fix_self_closing;q=a.isIE;o=/^:/;while(g=l.exec(E)){if(G<g.index){n.text(j(E.substr(G,g.index-G)))}if(I=g[6]){I=I.toLowerCase();if(q&&o.test(I)){I=I.substr(1)}u(I)}else{if(I=g[7]){I=I.toLowerCase();if(q&&o.test(I)){I=I.substr(1)}O=I in M;if(y&&J[I]&&A.length>0&&A[A.length-1].name===I){u(I)}if(!v||(m=e.getElementRule(I))){k=true;if(v){P=m.attributes;F=m.attributePatterns}if(R=g[8]){z=R.indexOf("data-mce-t
ype")!==-1;if(z&&s){k=false}N=[];N.map={};R.replace(D,p)}else{N=[];N.map={}}if(v&&!z){S=m.attributesRequired;L=m.attributesDefault;f=m.attributesForced;if(f){Q=f.length;while(Q--){t=f[Q];r=t.name;h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}if(L){Q=L.length;while(Q--){t=L[Q];r=t.name;if(!(r in N.map)){h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}}if(S){Q=S.length;while(Q--){if(S[Q] in N.map){break}}if(Q===-1){k=false}}if(N.map["data-mce-bogus"]){k=false}}if(k){n.start(I,N,O)}}else{k=false}if(B=K[I]){B.lastIndex=G=g.index+g[0].length;if(g=B.exec(E)){if(k){C=E.substr(G,g.index-G)}G=g.index+g[0].length}else{C=E.substr(G);G=E.length}if(k&&C.length>0){n.text(C,true)}if(k){n.end(I)}l.lastIndex=G;continue}if(!O){if(!R||R.indexOf("/")!=R.length-1){A.push({name:I,valid:k})}else{if(k){n.end(I)}}}}else{if(I=g[1]){n.comment(I)}else{if(I=g[2]
){n.cdata(I)}else{if(I=g[3]){n.doctype(I)}else{if(I=g[4]){n.pi(I,g[5])}}}}}}G=g.index+g[0].length}if(G<E.length){n.text(j(E.substr(G)))}for(Q=A.length-1;Q>=0;Q--){I=A[Q];if(I.valid){n.end(I.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map)
{delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h<f;h++){j=m[h];if(j.name!=="id"){k[k.length]={name:j.name,value:j.value};k.map[j.name]=j.value}}n.attributes=k}n.value=g.value;n.shortEnded=g.shortEnded;return n},wrap:function(g){var f=this;f.parent.insert(g,f);g.append(f);return f},unwrap:function(){var f=this,h,g;for(h=f.firstChild;h;){g=h.next;f.insert(h,f,true);h=g}f.remove()},remove:function(){var f=this,h=f.parent,g=f.next,i=f.prev;if(h){if(h.firstChild===f){h.firstChild=g;if(g){g.prev=null}}else{i.next=g}if(h.lastChild===f){h.lastChild=i;if(i){i.next=null}}else{g.prev=i}f.parent=f.next=f.prev=null}return f},append:function(h){var f=this,g;if(h.parent){h.remove()
}g=f.lastChild;if(g){g.next=h;h.prev=g;f.lastChild=h}else{f.lastChild=f.firstChild=h}h.parent=f;return h},insert:function(h,f,i){var g;if(h.parent){h.remove()}g=f.parent||this;if(i){if(f===g.firstChild){g.firstChild=h}else{f.prev.next=h}h.prev=f.prev;h.next=f;f.prev=h}else{if(f===g.lastChild){g.lastChild=h}else{f.next.prev=h}h.next=f.next;h.prev=f;f.next=h}h.parent=g;return h},getAll:function(g){var f=this,h,i=[];for(h=f.firstChild;h;h=a(h,f)){if(h.name===g){i.push(h)}}return i},empty:function(){var g=this,f,h,j;if(g.firstChild){f=[];for(j=g.firstChild;j;j=a(j,g)){f.push(j)}h=f.length;while(h--){j=f[h];j.parent=j.firstChild=j.lastChild=j.next=j.prev=null}}g.firstChild=g.lastChild=null;return g},isEmpty:function(k){var f=this,j=f.firstChild,h,g;if(j){do{if(j.type===1){if(j.attributes.map["data-mce-bogus"]){continue}if(k[j.name]){return false}h=j.attributes.length;while(h--){g=j.attributes[h].name;if(g==="name"||g.indexOf("data-mce-")===0){return false}}}
if(j.type===8){return false}if((j.type===3&&!c.test(j.value))){return false}}while(j=a(j,f))}return true},walk:function(f){return a(this,null,f)}});d.extend(b,{create:function(g,f){var i,h;i=new b(g,e[g]||1);if(f){for(h in f){i.attr(h,f[h])}}return i}});d.html.Node=b})(tinymce);(function(b){var a=b.html.Node;b.html.DomParser=function(g,h){var f=this,e={},d=[],i={},c={};g=g||{};g.validate="validate" in g?g.validate:true;g.root_name=g.root_name||"body";f.schema=h=h||new b.html.Schema();function j(n){var p,q,y,x,A,o,r,l,u,v,k,t,m,z,s;t=b.makeMap("tr,td,th,tbody,thead,tfoot,table");k=h.getNonEmptyElements();m=h.getTextBlockElements();for(p=0;p<n.length;p++){q=n[p];if(!q.parent||q.fixed){continue}if(m[q.name]&&q.parent.name=="li"){z=q.next;while(z){if(m[z.name]){z.name="li";z.fixed=true;q.parent.insert(z,q.parent)}else{break}z=z.next}q.unwrap(q);continue}x=[q];for(y=q.parent;y&&!h.isValidChild(y.name,q.name)&
;&!t[y.name];y=y.parent){x.push(y)}if(y&&x.length>1){x.reverse();A=o=f.filterNode(x[0].clone());for(u=0;u<x.length-1;u++){if(h.isValidChild(o.name,x[u].name)){r=f.filterNode(x[u].clone());o.append(r)}else{r=o}for(l=x[u].firstChild;l&&l!=x[u+1];){s=l.next;r.append(l);l=s}o=r}if(!A.isEmpty(k)){y.insert(A,x[0],true);y.insert(q,A)}else{y.insert(q,x[0],true)}y=x[0];if(y.isEmpty(k)||y.firstChild===y.lastChild&&y.firstChild.name==="br"){y.empty().remove()}}else{if(q.parent){if(q.name==="li"){z=q.prev;if(z&&(z.name==="ul"||z.name==="ul")){z.append(q);continue}z=q.next;if(z&&(z.name==="ul"||z.name==="ul")){z.insert(q,z.firstChild,true);continue}q.wrap(f.filterNode(new a("ul",1)));continue}if(h.isValidChild(q.parent.name,"div")&&h.isValidChild("div",q.name)){q.wrap(f.filterNode(new a("div",1)))}else{if(q.name==="style"||q.name=
=="script"){q.empty().remove()}else{q.unwrap()}}}}}}f.filterNode=function(m){var l,k,n;if(k in e){n=i[k];if(n){n.push(m)}else{i[k]=[m]}}l=d.length;while(l--){k=d[l].name;if(k in m.attributes.map){n=c[k];if(n){n.push(m)}else{c[k]=[m]}}}return m};f.addNodeFilter=function(k,l){b.each(b.explode(k),function(m){var n=e[m];if(!n){e[m]=n=[]}n.push(l)})};f.addAttributeFilter=function(k,l){b.each(b.explode(k),function(m){var n;for(n=0;n<d.length;n++){if(d[n].name===m){d[n].callbacks.push(l);return}}d.push({name:m,callbacks:[l]})})};f.parse=function(v,m){var n,J,B,A,D,C,x,r,F,N,z,o,E,M=[],L,t,k,y,s,p,u,q;m=m||{};i={};c={};o=b.extend(b.makeMap("script,style,head,html,body,title,meta,param"),h.getBlockElements());u=h.getNonEmptyElements();p=h.children;z=g.validate;q="forced_root_block" in m?m.forced_root_block:g.forced_root_block;s=h.getWhiteSpaceElements();E=/^[ \t\r\n]+/;t=/[ \t\r\n]+$/;k=/[ \t\r\n]+/g;y=/^[ \t\r\n]+$/;function G(){var O=J.firstChild,l,P;while(
O){l=O.next;if(O.type==3||(O.type==1&&O.name!=="p"&&!o[O.name]&&!O.attr("data-mce-type"))){if(!P){P=K(q,1);J.insert(P,O);P.append(O)}else{P.append(O)}}else{P=null}O=l}}function K(l,O){var P=new a(l,O),Q;if(l in e){Q=i[l];if(Q){Q.push(P)}else{i[l]=[P]}}return P}function I(P){var Q,l,O;for(Q=P.prev;Q&&Q.type===3;){l=Q.value.replace(t,"");if(l.length>0){Q.value=l;Q=Q.prev}else{O=Q.prev;Q.remove();Q=O}}}function H(O){var P,l={};for(P in O){if(P!=="li"&&P!="p"){l[P]=O[P]}}return l}n=new b.html.SaxParser({validate:z,self_closing_elements:H(h.getSelfClosingElements()),cdata:function(l){B.append(K("#cdata",4)).value=l},text:function(P,l){var O;if(!L){P=P.replace(k," ");if(B.lastChild&&o[B.lastChild.name]){P=P.replace(E,"")}}if(P.length!==0){O=K("#text",3);O.raw=!!l;B.append(O).value=P}},comment:function(l){B.append(K("#comment",8)).value=l},p
i:function(l,O){B.append(K(l,7)).value=O;I(B)},doctype:function(O){var l;l=B.append(K("#doctype",10));l.value=O;I(B)},start:function(l,W,P){var U,R,Q,O,S,X,V,T;Q=z?h.getElementRule(l):{};if(Q){U=K(Q.outputName||l,1);U.attributes=W;U.shortEnded=P;B.append(U);T=p[B.name];if(T&&p[U.name]&&!T[U.name]){M.push(U)}R=d.length;while(R--){S=d[R].name;if(S in W.map){F=c[S];if(F){F.push(U)}else{c[S]=[U]}}}if(o[l]){I(U)}if(!P){B=U}if(!L&&s[l]){L=true}}},end:function(l){var S,P,R,O,Q;P=z?h.getElementRule(l):{};if(P){if(o[l]){if(!L){S=B.firstChild;if(S&&S.type===3){R=S.value.replace(E,"");if(R.length>0){S.value=R;S=S.next}else{O=S.next;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.next;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}S=B.lastChild;if(S&&S.type===3){R=S.value.replace(t,"");if(R.length>0){S.value=R;S=S.prev}else{O=S.prev;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.prev;if(R.length===
0||y.test(R)){S.remove();S=O}S=O}}}}if(L&&s[l]){L=false}if(P.removeEmpty||P.paddEmpty){if(B.isEmpty(u)){if(P.paddEmpty){B.empty().append(new a("#text","3")).value="\u00a0"}else{if(!B.attributes.map.name&&!B.attributes.map.id){Q=B.parent;B.empty().remove();B=Q;return}}}}B=B.parent}}},h);J=B=new a(m.context||g.root_name,11);n.parse(v);if(z&&M.length){if(!m.context){j(M)}else{m.invalid=true}}if(q&&J.name=="body"){G()}if(!m.invalid){for(N in i){F=e[N];A=i[N];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(D=0,C=F.length;D<C;D++){F[D](A,N,m)}}for(D=0,C=d.length;D<C;D++){F=d[D];if(F.name in c){A=c[F.name];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(x=0,r=F.callbacks.length;x<r;x++){F.callbacks[x](A,F.name,m)}}}}return J};if(g.remove_trailing_brs){f.addNodeFilter("br",function(n,m){var r,q=n.length,o,v=b.extend({},h.getBlockElements()),k=h.getNonEmptyElements(),t,s,p,u;v.body=
1;for(r=0;r<q;r++){o=n[r];t=o.parent;if(v[o.parent.name]&&o===t.lastChild){p=o.prev;while(p){u=p.name;if(u!=="span"||p.attr("data-mce-type")!=="bookmark"){if(u!=="br"){break}if(u==="br"){o=null;break}}p=p.prev}if(o){o.remove();if(t.isEmpty(k)){elementRule=h.getElementRule(t.name);if(elementRule){if(elementRule.removeEmpty){t.remove()}else{if(elementRule.paddEmpty){t.empty().append(new b.html.Node("#text",3)).value="\u00a0"}}}}}}else{s=o;while(t.firstChild===s&&t.lastChild===s){s=t;if(v[t.name]){break}t=t.parent}if(s===t){textNode=new b.html.Node("#text",3);textNode.value="\u00a0";o.replace(textNode)}}}})}if(!g.allow_html_in_named_anchor){f.addAttributeFilter("id,name",function(k,l){var n=k.length,p,m,o,q;while(n--){q=k[n];if(q.name==="a"&&q.firstChild&&!q.attr("href")){o=q.parent;p=q.lastChild;do{m=p.prev;o.insert(p,q);p=m}while(p
)}}})}}})(tinymce);tinymce.html.Writer=function(e){var c=[],a,b,d,f,g;e=e||{};a=e.indent;b=tinymce.makeMap(e.indent_before||"");d=tinymce.makeMap(e.indent_after||"");f=tinymce.html.Entities.getEncodeFunc(e.entity_encoding||"raw",e.entities);g=e.element_format=="html";return{start:function(m,k,p){var n,j,h,o;if(a&&b[m]&&c.length>0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n<j;n++){h=k[n];c.push(" ",h.name,'="',f(h.value,true),'"')}}if(!p||g){c[c.length]=">"}else{c[c.length]=" />"}if(p&&a&&d[m]&&c.length>0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("</",h,">");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n&q
uot;){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("<![CDATA[",h,"]]>")},comment:function(h){c.push("<!--",h,"-->")},pi:function(h,i){if(i){c.push("<?",h," ",i,"?>")}else{c.push("<?",h,"?>")}if(a){c.push("\n")}},doctype:function(h){c.push("<!DOCTYPE",h,">",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:fun
ction(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n<m;n++){r=q.attributesOrder[n];if(r in s.map){p=s.map[r];u.map[r]=p;u.push({name:r,value:p})}}for(n=0,m=s.length;n<m;n++){r=s[n].name;if(!(r in u.map)){p=s.map[r];u.map[r]=p;u.push({name:r,value:p})}}s=u}e.start(k.name,s,o);if(!o){if((k=k.firstChild)){do{f(k)}while(k=k.next)}e.end(j)}}else{t(k)}}if(h.type==1&&!c.inner){f(h)}else{g[11](h)}return e.getContent()}}})(tinymce);tinymce.dom={};(function(b,h){var g=!!document.addEventListener;function c(k,j,l,i){if(k.addEventListener){k.addEventListener(j,l,i||false)}else{if(k.attachEvent){k.attachEvent("on"+j,l)}}}function e(k,j,l,i){if(k.removeEventListener){k.removeEventListener(j,l,i||false)}else{if(k.detach
Event){k.detachEvent("on"+j,l)}}}function a(n,l){var i,k=l||{};function j(){return false}function m(){return true}for(i in n){if(i!=="layerX"&&i!=="layerY"){k[i]=n[i]}}if(!k.target){k.target=k.srcElement||document}k.preventDefault=function(){k.isDefaultPrevented=m;if(n){if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}}};k.stopPropagation=function(){k.isPropagationStopped=m;if(n){if(n.stopPropagation){n.stopPropagation()}else{n.cancelBubble=true}}};k.stopImmediatePropagation=function(){k.isImmediatePropagationStopped=m;k.stopPropagation()};if(!k.isDefaultPrevented){k.isDefaultPrevented=j;k.isPropagationStopped=j;k.isImmediatePropagationStopped=j}return k}function d(m,n,l){var k=m.document,j={type:"ready"};function i(){if(!l.domLoaded){l.domLoaded=true;n(j)}}if(k.readyState=="complete"){i();return}if(g){c(m,"DOMContentLoaded",i)}else{c(k,"readystatechange",function(){if(k.readyState==="
complete"){e(k,"readystatechange",arguments.callee);i()}});if(k.documentElement.doScroll&&m===m.top){(function(){try{k.documentElement.doScroll("left")}catch(o){setTimeout(arguments.callee,0);return}i()})()}}c(m,"load",i)}function f(k){var q=this,p={},i,o,n,m,l;m="onmouseenter" in document.documentElement;n="onfocusin" in document.documentElement;l={mouseenter:"mouseover",mouseleave:"mouseout"};i=1;q.domLoaded=false;q.events=p;function j(t,x){var s,u,r,v;s=p[x][t.type];if(s){for(u=0,r=s.length;u<r;u++){v=s[u];if(v&&v.func.call(v.scope,t)===false){t.preventDefault()}if(t.isImmediatePropagationStopped()){return}}}}q.bind=function(x,A,D,E){var s,t,u,r,B,z,C,v=window;function y(F){j(a(F||v.event),s)}if(!x||x.nodeType===3||x.nodeType===8){return}if(!x[h]){s=i++;x[h]=s;p[s]={}}else{s=x[h];if(!p[s]){p[s]={}}}E=E||x;A=A.split(" ");u=A.length;while(u--){r=A[u];z=y;B=C=false;if(r==="DO
MContentLoaded"){r="ready"}if((q.domLoaded||x.readyState=="complete")&&r==="ready"){q.domLoaded=true;D.call(E,a({type:r}));continue}if(!m){B=l[r];if(B){z=function(F){var H,G;H=F.currentTarget;G=F.relatedTarget;if(G&&H.contains){G=H.contains(G)}else{while(G&&G!==H){G=G.parentNode}}if(!G){F=a(F||v.event);F.type=F.type==="mouseout"?"mouseleave":"mouseenter";F.target=H;j(F,s)}}}}if(!n&&(r==="focusin"||r==="focusout")){C=true;B=r==="focusin"?"focus":"blur";z=function(F){F=a(F||v.event);F.type=F.type==="focus"?"focusin":"focusout";j(F,s)}}t=p[s][r];if(!t){p[s][r]=t=[{func:D,scope:E}];t.fakeName=B;t.capture=C;t.nativeHandler=z;if(!g){t.proxyHandler=k(s)}if(r==="ready"){d(x,z,q)}else{c(x,B||r,g?z:t.proxyHandler,C)}}else{t.push({func:D,scope:E})}}x=t=0;return D};q.unbind=function(x,z,A){var s,u,v,B,r,t;if(!x
||x.nodeType===3||x.nodeType===8){return q}s=x[h];if(s){t=p[s];if(z){z=z.split(" ");v=z.length;while(v--){r=z[v];u=t[r];if(u){if(A){B=u.length;while(B--){if(u[B].func===A){u.splice(B,1)}}}if(!A||u.length===0){delete t[r];e(x,u.fakeName||r,g?u.nativeHandler:u.proxyHandler,u.capture)}}}}else{for(r in t){u=t[r];e(x,u.fakeName||r,g?u.nativeHandler:u.proxyHandler,u.capture)}t={}}for(r in t){return q}delete p[s];try{delete x[h]}catch(y){x[h]=null}}return q};q.fire=function(u,s,r){var v,t;if(!u||u.nodeType===3||u.nodeType===8){return q}t=a(null,r);t.type=s;do{v=u[h];if(v){j(t,v)}u=u.parentNode||u.ownerDocument||u.defaultView||u.parentWindow}while(u&&!t.isPropagationStopped());return q};q.clean=function(u){var s,r,t=q.unbind;if(!u||u.nodeType===3||u.nodeType===8){return q}if(u[h]){t(u)}if(!u.getElementsByTagName){u=u.document}if(u&&u.getElementsByTagName){t(u);r=u.getElementsByTagName("*");s=r.length;while(s--){u=r[s];if(u[h]){t(u)}}}return q};q.callNativ
eHandler=function(s,r){if(p){p[s][r.type].nativeHandler(r)}};q.destory=function(){p={}};q.add=function(v,s,u,t){if(typeof(v)==="string"){v=document.getElementById(v)}if(v&&v instanceof Array){var r=v.length;while(r--){q.add(v[r],s,u,t)}return}if(s==="init"){s="ready"}return q.bind(v,s instanceof Array?s.join(" "):s,u,t)};q.remove=function(v,s,u,t){if(!v){return q}if(typeof(v)==="string"){v=document.getElementById(v)}if(v instanceof Array){var r=v.length;while(r--){q.remove(v[r],s,u,t)}return q}return q.unbind(v,s instanceof Array?s.join(" "):s,u)};q.clear=function(r){if(typeof(r)==="string"){r=document.getElementById(r)}return q.clean(r)};q.cancel=function(r){if(r){q.prevent(r);q.stop(r)}return false};q.prevent=function(r){if(!r.preventDefault){r=a(r)}r.preventDefault();return false};q.stop=function(r){if(!r.stopPropagation){r=a(r)}r.stopPropagation();return false}}b.EventUtils=f;b.Event=new f(function(i){
return function(j){tinymce.dom.Event.callNativeHandler(i,j)}});b.Event.bind(window,"ready",function(){});b=0})(tinymce.dom,"data-mce-expando");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","previousSibling",e))}};(function(e){var g=e.each,d=e.is,f=e.isWebKit,b=e.isIE,h=e.html.Entities,c=/^([a-z0-9],?)+$/i,a=/^[ \t\r\n]*$/;e.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:&
quot;disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(o,l){var k=this,i,j,n;k.doc=o;k.win=window;k.files={};k.cssFlicker=false;k.counter=0;k.stdMode=!e.isIE||o.documentMode>=8;k.boxModel=!e.isIE||o.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in o.createElement("a");k.settings=l=e.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new e.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(e.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}k.fixDoc(o);k.events=l.ownEvents?new e.dom.EventUtils(l.proxy):e.dom.Event;e.addUnload(k.destroy,k);n=l.schema?l.schema.getBlockElements():{};k.isBlock=function(q){if(!q){return false}var p=q.nodeType;if(p){return !!(p===1&
;&n[q.nodeName])}return !!n[q]}},fixDoc:function(k){var j=this.settings,i;if(b&&!e.isIE11&&j.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(l){k.createElement(l)});for(i in j.schema.getCustomElements()){k.createElement(i)}}},clone:function(k,i){var j=this,m,l;if(!b||e.isIE11||k.nodeType!==1||i){return k.cloneNode(i)}l=j.doc;if(!i){m=l.createElement(k.nodeName);g(j.getAttribs(k),function(n){j.setAttrib(m,n.nodeName,j.getAttrib(k,n.nodeName))});return m}return m.firstChild},getRoot:function(){var i=this,j=i.settings;return(j&&i.get(j.root_element))||i.doc.body},getViewPort:function(j){var k,i;j=!j?this.win:j;k=j.document;i=this.boxModel?k.documentElement:k.body;return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop,w:j.innerWidth||i.clientWidth,h:j.innerHeight||i.clientHeight}},getRect:function(l){var k,i=th
is,j;l=i.get(l);k=i.getPos(l);j=i.getSize(l);return{x:k.x,y:k.y,w:j.w,h:j.h}},getSize:function(l){var j=this,i,k;l=j.get(l);i=j.getStyle(l,"width");k=j.getStyle(l,"height");if(i.indexOf("px")===-1){i=0}if(k.indexOf("px")===-1){k=0}return{w:parseInt(i,10)||l.offsetWidth||l.clientWidth,h:parseInt(k,10)||l.offsetHeight||l.clientHeight}},getParent:function(k,j,i){return this.getParents(k,j,i,false)},getParents:function(s,m,k,q){var j=this,i,l=j.settings,p=[];s=j.get(s);q=q===undefined;if(l.strict_root){k=k||j.getRoot()}if(d(m,"string")){i=m;if(m==="*"){m=function(o){return o.nodeType==1}}else{m=function(o){return j.is(o,i)}}}while(s){if(s==k||!s.nodeType||s.nodeType===9){break}if(!m||m(s)){if(q){p.push(s)}else{return s}}s=s.parentNode}return q?p:null},get:function(i){var j;if(i&&this.doc&&typeof(i)=="string"){j=i;i=this.doc.getElementById(i);if(i&&i.id!==j){return this.doc.getElementsByName(j)[
1]}}return i},getNext:function(j,i){return this._findSib(j,i,"nextSibling")},getPrev:function(j,i){return this._findSib(j,i,"previousSibling")},select:function(k,j){var i=this;return e.dom.Sizzle(k,i.get(j)||i.get(i.settings.root_element)||i.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(c.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return e.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(l,o,i,k,m){var j=this;return this.run(l,function(r){var q,n;q=d(o,"string")?j.doc.createElement(o):o;j.setAttribs(q,i);if(k){if(k.nodeType){q.appendChild(k)}else{j.setHTML(q,k)}}return !m?r.appendChild(q):q})},create:function(k,i,j){return this.add(this.doc.createElement(k),k,i,j,1)},createHTML:function(q,i,m){var p="",l=this,j;p+="<"+q;for(j in i){if(i.hasOwnProperty(j)){p+=" &quo
t;+j+'="'+l.encode(i[j])+'"'}}if(typeof(m)!="undefined"){return p+">"+m+"</"+q+">"}return p+" />"},remove:function(i,j){return this.run(i,function(l){var m,k=l.parentNode;if(!k){return null}if(j){while(m=l.firstChild){if(!e.isIE||m.nodeType!==3||m.nodeValue){k.insertBefore(m,l)}else{l.removeChild(m)}}}return k.removeChild(l)})},setStyle:function(l,i,j){var k=this;return k.run(l,function(o){var n,m;n=o.style;i=i.replace(/-(\D)/g,function(q,p){return p.toUpperCase()});if(k.pixelStyles.test(i)&&(e.is(j,"number")||/^[\-0-9\.]+$/.test(j))){j+="px"}switch(i){case"opacity":if(b&&!e.isIE11){n.filter=j===""?"":"alpha(opacity="+(j*100)+")";if(!l.currentStyle||!l.currentStyle.hasLayout){n.display="inline-block"}}n[i]=n["-moz-opacity"]=n["-khtml-opacity"]=j||"";break;case"float":(b&&
;!e.isIE11)?n.styleFloat=j:n.cssFloat=j;break;default:n[i]=j||""}if(k.settings.update_styles){k.setAttrib(o,"data-mce-style")}})},getStyle:function(l,i,k){l=this.get(l);if(!l){return}if(this.doc.defaultView&&k){i=i.replace(/[A-Z]/g,function(m){return"-"+m});try{return this.doc.defaultView.getComputedStyle(l,null).getPropertyValue(i)}catch(j){return null}}i=i.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(i=="float"){i=b?"styleFloat":"cssFloat"}if(l.currentStyle&&k){return l.currentStyle[i]}return l.style?l.style[i]:undefined},setStyles:function(l,m){var j=this,k=j.settings,i;i=k.update_styles;k.update_styles=0;g(m,function(o,p){j.setStyle(l,p,o)});k.update_styles=i;if(k.update_styles){j.setAttrib(l,k.cssText)}},removeAllAttribs:function(i){return this.run(i,function(l){var k,j=l.attributes;for(k=j.length-1;k>=0;k--){l.removeAttributeNode(j.item(k))}})},setAttrib:function(k,l,i){var j=this;if(!
k||!l){return}if(j.settings.strict){l=l.toLowerCase()}return this.run(k,function(p){var o=j.settings;var m=p.getAttribute(l);if(i!==null){switch(l){case"style":if(!d(i,"string")){g(i,function(q,r){j.setStyle(p,r,q)});return}if(o.keep_values){if(i&&!j._isRes(i)){p.setAttribute("data-mce-style",i,2)}else{p.removeAttribute("data-mce-style",2)}}p.style.cssText=i;break;case"class":p.className=i||"";break;case"src":case"href":if(o.keep_values){if(o.url_converter){i=o.url_converter.call(o.url_converter_scope||j,i,l,p)}j.setAttrib(p,"data-mce-"+l,i,2)}break;case"shape":p.setAttribute("data-mce-style",i);break}}if(d(i)&&i!==null&&i.length!==0){p.setAttribute(l,""+i,2)}else{p.removeAttribute(l,2)}if(tinyMCE.activeEditor&&m!=i){var n=tinyMCE.activeEditor;n.onSetAttrib.dispatch(n,p,l,i)}})},setAttribs:function(j,k){var i=this;return this.run(j,f
unction(l){g(k,function(m,o){i.setAttrib(l,o,m)})})},getAttrib:function(m,o,k){var i,j=this,l;m=j.get(m);if(!m||m.nodeType!==1){return k===l?false:k}if(!d(k)){k=""}if(/^(src|href|style|coords|shape)$/.test(o)){i=m.getAttribute("data-mce-"+o);if(i){return i}}if(b&&j.props[o]){i=m[j.props[o]];i=i&&i.nodeValue?i.nodeValue:i}if(!i){i=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[j.props[o]]===true&&i===""){return o}return i?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){i=i||m.style.cssText;if(i){i=j.serializeStyle(j.parseStyle(i),m.nodeName);if(j.settings.keep_values&&!j._isRes(i)){m.setAttribute("data-mce-style",i)}}}if(f&&o==="class"&&i){i=i.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){swit
ch(o){case"rowspan":case"colspan":if(i===1){i=""}break;case"size":if(i==="+0"||i===20||i===0){i=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(i===0){i=""}break;case"hspace":if(i===-1){i=""}break;case"maxlength":case"tabindex":if(i===32768||i===2147483647||i==="32768"){i=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(i===65535){return o}return k;case"shape":i=i.toLowerCase();break;default:if(o.indexOf("on")===0&&i){i=e._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+i)}}}return(i!==l&&i!==null&&i!=="")?""+i:k},getPos:function(q,l){var j=this,i=0,p=0,m,o=j.doc,k;q=j.get(q);l=l||o.body;if(q){if(q.getB
oundingClientRect){q=q.getBoundingClientRect();m=j.boxModel?o.documentElement:o.body;i=q.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-m.clientTop;p=q.top+(o.documentElement.scrollTop||o.body.scrollTop)-m.clientLeft;return{x:i,y:p}}k=q;while(k&&k!=l&&k.nodeType){i+=k.offsetLeft||0;p+=k.offsetTop||0;k=k.offsetParent}k=q.parentNode;while(k&&k!=l&&k.nodeType){i-=k.scrollLeft||0;p-=k.scrollTop||0;k=k.parentNode}}return{x:i,y:p}},parseStyle:function(i){return this.styles.parse(i)},serializeStyle:function(j,i){return this.styles.serialize(j,i)},addStyle:function(j){var k=this.doc,i;styleElm=k.getElementById("mceDefaultStyles");if(!styleElm){styleElm=k.createElement("style"),styleElm.id="mceDefaultStyles";styleElm.type="text/css";i=k.getElementsByTagName("head")[0];if(i.firstChild){i.insertBefore(styleElm,i.firstChild)}else{i.appendChild(styleElm)}}if(styleElm.styleSheet){styleElm.styleSheet.cssText+
=j}else{styleElm.appendChild(k.createTextNode(j))}},loadCSS:function(i){var k=this,l=k.doc,j;if(!i){i=""}j=l.getElementsByTagName("head")[0];g(i.split(","),function(m){var n;if(k.files[m]){return}k.files[m]=true;n=k.create("link",{rel:"stylesheet",href:e._addVer(m)});if(b&&!e.isIE11&&l.documentMode&&l.recalc){n.onload=function(){if(l.recalc){l.recalc()}n.onload=null}}j.appendChild(n)})},addClass:function(i,j){return this.run(i,function(k){var l;if(!j){return 0}if(this.hasClass(k,j)){return k.className}l=this.removeClass(k,j);return k.className=(l!=""?(l+" "):"")+j})},removeClass:function(k,l){var i=this,j;return i.run(k,function(n){var m;if(i.hasClass(n,l)){if(!j){j=new RegExp("(^|\\s+)"+l+"(\\s+|$)","g")}m=n.className.replace(j," ");m=e.trim(m!=" "?m:"");n.className=m;if(!m){n.removeAttribute("class");n.removeA
ttribute("className")}return m}return n.className})},hasClass:function(j,i){j=this.get(j);if(!j||!i){return false}return(" "+j.className+" ").indexOf(" "+i+" ")!==-1},show:function(i){return this.setStyle(i,"display","block")},hide:function(i){return this.setStyle(i,"display","none")},isHidden:function(i){i=this.get(i);return !i||i.style.display=="none"||this.getStyle(i,"display")=="none"},uniqueId:function(i){return(!i?"mce_":i)+(this.counter++)},setHTML:function(k,j){var i=this;return i.run(k,function(m){if(b){while(m.firstChild){m.removeChild(m.firstChild)}try{m.innerHTML="<br />"+j;m.removeChild(m.firstChild)}catch(l){var n=i.create("div");n.innerHTML="<br />"+j;g(e.grep(n.childNodes),function(p,o){if(o&&m.canHaveHTML){m.appendChild(p)}})}}else{m.innerHTML=j}return j})},getOuterHTML:function(k){var j,i
=this;k=i.get(k);if(!k){return null}if(k.nodeType===1&&i.hasOuterHTML){return k.outerHTML}j=(k.ownerDocument||i.doc).createElement("body");j.appendChild(k.cloneNode(true));return j.innerHTML},setOuterHTML:function(l,j,m){var i=this;function k(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){i.insertAfter(s.cloneNode(true),p);s=s.previousSibling}i.remove(p)}return this.run(l,function(o){o=i.get(o);if(o.nodeType==1){m=m||o.ownerDocument||i.doc;if(b){try{if(b&&o.nodeType==1){o.outerHTML=j}else{k(o,j,m)}}catch(n){k(o,j,m)}}else{k(o,j,m)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(i,j){j=this.get(j);return this.run(i,function(l){var k,m;k=j.parentNode;m=j.nextSibling;if(m){k.insertBefore(l,m)}else{k.appendChild(l)}return l})},replace:function(m,l,i){var j=this;if(d(l,"array")){m=m.cloneNode(true)}return j.run(l,function(k){if(i){g(e.grep(k.childNodes),function(n){m.appendChild(n)})}return k.par
entNode.replaceChild(m,k)})},rename:function(l,i){var k=this,j;if(l.nodeName!=i.toUpperCase()){j=k.create(i);g(k.getAttribs(l),function(m){k.setAttrib(j,m.nodeName,k.getAttrib(l,m.nodeName))});k.replace(j,l,1)}return j||l},findCommonAncestor:function(k,i){var l=k,j;while(l){j=i;while(j&&l!=j){j=j.parentNode}if(l==j){break}l=l.parentNode}if(!l&&k.ownerDocument){return k.ownerDocument.documentElement}return l},toHex:function(i){var k=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);function j(l){l=parseInt(l,10).toString(16);return l.length>1?l:"0"+l}if(k){i="#"+j(k[1])+j(k[2])+j(k[3]);return i}return i},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(i){g(i.imports,function(s){q(s)});g(i.cssRules||i.rules,function(t){switch(t.type||1){case 1:if(t.selectorText){g(t.selectorText.split(","),function(r){r=r.replace(/^\s*|\s*$|^\s\./g,"&q
uot;);if(/\.mce/.test(r)||!/\.[\w\-]+$/.test(r)){return}l=r;r=e._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",r);if(p&&!(r=p(r,l))){return}if(!o[r]){j.push({"class":r});o[r]=1}})}break;case 3:try{q(t.styleSheet)}catch(s){}break}})}try{g(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(l,k,j){var i=this,m;if(i.doc&&typeof(l)==="string"){l=i.get(l)}if(!l){return false}j=j||this;if(!l.nodeType&&(l.length||l.length===0)){m=[];g(l,function(o,n){if(o){if(typeof(o)=="string"){o=i.doc.getElementById(o)}m.push(k.call(j,o,n))}});return m}return k.call(j,l)},getAttribs:function(j){var i;j=this.get(j);if(!j){return[]}if(b){i=[];if(j.nodeName=="OBJECT"){return j.attributes}if(j.nodeName==="OPTION"&&this.getAttrib(j,"selected")){i.push({specified:1,nodeName:"selected"})}j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\
']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(k){i.push({specified:1,nodeName:k})});return i}return j.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p=0;m=m.firstChild;if(m){j=new e.dom.TreeWalker(m,m.parentNode);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){if(l==="br"){p++;continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if(q==8){return false}if((q===3&&!a.test(m.nodeValue))){return false}}while(m=j.next())}return p<=1},destroy:function(j){var i=this;i.win=i.doc=i.root=i.events=i.frag=null;if(!j){e.removeUnload(i.destroy)}},createRng:function(){var i=this.doc;return i.createRange?i.createRange():new e.dom.Range(this)},nodeIndex:function(m,n){var i=0,k,l,j;if(m){for(k=m.nodeType
,m=m.previousSibling,l=m;m;m=m.previousSibling){j=m.nodeType;if(n&&j==3){if(j==k||!m.nodeValue.length){continue}}i++;k=j}}return i},split:function(m,l,p){var q=this,i=q.createRng(),n,k,o;function j(v){var t,s=v.childNodes,u=v.nodeType;function x(A){var z=A.previousSibling&&A.previousSibling.nodeName=="SPAN";var y=A.nextSibling&&A.nextSibling.nodeName=="SPAN";return z&&y}if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=s.length-1;t>=0;t--){j(s[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){var r=e.trim(v.nodeValue).length;if(!q.isBlock(v.parentNode)||r>0||r===0&&x(v)){return}}else{if(u==1){s=v.childNodes;if(s.length==1&&s[0]&&s[0].nodeType==1&&s[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(s[0],v)}if(s.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}q.remove(v)}return v}if(m&&l)
{i.setStart(m.parentNode,q.nodeIndex(m));i.setEnd(l.parentNode,q.nodeIndex(l));n=i.extractContents();i=q.createRng();i.setStart(l.parentNode,q.nodeIndex(l)+1);i.setEnd(m.parentNode,q.nodeIndex(m)+1);k=i.extractContents();o=m.parentNode;o.insertBefore(j(n),m);if(p){o.replaceChild(p,l)}else{o.insertBefore(l,m)}o.insertBefore(j(k),m);q.remove(m);return p||l}},bind:function(l,i,k,j){return this.events.add(l,i,k,j||this)},unbind:function(k,i,j){return this.events.remove(k,i,j)},fire:function(k,j,i){return this.events.fire(k,j,i)},getContentEditable:function(j){var i;if(j.nodeType!=1){return null}i=j.getAttribute("data-mce-contenteditable");if(i&&i!=="inherit"){return i}return j.contentEditable!=="inherit"?j.contentEditable:null},_findSib:function(l,i,j){var k=this,m=i;if(l){if(d(m,"string")){m=function(n){return k.is(n,i)}}for(l=l[j];l;l=l[j]){if(m(l)){return l}}}return null},_isRes:function(i){return/^(top|left|bottom|right|width|height)/i
.test(i)||/;\s*(top|left|bottom|right|width|height)/i.test(i)}});e.DOM=new e.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,U=0,F=1,j=2,E=true,S=false,W="startOffset",h="startContainer",Q="endContainer",A="endOffset",k=tinymce.extend,n=c.nodeIndex;k(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,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:J,setEndBefore:K,setEndAfter:u,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:v,deleteContents:p,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L,toStringIE:T});function x(){return e.createDocumentFragment()}function q(X,t){C(E,X,t)}function s(X,t){C(S,X,t)}function g(t){q(t.parentNode,n(t))}function J(t){q(t.parentNode,n(t)+1)}function K(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t
)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[W]}else{O[h]=O[Q];O[W]=O[A]}O.collapsed=E}function y(t){g(t);u(t)}function G(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(aa,t){var ad=O[h],Y=O[W],ac=O[Q],X=O[A],ab=t.startContainer,af=t.startOffset,Z=t.endContainer,ae=t.endOffset;if(aa===0){return H(ad,Y,ab,af)}if(aa===1){return H(ac,X,ab,af)}if(aa===2){return H(ac,X,Z,ae)}if(aa===3){return H(ad,Y,Z,ae)}}function p(){l(j)}function I(){return l(U)}function d(){return l(F)}function D(aa){var X=this[h],t=this[W],Z,Y;if((X.nodeType===3||X.nodeType===4)&&X.nodeValue){if(!t){X.parentNode.insertBefore(aa,X)}else{if(t>=X.nodeValue.length){c.insertAfter(aa,X)}else{Z=X.splitText(t);X.parentNode.insertBefore(aa,Z)}}}else{if(X.childNodes.length>0){Y=X.childNodes[t]}if(Y){X.insertBefore(aa,Y)}else{X.appendChild(aa)}}}function N(X){var t=O.extractContents();O.insertNode(X);X.appendChild(t);O.selectNode(X)}function L(){return k(new b(c),{startContainer:O[h]
,startOffset:O[W],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,X){var Y;if(t.nodeType==3){return t}if(X<0){return t}Y=t.firstChild;while(Y&&X>0){--X;Y=Y.nextSibling}if(Y){return Y}return t}function m(){return(O[h]==O[Q]&&O[W]==O[A])}function H(Z,ab,X,aa){var ac,Y,t,ad,af,ae;if(Z==X){if(ab==aa){return 0}if(ab<aa){return -1}return 1}ac=X;while(ac&&ac.parentNode!=Z){ac=ac.parentNode}if(ac){Y=0;t=Z.firstChild;while(t!=ac&&Y<ab){Y++;t=t.nextSibling}if(ab<=Y){return -1}return 1}ac=Z;while(ac&&ac.parentNode!=X){ac=ac.parentNode}if(ac){Y=0;t=X.firstChild;while(t!=ac&&Y<aa){Y++;t=t.nextSibling}if(Y<aa){return -1}return 1}ad=c.findCommonAncestor(Z,X);af=Z;while(af&&af.parentNode!=ad){af=af.parentNode}if(!af){af=ad}ae=X;while(ae&&ae.parentNode!=ad){ae=ae.parentNode}if(!ae){ae=ad}if(af==ae){return 0}t=ad.firstChild;while(t){if(t==af){ret
urn -1}if(t==ae){return 1}t=t.nextSibling}}function C(X,aa,Z){var t,Y;if(X){O[h]=aa;O[W]=Z}else{O[Q]=aa;O[A]=Z}t=O[Q];while(t.parentNode){t=t.parentNode}Y=O[h];while(Y.parentNode){Y=Y.parentNode}if(Y==t){if(H(O[h],O[W],O[Q],O[A])>0){O.collapse(X)}}else{O.collapse(X)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function l(ad){var ac,Z=0,af=0,X,ab,Y,aa,t,ae;if(O[h]==O[Q]){return f(ad)}for(ac=O[Q],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[h]){return r(ac,ad)}++Z}for(ac=O[h],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[Q]){return V(ac,ad)}++af}ab=af-Z;Y=O[h];while(ab>0){Y=Y.parentNode;ab--}aa=O[Q];while(ab<0){aa=aa.parentNode;ab++}for(t=Y.parentNode,ae=aa.parentNode;t!=ae;t=t.parentNode,ae=ae.parentNode){Y=t;aa=ae}return o(Y,aa,ad)}function f(ac){var ae,af,t,Y,Z,ad,aa,X,ab;if(ac!=j){ae=x()}if(O[W]==O[A]){return ae}if(O[h].nodeType==3){af=O[h].nodeValue;t=af.substring(O[W],O[A]);if(ac!=F){Y=O[h];X=O[W];ab=O[A]-O[W];if(X===0&&ab>=Y.n
odeValue.length-1){Y.parentNode.removeChild(Y)}else{Y.deleteData(X,ab)}O.collapse(E)}if(ac==j){return}if(t.length>0){ae.appendChild(e.createTextNode(t))}return ae}Y=P(O[h],O[W]);Z=O[A]-O[W];while(Y&&Z>0){ad=Y.nextSibling;aa=z(Y,ac);if(ae){ae.appendChild(aa)}--Z;Y=ad}if(ac!=F){O.collapse(E)}return ae}function r(ad,aa){var ac,ab,X,t,Z,Y;if(aa!=j){ac=x()}ab=i(ad,aa);if(ac){ac.appendChild(ab)}X=n(ad);t=X-O[W];if(t<=0){if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}ab=ad.previousSibling;while(t>0){Z=ab.previousSibling;Y=z(ab,aa);if(ac){ac.insertBefore(Y,ac.firstChild)}--t;ab=Z}if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}function V(ab,aa){var ad,X,ac,t,Z,Y;if(aa!=j){ad=x()}ac=R(ab,aa);if(ad){ad.appendChild(ac)}X=n(ab);++X;t=O[A]-X;ac=ab.nextSibling;while(ac&&t>0){Z=ac.nextSibling;Y=z(ac,aa);if(ad){ad.appendChild(Y)}--t;ac=Z}if(aa!=F){O.setStartAfter(ab);O.collapse(E)}return ad}function o(ab,t,ae){var Y,ag,aa,ac,ad,X,af,Z;if(ae!=j){ag=x()}Y=R(a
b,ae);if(ag){ag.appendChild(Y)}aa=ab.parentNode;ac=n(ab);ad=n(t);++ac;X=ad-ac;af=ab.nextSibling;while(X>0){Z=af.nextSibling;Y=z(af,ae);if(ag){ag.appendChild(Y)}af=Z;--X}Y=i(t,ae);if(ag){ag.appendChild(Y)}if(ae!=F){O.setStartAfter(ab);O.collapse(E)}return ag}function i(ac,ad){var Y=P(O[Q],O[A]-1),ae,ab,aa,t,X,Z=Y!=O[Q];if(Y==ac){return M(Y,Z,S,ad)}ae=Y.parentNode;ab=M(ae,S,S,ad);while(ae){while(Y){aa=Y.previousSibling;t=M(Y,Z,S,ad);if(ad!=j){ab.insertBefore(t,ab.firstChild)}Z=E;Y=aa}if(ae==ac){return ab}Y=ae.previousSibling;ae=ae.parentNode;X=M(ae,S,S,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function R(ac,ad){var Z=P(O[h],O[W]),aa=Z!=O[h],ae,ab,Y,t,X;if(Z==ac){return M(Z,aa,E,ad)}ae=Z.parentNode;ab=M(ae,S,E,ad);while(ae){while(Z){Y=Z.nextSibling;t=M(Z,aa,E,ad);if(ad!=j){ab.appendChild(t)}aa=E;Z=Y}if(ae==ac){return ab}Z=ae.nextSibling;ae=ae.parentNode;X=M(ae,S,E,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function M(t,aa,ad,ae){var Z,Y,ab,X,ac;if(aa){return z(t,ae)}if(t.nodeType==3){Z=t.nod
eValue;if(ad){X=O[W];Y=Z.substring(X);ab=Z.substring(0,X)}else{X=O[A];Y=Z.substring(0,X);ab=Z.substring(X)}if(ae!=F){t.nodeValue=ab}if(ae==j){return}ac=c.clone(t,S);ac.nodeValue=Y;return ac}if(ae==j){return}return c.clone(t,S)}function z(X,t){if(t!=j){return t==F?c.clone(X,E):X}X.parentNode.removeChild(X)}function T(){return c.create("body",null,d()).outerText}return O}a.Range=b;b.prototype.toString=function(){return this.toStringIE()}})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p&
lt;0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",1)===0||s!=k.parentElement()){break}o++}}else{k.collapse(true);o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",-1)===0||s!=k.parentElement()){break}o++}}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.fir
stChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o
(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndP
oint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,v,q,t,s=d.dom.doc,m=s.body,r,u;function j(C){var y,B,x,A,z;x=h.create("a");y=C?k:v;B=C?p:q;A=n.duplicate();if(y==s||y==s.documentElement){y=m;B=0}if(y.nodeType==3){y.parentNode.insertBefore(x,y);A.moveToElementText(x);A.moveStart("character",B);h.remove(x);n.setEndPoint(C?"StartToStart":"EndToEnd",A)}else{z=y.childNodes;if(z.length){if(B>=z.length){h.insertAfter(x,z[z.length-1])}else{y.insertBefore(x,z[B])}A.moveToElementText(x)}else{if(y.canHaveHTML){y.innerHTML="<span>\uFEFF</span>";x=y.firstChild;A.moveToElementText(x);A.collapse(f)}}n.setEndPoint(C?"StartToStart":"EndToEnd",A);h.remove(x)}}k=i.startContainer;p=i.startOffset;v=i.
endContainer;q=i.endOffset;n=m.createTextRange();if(k==v&&k.nodeType==1){if(p==q&&!k.hasChildNodes()){if(k.canHaveHTML){t=k.previousSibling;if(t&&!t.hasChildNodes()&&h.isBlock(t)){t.innerHTML="\uFEFF"}else{t=null}k.innerHTML="<span>\uFEFF</span><span>\uFEFF</span>";n.moveToElementText(k.lastChild);n.select();h.doc.selection.clear();k.innerHTML="";if(t){t.innerHTML=""}return}else{p=h.nodeIndex(k);k=k.parentNode}}if(p==q-1){try{u=k.childNodes[p];l=m.createControlRange();l.addElement(u);l.select();r=d.getRng();if(r.item&&u===r.item(0)){return}}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var n=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i="sizcache",o=0,r=Object.prototype.toString,h=false,g=true,q=/\\/g,u
=/\r\n/g,x=/\W/;[0,0].sort(function(){g=false;return 0});var d=function(C,e,F,G){F=F||[];e=e||document;var I=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!C||typeof C!=="string"){return F}var z,K,N,y,J,M,L,E,B=true,A=d.isXML(e),D=[],H=C;do{n.exec("");z=n.exec(H);if(z){H=z[3];D.push(z[1]);if(z[2]){y=z[3];break}}}while(z);if(D.length>1&&j.exec(C)){if(D.length===2&&k.relative[D[0]]){K=s(D[0]+D[1],e,G)}else{K=k.relative[D[0]]?[e]:d(D.shift(),e);while(D.length){C=D.shift();if(k.relative[C]){C+=D.shift()}K=s(C,K,G)}}}else{if(!G&&D.length>1&&e.nodeType===9&&!A&&k.match.ID.test(D[0])&&!k.match.ID.test(D[D.length-1])){J=d.find(D.shift(),e,A);e=J.expr?d.filter(J.expr,J.set)[0]:J.set[0]}if(e){J=G?{expr:D.pop(),set:l(G)}:d.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&e.parentNode?e.parentNode:e,A);K=J.expr?d.filter(J.expr,J.set):J.set;if(D.length>0){N=l(K)
}else{B=false}while(D.length){M=D.pop();L=M;if(!k.relative[M]){M=""}else{L=D.pop()}if(L==null){L=e}k.relative[M](N,L,A)}}else{N=D=[]}}if(!N){N=K}if(!N){d.error(M||C)}if(r.call(N)==="[object Array]"){if(!B){F.push.apply(F,N)}else{if(e&&e.nodeType===1){for(E=0;N[E]!=null;E++){if(N[E]&&(N[E]===true||N[E].nodeType===1&&d.contains(e,N[E]))){F.push(K[E])}}}else{for(E=0;N[E]!=null;E++){if(N[E]&&N[E].nodeType===1){F.push(K[E])}}}}}else{l(N,F)}if(y){d(y,I,F,G);d.uniqueSort(F)}return F};d.uniqueSort=function(y){if(p){h=g;y.sort(p);if(h){for(var e=1;e<y.length;e++){if(y[e]===y[e-1]){y.splice(e--,1)}}}}return y};d.matches=function(e,y){return d(e,null,null,y)};d.matchesSelector=function(e,y){return d(y,null,null,[e]).length>0};d.find=function(E,e,F){var D,z,B,A,C,y;if(!E){return[]}for(z=0,B=k.order.length;z<B;z++){C=k.order[z];if((A=k.leftMatch[C].exec(E))){y=A[1];A.splice(1,1);if(y.substr(y.length-1)!=="\\"){A[1]=(A[1]||&qu
ot;").replace(q,"");D=k.find[C](A,e,F);if(D!=null){E=E.replace(k.match[C],"");break}}}}if(!D){D=typeof e.getElementsByTagName!=="undefined"?e.getElementsByTagName("*"):[]}return{set:D,expr:E}};d.filter=function(I,H,L,B){var D,e,G,N,K,y,A,C,J,z=I,M=[],F=H,E=H&&H[0]&&d.isXML(H[0]);while(I&&H.length){for(G in k.filter){if((D=k.leftMatch[G].exec(I))!=null&&D[2]){y=k.filter[G];A=D[1];e=false;D.splice(1,1);if(A.substr(A.length-1)==="\\"){continue}if(F===M){M=[]}if(k.preFilter[G]){D=k.preFilter[G](D,F,L,M,B,E);if(!D){e=N=true}else{if(D===true){continue}}}if(D){for(C=0;(K=F[C])!=null;C++){if(K){N=y(K,D,C,F);J=B^N;if(L&&N!=null){if(J){e=true}else{F[C]=false}}else{if(J){M.push(K);e=true}}}}}if(N!==undefined){if(!L){F=M}I=I.replace(k.match[G],"");if(!e){return[]}break}}}if(I===z){if(e==null){d.error(I)}else{break}}z=I}return F};d.error=function(e){throw new Error("Syntax error, unrecog
nized expression: "+e)};var b=d.getText=function(B){var z,A,e=B.nodeType,y="";if(e){if(e===1||e===9||e===11){if(typeof B.textContent==="string"){return B.textContent}else{if(typeof B.innerText==="string"){return B.innerText.replace(u,"")}else{for(B=B.firstChild;B;B=B.nextSibling){y+=b(B)}}}}else{if(e===3||e===4){return B.nodeValue}}}else{for(z=0;(A=B[z]);z++){if(A.nodeType!==8){y+=b(A)}}}return y};var k=d.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|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\)
)?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")},type:function(e){return e.getAttribute("type")}},relative:{"+":function(D,y){var A=typeof y==="string",C=A&&!x.test(y),E=A&&!C;if(C){y=y.toLowerCase()}for(var z=0,e=D.length,B;z<e;z++){if((B=D[z])){while((B=B.previousSibling)&&B.nodeType!==1){}D[z]=E||B&&B.nodeName.toLowerCase()===y?B||false:B===y}}if(E){d.filter(y,D,true)}},">":function(D,y){var C,B=typeof y==="string",z=0,e=D.length;if(B&&!x.test(y)){y=y.toLowerCase();for(;z<e;z++){C=D[z];if(C){var A=C.parentNode;D[z]=A.nodeName.toLowerCase()===y?A:false}}}else{for(;z<e;z++){C=D[z];if(C){D[z]=B?C.parentNode:C.parentNode===y}}if(B){d.filter(y,D,true)}}},"&q
uot;:function(A,y,C){var B,z=o++,e=t;if(typeof y==="string"&&!x.test(y)){y=y.toLowerCase();B=y;e=a}e("parentNode",y,z,A,B,C)},"~":function(A,y,C){var B,z=o++,e=t;if(typeof y==="string"&&!x.test(y)){y=y.toLowerCase();B=y;e=a}e("previousSibling",y,z,A,B,C)}},find:{ID:function(y,z,A){if(typeof z.getElementById!=="undefined"&&!A){var e=z.getElementById(y[1]);return e&&e.parentNode?[e]:[]}},NAME:function(z,C){if(typeof C.getElementsByName!=="undefined"){var y=[],B=C.getElementsByName(z[1]);for(var A=0,e=B.length;A<e;A++){if(B[A].getAttribute("name")===z[1]){y.push(B[A])}}return y.length===0?null:y}},TAG:function(e,y){if(typeof y.getElementsByTagName!=="undefined"){return y.getElementsByTagName(e[1])}}},preFilter:{CLASS:function(A,y,z,e,D,E){A=" "+A[1].replace(q,"")+" ";if(E){return A}for(var B=0,C;(C=y[B])!=null;B++){if(C){if(D^(C.clas
sName&&(" "+C.className+" ").replace(/[\t\n\r]/g," ").indexOf(A)>=0)){if(!z){e.push(C)}}else{if(z){y[B]=false}}}}return false},ID:function(e){return e[1].replace(q,"")},TAG:function(y,e){return y[1].replace(q,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){d.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var y=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(y[1]+(y[2]||1))-0;e[3]=y[3]-0}else{if(e[2]){d.error(e[0])}}e[0]=o++;return e},ATTR:function(B,y,z,e,C,D){var A=B[1]=B[1].replace(q,"");if(!D&&k.attrMap[A]){B[1]=k.attrMap[A]}B[4]=(B[4]||B[5]||"").replace(q,"");if(B[2]==="~="){B[4]=" "+B[4]+" "}return B},PSEUDO:function(B,y,z,e,C){if(B[1]==="not"){if((n.exec(B[3])||&qu
ot;").length>1||/^\w/.test(B[3])){B[3]=d(B[3],null,null,y)}else{var A=d.filter(B[3],y,z,true^C);if(!z){e.push.apply(e,A)}return false}}else{if(k.match.POS.test(B[0])||k.match.CHILD.test(B[0])){return true}}return B},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){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(z,y,e){return !!d(e[3],z).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(z){var e=z.getAttribute("type"),y=z.type;return z.nodeName.toLowerCase()==="input"&&"text"===y&&(e===y||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"==
=e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===y.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===y.type},button:function(y){var e=y.nodeName.toLowerCase();return e==="input"&&"button"===y.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.active
Element}},setFilters:{first:function(y,e){return e===0},last:function(z,y,e,A){return y===A.length-1},even:function(y,e){return e%2===0},odd:function(y,e){return e%2===1},lt:function(z,y,e){return y<e[3]-0},gt:function(z,y,e){return y>e[3]-0},nth:function(z,y,e){return e[3]-0===y},eq:function(z,y,e){return e[3]-0===y}},filter:{PSEUDO:function(z,E,D,F){var e=E[1],y=k.filters[e];if(y){return y(z,D,E,F)}else{if(e==="contains"){return(z.textContent||z.innerText||b([z])||"").indexOf(E[3])>=0}else{if(e==="not"){var A=E[3];for(var C=0,B=A.length;C<B;C++){if(A[C]===z){return false}}return true}else{d.error(e)}}}},CHILD:function(z,B){var A,H,D,G,e,C,F,E=B[1],y=z;switch(E){case"only":case"first":while((y=y.previousSibling)){if(y.nodeType===1){return false}}if(E==="first"){return true}y=z;case"last":while((y=y.nextSibling)){if(y.nodeType===1){return false}}return true;case"nth":A=B[2];H=B[3];if(A===1&am
p;&H===0){return true}D=B[0];G=z.parentNode;if(G&&(G[i]!==D||!z.nodeIndex)){C=0;for(y=G.firstChild;y;y=y.nextSibling){if(y.nodeType===1){y.nodeIndex=++C}}G[i]=D}F=z.nodeIndex-H;if(A===0){return F===0}else{return(F%A===0&&F/A>=0)}}},ID:function(y,e){return y.nodeType===1&&y.getAttribute("id")===e},TAG:function(y,e){return(e==="*"&&y.nodeType===1)||!!y.nodeName&&y.nodeName.toLowerCase()===e},CLASS:function(y,e){return(" "+(y.className||y.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(C,A){var z=A[1],e=d.attr?d.attr(C,z):k.attrHandle[z]?k.attrHandle[z](C):C[z]!=null?C[z]:C.getAttribute(z),D=e+"",B=A[2],y=A[4];return e==null?B==="!=":!B&&d.attr?e!=null:B==="="?D===y:B==="*="?D.indexOf(y)>=0:B==="~="?(" "+D+" ").indexOf(y)>=0:!y?D&&e!==false:B==="!="?D!==y:B==="^="?D.in
dexOf(y)===0:B==="$="?D.substr(D.length-y.length)===y:B==="|="?D===y||D.substr(0,y.length+1)===y+"-":false},POS:function(B,y,z,C){var e=y[2],A=k.setFilters[e];if(A){return A(B,z,y,C)}}}};var j=k.match.POS,c=function(y,e){return"\\"+(e-0+1)};for(var f in k.match){k.match[f]=new RegExp(k.match[f].source+(/(?![^\[]*\])(?![^\(]*\))/.source));k.leftMatch[f]=new RegExp(/(^(?:.|\r|\n)*?)/.source+k.match[f].source.replace(/\\(\d+)/g,c))}k.match.globalPOS=j;var l=function(y,e){y=Array.prototype.slice.call(y,0);if(e){e.push.apply(e,y);return e}return y};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(v){l=function(B,A){var z=0,y=A||[];if(r.call(B)==="[object Array]"){Array.prototype.push.apply(y,B)}else{if(typeof B.length==="number"){for(var e=B.length;z<e;z++){y.push(B[z])}}else{for(;B[z];z++){y.push(B[z])}}}return y}}var p,m;if(document.documentElement.compareDocumentPosition){p=function(y
,e){if(y===e){h=true;return 0}if(!y.compareDocumentPosition||!e.compareDocumentPosition){return y.compareDocumentPosition?-1:1}return y.compareDocumentPosition(e)&4?-1:1}}else{p=function(F,E){if(F===E){h=true;return 0}else{if(F.sourceIndex&&E.sourceIndex){return F.sourceIndex-E.sourceIndex}}var C,y,z=[],e=[],B=F.parentNode,D=E.parentNode,G=B;if(B===D){return m(F,E)}else{if(!B){return -1}else{if(!D){return 1}}}while(G){z.unshift(G);G=G.parentNode}G=D;while(G){e.unshift(G);G=G.parentNode}C=z.length;y=e.length;for(var A=0;A<C&&A<y;A++){if(z[A]!==e[A]){return m(z[A],e[A])}}return A===C?m(F,e[A],-1):m(z[A],E,1)};m=function(y,e,z){if(y===e){return z}var A=y.nextSibling;while(A){if(A===e){return -1}A=A.nextSibling}return 1}}(function(){var y=document.createElement("div"),z="script"+(new Date()).getTime(),e=document.documentElement;y.innerHTML="<a name='"+z+"'/>";e.insertBefore(y,e.firstChild);if(document.getElementById
(z)){k.find.ID=function(B,C,D){if(typeof C.getElementById!=="undefined"&&!D){var A=C.getElementById(B[1]);return A?A.id===B[1]||typeof A.getAttributeNode!=="undefined"&&A.getAttributeNode("id").nodeValue===B[1]?[A]:undefined:[]}};k.filter.ID=function(C,A){var B=typeof C.getAttributeNode!=="undefined"&&C.getAttributeNode("id");return C.nodeType===1&&B&&B.nodeValue===A}}e.removeChild(y);e=y=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){k.find.TAG=function(y,C){var B=C.getElementsByTagName(y[1]);if(y[1]==="*"){var A=[];for(var z=0;B[z];z++){if(B[z].nodeType===1){A.push(B[z])}}B=A}return B}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("
href")!=="#"){k.attrHandle.href=function(y){return y.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=d,A=document.createElement("div"),z="__sizzle__";A.innerHTML="<p class='TEST'></p>";if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return}d=function(L,C,G,K){C=C||document;if(!K&&!d.isXML(C)){var J=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(L);if(J&&(C.nodeType===1||C.nodeType===9)){if(J[1]){return l(C.getElementsByTagName(L),G)}else{if(J[2]&&k.find.CLASS&&C.getElementsByClassName){return l(C.getElementsByClassName(J[2]),G)}}}if(C.nodeType===9){if(L==="body"&&C.body){return l([C.body],G)}else{if(J&&J[3]){var F=C.getElementById(J[3]);if(F&&F.parentNode){if(F.id===J[3]){return l([F],G)}}else{return l([],G)}}}try{return l(C.querySelectorAll(L),G)}catch(H){}}else{if(C.nodeType===1&&
C.nodeName.toLowerCase()!=="object"){var D=C,E=C.getAttribute("id"),B=E||z,N=C.parentNode,M=/^\s*[+~]/.test(L);if(!E){C.setAttribute("id",B)}else{B=B.replace(/'/g,"\\$&")}if(M&&N){C=C.parentNode}try{if(!M||N){return l(C.querySelectorAll("[id='"+B+"'] "+L),G)}}catch(I){}finally{if(!E){D.removeAttribute("id")}}}}}return e(L,C,G,K)};for(var y in e){d[y]=e[y]}A=null})()}(function(){var e=document.documentElement,z=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(z){var B=!z.call(document.createElement("div"),"div"),y=false;try{z.call(document.documentElement,"[test!='']:sizzle")}catch(A){y=true}d.matchesSelector=function(D,F){F=F.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!d.isXML(D)){try{if(y||!k.match.PSEUDO.test(F)&&!/!=/.test(F)){var C=z.call(D,F);if(C||!B||D.document&&D.document.nodeType!==11){return
C}}}catch(E){}}return d(F,null,null,[D]).length>0}}})();(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}k.order.splice(1,0,"CLASS");k.find.CLASS=function(y,z,A){if(typeof z.getElementsByClassName!=="undefined"&&!A){return z.getElementsByClassName(y[1])}};e=null})();function a(y,D,C,G,E,F){for(var A=0,z=G.length;A<z;A++){var e=G[A];if(e){var B=false;e=e[y];while(e){if(e[i]===C){B=G[e.sizset];break}if(e.nodeType===1&&!F){e[i]=C;e.sizset=A}if(e.nodeName.toLowerCase()===D){B=e;break}e=e[y]}G[A]=B}}}function t(y,D,C,G,E,F){for(var A=0,z=G.length;A<z;A++){var e=G[A];if(e){var B=false;e=e[y];while(e){if(e[i]===C){B=G[e.sizset];break}if(e.nodeType===1){if
(!F){e[i]=C;e.sizset=A}if(typeof D!=="string"){if(e===D){B=true;break}}else{if(d.filter(D,[e]).length>0){B=e;break}}}e=e[y]}G[A]=B}}}if(document.documentElement.contains){d.contains=function(y,e){return y!==e&&(y.contains?y.contains(e):true)}}else{if(document.documentElement.compareDocumentPosition){d.contains=function(y,e){return !!(y.compareDocumentPosition(e)&16)}}else{d.contains=function(){return false}}}d.isXML=function(e){var y=(e?e.ownerDocument||e:0).documentElement;return y?y.nodeName!=="HTML":false};var s=function(z,e,D){var C,E=[],B="",F=e.nodeType?[e]:e;while((C=k.match.PSEUDO.exec(z))){B+=C[0];z=z.replace(k.match.PSEUDO,"")}z=k.relative[z]?z+"*":z;for(var A=0,y=F.length;A<y;A++){d(z,F[A],E,D)}return d.filter(B,E)};window.tinymce.dom.Sizzle=d})();(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,ge
tParent,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(d){function f(g){return g.replace(/[\n\r]+/g,"")}var c=d.is,b=d.isIE,e=d.each,a=d.dom.TreeWalker;d.create("tinymce.dom.Selection",{Selection:function(k,j,i,h){var g=this;g.dom=k;g.win=j;g.serializer=i;g.editor=h;e(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetConte
nt"],function(l){g[l]=new d.util.Dispatcher(g)});if(!g.win.getSelection){g.tridentSel=new d.dom.TridentSelection(g)}if(d.isIE&&!d.isIE11&&k.boxModel){this._fixIESelection()}d.addUnload(g.destroy,g)},setCursorLocation:function(i,j){var g=this;var h=g.dom.createRng();h.setStart(i,j);h.setEnd(i,j);g.setRng(h);g.collapse(false)},getContent:function(h){var g=this,i=g.getRng(),m=g.dom.create("body"),k=g.getSel(),j,l,o;h=h||{};j=l="";h.get=true;h.format=h.format||"html";h.forced_root_block="";g.onBeforeGetContent.dispatch(g,h);if(h.format=="text"){return g.isCollapsed()?"":(i.text||(k.toString?k.toString():""))}if(i.cloneContents){o=i.cloneContents();if(o){m.appendChild(o)}}else{if(c(i.item)||c(i.htmlText)){m.innerHTML="<br>"+(i.item?i.item(0).outerHTML:i.htmlText);m.removeChild(m.firstChild)}else{m.innerHTML=i.toString()}}if(/^\s/.test(m.innerHTML)){j=" "}if(/\s+$/.test(m.i
nnerHTML)){l=" "}h.getInner=true;h.content=g.isCollapsed()?"":j+g.serializer.serialize(m,h)+l;g.onGetContent.dispatch(g,h);return h.content},setContent:function(h,j){var o=this,g=o.getRng(),k,l=o.win.document,n,m;j=j||{format:"html"};j.set=true;h=j.content=h;if(!j.no_events){o.onBeforeSetContent.dispatch(o,j)}h=j.content;if(g.insertNode){h+='<span id="__caret">_</span>';if(g.startContainer==l&&g.endContainer==l){l.body.innerHTML=h}else{g.deleteContents();if(l.body.childNodes.length===0){l.body.innerHTML=h}else{if(g.createContextualFragment){g.insertNode(g.createContextualFragment(h))}else{n=l.createDocumentFragment();m=l.createElement("div");n.appendChild(m);m.outerHTML=h;g.insertNode(n)}}}k=o.dom.get("__caret");g=l.createRange();g.setStartBefore(k);g.setEndBefore(k);o.setRng(g);o.dom.remove("__caret");try{o.setRng(g)}catch(i){}}else{if(g.item){l.execCommand("Delete",false,null);g=o.g
etRng()}if(/^\s+/.test(h)){g.pasteHTML('<span id="__mce_tmp">_</span>'+h);o.dom.remove("__mce_tmp")}else{g.pasteHTML(h)}}if(!j.no_events){o.onSetContent.dispatch(o,j)}},getStart:function(){var i=this,h=i.getRng(),j,g,l,k;if(h.duplicate||h.item){if(h.item){return h.item(0)}l=h.duplicate();l.collapse(1);j=l.parentElement();if(j.ownerDocument!==i.dom.doc){j=i.dom.getRoot()}g=k=h.parentElement();while(k=k.parentNode){if(k==j){j=g;break}}return j}else{j=h.startContainer;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[Math.min(j.childNodes.length-1,h.startOffset)]}if(j&&j.nodeType==3){return j.parentNode}return j}},getEnd:function(){var h=this,g=h.getRng(),j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(0);j=g.parentElement();if(j.ownerDocument!==h.dom.doc){j=h.dom.getRoot()}if(j&&j.nodeName=="BODY"){return j.lastChild||j}return j}else{j=g.endContainer;i=g.endOffset;if(j.nodeType==1&am
p;&j.hasChildNodes()){j=j.childNodes[i>0?i-1:i]}if(j&&j.nodeType==3){return j.parentNode}return j}},getBookmark:function(s,v){var y=this,n=y.dom,h,k,j,o,i,p,q,m="\uFEFF",x;function g(z,A){var t=0;e(n.select(z),function(C,B){if(C==A){t=B}});return t}function u(t){function z(E){var A,D,C,B=E?"start":"end";A=t[B+"Container"];D=t[B+"Offset"];if(A.nodeType==1&&A.nodeName=="TR"){C=A.childNodes;A=C[Math.min(E?D:D-1,C.length-1)];if(A){D=E?0:A.childNodes.length;t["set"+(E?"Start":"End")](A,D)}}}z(true);z();return t}function l(){var z=y.getRng(true),t=n.getRoot(),A={};function B(E,J){var D=E[J?"startContainer":"endContainer"],I=E[J?"startOffset":"endOffset"],C=[],F,H,G=0;if(D.nodeType==3){if(v){for(F=D.previousSibling;F&&F.nodeType==3;F=F.previousSibling){I+=F.nodeValue.length}}C.push(I)}else{H=D.childNodes;if(I>=H.length&&
H.length){G=1;I=Math.max(0,H.length-1)}C.push(y.dom.nodeIndex(H[I],v)+G)}for(;D&&D!=t;D=D.parentNode){C.push(y.dom.nodeIndex(D,v))}return C}A.start=B(z,true);if(!y.isCollapsed()){A.end=B(z)}return A}if(s==2){if(y.tridentSel){return y.tridentSel.getBookmark(s)}return l()}if(s){h=y.getRng();if(h.setStart){h={startContainer:h.startContainer,startOffset:h.startOffset,endContainer:h.endContainer,endOffset:h.endOffset}}return{rng:h}}h=y.getRng();j=n.uniqueId();o=tinyMCE.activeEditor.selection.isCollapsed();x="overflow:hidden;line-height:0px";if(h.duplicate||h.item){if(!h.item){k=h.duplicate();try{h.collapse();h.pasteHTML('<span data-mce-type="bookmark" id="'+j+'_start" style="'+x+'">'+m+"</span>");if(!o){k.collapse(false);h.moveToElementText(k.parentElement());if(h.compareEndPoints("StartToEnd",k)===0){k.move("character",-1)}k.pasteHTML('<span data-mce-type="bookmark" id="'+j+'_end&
quot; style="'+x+'">'+m+"</span>")}}catch(r){return null}}else{p=h.item(0);i=p.nodeName;return{name:i,index:g(i,p)}}}else{p=y.getNode();i=p.nodeName;if(i=="IMG"){return{name:i,index:g(i,p)}}k=u(h.cloneRange());if(!o){k.collapse(false);k.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_end",style:x},m))}h=u(h);h.collapse(true);h.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_start",style:x},m))}y.moveToBookmark({id:j,keep:1});return{id:j}},moveToBookmark:function(q){var v=this,n=v.dom,l,j,g,i,u,k,x,r,s;function h(C){var t=q[C?"start":"end"],z,A,B,y;if(t){B=t[0];for(A=u,z=t.length-1;z>=1;z--){y=A.childNodes;if(t[z]>y.length-1){return}A=y[t[z]]}if(A.nodeType===3){B=Math.min(t[0],A.nodeValue.length)}if(A.nodeType===1){B=Math.min(t[0],A.childNodes.length)}if(C){g.setStart(A,B)}else{g.setEnd(A,B)}}return true}function
m(D){var y=n.get(q.id+"_"+D),C,t,A,B,z=q.keep;if(y){C=y.parentNode;if(D=="start"){if(!z){t=n.nodeIndex(y)}else{C=y.firstChild;t=1}k=x=C;r=s=t}else{if(!z){t=n.nodeIndex(y)}else{C=y.firstChild;t=1}x=C;s=t}if(!z){B=y.previousSibling;A=y.nextSibling;e(d.grep(y.childNodes),function(E){if(E.nodeType==3){E.nodeValue=E.nodeValue.replace(/\uFEFF/g,"")}});while(y=n.get(q.id+"_"+D)){n.remove(y,1)}if(B&&A&&B.nodeType==A.nodeType&&B.nodeType==3&&!d.isOpera){t=B.nodeValue.length;B.appendData(A.nodeValue);n.remove(A);if(D=="start"){k=x=B;r=s=t}else{x=B;s=t}}}}}function o(t){if(n.isBlock(t)&&!t.innerHTML&&!b){t.innerHTML='<br data-mce-bogus="1" />'}return t}if(q){if(q.start){g=n.createRng();u=n.getRoot();if(v.tridentSel){return v.tridentSel.moveToBookmark(q)}if(h(true)&&h()){v.setRng(g)}}else{if(q.id){m("start");m("end");if(k){g=n.createRng();g.setStart(o(k),
r);g.setEnd(o(x),s);v.setRng(g)}}else{if(q.name){v.select(n.select(q.name)[q.index])}else{if(q.rng){g=q.rng;if(g.startContainer){i=v.dom.createRng();try{i.setStart(g.startContainer,g.startOffset);i.setEnd(g.endContainer,g.endOffset)}catch(p){}g=i}v.setRng(g)}}}}}},select:function(l,k){var j=this,m=j.dom,h=m.createRng(),g;function i(n,p){var o=new a(n,n);do{if(n.nodeType==3&&d.trim(n.nodeValue).length!==0){if(p){h.setStart(n,0)}else{h.setEnd(n,n.nodeValue.length)}return}if(n.nodeName=="BR"){if(p){h.setStartBefore(n)}else{h.setEndBefore(n)}return}}while(n=(p?o.next():o.prev()))}if(l){g=m.nodeIndex(l);h.setStart(l.parentNode,g);h.setEnd(l.parentNode,g+1);if(k){i(l,1);i(l)}j.setRng(h)}return l},isCollapsed:function(){var g=this,i=g.getRng(),h=g.getSel();if(!i||i.item){return false}if(i.compareEndPoints){return i.compareEndPoints("StartToEnd",i)===0}return !h||i.collapsed},collapse:function(g){var i=this,h=i.getRng(),j;if(h.item){j=h.item(0);h=i.win.document.b
ody.createTextRange();h.moveToElementText(j)}h.collapse(!!g);i.setRng(h)},getSel:function(){var h=this,g=this.win;return g.getSelection?g.getSelection():g.document.selection},getRng:function(m){var h=this,j,g,l,k=h.win.document;if(m&&h.tridentSel){return h.tridentSel.getRangeAt(0)}try{if(j=h.getSel()){g=j.rangeCount>0?j.getRangeAt(0):(j.createRange?j.createRange():k.createRange())}}catch(i){}if(d.isIE&&!d.isIE11&&g&&g.setStart&&k.selection.createRange().item){l=k.selection.createRange().item(0);g=k.createRange();g.setStartBefore(l);g.setEndAfter(l)}if(!g){g=k.createRange?k.createRange():k.body.createTextRange()}if(g.setStart&&g.startContainer.nodeType===9&&g.collapsed){l=h.dom.getRoot();g.setStart(l,0);g.setEnd(l,0)}if(h.selectedRange&&h.explicitRange){if(g.compareBoundaryPoints(g.START_TO_START,h.selectedRange)===0&&g.compareBoundaryPoints(g.END_TO_END,h.selectedRange)===0){g=h.explicitRange}else{h.selectedR
ange=null;h.explicitRange=null}}return g},setRng:function(k,g){var j,i=this;if(!i.tridentSel){j=i.getSel();if(j){i.explicitRange=k;try{j.removeAllRanges()}catch(h){}j.addRange(k);if(g===false&&j.extend){j.collapse(k.endContainer,k.endOffset);j.extend(k.startContainer,k.startOffset)}i.selectedRange=j.rangeCount>0?j.getRangeAt(0):null}}else{if(k.cloneRange){try{i.tridentSel.addRange(k);return}catch(h){}}try{k.select()}catch(h){}}},setNode:function(h){var g=this;g.setContent(g.dom.getOuterHTML(h));return h},getNode:function(){var i=this,h=i.getRng(),j=i.getSel(),m,l=h.startContainer,g=h.endContainer;function k(q,o){var p=q;while(q&&q.nodeType===3&&q.length===0){q=o?q.nextSibling:q.previousSibling}return q||p}if(!h){return i.dom.getRoot()}if(h.setStart){m=h.commonAncestorContainer;if(!h.collapsed){if(h.startContainer==h.endContainer){if(h.endOffset-h.startOffset<2){if(h.startContainer.hasChildNodes()){m=h.startContainer.childNodes[h.startOffset]}}}if(l.node
Type===3&&g.nodeType===3){if(l.length===h.startOffset){l=k(l.nextSibling,true)}else{l=l.parentNode}if(h.endOffset===0){g=k(g.previousSibling,false)}else{g=g.parentNode}if(l&&l===g){return l}}}if(m&&m.nodeType==3){return m.parentNode}return m}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(p,h){var o=this,k=o.dom,m,l,i,j=[];m=k.getParent(p||o.getStart(),k.isBlock);l=k.getParent(h||o.getEnd(),k.isBlock);if(m){j.push(m)}if(m&&l&&m!=l){i=m;var g=new a(m,k.getRoot());while((i=g.next())&&i!=l){if(k.isBlock(i)){j.push(i)}}}if(l&&m!=l){j.push(l)}return j},isForward:function(){var i=this.dom,g=this.getSel(),j,h;if(!g||g.anchorNode==null||g.focusNode==null){return true}j=i.createRng();j.setStart(g.anchorNode,g.anchorOffset);j.collapse(true);h=i.createRng();h.setStart(g.focusNode,g.focusOffset);h.collapse(true);return j.compareBoundaryPoints(j.START_TO_START,h)<=0},normalize:function(){var h=this,g,m,l,j,i;functio
n k(p){var o,r,n,s=h.dom,u=s.getRoot(),q,t,v;function y(z,A){var B=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(z=B[A?"prev":"next"]()){if(z.nodeName==="BR"){return true}}}function x(B,z){var C,A;z=z||o;C=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(q=C[B?"prev":"next"]()){if(q.nodeType===3&&q.nodeValue.length>0){o=q;r=B?q.nodeValue.length:0;m=true;return}if(s.isBlock(q)||t[q.nodeName.toLowerCase()]){return}A=q}if(l&&A){o=A;m=true;r=0}}o=g[(p?"start":"end")+"Container"];r=g[(p?"start":"end")+"Offset"];t=s.schema.getNonEmptyElements();if(o.nodeType===9){o=s.getRoot();r=0}if(o===u){if(p){q=o.childNodes[r>0?r-1:0];if(q){v=q.nodeName.toLowerCase();if(t[q.nodeName]||q.nodeName=="TABLE"){return}}}if(o.hasChildNodes()){o=o.childNodes[Math.min(!p&&r>0?r-1:r,o.childNodes.length-1)];r=0;if(o.hasChildNodes()&&!/TABLE/
.test(o.nodeName)){q=o;n=new a(o,u);do{if(q.nodeType===3&&q.nodeValue.length>0){r=p?0:q.nodeValue.length;o=q;m=true;break}if(t[q.nodeName.toLowerCase()]){r=s.nodeIndex(q);o=q.parentNode;if(q.nodeName=="IMG"&&!p){r++}m=true;break}}while(q=(p?n.next():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o.childNodes[r];if(q&&q.nodeName==="BR"&&!y(q)&&!y(q,true)){x(true,o.childNodes[r])}}}if(p&&!l&&o.nodeType===3&&r===o.nodeValue.length){x(false)}if(m){g["set"+(p?"Start":"End")](o,r)}}if(d.isIE){return}g=h.getRng();l=g.collapsed;k(true);if(!l){k()}if(m){if(l){g.collapse(true)}h.setRng(g,h.isForward())}},selectorChanged:function(g,j){var h=this,i;if(!h.selectorChangedData){h.selectorChangedData={};i={};h.editor.onNodeChange.addToTop(function(l,k,o){var p=h.dom,m=p.getParents(o,null,p.getRoot()),n={};e(h.selectorChangedData,function(r,q){e(m,fu
nction(s){if(p.is(s,q)){if(!i[q]){e(r,function(t){t(true,{node:s,selector:q,parents:m})});i[q]=r}n[q]=r;return false}})});e(i,function(r,q){if(!n[q]){delete i[q];e(r,function(s){s(false,{node:o,selector:q,parents:m})})}})})}if(!h.selectorChangedData[g]){h.selectorChangedData[g]=[]}h.selectorChangedData[g].push(j);return h},scrollIntoView:function(k){var j,h,g=this,i=g.dom;h=i.getViewPort(g.editor.getWin());j=i.getPos(k).y;if(j<h.y||j+25>h.y+h.h){g.editor.getWin().scrollTo(0,j<h.y?j:j-h.h+25)}},destroy:function(h){var g=this;g.win=null;if(!h){d.removeUnload(g.destroy)}},_fixIESelection:function(){var h=this.dom,n=h.doc,i=n.body,k,o,g;function j(p,s){var q=i.createTextRange();try{q.moveToPoint(p,s)}catch(r){q=null}return q}function m(q){var p;if(q.button){p=j(q.x,q.y);if(p){if(p.compareEndPoints("StartToStart",o)>0){p.setEndPoint("StartToStart",o)}else{p.setEndPoint("EndToEnd",o)}p.select()}}else{l()}}function l(){var p=n.selection.createRange
();if(o&&!p.item&&p.compareEndPoints("StartToEnd",p)===0){o.select()}h.unbind(n,"mouseup",l);h.unbind(n,"mousemove",m);o=k=0}n.documentElement.unselectable=true;h.bind(n,["mousedown","contextmenu"],function(p){if(p.target.nodeName==="HTML"){if(k){l()}g=n.documentElement;if(g.scrollHeight>g.clientHeight){return}k=1;o=j(p.x,p.y);if(o){h.bind(n,"mouseup",l);h.bind(n,"mousemove",m);h.win.focus();o.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";e.remove_trailing_brs="remove_trailing_brs" in e?e.remove_trailing_brs:true;h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="
;data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/(?:^|\s)mce(Item\w+|Selected)(?!\S)/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addAttributeFilter("data-mce-expando",function(j,l,k){var m=j.length;while(m--){j[m].attr(l,null)}});c.addNodeFilter("noscript",function(j){var k=j.length,l;while(k--){l=j[k].firstChild;if(l){l.value=a.html.Entities.d
ecode(l.value)}}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// <![CDATA[\n"+j(o)+"\n// ]]>"}}else{if(o.length>0){n.firstChild.value="<!--\n"+j(o)+"\n-->"}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;w
hile(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAtt
ributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(a.trim(m.getInner?o.innerHTML:i.getOuterHTML(o)),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.d
om.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],e={},d=[],g=0,f;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}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&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=document.createElement("script");s.id=n;s.type="text/javascript";s.src=a._addVer(m);if(!a.isIE||a.isIE11){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete&quo
t;||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==f){j.push(m);l[m]=c}if(q){if(!e[m]){e[m]=[]}e[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(e[r],function(s){s.func.call(s.scope)});e[r]=f}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);(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mc
eSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break
}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&d<h.nodeValue.length){i=f(h,d);h=i.previousSibling;if(g>d){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d<h.nodeValue.length){h=f(h,d);d=0}if(i.nodeType==3&&g>0&&g<i.nodeValue.length){i=f(i,g).previousSibling;g=i.nodeValue.length}}return{startContainer:h,startOffset:d,endContainer:i,endOffset:g}}};a.dom.RangeUtils.compareRanges=function(c,b){if(c&&b){if(c.item||c.duplicate){if(c.item&&b.item&&c.item(0)===b.item(0)){return true}if(c.isEqual&&b.isEqual&&b.isEqual(c)){return true}}else{return c.startContainer==b.startContainer&&
amp;c.startOffset==b.startOffset}}return false}})(tinymce);(function(b){var a=b.dom.Event,c=b.each;b.create("tinymce.ui.KeyboardNavigation",{KeyboardNavigation:function(e,f){var q=this,n=e.root,m=e.items,o=e.enableUpDown,i=e.enableLeftRight||!e.enableUpDown,l=e.excludeFromTabOrder,k,h,p,d,g;f=f||b.DOM;k=function(r){g=r.target.id};h=function(r){f.setAttrib(r.target.id,"tabindex","-1")};d=function(r){var s=f.get(g);f.setAttrib(s,"tabindex","0");s.focus()};q.focus=function(){f.get(g).focus()};q.destroy=function(){c(m,function(s){var t=f.get(s.id);f.unbind(t,"focus",k);f.unbind(t,"blur",h)});var r=f.get(n);f.unbind(r,"focus",d);f.unbind(r,"keydown",p);m=f=n=q.focus=k=h=p=d=null;q.destroy=function(){}};q.moveFocus=function(v,s){var r=-1,u=q.controls,t;if(!g){return}c(m,function(y,x){if(y.id===g){r=x;return false}});r+=v;if(r<0){r=m.length-1}else{if(r>=m.length){r=0}}t=m[r];f.setAttrib(g,"
tabindex","-1");f.setAttrib(t.id,"tabindex","0");f.get(t.id).focus();if(e.actOnFocus){e.onAction(t.id)}if(s){a.cancel(s)}};p=function(z){var v=37,u=39,y=38,A=40,r=27,t=14,s=13,x=32;switch(z.keyCode){case v:if(i){q.moveFocus(-1)}a.cancel(z);break;case u:if(i){q.moveFocus(1)}a.cancel(z);break;case y:if(o){q.moveFocus(-1)}a.cancel(z);break;case A:if(o){q.moveFocus(1)}a.cancel(z);break;case r:if(e.onCancel){e.onCancel();a.cancel(z)}break;case t:case s:case x:if(e.onAction){e.onAction(g);a.cancel(z)}break}};c(m,function(t,r){var s,u;if(!t.id){t.id=f.uniqueId("_mce_item_")}u=f.get(t.id);if(l){f.bind(u,"blur",h);s="-1"}else{s=(r===0?"0":"-1")}u.setAttribute("tabindex",s);f.bind(u,"focus",k)});if(m[0]){g=m[0].id}f.setAttrib(n,"tabindex","-1");var j=f.get(n);f.bind(j,"focus",d);f.bind(j,"keydown",p)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.cr
eate("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);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;this.setAriaProperty("pressed",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},renderH
TML: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(c,b,a){this.parent(c,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";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(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.setAriaProperty("checked",!!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"]+=&qu
ot; 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;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},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.offsetWidth,j.max_width):g.offsetWidth;k=j.max_height?Math.min(g.offsetHeight,j.max_height):g.offsetHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.e
lement.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 false}});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")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover&qu
ot;,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);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);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",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",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",{role:"presentation",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},_setupKeyboardNav:function(){var i,h,g=this;i=c.get("menu_"+g.id);h=c.select("a[
role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_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,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;&qu
ot;,onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}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){if(typeof h.settings.style=="function"){h.settings.style=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(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a role="button" id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" aria-labelledby="'+this.id+'_voice" title="'+a.encode(e.title)+'">';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+='<span class="mceIcon '+e["class"]+'"><img class="mceIcon" src="'+e.image+'" alt="'+a.encode(e.title)+'" /></span>'+(c?'<span class="'+f+'Label">'+c
+"</span>":"")}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")}d+='<span class="mceVoiceLabel mceIconOnly" style="display: none;" id="'+this.id+'_voice">'+e.title+"</span>";d+="</a>";return d},postRender:function(){var d=this,e=d.settings,c;if(b.isIE&&d.editor){b.dom.Event.add(d.id,"mousedown",function(f){var g=d.editor.selection.getNode().nodeName;c=g==="IMG"?d.editor.selection.getBookmark():null})}b.dom.Event.add(d.id,"click",function(f){if(!d.isDisabled()){if(b.isIE&&d.editor&&c!==null){d.editor.selection.moveToBookmark(c)}return e.onclick.call(e.scope,f)}});b.dom.Event.add(d.id,"keydown",function(f){if(!d.isDisabled()&&f.keyCode==b.VK.SPACEBAR){b.dom.Event.cancel(f);return e.onclick.call(e.
scope,f)}})}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(j,i,g){var h=this;h.parent(j,i,g);h.items=[];h.onChange=new a(h);h.onPostRender=new a(h);h.onAdd=new a(h);h.onRenderMenu=new e.util.Dispatcher(this);h.classPrefix="mceListBox";h.marked={}},select:function(h){var g=this,j,i;g.marked={};if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){var i=this,j,k,h;i.marked={};if(g!=i.selectedIndex){j=d.get(i.id+"_text");h=d.get(i.id+"_voiceDesc");k=i.items[g];if(k){i.selectedValue=k.value;i.selectedIndex=g;d.setHTML(j,d.encode(k.title));d.setHTML(h,i.settings.title+" - "+k.title);d.removeClass(j,"mceTitle"
);d.setAttrib(i.id,"aria-valuenow",k.title)}else{d.setHTML(j,d.encode(i.settings.title));d.setHTML(h,d.encode(i.settings.title));d.addClass(j,"mceTitle");i.selectedValue=i.selectedIndex=null;d.setAttrib(i.id,"aria-valuenow",i.settings.title)}j=0}},mark:function(g){this.marked[g]=true},add:function(j,g,i){var h=this;i=i||{};i=e.extend(i,{title:j,value:g});h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var j="",g=this,i=g.settings,k=g.classPrefix;j='<span role="listbox" aria-haspopup="true" aria-labelledby="'+g.id+'_voiceDesc" aria-describedby="'+g.id+'_voiceDesc"><table role="presentation" tabindex="0" id="'+g.id+'" cellpadding="0" cellspacing="0" class="'+k+" "+k+"Enabled"+(i["class"]?(" "+i["class"]):"")+'"><tb
ody><tr>';j+="<td>"+d.createHTML("span",{id:g.id+"_voiceDesc","class":"voiceLabel",style:"display:none;"},g.settings.title);j+=d.createHTML("a",{id:g.id+"_text",tabindex:-1,href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},d.encode(g.settings.title))+"</td>";j+="<td>"+d.createHTML("a",{id:g.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},'<span><span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span></span>')+"</td>";j+="</tr></tbody></table></span>";return j},showMenu:function(){var h=this,j,i=d.get(this.id),
g;if(h.isDisabled()||h.items.length===0){return}if(h.menu&&h.menu.isMenuVisible){return h.hideMenu()}if(!h.isMenuRendered){h.renderMenu();h.isMenuRendered=true}j=d.getPos(i);g=h.menu;g.settings.offset_x=j.x;g.settings.offset_y=j.y;g.settings.keyboard_focus=!e.isOpera;f(h.items,function(k){if(g.items[k.id]){g.items[k.id].setSelected(0)}});f(h.items,function(k){if(g.items[k.id]&&h.marked[k.value]){g.items[k.id].setSelected(1)}if(k.value===h.selectedValue){g.items[k.id].setSelected(1)}});g.showMenu(0,i.clientHeight);b.add(d.doc,"mousedown",h.hideMenu,h);d.addClass(h.id,h.classPrefix+"Selected")},hideMenu:function(h){var g=this;if(g.menu&&g.menu.isMenuVisible){d.removeClass(g.id,g.classPrefix+"Selected");if(h&&h.type=="mousedown"&&(h.target.id==g.id+"_text"||h.target.id==g.id+"_open")){return}if(!h||!d.getParent(h.target,".mceMenu")){d.removeClass(g.id,g.classPrefix+"Select
ed");b.remove(d.doc,"mousedown",g.hideMenu,g);g.menu.hideMenu()}}},renderMenu:function(){var h=this,g;g=h.settings.control_manager.createDropMenu(h.id+"_menu",{menu_line:1,"class":h.classPrefix+"Menu mceNoIcons",max_width:250,max_height:150});g.onHideMenu.add(function(){h.hideMenu();h.focus()});g.add({title:h.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}});f(h.items,function(i){if(i.value===c){g.add({title:i.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}})}else{i.id=d.uniqueId();i.role="option";i.onclick=function(){if(h.settings.onselect(i.value)!==false){h.select(i.value)}};g.add(i)}});h.onRenderMenu.dispatch(h,g);h.menu=g},postRender:function(){var g=this,h=g.classPrefix;b.add(g.id,"click",g.sho
wMenu,g);b.add(g.id,"keydown",function(i){if(i.keyCode==32){g.showMenu(i);b.cancel(i)}});b.add(g.id,"focus",function(){if(!g._focused){g.keyDownHandler=b.add(g.id,"keydown",function(i){if(i.keyCode==40){g.showMenu();b.cancel(i)}});g.keyPressHandler=b.add(g.id,"keypress",function(j){var i;if(j.keyCode==13){i=g.selectedValue;g.selectedValue=null;b.cancel(j);g.settings.onselect(i)}})}g._focused=1});b.add(g.id,"blur",function(){b.remove(g.id,"keydown",g.keyDownHandler);b.remove(g.id,"keypress",g.keyPressHandler);g._focused=0});if(e.isIE6||!d.boxModel){b.add(g.id,"mouseover",function(){if(!d.hasClass(g.id,h+"Disabled")){d.addClass(g.id,h+"Hover")}});b.add(g.id,"mouseout",function(){if(!d.hasClass(g.id,h+"Disabled")){d.removeClass(g.id,h+"Hover")}})}g.onPostRender.dispatch(g,d.get(g.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.cle
ar(this.id+"_open")}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(h,g){this.parent(h,g);this.classPrefix="mceNativeListBox"},setDisabled:function(g){d.get(this.id).disabled=g;this.setAriaProperty("disabled",g)},isDisabled:function(){return d.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){d.get(this.id).selectedIndex=g+1;this.selectedValue=this.items[g]?this.items[g].value:null},add:function(k,h,g){var j,i=this;g=g||{};g.value=h;if(i.isRendered()){d.add(d.get(this.id),"option",g,k)}j={title:k,value:h,attribs:g};i.items.push(j);i.onAdd.disp
atch(i,j)},getLength:function(){return this.items.length},renderHTML:function(){var i,g=this;i=d.createHTML("option",{value:""},"-- "+g.settings.title+" --");f(g.items,function(h){i+=d.createHTML("option",{value:h.value},h.title)});i=d.createHTML("select",{id:g.id,"class":"mceNativeListBox","aria-labelledby":g.id+"_aria"},i);i+=d.createHTML("span",{id:g.id+"_aria",style:"display: none"},g.settings.title);return i},postRender:function(){var h=this,i,j=true;h.rendered=true;function g(l){var k=h.items[l.target.selectedIndex-1];if(k&&(k=k.value)){h.onChange.dispatch(h,k);if(h.settings.onselect){h.settings.onselect(k)}}}b.add(h.id,"change",g);b.add(h.id,"keydown",function(q){var n,p=37,m=39,l=38,r=40,k=13,o=32;b.remove(h.id,"change",i);j=false;n=b.add(h.id,"blur",function(){if(j){return}j=true;b.add(h.id,"ch
ange",g);b.remove(h.id,"blur",n)});if(q.keyCode==k||q.keyCode==o){g(q);return b.cancel(q)}else{if(q.keyCode==r||q.keyCode==l){q.stopImmediatePropagation()}}});h.onPostRender.dispatch(h,d.get(h.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(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.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.firstChild.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},ren
derMenu: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(function(){f.hideMenu();f.focus()});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(g,f,e){this.parent(g,f,e);this.classPrefix=&qu
ot;mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+="<td >"+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",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"]},'<span style="displa
y:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span>');i+="<td >"+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.va
lue);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,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");a.clear(this.id)}})})(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(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=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"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.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,"mceSplit
ButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.firstChild.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.keyboardNav=new d.ui.KeyboardNavigation({root:f.id+"_menu",items:c.select("a",f.id+"_menu"),onCancel:function(){f.hideMenu();f.focus()}});f.keyboardNav.focus();f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){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","keyd
own",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch();f.keyboardNav.destroy()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(m){m=m.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");var i={href:"javascript:;",style:{backgroundColor:"#"+m},title:p.edito
r.getLang("colors."+m,m),"data-mce-color":"#"+m};if(!d.isIE){i.role="option"}g=c.add(g,"a",i);if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+m;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id
+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return false});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=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(){var f=this;f.parent();a.clear(f.id+"_menu");a.clear(f.id+"_more");c.remove(f.id+"_menu");if(f.keyboardNav){f.keyboardNav.destroy()}}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container"
;,{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('<div id="'+f.id+'" role="group" aria-labelledby="'+f.id+'_voice">');i.push("<span role='application'>");i.push('<span id="'+f.id+'_voice" class="mceVoiceLabel" style="display:none;">'+d.encode(g.name)+"</span>");j(e,function(h){i.push(h.renderHTML())});i.push("</span>");i.push("</div>");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(func
tion(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e<l.length;e++){k=l[e];d=l[e-1];g=l[e+1];if(e===0){j="mceToolbarStart";if(k.Button){j+=" mceToolbarStartButton"}else{if(k.SplitButton){j+=" mceToolbarStartSplitButton"}else{if(k.ListBox){j+=" mceToolbarStartListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,"<!-- IE -->"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,"<!-- IE -->"))}}if(c.stdMode){f+='<td style="position: relative">'+k.renderHTML()+"</td>"}else{f+="<td>"+k.renderHTML()+"</td>"}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c
.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,"<!-- IE -->"))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,"<!-- IE -->"));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},"<tbody><tr>"+f+"</tr></tbody>")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.url
s={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}i
f(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!==0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});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:fu
nction(x){var v=this,o,n=j.ScriptLoader,u,l=[],r;function q(t){var s=t.id;if(!s){s=t.name;if(s&&!k.get(s)){s=t.name}else{s=k.uniqueId()}t.setAttribute("id",s)}return s}function m(z,A,t){var y=z[A];if(!y){return}if(j.is(y,"string")){t=y.replace(/\.\w+$/,"");t=t?j.resolve(t):0;y=j.resolve(y)}return y.apply(t||this,Array.prototype.slice.call(arguments,2))}function p(t,s){return s.constructor===RegExp?s.test(t.className):k.hasClass(t,s)}v.settings=x;i.bind(window,"ready",function(){var s,t;m(x,"onpageload");switch(x.mode){case"exact":s=x.elements||"";if(s.length>0){g(e(s),function(y){if(k.get(y)){r=new j.Editor(y,x);l.push(r);r.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;k.setAttrib(A,"id",y);r=new j.Editor(y,x);l.push(r);r.render(1)}})})}})}break;case"textareas":case"specific_textareas":g(k.select("text
area"),function(y){if(x.editor_deselector&&p(y,x.editor_deselector)){return}if(!x.editor_selector||p(y,x.editor_selector)){r=new j.Editor(q(y),x);l.push(r);r.render(1)}});break;default:if(x.types){g(x.types,function(y){g(k.select(y.selector),function(A){var z=new j.Editor(q(A),j.extend({},x,y));l.push(z);z.render(1)})})}else{if(x.selector){g(k.select(x.selector),function(z){var y=new j.Editor(q(z),x);l.push(y);y.render(1)})}}}if(x.oninit){s=t=0;g(l,function(y){t++;if(!y.initialized){y.onInit.add(function(){s++;if(s==t){m(x,"oninit")}})}else{s++}if(s==t){m(x,"oninit")}})}})},get:function(l){if(l===a){return this.editors}if(!this.editors.hasOwnProperty(l)){return a}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;function m(){n.destroy();l.detachEvent("onunload",m);l=l.tinyMCE=l.tinymce=null}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&&!j.isIE11){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(k){var l=k.DOM,j=k.dom.Event,f=k.extend,i=k.each,a=k.isGecko,b=k.isIE,e=k.isWebKit,d=k.is,h=k.ThemeManager,c=k.PluginManager,g=k.explode;k.create("tinymce.Editor",{Editor:function(p,o){var m=this,n=true;m.settings=o=f({id:p,language:"en",theme:"advanced",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:k.documentBaseURL,add_form_submit_trigger:n,
submit_patch:n,add_unload_trigger:n,convert_urls:n,relative_urls:n,remove_script_host:n,table_inline_editing:false,object_resizing:n,accessibility_focus:n,doctype:k.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",visual:n,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:n,directionality:"ltr",forced_root_block:"p",hidden_input:n,padd_empty_editor:n,render_ui:n,indentation:"30px",fix_table_elements:n,inline_styles:n,convert_fonts_to_spans:n,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,ta
ble,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:n,entity_encoding:"named",url_converter:m.convertURL,url_converter_scope:m,ie7_compat:n},o);m.id=m.editorId=p;m.isNotDirty=false;m.plugins={};m.documentBaseURI=new k.util.URI(o.document_base_url||k.documentBaseURL,{base_uri:tinyMCE.baseURI});m.baseURI=k.baseURI;m.contentCSS=[];m.contentStyles=[];m.setupEvents();m.execCommands={};m.queryStateCommands={};m.queryValueCommands={};m.execCallback("setup",m)},render:function(o){var p=this,q=p.settings,r=p.id,m=k.ScriptLoader;if(!j.domLoaded){j.add(window,"ready",function(){p.render()});return}tinyMCE.settings=q;if(!p.getElement()){return}if(k.isIDevice&&!k.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(p.getElement().nodeName)&&q.hidden_input&&l.getParent(r,"form")){l.insertAfter(l.create("input",{type:"hidden",name:r}),r)}if(!q.content_editable){p.orgVisibility=
p.getElement().style.visibility;p.getElement().style.visibility="hidden"}if(k.WindowManager){p.windowManager=new k.WindowManager(p)}if(q.encoding=="xml"){p.onGetContent.add(function(s,t){if(t.save){t.content=l.encode(t.content)}})}if(q.add_form_submit_trigger){p.onSubmit.addToTop(function(){if(p.initialized){p.save();p.isNotDirty=1}})}if(q.add_unload_trigger){p._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(p.initialized&&!p.destroyed&&!p.isHidden()){p.save({format:"raw",no_events:true})}})}k.addUnload(p.destroy,p);if(q.submit_patch){p.onBeforeRenderUI.add(function(){var s=p.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){p.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){k.triggerSave();p.isNotDirty=1;return p.formElement._mceOldSubmit(p.formElement)}}s=null})}function n(){if(q.language&&q.language_load!==false){m.add(k.baseURL+"/langs/"+q.la
nguage+".js")}if(q.theme&&typeof q.theme!="function"&&q.theme.charAt(0)!="-"&&!h.urls[q.theme]){h.load(q.theme,"themes/"+q.theme+"/editor_template"+k.suffix+".js")}i(g(q.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(v){var u={prefix:"plugins/",resource:v,suffix:"/editor_plugin"+k.suffix+".js"};v=c.createUrl(u,v);c.load(v.resource,v)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+k.suffix+".js"})}}});m.loadQueue(function(){if(!p.removed){p.init()}})}n()},init:function(){var q,G=this,H=G.settings,D,y,z,C=G.getElement(),p,m,E,v,B,F,x,r=[];k.add(G);H.aria_label=H.aria_label||l.getAttrib(C,"aria-label",G.getLang("aria.rich_text_area"));if(H.theme){if(typeof H.theme!="function&
quot;){H.theme=H.theme.replace(/-/,"");p=h.get(H.theme);G.theme=new p();if(G.theme.init){G.theme.init(G,h.urls[H.theme]||k.documentBaseURL.replace(/\/$/,""))}}else{G.theme=H.theme}}function A(s){var t=c.get(s),o=c.urls[s]||k.documentBaseURL.replace(/\/$/,""),n;if(t&&k.inArray(r,s)===-1){i(c.dependencies(s),function(u){A(u)});n=new t(G,o);G.plugins[s]=n;if(n.init){n.init(G,o);r.push(s)}}}i(g(H.plugins.replace(/\-/g,"")),A);if(H.popup_css!==false){if(H.popup_css){H.popup_css=G.documentBaseURI.toAbsolute(H.popup_css)}else{H.popup_css=G.baseURI.toAbsolute("themes/"+H.theme+"/skins/"+H.skin+"/dialog.css")}}if(H.popup_css_add){H.popup_css+=","+G.documentBaseURI.toAbsolute(H.popup_css_add)}G.controlManager=new k.ControlManager(G);G.onBeforeRenderUI.dispatch(G,G.controlManager);if(H.render_ui&&G.theme){G.orgDisplay=C.style.display;if(typeof H.theme!="function"){D=H.width||C.style.width|
|C.offsetWidth;y=H.height||C.style.height||C.offsetHeight;z=H.min_height||100;F=/^[0-9\.]+(|px)$/i;if(F.test(""+D)){D=Math.max(parseInt(D,10)+(p.deltaWidth||0),100)}if(F.test(""+y)){y=Math.max(parseInt(y,10)+(p.deltaHeight||0),z)}p=G.theme.renderUI({targetNode:C,width:D,height:y,deltaWidth:H.delta_width,deltaHeight:H.delta_height});l.setStyles(p.sizeContainer||p.editorContainer,{width:D,height:y});y=(p.iframeHeight||y)+(typeof(y)=="number"?(p.deltaHeight||0):"");if(y<z){y=z}}else{p=H.theme(G,C);if(p.editorContainer.nodeType){p.editorContainer=p.editorContainer.id=p.editorContainer.id||G.id+"_parent"}if(p.iframeContainer.nodeType){p.iframeContainer=p.iframeContainer.id=p.iframeContainer.id||G.id+"_iframecontainer"}y=p.iframeHeight||C.offsetHeight;if(b){G.onInit.add(function(n){n.dom.bind(n.getBody(),"beforedeactivate keydown keyup",function(){n.bookmark=n.selection.getBookmark(1)})});G.onNodeChange.add(function(
n){if(document.activeElement.id==n.id+"_ifr"){n.bookmark=n.selection.getBookmark(1)}})}}G.editorContainer=p.editorContainer}if(H.content_css){i(g(H.content_css),function(n){G.contentCSS.push(G.documentBaseURI.toAbsolute(n))})}if(H.content_style){G.contentStyles.push(H.content_style)}if(H.content_editable){C=q=p=null;return G.initContentBody()}if(document.domain&&location.hostname!=document.domain){k.relaxedDomain=document.domain}G.iframeHTML=H.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(H.document_base_url!=k.documentBaseURL){G.iframeHTML+='<base href="'+G.documentBaseURI.getURI()+'" />'}if(k.isIE8){if(H.ie7_compat){G.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'}else{G.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=edge" />'}}G.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8&
quot; />';for(x=0;x<G.contentCSS.length;x++){G.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+G.contentCSS[x]+'" />'}G.contentCSS=[];v=H.body_id||"tinymce";if(v.indexOf("=")!=-1){v=G.getParam("body_id","","hash");v=v[G.id]||v}B=H.body_class||"";if(B.indexOf("=")!=-1){B=G.getParam("body_class","","hash");B=B[G.id]||""}G.iframeHTML+='</head><body id="'+v+'" class="mceContentBody '+B+'" onload="window.parent.tinyMCE.get(\''+G.id+"').onLoad.dispatch();\"><br></body></html>";if(k.relaxedDomain&&(b||(k.isOpera&&parseFloat(opera.version())<11))){E='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+G.id+'");document.write(ed.iframeHTML);document.close();ed.i
nitContentBody();})()'}q=l.add(p.iframeContainer,"iframe",{id:G.id+"_ifr",src:E||'javascript:""',frameBorder:"0",allowTransparency:"true",title:H.aria_label,style:{width:"100%",height:y,display:"block"}});G.contentAreaContainer=p.iframeContainer;if(p.editorContainer){l.get(p.editorContainer).style.display=G.orgDisplay}C.style.visibility=G.orgVisibility;l.get(G.id).style.display="none";l.setAttrib(G.id,"aria-hidden",true);if(!k.relaxedDomain||!E){G.initContentBody()}C=q=p=null},initContentBody:function(){var n=this,p=n.settings,q=l.get(n.id),r=n.getDoc(),o,m,s;if((!b||!k.relaxedDomain)&&!p.content_editable){r.open();r.write(n.iframeHTML);r.close();if(k.relaxedDomain){r.domain=k.relaxedDomain}}if(p.content_editable){l.addClass(q,"mceContentBody");n.contentDocument=r=p.content_document||document;n.contentWindow=p.content_window||window;n.bodyElement=q;p.content_document=p.content
_window=null}m=n.getBody();m.disabled=true;if(!p.readonly){m.contentEditable=n.getParam("content_editable_state",true)}m.disabled=false;n.schema=new k.html.Schema(p);n.dom=new k.dom.DOMUtils(r,{keep_values:true,url_converter:n.convertURL,url_converter_scope:n,hex_colors:p.force_hex_style_colors,class_filter:p.class_filter,update_styles:true,root_element:p.content_editable?n.id:null,schema:n.schema});n.parser=new k.html.DomParser(p,n.schema);n.parser.addAttributeFilter("src,href,style",function(t,u){var v=t.length,y,A=n.dom,z,x;while(v--){y=t[v];z=y.attr(u);x="data-mce-"+u;if(!y.attributes.map[x]){if(u==="style"){y.attr(x,A.serializeStyle(A.parseStyle(z),y.name))}else{y.attr(x,n.convertURL(z,u,y.name))}}}});n.parser.addNodeFilter("script",function(t,u){var v=t.length,x;while(v--){x=t[v];x.attr("type","mce-"+(x.attr("type")||"text/javascript"))}});n.parser.addNodeFilter("#cdata",functio
n(t,u){var v=t.length,x;while(v--){x=t[v];x.type=8;x.name="#comment";x.value="[CDATA["+x.value+"]]"}});n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(u,v){var x=u.length,y,t=n.schema.getNonEmptyElements();while(x--){y=u[x];if(y.isEmpty(t)){y.empty().append(new k.html.Node("br",1)).shortEnded=true}}});n.serializer=new k.dom.Serializer(p,n.dom,n.schema);n.selection=new k.dom.Selection(n.dom,n.getWin(),n.serializer,n);n.formatter=new k.Formatter(n);n.undoManager=new k.UndoManager(n);n.forceBlocks=new k.ForceBlocks(n);n.enterKey=new k.EnterKey(n);n.editorCommands=new k.EditorCommands(n);n.onExecCommand.add(function(t,u){if(!/^(FontName|FontSize)$/.test(u)){n.nodeChanged()}});n.serializer.onPreProcess.add(function(t,u){return n.onPreProcess.dispatch(n,u,t)});n.serializer.onPostProcess.add(function(t,u){return n.onPostProcess.dispatch(n,u,t)});n.onPreInit.dispatch(n);if(!p.browser_spellcheck&&!p.gecko_spellcheck){r.body.
spellcheck=false}if(!p.readonly){n.bindNativeEvents()}n.controlManager.onPostRender.dispatch(n,n.controlManager);n.onPostRender.dispatch(n);n.quirks=k.util.Quirks(n);if(p.directionality){m.dir=p.directionality}if(p.nowrap){m.style.whiteSpace="nowrap"}if(p.protect){n.onBeforeSetContent.add(function(t,u){i(p.protect,function(v){u.content=u.content.replace(v,function(x){return"<!--mce:protected "+escape(x)+"-->"})})})}n.onSetContent.add(function(){n.addVisual(n.getBody())});if(p.padd_empty_editor){n.onPostProcess.add(function(t,u){u.content=u.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}n.load({initial:true,format:"html"});n.startContent=n.getContent({format:"raw"});n.initialized=true;n.onInit.dispatch(n);n.execCallback("setupcontent_callback",n.id,m,r);n.execCallback("init_instance_callback",n);n.focus(true);n.nodeChanged({init
ial:true});if(n.contentStyles.length>0){s="";i(n.contentStyles,function(t){s+=t+"\r\n"});n.dom.addStyle(s)}i(n.contentCSS,function(t){n.dom.loadCSS(t)});if(p.auto_focus){setTimeout(function(){var t=k.get(p.auto_focus);t.selection.select(t.getBody(),1);t.selection.collapse(1);t.getBody().focus();t.getWin().focus()},100)}q=r=m=null},focus:function(p){var o,u=this,t=u.selection,q=u.settings.content_editable,n,r,s=u.getDoc(),m;if(!p){if(u.bookmark){t.moveToBookmark(u.bookmark);u.bookmark=null}n=t.getRng();if(n.item){r=n.item(0)}u._refreshContentEditable();if(!q){u.getWin().focus()}if(k.isGecko||q){m=u.getBody();if(m.setActive&&!k.isIE11){m.setActive()}else{m.focus()}if(q){t.normalize()}}if(r&&r.ownerDocument==s){n=s.body.createControlRange();n.addElement(r);n.select()}}if(k.activeEditor!=u){if((o=k.activeEditor)!=null){o.onDeactivate.dispatch(o,u)}u.onActivate.dispatch(u,o)}k._setActive(u)},execCallback:function(q){var m=this,p=m.settings[q],o;if(!
p){return}if(m.callbackLookup&&(o=m.callbackLookup[q])){p=o.func;o=o.scope}if(d(p,"string")){o=p.replace(/\.\w+$/,"");o=o?k.resolve(o):0;p=k.resolve(p);m.callbackLookup=m.callbackLookup||{};m.callbackLookup[q]={func:p,scope:o}}return p.apply(o||m,Array.prototype.slice.call(arguments,1))},translate:function(m){var o=this.settings.language||"en",n=k.i18n;if(!m){return""}return n[o+"."+m]||m.replace(/\{\#([^\}]+)\}/g,function(q,p){return n[o+"."+p]||"{#"+p+"}"})},getLang:function(o,m){return k.i18n[(this.settings.language||"en")+"."+o]||(d(m)?m:"{#"+o+"}")},getParam:function(t,q,m){var r=k.trim,p=d(this.settings[t])?this.settings[t]:q,s;if(m==="hash"){s={};if(d(p,"string")){i(p.indexOf("=")>0?p.split(/[;,](?![^=;,]*(?:[;,]|$))/):p.split(","),function(n){n=n.split("=");if(n.length>1){s[r(n[0])]=r(n[1])}els
e{s[r(n[0])]=r(n)}})}else{s=p}return s}return p},nodeChanged:function(q){var m=this,n=m.selection,p;if(m.initialized){q=q||{};p=n.getStart()||m.getBody();p=b&&p.ownerDocument!=m.getDoc()?m.getBody():p;q.parents=[];m.dom.getParent(p,function(o){if(o.nodeName=="BODY"){return true}q.parents.push(o)});m.onNodeChange.dispatch(m,q?q.controlManager||m.controlManager:m.controlManager,p,n.isCollapsed(),q)}},addButton:function(n,o){var m=this;m.buttons=m.buttons||{};m.buttons[n]=o},addCommand:function(m,o,n){this.execCommands[m]={func:o,scope:n||this}},addQueryStateHandler:function(m,o,n){this.queryStateCommands[m]={func:o,scope:n||this}},addQueryValueHandler:function(m,o,n){this.queryValueCommands[m]={func:o,scope:n||this}},addShortcut:function(o,q,m,p){var n=this,r;if(n.settings.custom_shortcuts===false){return false}n.shortcuts=n.shortcuts||{};if(d(m,"string")){r=m;m=function(){n.execCommand(r,false,null)}}if(d(m,"object")){r=m;m=function(){n.execComma
nd(r[0],r[1],r[2])}}i(g(o),function(s){var t={func:m,scope:p||this,desc:n.translate(q),alt:false,ctrl:false,shift:false};i(g(s,"+"),function(u){switch(u){case"alt":case"ctrl":case"shift":t[u]=true;break;default:t.charCode=u.charCodeAt(0);t.keyCode=u.toUpperCase().charCodeAt(0)}});n.shortcuts[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t});return true},execCommand:function(u,r,x,m){var p=this,q=0,v,n;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(u)&&(!m||!m.skip_focus)){p.focus()}m=f({},m);p.onBeforeExecCommand.dispatch(p,u,r,x,m);if(m.terminate){return false}if(p.execCallback("execcommand_callback",p.id,p.selection.getNode(),u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(v=p.execCommands[u]){n=v.func.call(v.scope,r,x);if(n!==true){p.onExecCommand.disp
atch(p,u,r,x,m);return n}}i(p.plugins,function(o){if(o.execCommand&&o.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);q=1;return false}});if(q){return true}if(p.theme&&p.theme.execCommand&&p.theme.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(p.editorCommands.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}p.getDoc().execCommand(u,r,x);p.onExecCommand.dispatch(p,u,r,x,m)},queryCommandState:function(q){var n=this,r,p;if(n._isHidden()){return}if(r=n.queryStateCommands[q]){p=r.func.call(r.scope);if(p!==true){return p}}r=n.editorCommands.queryCommandState(q);if(r!==-1){return r}try{return this.getDoc().queryCommandState(q)}catch(m){}},queryCommandValue:function(r){var n=this,q,p;if(n._isHidden()){return}if(q=n.queryValueCommands[r]){p=q.func.call(q.scope);if(p!==true){return p}}q=n.editorCommands.queryCommandValue(r);if(d(q)){return q}try{return this.getDoc().queryCommandValue(r)}catch(m){}},show:function(){var
m=this;l.show(m.getContainer());l.hide(m.id);m.load()},hide:function(){var m=this,n=m.getDoc();if(b&&n){n.execCommand("SelectAll")}m.save();l.hide(m.getContainer());l.setStyle(m.id,"display",m.orgDisplay)},isHidden:function(){return !l.isHidden(this.id)},setProgressState:function(m,n,p){this.onSetProgressState.dispatch(this,m,n,p);return m},load:function(q){var m=this,p=m.getElement(),n;if(p){q=q||{};q.load=true;n=m.setContent(d(p.value)?p.value:p.innerHTML,q);q.element=p;if(!q.no_events){m.onLoadContent.dispatch(m,q)}q.element=p=null;return n}},save:function(r){var m=this,q=m.getElement(),n,p;if(!q||!m.initialized){return}r=r||{};r.save=true;r.element=q;n=r.content=m.getContent(r);if(!r.no_events){m.onSaveContent.dispatch(m,r)}n=r.content;if(!/TEXTAREA|INPUT/i.test(q.nodeName)){q.innerHTML=n;if(p=l.getParent(m.id,"form")){i(p.elements,function(o){if(o.name==m.id){o.value=n;return false}})}}else{q.value=n}r.element=q=null;return n},setContent:f
unction(r,p){var o=this,n,m=o.getBody(),q;p=p||{};p.format=p.format||"html";p.set=true;p.content=r;if(!p.no_events){o.onBeforeSetContent.dispatch(o,p)}r=p.content;if(!k.isIE&&(r.length===0||/^\s+$/.test(r))){q=o.settings.forced_root_block;if(q){r="<"+q+'><br data-mce-bogus="1"></'+q+">"}else{r='<br data-mce-bogus="1">'}m.innerHTML=r;o.selection.select(m,true);o.selection.collapse(true);return}if(p.format!=="raw"){r=new k.html.Serializer({},o.schema).serialize(o.parser.parse(r))}p.content=k.trim(r);o.dom.setHTML(m,p.content);if(!p.no_events){o.onSetContent.dispatch(o,p)}if(!o.settings.content_editable||document.activeElement===o.getBody()){o.selection.normalize()}return p.content},getContent:function(o){var n=this,p,m=n.getBody();o=o||{};o.format=o.format||"html";o.get=true;o.getInner=true;if(!o.no_events){n.onBeforeGetContent.dispatch(n,o)}if(o.format=="raw"){p=m.innerHTML
}else{if(o.format=="text"){p=m.innerText||m.textContent}else{p=n.serializer.serialize(m,o)}}if(o.format!="text"){o.content=k.trim(p)}else{o.content=p}if(!o.no_events){n.onGetContent.dispatch(n,o)}return o.content},isDirty:function(){var m=this;return k.trim(m.startContent)!=k.trim(m.getContent({format:"raw",no_events:1}))&&!m.isNotDirty},getContainer:function(){var m=this;if(!m.container){m.container=l.get(m.editorContainer||m.id+"_parent")}return m.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return l.get(this.settings.content_element||this.id)},getWin:function(){var m=this,n;if(!m.contentWindow){n=l.get(m.id+"_ifr");if(n){m.contentWindow=n.contentWindow}}return m.contentWindow},getDoc:function(){var m=this,n;if(!m.contentDocument){n=m.getWin();if(n){m.contentDocument=n.document}}return m.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},
convertURL:function(o,n,q){var m=this,p=m.settings;if(p.urlconverter_callback){return m.execCallback("urlconverter_callback",o,q,true,n)}if(!p.convert_urls||(q&&q.nodeName=="LINK")||o.indexOf("file:")===0){return o}if(p.relative_urls){return m.documentBaseURI.toRelative(o)}o=m.documentBaseURI.toAbsolute(o,p.remove_script_host);return o},addVisual:function(q){var n=this,o=n.settings,p=n.dom,m;q=q||n.getBody();if(!d(n.hasVisual)){n.hasVisual=o.visual}i(p.select("table,a",q),function(s){var r;switch(s.nodeName){case"TABLE":m=o.visual_table_class||"mceItemTable";r=p.getAttrib(s,"border");if(!r||r=="0"){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return;case"A":if(!p.getAttrib(s,"href",false)){r=p.getAttrib(s,"name")||s.id;m="mceItemAnchor";if(r){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}}return}});n.onVisualAid.dispatch(n,q,n.hasVisu
al)},remove:function(){var m=this,o=m.getContainer(),n=m.getDoc();if(!m.removed){m.removed=1;if(b&&n){n.execCommand("SelectAll")}m.save();l.setStyle(m.id,"display",m.orgDisplay);if(!m.settings.content_editable){j.unbind(m.getWin());j.unbind(m.getDoc())}j.unbind(m.getBody());j.clear(o);m.execCallback("remove_instance_callback",m);m.onRemove.dispatch(m);m.onExecCommand.listeners=[];k.remove(m);l.remove(o)}},destroy:function(n){var m=this;if(m.destroyed){return}if(a){j.unbind(m.getDoc());j.unbind(m.getWin());j.unbind(m.getBody())}if(!n){k.removeUnload(m.destroy);tinyMCE.onBeforeUnload.remove(m._beforeUnload);if(m.theme&&m.theme.destroy){m.theme.destroy()}m.controlManager.destroy();m.selection.destroy();m.dom.destroy()}if(m.formElement){m.formElement.submit=m.formElement._mceOldSubmit;m.formElement._mceOldSubmit=null}m.contentAreaContainer=m.formElement=m.container=m.settings.content_element=m.bodyElement=m.contentDocument=m.contentWindow=nu
ll;if(m.selection){m.selection=m.selection.win=m.selection.dom=m.selection.dom.doc=null}m.destroyed=1},_refreshContentEditable:function(){var n=this,m,o;if(n._isHidden()){m=n.getBody();o=m.parentNode;o.removeChild(m);o.appendChild(m);m.focus()}},_isHidden:function(){var m;if(!a){return 0}m=this.selection.getSel();return(!m||!m.rangeCount||m.rangeCount===0)}})})(tinymce);(function(a){var b=a.each;a.Editor.prototype.setupEvents=function(){var c=this,d=c.settings;b(["onPreInit","onBeforeRenderUI","onPostRender","onLoad","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent",&qu
ot;onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState","onSetAttrib"],function(e){c[e]=new a.util.Dispatcher(c)});if(d.cleanup_callback){c.onBeforeSetContent.add(function(e,f){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)});c.onPreProcess.add(function(e,f){if(f.set){e.execCallback("cleanup_callback","insert_to_editor_dom",f.node,f)}if(f.get){e.execCallback("cleanup_callback","get_from_editor_dom",f.node,f)}});c.onPostProcess.add(function(e,f){if(f.set){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)}if(f.get){f.content=e.execCallback("cleanup_callback","ge
t_from_editor",f.content,f)}})}if(d.save_callback){c.onGetContent.add(function(e,f){if(f.save){f.content=e.execCallback("save_callback",e.id,f.content,e.getBody())}})}if(d.handle_event_callback){c.onEvent.add(function(f,g,h){if(c.execCallback("handle_event_callback",g,f,h)===false){g.preventDefault();g.stopPropagation()}})}if(d.handle_node_change_callback){c.onNodeChange.add(function(f,e,g){f.execCallback("handle_node_change_callback",f.id,g,-1,-1,true,f.selection.isCollapsed())})}if(d.save_callback){c.onSaveContent.add(function(e,g){var f=e.execCallback("save_callback",e.id,g.content,e.getBody());if(f){g.content=f}})}if(d.onchange_callback){c.onChange.add(function(f,e){f.execCallback("onchange_callback",f,e)})}};a.Editor.prototype.bindNativeEvents=function(){var l=this,f,d=l.settings,e=l.dom,h;h={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onK
eyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function c(i,m){var n=i.type;if(l.removed){return}if(l.onEvent.dispatch(l,i,m)!==false){l[h[i.fakeType||i.type]].dispatch(l,i,m)}}function j(i){l.focus(true)}function k(i,m){if(m.keyCode!=65||!a.VK.metaKeyPressed(m)){l.selection.normalize()}l.nodeChanged()}b(h,function(m,n){var i=d.content_editable?l.getBody():l.getDoc();switch(n){case"contextmenu":e.bind(i,n,c);break;case"paste":e.bind(l.getBody(),n,c);break;case"submit":case"reset":e.bind(l.getElement().form||a.DOM.getParent(l.id,"form"),n,c);break;default:e.bind(i,n,c)}});e.bind(d.content_editable?l.getBody():(a.isGecko?l.getDoc():l.getWin()),"focus",function(i){l.focus(true)});if(d.content_editable&&a.isOpera){e.bind(l.getBody(),"click",j);e.bind(l.getBody(),&
quot;keydown",j)}l.onMouseUp.add(k);l.onKeyUp.add(function(i,n){var m=n.keyCode;if((m>=33&&m<=36)||(m>=37&&m<=40)||m==13||m==45||m==46||m==8||(a.isMac&&(m==91||m==93))||n.ctrlKey){k(i,n)}});l.onReset.add(function(){l.setContent(l.startContent,{format:"raw"})});function g(m,i){if(m.altKey||m.ctrlKey||m.metaKey){b(l.shortcuts,function(n){var o=a.isMac?m.metaKey:m.ctrlKey;if(n.ctrl!=o||n.alt!=m.altKey||n.shift!=m.shiftKey){return}if(m.keyCode==n.keyCode||(m.charCode&&m.charCode==n.charCode)){m.preventDefault();if(i){n.func.call(n.scope)}return true}})}}l.onKeyUp.add(function(i,m){g(m)});l.onKeyPress.add(function(i,m){g(m)});l.onKeyDown.add(function(i,m){g(m,true)});if(a.isOpera){l.onClick.add(function(i,m){m.preventDefault()})}}})(tinymce);(function(d){var e=d.each,b,a=true,c=false;d.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowe
rCase();if(v=j.exec[z]){v(z,y,x);return a}return c}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return c}function u(v,x){x=x||"exec";e(v,function(z,y){e(y.toLowerCase().split(","),function(A){j[x][A]=z})})}d.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===b){x=c}if(v===b){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:b)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(d.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("h
ttp://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(c)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);e("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=d.explode(k.font_size_style_values);v=d.explode(k.font_size_clas
ses);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return c}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new d.html.Serializer({},n.schema);v='<span id="mce_marker" data-mce-type="bookmark">\uFEFF</span>';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p
.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=p.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.y<L.y)||(C.x>L.x+L.w||C.x<L.x)){H=d.isIE?n.getDoc().documentElement:n.ge
tBody();H.scrollLeft=C.x;H.scrollTop=C.y-L.h+25}x=m.createRng();A=D.previousSibling;if(A&&A.nodeType==3){x.setStart(A,A.nodeValue.length)}else{x.setStartBefore(D);x.setEndBefore(D)}m.remove(D);p.setRng(x);p.onSetContent.dispatch(p,G);n.addVisual()},mceInsertRawHTML:function(y,x,v){p.setContent("tiny_mce_marker");n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return v}))},mceToggleFormat:function(y,x,v){s(v)},mceSetContent:function(y,x,v){n.setContent(v)},"Indent,Outdent":function(z){var x,v,y;x=k.indentation;v=/[a-z%]+$/i.exec(x);x=parseInt(x);if(!l("InsertUnorderedList")&&!l("InsertOrderedList")){if(!k.forced_root_block&&!m.getParent(p.getNode(),m.isBlock)){q.apply("div")}e(p.getSelectedBlocks(),function(A){if(z=="outdent"){y=Math.max(0,parseInt(A.style.paddingLeft||0)-x);m.setStyle(A,"paddingLeft",y?y+v:"")}else{m.setStyle(A,"paddingLeft",(parseInt(A
.style.paddingLeft||0)+x)+v)}})}else{f(z)}},mceRepaint:function(){var x;if(d.isGecko){try{i(a);if(p.getSel()){p.getSel().selectAllChildren(n.getBody())}p.collapse(a);g()}catch(v){}}},mceToggleFormat:function(y,x,v){q.toggle(v)},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",false,"<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();if(p.getRng().setStart){v.setStart(x,0);v.setEnd(x,x.childNodes.length);p.setRng(v)}else{f("SelectAll")}}});u(
{"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(z){var x="align"+z.substring(7);var v=p.isCollapsed()?[m.getParent(p.getNode(),m.isBlock)]:p.getSelectedBlocks();var y=d.map(v,function(A){return !!q.matchNode(A,x)});return d.inArray(y,a)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(x){var v=m.getParent(p.getNode(),"ul,ol");return v&&(x==="insertunorderedlist"&&
amp;v.tagName==="UL"||x==="insertorderedlist"&&v.tagName==="OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(h){var l,i=0,e=[],g,k,j,f;function c(){return b.trim(h.getContent({format:"raw",no_events:1}).replace(/<span[^>]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g,""))}function d(){l.typing=false;l.add()}onBeforeAdd=new a(l);k=new a(l);j=new a(l);f=new a(l);k.add(function(m,n){if(m.hasUndo()){return h.onChange.dispatch(h,n,m)}});j.add(function(m,n){return h.onUndo.dispatch(h,n,m)});f.add(function
(m,n){return h.onRedo.dispatch(h,n,m)});h.onInit.add(function(){l.add()});h.onBeforeExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.beforeChange()}});h.onExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.add()}});h.onSaveContent.add(d);h.dom.bind(h.dom.getRoot(),"dragend",d);h.dom.bind(h.getBody(),"focusout",function(m){if(!h.removed&&l.typing){d()}});h.onKeyUp.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45||n==13||o.ctrlKey){d()}});h.onKeyDown.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45){if(l.typing){d()}return}if((n<16||n>20)&&n!=224&&n!=91&&!l.typing){l.beforeChange();l.typing=true;l.add()}});h.onMouseDo
wn.add(function(m,n){if(l.typing){d()}});h.addShortcut("ctrl+z","undo_desc","Undo");h.addShortcut("ctrl+y","redo_desc","Redo");l={data:e,typing:false,onBeforeAdd:onBeforeAdd,onAdd:k,onUndo:j,onRedo:f,beforeChange:function(){g=h.selection.getBookmark(2,true)},add:function(p){var m,n=h.settings,o;p=p||{};p.content=c();l.onBeforeAdd.dispatch(l,p);o=e[i];if(o&&o.content==p.content){return null}if(e[i]){e[i].beforeBookmark=g}if(n.custom_undo_redo_levels){if(e.length>n.custom_undo_redo_levels){for(m=0;m<e.length-1;m++){e[m]=e[m+1]}e.length--;i=e.length}}p.bookmark=h.selection.getBookmark(2,true);if(i<e.length-1){e.length=i+1}e.push(p);i=e.length-1;l.onAdd.dispatch(l,p);h.isNotDirty=0;return p},undo:function(){var n,m;if(l.typing){l.add();l.typing=false}if(i>0){n=e[--i];h.setContent(n.content,{format:"raw"});h.selection.moveToBookmark(n.beforeBookmark);l.onUndo.dispatch(l,n)}return n},redo:function(){
var m;if(i<e.length-1){m=e[++i];h.setContent(m.content,{format:"raw"});h.selection.moveToBookmark(m.bookmark);l.onRedo.dispatch(l,m)}return m},clear:function(){e=[];i=0;l.typing=false},hasUndo:function(){return i>0||this.typing},hasRedo:function(){return i<e.length-1&&!this.typing}};return l}})(tinymce);tinymce.ForceBlocks=function(c){var b=c.settings,e=c.dom,a=c.selection,d=c.schema.getBlockElements();function f(){var j=a.getStart(),h=c.getBody(),g,k,o,s,q,i,l,m=-16777215,p,r;if(!j||j.nodeType!==1||!b.forced_root_block){return}while(j&&j!=h){if(d[j.nodeName]){return}j=j.parentNode}g=a.getRng();if(g.setStart){k=g.startContainer;o=g.startOffset;s=g.endContainer;q=g.endOffset}else{if(g.item){j=g.item(0);g=c.getDoc().body.createTextRange();g.moveToElementText(j)}r=g.parentElement().ownerDocument===c.getDoc();tmpRng=g.duplicate();tmpRng.collapse(true);o=tmpRng.move("character",m)*-1;if(!tmpRng.collapsed){tmpRng=g.duplicate();tmpRng.collapse(f
alse);q=(tmpRng.move("character",m)*-1)-o}}j=h.firstChild;while(j){if(j.nodeType===3||(j.nodeType==1&&!d[j.nodeName])){if(j.nodeType===3&&j.nodeValue.length==0){l=j;j=j.nextSibling;e.remove(l);continue}if(!i){i=e.create(b.forced_root_block);j.parentNode.insertBefore(i,j);p=true}l=j;j=j.nextSibling;i.appendChild(l)}else{i=null;j=j.nextSibling}}if(p){if(g.setStart){g.setStart(k,o);g.setEnd(s,q);a.setRng(g)}else{if(r){try{g=c.getDoc().body.createTextRange();g.moveToElementText(h);g.collapse(true);g.moveStart("character",o);if(q>0){g.moveEnd("character",q)}g.select()}catch(n){}}}c.nodeChanged()}}if(b.forced_root_block){c.onKeyUp.add(f);c.onNodeChange.add(f)}};(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+"_&
quot;;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(j){var o,k,g,h=this,m=h.editor,n,f;if(!h.controlFactories){h.controlFactories=[];d(m.plugins,function(i){if(i.createControl){h.controlFactories.push(i)}})}n=h.controlFactories;for(k=0,g=n.length;k<g;k++){o=n[k].createControl(j,h);if(o){return h.add(o)}}if(j==="|"||j==="separator"){return h.createSeparator()}if(m.buttons&&(o=m.buttons[j])){return h.createButton(j,o)}return h.add(o)},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[&
quot;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)}n["class"]+=i.settings.directionality=="rtl"?" mceRtl":"";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(f,n,h){var l=this,j=l.editor,i,k,m;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;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,scope:n.scope,control_manager:l},n);f=l.prefix+f;function g(o){return o.settings.use_accessible_selects&&!c.isGecko}if(j.settings.use_native_selects||g(j)){k=new c.ui.NativeListBox(f,n)}else{m=h||l._cls.listbox||c.ui.ListBox;k=new m(f,n,j)}l.controls[f]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){j.bookmark=j.selection.getBookmark(1)});a.add(o,"focus",function(){j.selection.moveToBookmark(j.bookmark);j.bookmark=null})})}if(k.hideMenu){j.onMouseDown.add(k.hideMenu,k)}return l.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.getLa
ng("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);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i,g)}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));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.s
cope||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);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,g.editor);if(g.get(k)){return null}return g.add(i)},createToolbarGroup:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||this._cls.toolbarGroup||c.ui.ToolbarGroup;i=new f(k,h,g
.editor);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_foc
us=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){a.Formatter=function(aa){var Q={},T=a.each,c=aa.dom,r=aa.selection,t=a.dom.TreeWalker,N=new a.dom.RangeUtils(c),d=aa.schema.isValidChild,A=a.isArray,H=c.isBlock,m=aa.settings.forced_root_block,s=c.nodeIndex,G="\uFEFF",e=/^(src|href|style)$/,X=false,C=true,P,D,x=c.getContentEditable;function I(ab){if(ab.nodeType){ab=ab.nodeName}return !!aa.schema.getTextBlockElements()[ab.toLowerCase()]}function n(ac,ab){return c.getParents(ac,ab,c.getRoot())}function b(ab){return ab.nodeType===1&&ab.id==="_mce_caret"}function j(){l({alignleft:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,d
iv,ul,ol,li",styles:{textAlign:"center"},defaultBlock:"div"},{selector:"img",collapsed:false,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:false,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"right"}}],alignfull:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"},defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"it
alic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:false},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:false},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},link:{inline:"a",selector:"a",remove:"all",
split:true,deep:true,onmatch:function(ab){return true},onformat:function(ad,ab,ac){T(ac,function(af,ae){c.setAttrib(ad,ae,af)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});T("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(ab){l(ab,{block:ab,remove:"all"})});l(aa.settings.formats)}function W(){aa.addShortcut("ctrl+b","bold_desc","Bold");aa.addShortcut("ctrl+i","italic_desc","Italic");aa.addShortcut("ctrl+u","underline_desc","Underline");for(var ab=1;ab<=6;ab++){aa.addShortcut("ctrl+"+ab,"
",["FormatBlock",false,"h"+ab])}aa.addShortcut("ctrl+7","",["FormatBlock",false,"p"]);aa.addShortcut("ctrl+8","",["FormatBlock",false,"div"]);aa.addShortcut("ctrl+9","",["FormatBlock",false,"address"])}function V(ab){return ab?Q[ab]:Q}function l(ab,ac){if(ab){if(typeof(ab)!=="string"){T(ab,function(ae,ad){l(ad,ae)})}else{ac=ac.length?ac:[ac];T(ac,function(ad){if(ad.deep===D){ad.deep=!ad.selector}if(ad.split===D){ad.split=!ad.selector||ad.inline}if(ad.remove===D&&ad.selector&&!ad.inline){ad.remove="none"}if(ad.selector&&ad.inline){ad.mixed=true;ad.block_expand=true}if(typeof(ad.classes)==="string"){ad.classes=ad.classes.split(/\s+/)}});Q[ab]=ac}}}var i=function(ac){var ab;aa.dom.getParent(ac,function(ad){ab=aa.dom.getStyle(ad,"text-decoration");return ab&&ab!=="none
"});return ab};var L=function(ab){var ac;if(ab.nodeType===1&&ab.parentNode&&ab.parentNode.nodeType===1){ac=i(ab.parentNode);if(aa.dom.getStyle(ab,"color")&&ac){aa.dom.setStyle(ab,"text-decoration",ac)}else{if(aa.dom.getStyle(ab,"textdecoration")===ac){aa.dom.setStyle(ab,"text-decoration",null)}}}};function Y(ae,al,ag){var ah=V(ae),am=ah[0],ak,ac,aj,ai=r.isCollapsed();function ab(aq,ap){ap=ap||am;if(aq){if(ap.onformat){ap.onformat(aq,ap,al,ag)}T(ap.styles,function(at,ar){c.setStyle(aq,ar,q(at,al))});T(ap.attributes,function(at,ar){c.setAttrib(aq,ar,q(at,al))});T(ap.classes,function(ar){ar=q(ar,al);if(!c.hasClass(aq,ar)){c.addClass(aq,ar)}})}}function af(){function ar(ay,aw){var ax=new t(aw);for(ag=ax.current();ag;ag=ax.prev()){if(ag.childNodes.length>1||ag==ay||ag.tagName=="BR"){return ag}}}var aq=aa.selection.getRng();var av=aq.startContainer;var ap=aq.endContainer;if(av!=ap&&aq.endOffset===0){
var au=ar(av,ap);var at=au.nodeType==3?au.length:au.childNodes.length;aq.setEnd(au,at)}return aq}function ad(at,ay,aw,av,aq){var ap=[],ar=-1,ax,aA=-1,au=-1,az;T(at.childNodes,function(aC,aB){if(aC.nodeName==="UL"||aC.nodeName==="OL"){ar=aB;ax=aC;return false}});T(at.childNodes,function(aC,aB){if(aC.nodeName==="SPAN"&&c.getAttrib(aC,"data-mce-type")=="bookmark"){if(aC.id==ay.id+"_start"){aA=aB}else{if(aC.id==ay.id+"_end"){au=aB}}}});if(ar<=0||(aA<ar&&au>ar)){T(a.grep(at.childNodes),aq);return 0}else{az=c.clone(aw,X);T(a.grep(at.childNodes),function(aC,aB){if((aA<ar&&aB<ar)||(aA>ar&&aB>ar)){ap.push(aC);aC.parentNode.removeChild(aC)}});if(aA<ar){at.insertBefore(az,ax)}else{if(aA>ar){at.insertBefore(az,ax.nextSibling)}}av.push(az);T(ap,function(aB){az.appendChild(aB)});return az}}function an(aq,at,aw){var ap=[],av,ar,au=true;av=am.inline||am.block;ar=c.create(
av);ab(ar);N.walk(aq,function(ax){var ay;function az(aA){var aF,aD,aB,aC,aE;aE=au;aF=aA.nodeName.toLowerCase();aD=aA.parentNode.nodeName.toLowerCase();if(aA.nodeType===1&&x(aA)){aE=au;au=x(aA)==="true";aC=true}if(g(aF,"br")){ay=0;if(am.block){c.remove(aA)}return}if(am.wrapper&&y(aA,ae,al)){ay=0;return}if(au&&!aC&&am.block&&!am.wrapper&&I(aF)){aA=c.rename(aA,av);ab(aA);ap.push(aA);ay=0;return}if(am.selector){T(ah,function(aG){if("collapsed" in aG&&aG.collapsed!==ai){return}if(c.is(aA,aG.selector)&&!b(aA)){ab(aA,aG);aB=true}});if(!am.inline||aB){ay=0;return}}if(au&&!aC&&d(av,aF)&&d(aD,av)&&!(!aw&&aA.nodeType===3&&aA.nodeValue.length===1&&aA.nodeValue.charCodeAt(0)===65279)&&!b(aA)&&(!am.inline||!H(aA))){if(!ay){ay=c.clone(ar,X);aA.parentNode.insertBefore(ay,aA);ap.push(ay)}ay.appendChild(aA)}else{if(aF=="li"&
;&at){ay=ad(aA,at,ar,ap,az)}else{ay=0;T(a.grep(aA.childNodes),az);if(aC){au=aE}ay=0}}}T(ax,az)});if(am.wrap_links===false){T(ap,function(ax){function ay(aC){var aB,aA,az;if(aC.nodeName==="A"){aA=c.clone(ar,X);ap.push(aA);az=a.grep(aC.childNodes);for(aB=0;aB<az.length;aB++){aA.appendChild(az[aB])}aC.appendChild(aA)}T(a.grep(aC.childNodes),ay)}ay(ax)})}T(ap,function(az){var ax;function aA(aC){var aB=0;T(aC.childNodes,function(aD){if(!f(aD)&&!K(aD)){aB++}});return aB}function ay(aB){var aD,aC;T(aB.childNodes,function(aE){if(aE.nodeType==1&&!K(aE)&&!b(aE)){aD=aE;return X}});if(aD&&h(aD,am)){aC=c.clone(aD,X);ab(aC);c.replace(aC,aB,C);c.remove(aD,1)}return aC||aB}ax=aA(az);if((ap.length>1||!H(az))&&ax===0){c.remove(az,1);return}if(am.inline||am.wrapper){if(!am.exact&&ax===1){az=ay(az)}T(ah,function(aB){T(c.select(aB.inline,az),function(aD){var aC;if(aB.wrap_links===false){aC=aD.parentNode;do{if(aC.nodeName==="A"
){return}}while(aC=aC.parentNode)}Z(aB,al,aD,aB.exact?aD:null)})});if(y(az.parentNode,ae,al)){c.remove(az,1);az=0;return C}if(am.merge_with_parents){c.getParent(az.parentNode,function(aB){if(y(aB,ae,al)){c.remove(az,1);az=0;return C}})}if(az&&am.merge_siblings!==false){az=u(E(az),az);az=u(az,E(az,C))}}})}if(am){if(ag){if(ag.nodeType){ac=c.createRng();ac.setStartBefore(ag);ac.setEndAfter(ag);an(p(ac,ah),null,true)}else{an(ag,null,true)}}else{if(!ai||!am.inline||c.select("td.mceSelected,th.mceSelected").length){var ao=aa.selection.getNode();if(!m&&ah[0].defaultBlock&&!c.getParent(ao,c.isBlock)){Y(ah[0].defaultBlock)}aa.selection.setRng(af());ak=r.getBookmark();an(p(r.getRng(C),ah),ak);if(am.styles&&(am.styles.color||am.styles.textDecoration)){a.walk(ao,L,"childNodes");L(ao)}r.moveToBookmark(ak);R(r.getRng(C));aa.nodeChanged()}else{U("apply",ae,al)}}}}function B(ad,am,af){var ag=V(ad),ao=ag[0],ak,aj,ac,al=true;function ae(av
){var au,at,ar,aq,ax,aw;if(av.nodeType===3){return}if(av.nodeType===1&&x(av)){ax=al;al=x(av)==="true";aw=true}au=a.grep(av.childNodes);if(al&&!aw){for(at=0,ar=ag.length;at<ar;at++){if(Z(ag[at],am,av,av)){break}}}if(ao.deep){if(au.length){for(at=0,ar=au.length;at<ar;at++){ae(au[at])}if(aw){al=ax}}}}function ah(aq){var ar;T(n(aq.parentNode).reverse(),function(at){var au;if(!ar&&at.id!="_start"&&at.id!="_end"){au=y(at,ad,am);if(au&&au.split!==false){ar=at}}});return ar}function ab(au,aq,aw,az){var aA,ay,ax,at,av,ar;if(au){ar=au.parentNode;for(aA=aq.parentNode;aA&&aA!=ar;aA=aA.parentNode){ay=c.clone(aA,X);for(av=0;av<ag.length;av++){if(Z(ag[av],am,ay,ay)){ay=0;break}}if(ay){if(ax){ay.appendChild(ax)}if(!at){at=ay}ax=ay}}if(az&&(!ao.mixed||!H(au))){aq=c.split(au,aq)}if(ax){aw.parentNode.insertBefore(ax,aw);at.appendChild(aw)}}return aq}function an(aq){return ab(ah(aq),aq,aq,true)}function ai(at
){var ar=c.get(at?"_start":"_end"),aq=ar[at?"firstChild":"lastChild"];if(K(aq)){aq=aq[at?"firstChild":"lastChild"]}c.remove(ar,true);return aq}function ap(aq){var at,au,ar;aq=p(aq,ag,C);if(ao.split){at=M(aq,C);au=M(aq);if(at!=au){if(/^(TR|TD)$/.test(at.nodeName)&&at.firstChild){at=(at.nodeName=="TD"?at.firstChild:at.firstChild.firstChild)||at}at=S(at,"span",{id:"_start","data-mce-type":"bookmark"});au=S(au,"span",{id:"_end","data-mce-type":"bookmark"});an(at);an(au);at=ai(C);au=ai()}else{at=au=an(at)}aq.startContainer=at.parentNode;aq.startOffset=s(at);aq.endContainer=au.parentNode;aq.endOffset=s(au)+1}N.walk(aq,function(av){T(av,function(aw){ae(aw);if(aw.nodeType===1&&aa.dom.getStyle(aw,"text-decoration")==="underline"&&aw.parentNode&&i(aw.parentNode)==="underline"){Z({deep
:false,exact:true,inline:"span",styles:{textDecoration:"underline"}},null,aw)}})})}if(af){if(af.nodeType){ac=c.createRng();ac.setStartBefore(af);ac.setEndAfter(af);ap(ac)}else{ap(af)}return}if(!r.isCollapsed()||!ao.inline||c.select("td.mceSelected,th.mceSelected").length){ak=r.getBookmark();ap(r.getRng(C));r.moveToBookmark(ak);if(ao.inline&&k(ad,am,r.getStart())){R(r.getRng(true))}aa.nodeChanged()}else{U("remove",ad,am)}}function F(ac,ae,ad){var ab=V(ac);if(k(ac,ae,ad)&&(!("toggle" in ab[0])||ab[0].toggle)){B(ac,ae,ad)}else{Y(ac,ae,ad)}}function y(ac,ab,ah,af){var ad=V(ab),ai,ag,ae;function aj(an,ap,aq){var am,ao,ak=ap[aq],al;if(ap.onmatch){return ap.onmatch(an,ap,aq)}if(ak){if(ak.length===D){for(am in ak){if(ak.hasOwnProperty(am)){if(aq==="attributes"){ao=c.getAttrib(an,am)}else{ao=O(an,am)}if(af&&!ao&&!ap.exact){return}if((!af||ap.exact)&&!g(ao,q(ak[am],ah))){return}}}}else{for(al=0
;al<ak.length;al++){if(aq==="attributes"?c.getAttrib(an,ak[al]):O(an,ak[al])){return ap}}}}return ap}if(ad&&ac){for(ag=0;ag<ad.length;ag++){ai=ad[ag];if(h(ac,ai)&&aj(ac,ai,"attributes")&&aj(ac,ai,"styles")){if(ae=ai.classes){for(ag=0;ag<ae.length;ag++){if(!c.hasClass(ac,ae[ag])){return}}}return ai}}}}function k(ad,af,ae){var ac;function ab(ag){ag=c.getParent(ag,function(ah){return !!y(ah,ad,af,true)});return y(ag,ad,af)}if(ae){return ab(ae)}ae=r.getNode();if(ab(ae)){return C}ac=r.getStart();if(ac!=ae){if(ab(ac)){return C}}return X}function v(ai,ah){var af,ag=[],ae={},ad,ac,ab;af=r.getStart();c.getParent(af,function(al){var ak,aj;for(ak=0;ak<ai.length;ak++){aj=ai[ak];if(!ae[aj]&&y(al,aj,ah)){ae[aj]=true;ag.push(aj)}}},c.getRoot());return ag}function z(af){var ah=V(af),ae,ad,ag,ac,ab;if(ah){ae=r.getStart();ad=n(ae);for(ac=ah.length-1;ac>=0;ac--){ab=ah[ac].selector;if(!ab){return C}for(ag=ad.length-1;ag>=0;
ag--){if(c.is(ad[ag],ab)){return C}}}}return X}function J(ab,ae,ac){var ad;if(!P){P={};ad={};aa.onNodeChange.addToTop(function(ag,af,ai){var ah=n(ai),aj={};T(P,function(ak,al){T(ah,function(am){if(y(am,al,{},ak.similar)){if(!ad[al]){T(ak,function(an){an(true,{node:am,format:al,parents:ah})});ad[al]=ak}aj[al]=ak;return false}})});T(ad,function(ak,al){if(!aj[al]){delete ad[al];T(ak,function(am){am(false,{node:ai,format:al,parents:ah})})}})})}T(ab.split(","),function(af){if(!P[af]){P[af]=[];P[af].similar=ac}P[af].push(ae)});return this}a.extend(this,{get:V,register:l,apply:Y,remove:B,toggle:F,match:k,matchAll:v,matchNode:y,canApply:z,formatChanged:J});j();W();function h(ab,ac){if(g(ab,ac.inline)){return C}if(g(ab,ac.block)){return C}if(ac.selector){return c.is(ab,ac.selector)}}function g(ac,ab){ac=ac||"";ab=ab||"";ac=""+(ac.nodeName||ac);ab=""+(ab.nodeName||ab);return ac.toLowerCase()==ab.toLowerCase()}function O(ac,ab){var ad=c.getStyl
e(ac,ab);if(ab=="color"||ab=="backgroundColor"){ad=c.toHex(ad)}if(ab=="fontWeight"&&ad==700){ad="bold"}return""+ad}function q(ab,ac){if(typeof(ab)!="string"){ab=ab(ac)}else{if(ac){ab=ab.replace(/%(\w+)/g,function(ae,ad){return ac[ad]||ae})}}return ab}function f(ab){return ab&&ab.nodeType===3&&/^([\t \r\n]+|)$/.test(ab.nodeValue)}function S(ad,ac,ab){var ae=c.create(ac,ab);ad.parentNode.insertBefore(ae,ad);ae.appendChild(ad);return ae}function p(ab,am,ae){var ap,an,ah,al,ad=ab.startContainer,ai=ab.startOffset,ar=ab.endContainer,ak=ab.endOffset;function ao(aA){var au,ax,az,aw,av,at;au=ax=aA?ad:ar;av=aA?"previousSibling":"nextSibling";at=c.getRoot();function ay(aB){return aB.nodeName=="BR"&&aB.getAttribute("data-mce-bogus")&&!aB.nextSibling}if(au.nodeType==3&&!f(au)){if(aA?ai>0:ak<au.nodeValue.length){return au}}for(;;){if(!am[0].bloc
k_expand&&H(ax)){return ax}for(aw=ax[av];aw;aw=aw[av]){if(!K(aw)&&!f(aw)&&!ay(aw)){return ax}}if(ax.parentNode==at){au=ax;break}ax=ax.parentNode}return au}function ag(at,au){if(au===D){au=at.nodeType===3?at.length:at.childNodes.length}while(at&&at.hasChildNodes()){at=at.childNodes[au];if(at){au=at.nodeType===3?at.length:at.childNodes.length}}return{node:at,offset:au}}if(ad.nodeType==1&&ad.hasChildNodes()){an=ad.childNodes.length-1;ad=ad.childNodes[ai>an?an:ai];if(ad.nodeType==3){ai=0}}if(ar.nodeType==1&&ar.hasChildNodes()){an=ar.childNodes.length-1;ar=ar.childNodes[ak>an?an:ak-1];if(ar.nodeType==3){ak=ar.nodeValue.length}}function aq(au){var at=au;while(at){if(at.nodeType===1&&x(at)){return x(at)==="false"?at:au}at=at.parentNode}return au}function aj(au,ay,aA){var ax,av,az,at;function aw(aC,aE){var aF,aB,aD=aC.nodeValue;if(typeof(aE)=="undefined"){aE=aA?aD.length:0}if(aA){aF=aD.lastIndexOf(" "
;,aE);aB=aD.lastIndexOf("\u00a0",aE);aF=aF>aB?aF:aB;if(aF!==-1&&!ae){aF++}}else{aF=aD.indexOf(" ",aE);aB=aD.indexOf("\u00a0",aE);aF=aF!==-1&&(aB===-1||aF<aB)?aF:aB}return aF}if(au.nodeType===3){az=aw(au,ay);if(az!==-1){return{container:au,offset:az}}at=au}ax=new t(au,c.getParent(au,H)||aa.getBody());while(av=ax[aA?"prev":"next"]()){if(av.nodeType===3){at=av;az=aw(av);if(az!==-1){return{container:av,offset:az}}}else{if(H(av)){break}}}if(at){if(aA){ay=0}else{ay=at.length}return{container:at,offset:ay}}}function af(au,at){var av,aw,ay,ax;if(au.nodeType==3&&au.nodeValue.length===0&&au[at]){au=au[at]}av=n(au);for(aw=0;aw<av.length;aw++){for(ay=0;ay<am.length;ay++){ax=am[ay];if("collapsed" in ax&&ax.collapsed!==ab.collapsed){continue}if(c.is(av[aw],ax.selector)){return av[aw]}}}return au}function ac(au,at,aw){var av;if(!am[0].wrapper){av=c.getParent(au,am[0].block)}if(!av){av=c.
getParent(au.nodeType==3?au.parentNode:au,I)}if(av&&am[0].wrapper){av=n(av,"ul,ol").reverse()[0]||av}if(!av){av=au;while(av[at]&&!H(av[at])){av=av[at];if(g(av,"br")){break}}}return av||au}ad=aq(ad);ar=aq(ar);if(K(ad.parentNode)||K(ad)){ad=K(ad)?ad:ad.parentNode;ad=ad.nextSibling||ad;if(ad.nodeType==3){ai=0}}if(K(ar.parentNode)||K(ar)){ar=K(ar)?ar:ar.parentNode;ar=ar.previousSibling||ar;if(ar.nodeType==3){ak=ar.length}}if(am[0].inline){if(ab.collapsed){al=aj(ad,ai,true);if(al){ad=al.container;ai=al.offset}al=aj(ar,ak);if(al){ar=al.container;ak=al.offset}}ah=ag(ar,ak);if(ah.node){while(ah.node&&ah.offset===0&&ah.node.previousSibling){ah=ag(ah.node.previousSibling)}if(ah.node&&ah.offset>0&&ah.node.nodeType===3&&ah.node.nodeValue.charAt(ah.offset-1)===" "){if(ah.offset>1){ar=ah.node;ar.splitText(ah.offset-1)}}}}if(am[0].inline||am[0].block_expand){if(!am[0].inline||(ad.nodeType!=3||ai===0)){ad=ao
(true)}if(!am[0].inline||(ar.nodeType!=3||ak===ar.nodeValue.length)){ar=ao()}}if(am[0].selector&&am[0].expand!==X&&!am[0].inline){ad=af(ad,"previousSibling");ar=af(ar,"nextSibling")}if(am[0].block||am[0].selector){ad=ac(ad,"previousSibling");ar=ac(ar,"nextSibling");if(am[0].block){if(!H(ad)){ad=ao(true)}if(!H(ar)){ar=ao()}}}if(ad.nodeType==1){ai=s(ad);ad=ad.parentNode}if(ar.nodeType==1){ak=s(ar)+1;ar=ar.parentNode}return{startContainer:ad,startOffset:ai,endContainer:ar,endOffset:ak}}function Z(ah,ag,ae,ab){var ad,ac,af;if(!h(ae,ah)){return X}if(ah.remove!="all"){T(ah.styles,function(aj,ai){aj=q(aj,ag);if(typeof(ai)==="number"){ai=aj;ab=0}if(!ab||g(O(ab,ai),aj)){c.setStyle(ae,ai,"")}af=1});if(af&&c.getAttrib(ae,"style")==""){ae.removeAttribute("style");ae.removeAttribute("data-mce-style")}T(ah.attributes,function(ak,ai){var aj;ak=q(ak,ag);if(typeof(ai)
==="number"){ai=ak;ab=0}if(!ab||g(c.getAttrib(ab,ai),ak)){if(ai=="class"){ak=c.getAttrib(ae,ai);if(ak){aj="";T(ak.split(/\s+/),function(al){if(/mce\w+/.test(al)){aj+=(aj?" ":"")+al}});if(aj){c.setAttrib(ae,ai,aj);return}}}if(ai=="class"){ae.removeAttribute("className")}if(e.test(ai)){ae.removeAttribute("data-mce-"+ai)}ae.removeAttribute(ai)}});T(ah.classes,function(ai){ai=q(ai,ag);if(!ab||c.hasClass(ab,ai)){c.removeClass(ae,ai)}});ac=c.getAttribs(ae);for(ad=0;ad<ac.length;ad++){if(ac[ad].nodeName.indexOf("_")!==0){return X}}}if(ah.remove!="none"){o(ae,ah);return C}}function o(ad,ae){var ab=ad.parentNode,ac;function af(ah,ag,ai){ah=E(ah,ag,ai);return !ah||(ah.nodeName=="BR"||H(ah))}if(ae.block){if(!m){if(H(ad)&&!H(ab)){if(!af(ad,X)&&!af(ad.firstChild,C,1)){ad.insertBefore(c.create("br"),ad.firstChild)}if(!af(ad,C)&&!af(ad.lastChild,X,1)){a
d.appendChild(c.create("br"))}}}else{if(ab==c.getRoot()){if(!ae.list_block||!g(ad,ae.list_block)){T(a.grep(ad.childNodes),function(ag){if(d(m,ag.nodeName.toLowerCase())){if(!ac){ac=S(ag,m)}else{ac.appendChild(ag)}}else{ac=0}})}}}}if(ae.selector&&ae.inline&&!g(ae.inline,ad)){return}c.remove(ad,1)}function E(ac,ab,ad){if(ac){ab=ab?"nextSibling":"previousSibling";for(ac=ad?ac:ac[ab];ac;ac=ac[ab]){if(ac.nodeType==1||!f(ac)){return ac}}}}function K(ab){return ab&&ab.nodeType==1&&ab.getAttribute("data-mce-type")=="bookmark"}function u(af,ae){var ab,ad,ac;function ah(ak,aj){if(ak.nodeName!=aj.nodeName){return X}function ai(am){var an={};T(c.getAttribs(am),function(ao){var ap=ao.nodeName.toLowerCase();if(ap.indexOf("_")!==0&&ap!=="style"){an[ap]=c.getAttrib(am,ap)}});return an}function al(ap,ao){var an,am;for(am in ap){if(ap.hasOwnProperty(am)){an=ao[am];if(an===D){return X}if(ap[am
]!=an){return X}delete ao[am]}}for(am in ao){if(ao.hasOwnProperty(am)){return X}}return C}if(!al(ai(ak),ai(aj))){return X}if(!al(c.parseStyle(c.getAttrib(ak,"style")),c.parseStyle(c.getAttrib(aj,"style")))){return X}return C}function ag(aj,ai){for(ad=aj;ad;ad=ad[ai]){if(ad.nodeType==3&&ad.nodeValue.length!==0){return aj}if(ad.nodeType==1&&!K(ad)){return ad}}return aj}if(af&&ae){af=ag(af,"previousSibling");ae=ag(ae,"nextSibling");if(ah(af,ae)){for(ad=af.nextSibling;ad&&ad!=ae;){ac=ad;ad=ad.nextSibling;af.appendChild(ac)}c.remove(ae);T(a.grep(ae.childNodes),function(ai){af.appendChild(ai)});return af}}return ae}function M(ac,ag){var ab,af,ad,ae;ab=ac[ag?"startContainer":"endContainer"];af=ac[ag?"startOffset":"endOffset"];if(ab.nodeType==1){ad=ab.childNodes.length-1;if(!ag&&af){af--}ab=ab.childNodes[af>ad?ad:af]}if(ab.nodeType===3&&ag&&af>=ab.nod
eValue.length){ab=new t(ab,aa.getBody()).next()||ab}if(ab.nodeType===3&&!ag&&af===0){ab=new t(ab,aa.getBody()).prev()||ab}return ab}function U(ak,ab,ai){var al="_mce_caret",ac=aa.settings.caret_debug;function ad(ap){var ao=c.create("span",{id:al,"data-mce-bogus":true,style:ac?"color:red":""});if(ap){ao.appendChild(aa.getDoc().createTextNode(G))}return ao}function aj(ap,ao){while(ap){if((ap.nodeType===3&&ap.nodeValue!==G)||ap.childNodes.length>1){return false}if(ao&&ap.nodeType===1){ao.push(ap)}ap=ap.firstChild}return true}function ag(ao){while(ao){if(ao.id===al){return ao}ao=ao.parentNode}}function af(ao){var ap;if(ao){ap=new t(ao,ao);for(ao=ap.current();ao;ao=ap.next()){if(ao.nodeType===3){return ao}}}}function ae(aq,ap){var ar,ao;if(!aq){aq=ag(r.getStart());if(!aq){while(aq=c.get(al)){ae(aq,false)}}}else{ao=r.getRng(true);if(aj(aq)){if(ap!==false){ao.setStartBefore(aq);ao.setEndBefore(aq)}c.remove
(aq)}else{ar=af(aq);if(ar.nodeValue.charAt(0)===G){ar=ar.deleteData(0,1)}c.remove(aq,1)}r.setRng(ao)}}function ah(){var aq,ao,av,au,ar,ap,at;aq=r.getRng(true);au=aq.startOffset;ap=aq.startContainer;at=ap.nodeValue;ao=ag(r.getStart());if(ao){av=af(ao)}if(at&&au>0&&au<at.length&&/\w/.test(at.charAt(au))&&/\w/.test(at.charAt(au-1))){ar=r.getBookmark();aq.collapse(true);aq=p(aq,V(ab));aq=N.split(aq);Y(ab,ai,aq);r.moveToBookmark(ar)}else{if(!ao||av.nodeValue!==G){ao=ad(true);av=ao.firstChild;aq.insertNode(ao);au=1;Y(ab,ai,ao)}else{Y(ab,ai,ao)}r.setCursorLocation(av,au)}}function am(){var ao=r.getRng(true),ap,at,aw,av,aq,az,ay=[],au,ax;ap=ao.startContainer;at=ao.startOffset;aq=ap;if(ap.nodeType==3){if(at!=ap.nodeValue.length||ap.nodeValue===G){av=true}aq=aq.parentNode}while(aq){if(y(aq,ab,ai)){az=aq;break}if(aq.nextSibling){av=true}ay.push(aq);aq=aq.parentNode}if(!az){return}if(av){aw=r.getBookmark();ao.collapse(true);ao=p(ao,V(ab),true);ao=N.split(ao
);B(ab,ai,ao);r.moveToBookmark(aw)}else{ax=ad();aq=ax;for(au=ay.length-1;au>=0;au--){aq.appendChild(c.clone(ay[au],false));aq=aq.firstChild}aq.appendChild(c.doc.createTextNode(G));aq=aq.firstChild;var ar=c.getParent(az,I);if(ar&&c.isEmpty(ar)){az.parentNode.replaceChild(ax,az)}else{c.insertAfter(ax,az)}r.setCursorLocation(aq,1);if(c.isEmpty(az)){c.remove(az)}}}function an(){var ap,ao,aq;ao=ag(r.getStart());if(ao&&!c.isEmpty(ao)){a.walk(ao,function(ar){if(ar.nodeType==1&&ar.id!==al&&!c.isEmpty(ar)){c.setAttrib(ar,"data-mce-bogus",null)}},"childNodes")}}if(!self._hasCaretEvents){aa.onBeforeGetContent.addToTop(function(){var ao=[],ap;if(aj(ag(r.getStart()),ao)){ap=ao.length;while(ap--){c.setAttrib(ao[ap],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(ao){aa[ao].addToTop(function(){ae();an()})});aa.onKeyDown.addToTop(function(ao,aq){var ap=aq.keyCode;if(ap==8||ap==37|
|ap==39){ae(ag(r.getStart()))}an()});r.onSetContent.add(an);self._hasCaretEvents=true}if(ak=="apply"){ah()}else{am()}}function R(ac){var ab=ac.startContainer,ai=ac.startOffset,ae,ah,ag,ad,af;if(ab.nodeType==3&&ai>=ab.nodeValue.length){ai=s(ab);ab=ab.parentNode;ae=true}if(ab.nodeType==1){ad=ab.childNodes;ab=ad[Math.min(ai,ad.length-1)];ah=new t(ab,c.getParent(ab,c.isBlock));if(ai>ad.length-1||ae){ah.next()}for(ag=ah.current();ag;ag=ah.next()){if(ag.nodeType==3&&!f(ag)){af=c.create("a",null,G);ag.parentNode.insertBefore(af,ag);ac.setStart(ag,0);r.setRng(ac);c.remove(af);return}}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}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)})}}if(c.inline_styles){h=e.explode(c.font_size_le
gacy_values);d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size,10)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});(function(b){var a=b.dom.TreeWalker;b.EnterKey=function(f){var i=f.dom,e=f.selection,d=f.settings,h=f.undoManager,c=f.schema.getNonEmptyElements();function g(B){var v=e.getRng(true),G,j,A,u,p,M,C,o,k,n,t,J,x,D;function E(N){return N&&i.isBlock(N)&&!/^(TD|TH|CAPTION|FORM)$/.test(N.nodeName)&&!/^(fixed|absolute)/i.test(N.style.position)&&i.getContentEditable(N)!=="true"}function F(O){var N;if(b.isIE&&!b.isIE11&&i.isBlock(O)){N=e.getRng();O.appendChild(i.create("span",null,"\u00a0"));e.select(O);O.lastChild.outerHTML="";e
.setRng(N)}}function z(P){var O=P,Q=[],N;while(O=O.firstChild){if(i.isBlock(O)){return}if(O.nodeType==1&&!c[O.nodeName.toLowerCase()]){Q.push(O)}}N=Q.length;while(N--){O=Q[N];if(!O.hasChildNodes()||(O.firstChild==O.lastChild&&O.firstChild.nodeValue==="")){i.remove(O)}else{if(O.nodeName=="A"&&(O.innerText||O.textContent)===" "){i.remove(O)}}}}function m(O){var T,R,N,U,S,Q=O,P;N=i.createRng();if(O.hasChildNodes()){T=new a(O,O);while(R=T.current()){if(R.nodeType==3){N.setStart(R,0);N.setEnd(R,0);break}if(c[R.nodeName.toLowerCase()]){N.setStartBefore(R);N.setEndBefore(R);break}Q=R;R=T.next()}if(!R){N.setStart(Q,0);N.setEnd(Q,0)}}else{if(O.nodeName=="BR"){if(O.nextSibling&&i.isBlock(O.nextSibling)){if(!M||M<9){P=i.create("br");O.parentNode.insertBefore(P,O)}N.setStartBefore(O);N.setEndBefore(O)}else{N.setStartAfter(O);N.setEndAfter(O)}}else{N.setStart(O,0);N.setEnd(O,0)}}e.setRng(N);i.remove(P);S=i.getVi
ewPort(f.getWin());U=i.getPos(O).y;if(U<S.y||U+25>S.y+S.h){f.getWin().scrollTo(0,U<S.y?U:U-S.h+25)}}function r(O){var P=A,R,Q,N;R=O||t=="TABLE"?i.create(O||x):p.cloneNode(false);N=R;if(d.keep_styles!==false){do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(P.nodeName)){if(P.id=="_mce_caret"){continue}Q=P.cloneNode(false);i.setAttrib(Q,"id","");if(R.hasChildNodes()){Q.appendChild(R.firstChild);R.appendChild(Q)}else{N=Q;R.appendChild(Q)}}}while(P=P.parentNode)}if(!b.isIE||b.isIE11){N.innerHTML='<br data-mce-bogus="1">'}return R}function q(Q){var P,O,N;if(A.nodeType==3&&(Q?u>0:u<A.nodeValue.length)){return false}if(A.parentNode==p&&D&&!Q){return true}if(Q&&A.nodeType==1&&A==p.firstChild){return true}if(A.nodeName==="TABLE"||(A.previousSibling&&A.previousSibling.nodeName=="TABLE")){return(D&&!Q)||(!D&&Q)}P=new a(A,p);if(A.nodeType==3
){if(Q&&u==0){P.prev()}else{if(!Q&&u==A.nodeValue.length){P.next()}}}while(O=P.current()){if(O.nodeType===1){if(!O.getAttribute("data-mce-bogus")){N=O.nodeName.toLowerCase();if(c[N]&&N!=="br"){return false}}}else{if(O.nodeType===3&&!/^[ \t\r\n]*$/.test(O.nodeValue)){return false}}if(Q){P.prev()}else{P.next()}}return true}function l(N,T){var U,S,P,R,Q,O=x||"P";S=i.getParent(N,i.isBlock);if(!S||!E(S)){S=S||j;if(!S.hasChildNodes()){U=i.create(O);S.appendChild(U);v.setStart(U,0);v.setEnd(U,0);return U}R=N;while(R.parentNode!=S){R=R.parentNode}while(R&&!i.isBlock(R)){P=R;R=R.previousSibling}if(P){U=i.create(O);P.parentNode.insertBefore(U,P);R=P;while(R&&!i.isBlock(R)){Q=R.nextSibling;U.appendChild(R);R=Q}v.setStart(N,T);v.setEnd(N,T)}}return N}function H(){function N(P){var O=n[P?"firstChild":"lastChild"];while(O){if(O.nodeType==1){break}O=O[P?"nextSibling":"previousSibling&qu
ot;]}return O===p}o=x?r(x):i.create("BR");if(N(true)&&N()){i.replace(o,n)}else{if(N(true)){n.parentNode.insertBefore(o,n)}else{if(N()){i.insertAfter(o,n);F(o)}else{G=v.cloneRange();G.setStartAfter(p);G.setEndAfter(n);k=G.extractContents();i.insertAfter(k,n);i.insertAfter(o,n)}}}i.remove(p);m(o);h.add()}function y(){var O=new a(A,p),N;while(N=O.next()){if(c[N.nodeName.toLowerCase()]||N.length>0){return true}}}function L(){var P,O,N;if(A&&A.nodeType==3&&u>=A.nodeValue.length){if((!b.isIE||b.isIE11)&&!y()){P=i.create("br");v.insertNode(P);v.setStartAfter(P);v.setEndAfter(P);O=true}}P=i.create("br");v.insertNode(P);if((b.isIE&&!b.isIE11)&&t=="PRE"&&(!M||M<8)){P.parentNode.insertBefore(i.doc.createTextNode("\r"),P)}N=i.create("span",{}," ");P.parentNode.insertBefore(N,P);e.scrollIntoView(N);i.remove(N);if(!O){v.setStartAfter(P);v.setEndAfter(P)}e
lse{v.setStartBefore(P);v.setEndBefore(P)}e.setRng(v);h.add()}function s(N){do{if(N.nodeType===3){N.nodeValue=N.nodeValue.replace(/^[\r\n]+/,"")}N=N.firstChild}while(N)}function K(P){var N=i.getRoot(),O,Q;O=P;while(O!==N&&i.getContentEditable(O)!=="false"){if(i.getContentEditable(O)==="true"){Q=O}O=O.parentNode}return O!==N?Q:N}function I(O){var N;if(!b.isIE||b.isIE11){O.normalize();N=O.lastChild;if(!N||(/^(left|right)$/gi.test(i.getStyle(N,"float",true)))){i.add(O,"br")}}}if(!v.collapsed){f.execCommand("Delete");return}if(B.isDefaultPrevented()){return}A=v.startContainer;u=v.startOffset;x=(d.force_p_newlines?"p":"")||d.forced_root_block;x=x?x.toUpperCase():"";M=i.doc.documentMode;C=B.shiftKey;if(A.nodeType==1&&A.hasChildNodes()){D=u>A.childNodes.length-1;A=A.childNodes[Math.min(u,A.childNodes.length-1)]||A;if(D&&A.nodeType==3){u=A.nodeValue.length}else{u=0}}j=K(A);if
(!j){return}h.beforeChange();if(!i.isBlock(j)&&j!=i.getRoot()){if(!x||C){L()}return}if((x&&!C)||(!x&&C)){A=l(A,u)}p=i.getParent(A,i.isBlock);n=p?i.getParent(p.parentNode,i.isBlock):null;t=p?p.nodeName.toUpperCase():"";J=n?n.nodeName.toUpperCase():"";if(J=="LI"&&!B.ctrlKey){p=n;t=J}if(t=="LI"){if(!x&&C){L();return}if(i.isEmpty(p)){if(/^(UL|OL|LI)$/.test(n.parentNode.nodeName)){return false}H();return}}if(t=="PRE"&&d.br_in_pre!==false){if(!C){L();return}}else{if((!x&&!C&&t!="LI")||(x&&C)){L();return}}x=x||"P";if(q()){if(/^(H[1-6]|PRE)$/.test(t)&&J!="HGROUP"){o=r(x)}else{o=r()}if(d.end_container_on_empty_block&&E(n)&&i.isEmpty(p)){o=i.split(n,p)}else{i.insertAfter(o,p)}m(o)}else{if(q(true)){o=p.parentNode.insertBefore(r(),p);F(o)}else{G=v.cloneRange();G.setEndAfter(p);k=G.extractContents();s(k);o=k.firstChild;i.i
nsertAfter(k,p);z(o);I(p);m(o)}}i.setAttrib(o,"id","");h.add()}f.onKeyDown.add(function(k,j){if(j.keyCode==13){if(g(j)!==false){j.preventDefault()}}})}})(tinymce);
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcetiny_mce_popupjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/tiny_mce_popup.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/tiny_mce_popup.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/tiny_mce_popup.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,5 +1,530 @@
</span><ins>+/**
+ * Popup.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
</ins><span class="cx">
</span><del>-// Uncomment and change this document.domain value if you are loading the script cross subdomains
-// document.domain = 'moxiecode.com';
</del><ins>+var tinymce, tinyMCE;
</ins><span class="cx">
</span><del>-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,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);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:functio
n(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)},10)},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&&b.editor.setting
s.language_load!==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(a){var a=(a&&a.target)||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.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}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE&&!tinymce.isIE11){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],&
quot;base",{target:"_self"})}else{if(tinymce.isIE11){document.addEventListener("mouseup",tinyMCEPopup._restoreSelection,false)}}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(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){var b=a.target||a.srcElement;if(b.onchange){b.onchange()}return t
inymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();
</del><span class="cx">\ No newline at end of file
</span><ins>+/**
+ * TinyMCE popup/dialog helper class. This gives you easy access to the
+ * parent editor instance and a bunch of other things. It's higly recommended
+ * that you load this script into your dialogs.
+ *
+ * @static
+ * @class tinyMCEPopup
+ */
+var tinyMCEPopup = {
+ /**
+ * Initializes the popup this will be called automatically.
+ *
+ * @method init
+ */
+ init: function() {
+ var self = this, parentWin, settings, uiWindow;
+
+ // Find window & API
+ parentWin = self.getWin();
+ tinymce = tinyMCE = parentWin.tinymce;
+ self.editor = tinymce.EditorManager.activeEditor;
+ self.params = self.editor.windowManager.getParams();
+
+ uiWindow = self.editor.windowManager.windows[self.editor.windowManager.windows.length - 1];
+ self.features = uiWindow.features;
+ self.uiWindow = uiWindow;
+
+ settings = self.editor.settings;
+
+ // Setup popup CSS path(s)
+ if (settings.popup_css !== false) {
+ if (settings.popup_css) {
+ settings.popup_css = self.editor.documentBaseURI.toAbsolute(settings.popup_css);
+ } else {
+ settings.popup_css = self.editor.baseURI.toAbsolute("plugins/compat3x/css/dialog.css");
+ }
+ }
+
+ if (settings.popup_css_add) {
+ settings.popup_css += ',' + self.editor.documentBaseURI.toAbsolute(settings.popup_css_add);
+ }
+
+ // Setup local DOM
+ self.dom = self.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document, {
+ ownEvents: true,
+ proxy: tinyMCEPopup._eventProxy
+ });
+
+ self.dom.bind(window, 'ready', self._onDOMLoaded, self);
+
+ // Enables you to skip loading the default css
+ if (self.features.popup_css !== false) {
+ self.dom.loadCSS(self.features.popup_css || self.editor.settings.popup_css);
+ }
+
+ // Setup on init listeners
+ self.listeners = [];
+
+ /**
+ * Fires when the popup is initialized.
+ *
+ * @event onInit
+ * @param {tinymce.Editor} editor Editor instance.
+ * @example
+ * // Alerts the selected contents when the dialog is loaded
+ * tinyMCEPopup.onInit.add(function(ed) {
+ * alert(ed.selection.getContent());
+ * });
+ *
+ * // Executes the init method on page load in some object using the SomeObject scope
+ * tinyMCEPopup.onInit.add(SomeObject.init, SomeObject);
+ */
+ self.onInit = {
+ add: function(func, scope) {
+ self.listeners.push({func : func, scope : scope});
+ }
+ };
+
+ self.isWindow = !self.getWindowArg('mce_inline');
+ self.id = self.getWindowArg('mce_window_id');
+ },
+
+ /**
+ * Returns the reference to the parent window that opened the dialog.
+ *
+ * @method getWin
+ * @return {Window} Reference to the parent window that opened the dialog.
+ */
+ getWin: function() {
+ // Added frameElement check to fix bug: #2817583
+ return (!window.frameElement && window.dialogArguments) || opener || parent || top;
+ },
+
+ /**
+ * Returns a window argument/parameter by name.
+ *
+ * @method getWindowArg
+ * @param {String} name Name of the window argument to retrive.
+ * @param {String} defaultValue Optional default value to return.
+ * @return {String} Argument value or default value if it wasn't found.
+ */
+ getWindowArg : function(name, defaultValue) {
+ var value = this.params[name];
+
+ return tinymce.is(value) ? value : defaultValue;
+ },
+
+ /**
+ * Returns a editor parameter/config option value.
+ *
+ * @method getParam
+ * @param {String} name Name of the editor config option to retrive.
+ * @param {String} defaultValue Optional default value to return.
+ * @return {String} Parameter value or default value if it wasn't found.
+ */
+ getParam : function(name, defaultValue) {
+ return this.editor.getParam(name, defaultValue);
+ },
+
+ /**
+ * Returns a language item by key.
+ *
+ * @method getLang
+ * @param {String} name Language item like mydialog.something.
+ * @param {String} defaultValue Optional default value to return.
+ * @return {String} Language value for the item like "my string" or the default value if it wasn't found.
+ */
+ getLang : function(name, defaultValue) {
+ return this.editor.getLang(name, defaultValue);
+ },
+
+ /**
+ * Executed a command on editor that opened the dialog/popup.
+ *
+ * @method execCommand
+ * @param {String} cmd Command to execute.
+ * @param {Boolean} ui Optional boolean value if the UI for the command should be presented or not.
+ * @param {Object} val Optional value to pass with the comman like an URL.
+ * @param {Object} a Optional arguments object.
+ */
+ execCommand : function(cmd, ui, val, args) {
+ args = args || {};
+ args.skip_focus = 1;
+
+ this.restoreSelection();
+ return this.editor.execCommand(cmd, ui, val, args);
+ },
+
+ /**
+ * Resizes the dialog to the inner size of the window. This is needed since various browsers
+ * have different border sizes on windows.
+ *
+ * @method resizeToInnerSize
+ */
+ resizeToInnerSize : function() {
+ /*var self = this;
+
+ // Detach it to workaround a Chrome specific bug
+ // https://sourceforge.net/tracker/?func=detail&atid=635682&aid=2926339&group_id=103281
+ setTimeout(function() {
+ var vp = self.dom.getViewPort(window);
+
+ self.editor.windowManager.resizeBy(
+ self.getWindowArg('mce_width') - vp.w,
+ self.getWindowArg('mce_height') - vp.h,
+ self.id || window
+ );
+ }, 10);*/
+ },
+
+ /**
+ * Will executed the specified string when the page has been loaded. This function
+ * was added for compatibility with the 2.x branch.
+ *
+ * @method executeOnLoad
+ * @param {String} evil String to evalutate on init.
+ */
+ executeOnLoad : function(evil) {
+ this.onInit.add(function() {
+ eval(evil);
+ });
+ },
+
+ /**
+ * Stores the current editor selection for later restoration. This can be useful since some browsers
+ * looses it's selection if a control element is selected/focused inside the dialogs.
+ *
+ * @method storeSelection
+ */
+ storeSelection : function() {
+ this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark(1);
+ },
+
+ /**
+ * Restores any stored selection. This can be useful since some browsers
+ * looses it's selection if a control element is selected/focused inside the dialogs.
+ *
+ * @method restoreSelection
+ */
+ restoreSelection : function() {
+ var self = tinyMCEPopup;
+
+ if (!self.isWindow && tinymce.isIE) {
+ self.editor.selection.moveToBookmark(self.editor.windowManager.bookmark);
+ }
+ },
+
+ /**
+ * Loads a specific dialog language pack. If you pass in plugin_url as a argument
+ * when you open the window it will load the <plugin url>/langs/<code>_dlg.js lang pack file.
+ *
+ * @method requireLangPack
+ */
+ requireLangPack : function() {
+ var self = this, url = self.getWindowArg('plugin_url') || self.getWindowArg('theme_url'), settings = self.editor.settings, lang;
+
+ if (settings.language !== false) {
+ lang = settings.language || "en";
+ }
+
+ if (url && lang && self.features.translate_i18n !== false && settings.language_load !== false) {
+ url += '/langs/' + lang + '_dlg.js';
+
+ if (!tinymce.ScriptLoader.isDone(url)) {
+ document.write('<script type="text/javascript" src="' + url + '"></script>');
+ tinymce.ScriptLoader.markDone(url);
+ }
+ }
+ },
+
+ /**
+ * Executes a color picker on the specified element id. When the user
+ * then selects a color it will be set as the value of the specified element.
+ *
+ * @method pickColor
+ * @param {DOMEvent} e DOM event object.
+ * @param {string} element_id Element id to be filled with the color value from the picker.
+ */
+ pickColor : function(e, element_id) {
+ this.execCommand('mceColorPicker', true, {
+ color : document.getElementById(element_id).value,
+ func : function(c) {
+ document.getElementById(element_id).value = c;
+
+ try {
+ document.getElementById(element_id).onchange();
+ } catch (ex) {
+ // Try fire event, ignore errors
+ }
+ }
+ });
+ },
+
+ /**
+ * Opens a filebrowser/imagebrowser this will set the output value from
+ * the browser as a value on the specified element.
+ *
+ * @method openBrowser
+ * @param {string} element_id Id of the element to set value in.
+ * @param {string} type Type of browser to open image/file/flash.
+ * @param {string} option Option name to get the file_broswer_callback function name from.
+ */
+ openBrowser : function(element_id, type) {
+ tinyMCEPopup.restoreSelection();
+ this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window);
+ },
+
+ /**
+ * Creates a confirm dialog. Please don't use the blocking behavior of this
+ * native version use the callback method instead then it can be extended.
+ *
+ * @method confirm
+ * @param {String} t Title for the new confirm dialog.
+ * @param {function} cb Callback function to be executed after the user has selected ok or cancel.
+ * @param {Object} s Optional scope to execute the callback in.
+ */
+ confirm : function(t, cb, s) {
+ this.editor.windowManager.confirm(t, cb, s, window);
+ },
+
+ /**
+ * Creates a alert dialog. Please don't use the blocking behavior of this
+ * native version use the callback method instead then it can be extended.
+ *
+ * @method alert
+ * @param {String} t Title for the new alert dialog.
+ * @param {function} cb Callback function to be executed after the user has selected ok.
+ * @param {Object} s Optional scope to execute the callback in.
+ */
+ alert : function(tx, cb, s) {
+ this.editor.windowManager.alert(tx, cb, s, window);
+ },
+
+ /**
+ * Closes the current window.
+ *
+ * @method close
+ */
+ close : function() {
+ var t = this;
+
+ // To avoid domain relaxing issue in Opera
+ function close() {
+ t.editor.windowManager.close(window);
+ tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup
+ }
+
+ if (tinymce.isOpera) {
+ t.getWin().setTimeout(close, 0);
+ } else {
+ close();
+ }
+ },
+
+ // Internal functions
+
+ _restoreSelection : function() {
+ var e = window.event.srcElement;
+
+ if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button'))
+ tinyMCEPopup.restoreSelection();
+ },
+
+/* _restoreSelection : function() {
+ var e = window.event.srcElement;
+
+ // If user focus a non text input or textarea
+ if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text')
+ tinyMCEPopup.restoreSelection();
+ },*/
+
+ _onDOMLoaded : function() {
+ var t = tinyMCEPopup, ti = document.title, h, nv;
+
+ // Translate page
+ if (t.features.translate_i18n !== false) {
+ var map = {
+ "update": "Ok",
+ "insert": "Ok",
+ "cancel": "Cancel",
+ "not_set": "--",
+ "class_name": "Class name",
+ "browse": "Browse"
+ };
+
+ var langCode = tinymce.settings.language || 'en';
+ for (var key in map) {
+ tinymce.i18n.data[langCode + "." + key] = tinymce.i18n.translate(map[key]);
+ }
+
+ h = document.body.innerHTML;
+
+ // Replace a=x with a="x" in IE
+ if (tinymce.isIE) {
+ h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"');
+ }
+
+ document.dir = t.editor.getParam('directionality','');
+
+ if ((nv = t.editor.translate(h)) && nv != h) {
+ document.body.innerHTML = nv;
+ }
+
+ if ((nv = t.editor.translate(ti)) && nv != ti) {
+ document.title = ti = nv;
+ }
+ }
+
+ if (!t.editor.getParam('browser_preferred_colors', false) || !t.isWindow) {
+ t.dom.addClass(document.body, 'forceColors');
+ }
+
+ document.body.style.display = '';
+
+ // Restore selection in IE when focus is placed on a non textarea or input element of the type text
+ if (tinymce.isIE) {
+ document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection);
+
+ // Add base target element for it since it would fail with modal dialogs
+ t.dom.add(t.dom.select('head')[0], 'base', {target : '_self'});
+ }
+
+ t.restoreSelection();
+ t.resizeToInnerSize();
+
+ // Set inline title
+ if (!t.isWindow) {
+ t.editor.windowManager.setTitle(window, ti);
+ } else {
+ window.focus();
+ }
+
+ if (!tinymce.isIE && !t.isWindow) {
+ t.dom.bind(document, 'focus', function() {
+ t.editor.windowManager.focus(t.id);
+ });
+ }
+
+ // Patch for accessibility
+ tinymce.each(t.dom.select('select'), function(e) {
+ e.onkeydown = tinyMCEPopup._accessHandler;
+ });
+
+ // Call onInit
+ // Init must be called before focus so the selection won't get lost by the focus call
+ tinymce.each(t.listeners, function(o) {
+ o.func.call(o.scope, t.editor);
+ });
+
+ // Move focus to window
+ if (t.getWindowArg('mce_auto_focus', true)) {
+ window.focus();
+
+ // Focus element with mceFocus class
+ tinymce.each(document.forms, function(f) {
+ tinymce.each(f.elements, function(e) {
+ if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) {
+ e.focus();
+ return false; // Break loop
+ }
+ });
+ });
+ }
+
+ document.onkeyup = tinyMCEPopup._closeWinKeyHandler;
+
+ t.uiWindow.getEl('head').firstChild.firstChild.data = document.title;
+ },
+
+ _accessHandler : function(e) {
+ e = e || window.event;
+
+ if (e.keyCode == 13 || e.keyCode == 32) {
+ var elm = e.target || e.srcElement;
+
+ if (elm.onchange) {
+ elm.onchange();
+ }
+
+ return tinymce.dom.Event.cancel(e);
+ }
+ },
+
+ _closeWinKeyHandler : function(e) {
+ e = e || window.event;
+
+ if (e.keyCode == 27) {
+ tinyMCEPopup.close();
+ }
+ },
+
+ _eventProxy: function(id) {
+ return function(evt) {
+ tinyMCEPopup.dom.events.callNativeHandler(id, evt);
+ };
+ }
+};
+
+tinyMCEPopup.init();
+
+tinymce.util.Dispatcher = function(scope) {
+ this.scope = scope || this;
+ this.listeners = [];
+
+ this.add = function(callback, scope) {
+ this.listeners.push({cb : callback, scope : scope || this.scope});
+
+ return callback;
+ };
+
+ this.addToTop = function(callback, scope) {
+ var self = this, listener = {cb : callback, scope : scope || self.scope};
+
+ // Create new listeners if addToTop is executed in a dispatch loop
+ if (self.inDispatch) {
+ self.listeners = [listener].concat(self.listeners);
+ } else {
+ self.listeners.unshift(listener);
+ }
+
+ return callback;
+ };
+
+ this.remove = function(callback) {
+ var listeners = this.listeners, output = null;
+
+ tinymce.each(listeners, function(listener, i) {
+ if (callback == listener.cb) {
+ output = listener;
+ listeners.splice(i, 1);
+ return false;
+ }
+ });
+
+ return output;
+ };
+
+ this.dispatch = function() {
+ var self = this, returnValue, args = arguments, i, listeners = self.listeners, listener;
+
+ self.inDispatch = true;
+
+ // Needs to be a real loop since the listener count might change while looping
+ // And this is also more efficient
+ for (i = 0; i < listeners.length; i++) {
+ listener = listeners[i];
+ returnValue = listener.cb.apply(listener.scope, args.length > 0 ? args : [listener.scope]);
+
+ if (returnValue === false) {
+ break;
+ }
+ }
+
+ self.inDispatch = false;
+
+ return returnValue;
+ };
+};
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcetinymcejsfromrev26862trunksrcwpincludesjstinymcetiny_mcejs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/tinymce/tinymce.js (from rev 26862, trunk/src/wp-includes/js/tinymce/tiny_mce.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/tinymce.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/tinymce.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,34156 @@
</span><ins>+// 4.0.12 (2013-12-18)
+
+/**
+ * Compiled inline version. (Library mode)
+ */
+
+/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
+/*globals $code */
+
+(function(exports, undefined) {
+ "use strict";
+
+ var modules = {};
+
+ function require(ids, callback) {
+ var module, defs = [];
+
+ for (var i = 0; i < ids.length; ++i) {
+ module = modules[ids[i]] || resolve(ids[i]);
+ if (!module) {
+ throw 'module definition dependecy not found: ' + ids[i];
+ }
+
+ defs.push(module);
+ }
+
+ callback.apply(null, defs);
+ }
+
+ function define(id, dependencies, definition) {
+ if (typeof id !== 'string') {
+ throw 'invalid module definition, module id must be defined and be a string';
+ }
+
+ if (dependencies === undefined) {
+ throw 'invalid module definition, dependencies must be specified';
+ }
+
+ if (definition === undefined) {
+ throw 'invalid module definition, definition function must be specified';
+ }
+
+ require(dependencies, function() {
+ modules[id] = definition.apply(null, arguments);
+ });
+ }
+
+ function defined(id) {
+ return !!modules[id];
+ }
+
+ function resolve(id) {
+ var target = exports;
+ var fragments = id.split(/[.\/]/);
+
+ for (var fi = 0; fi < fragments.length; ++fi) {
+ if (!target[fragments[fi]]) {
+ return;
+ }
+
+ target = target[fragments[fi]];
+ }
+
+ return target;
+ }
+
+ function expose(ids) {
+ for (var i = 0; i < ids.length; i++) {
+ var target = exports;
+ var id = ids[i];
+ var fragments = id.split(/[.\/]/);
+
+ for (var fi = 0; fi < fragments.length - 1; ++fi) {
+ if (target[fragments[fi]] === undefined) {
+ target[fragments[fi]] = {};
+ }
+
+ target = target[fragments[fi]];
+ }
+
+ target[fragments[fragments.length - 1]] = modules[id];
+ }
+ }
+
+// Included from: js/tinymce/classes/dom/EventUtils.js
+
+/**
+ * EventUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint loopfunc:true*/
+
+define("tinymce/dom/EventUtils", [], function() {
+ "use strict";
+
+ var eventExpandoPrefix = "mce-data-";
+ var mouseEventRe = /^(?:mouse|contextmenu)|click/;
+ var deprecated = {keyLocation: 1, layerX: 1, layerY: 1, returnValue: 1};
+
+ /**
+ * Binds a native event to a callback on the speified target.
+ */
+ function addEvent(target, name, callback, capture) {
+ if (target.addEventListener) {
+ target.addEventListener(name, callback, capture || false);
+ } else if (target.attachEvent) {
+ target.attachEvent('on' + name, callback);
+ }
+ }
+
+ /**
+ * Unbinds a native event callback on the specified target.
+ */
+ function removeEvent(target, name, callback, capture) {
+ if (target.removeEventListener) {
+ target.removeEventListener(name, callback, capture || false);
+ } else if (target.detachEvent) {
+ target.detachEvent('on' + name, callback);
+ }
+ }
+
+ /**
+ * Normalizes a native event object or just adds the event specific methods on a custom event.
+ */
+ function fix(originalEvent, data) {
+ var name, event = data || {}, undef;
+
+ // Dummy function that gets replaced on the delegation state functions
+ function returnFalse() {
+ return false;
+ }
+
+ // Dummy function that gets replaced on the delegation state functions
+ function returnTrue() {
+ return true;
+ }
+
+ // Copy all properties from the original event
+ for (name in originalEvent) {
+ // layerX/layerY is deprecated in Chrome and produces a warning
+ if (!deprecated[name]) {
+ event[name] = originalEvent[name];
+ }
+ }
+
+ // Normalize target IE uses srcElement
+ if (!event.target) {
+ event.target = event.srcElement || document;
+ }
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if (originalEvent && mouseEventRe.test(originalEvent.type) && originalEvent.pageX === undef && originalEvent.clientX !== undef) {
+ var eventDoc = event.target.ownerDocument || document;
+ var doc = eventDoc.documentElement;
+ var body = eventDoc.body;
+
+ event.pageX = originalEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0 ) -
+ ( doc && doc.clientLeft || body && body.clientLeft || 0);
+
+ event.pageY = originalEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0 ) -
+ ( doc && doc.clientTop || body && body.clientTop || 0);
+ }
+
+ // Add preventDefault method
+ event.preventDefault = function() {
+ event.isDefaultPrevented = returnTrue;
+
+ // Execute preventDefault on the original event object
+ if (originalEvent) {
+ if (originalEvent.preventDefault) {
+ originalEvent.preventDefault();
+ } else {
+ originalEvent.returnValue = false; // IE
+ }
+ }
+ };
+
+ // Add stopPropagation
+ event.stopPropagation = function() {
+ event.isPropagationStopped = returnTrue;
+
+ // Execute stopPropagation on the original event object
+ if (originalEvent) {
+ if (originalEvent.stopPropagation) {
+ originalEvent.stopPropagation();
+ } else {
+ originalEvent.cancelBubble = true; // IE
+ }
+ }
+ };
+
+ // Add stopImmediatePropagation
+ event.stopImmediatePropagation = function() {
+ event.isImmediatePropagationStopped = returnTrue;
+ event.stopPropagation();
+ };
+
+ // Add event delegation states
+ if (!event.isDefaultPrevented) {
+ event.isDefaultPrevented = returnFalse;
+ event.isPropagationStopped = returnFalse;
+ event.isImmediatePropagationStopped = returnFalse;
+ }
+
+ return event;
+ }
+
+ /**
+ * Bind a DOMContentLoaded event across browsers and executes the callback once the page DOM is initialized.
+ * It will also set/check the domLoaded state of the event_utils instance so ready isn't called multiple times.
+ */
+ function bindOnReady(win, callback, eventUtils) {
+ var doc = win.document, event = {type: 'ready'};
+
+ if (eventUtils.domLoaded) {
+ callback(event);
+ return;
+ }
+
+ // Gets called when the DOM is ready
+ function readyHandler() {
+ if (!eventUtils.domLoaded) {
+ eventUtils.domLoaded = true;
+ callback(event);
+ }
+ }
+
+ function waitForDomLoaded() {
+ if (doc.readyState === "complete") {
+ removeEvent(doc, "readystatechange", waitForDomLoaded);
+ readyHandler();
+ }
+ }
+
+ function tryScroll() {
+ try {
+ // If IE is used, use the trick by Diego Perini licensed under MIT by request to the author.
+ // http://javascript.nwbox.com/IEContentLoaded/
+ doc.documentElement.doScroll("left");
+ } catch (ex) {
+ setTimeout(tryScroll, 0);
+ return;
+ }
+
+ readyHandler();
+ }
+
+ // Use W3C method
+ if (doc.addEventListener) {
+ if (doc.readyState === "complete") {
+ readyHandler();
+ } else {
+ addEvent(win, 'DOMContentLoaded', readyHandler);
+ }
+ } else {
+ // Use IE method
+ addEvent(doc, "readystatechange", waitForDomLoaded);
+
+ // Wait until we can scroll, when we can the DOM is initialized
+ if (doc.documentElement.doScroll && win === win.top) {
+ tryScroll();
+ }
+ }
+
+ // Fallback if any of the above methods should fail for some odd reason
+ addEvent(win, 'load', readyHandler);
+ }
+
+ /**
+ * This class enables you to bind/unbind native events to elements and normalize it's behavior across browsers.
+ */
+ function EventUtils() {
+ var self = this, events = {}, count, expando, hasFocusIn, hasMouseEnterLeave, mouseEnterLeave;
+
+ expando = eventExpandoPrefix + (+new Date()).toString(32);
+ hasMouseEnterLeave = "onmouseenter" in document.documentElement;
+ hasFocusIn = "onfocusin" in document.documentElement;
+ mouseEnterLeave = {mouseenter: 'mouseover', mouseleave: 'mouseout'};
+ count = 1;
+
+ // State if the DOMContentLoaded was executed or not
+ self.domLoaded = false;
+ self.events = events;
+
+ /**
+ * Executes all event handler callbacks for a specific event.
+ *
+ * @private
+ * @param {Event} evt Event object.
+ * @param {String} id Expando id value to look for.
+ */
+ function executeHandlers(evt, id) {
+ var callbackList, i, l, callback, container = events[id];
+
+ callbackList = container && container[evt.type];
+ if (callbackList) {
+ for (i = 0, l = callbackList.length; i < l; i++) {
+ callback = callbackList[i];
+
+ // Check if callback exists might be removed if a unbind is called inside the callback
+ if (callback && callback.func.call(callback.scope, evt) === false) {
+ evt.preventDefault();
+ }
+
+ // Should we stop propagation to immediate listeners
+ if (evt.isImmediatePropagationStopped()) {
+ return;
+ }
+ }
+ }
+ }
+
+ /**
+ * Binds a callback to an event on the specified target.
+ *
+ * @method bind
+ * @param {Object} target Target node/window or custom object.
+ * @param {String} names Name of the event to bind.
+ * @param {function} callback Callback function to execute when the event occurs.
+ * @param {Object} scope Scope to call the callback function on, defaults to target.
+ * @return {function} Callback function that got bound.
+ */
+ self.bind = function(target, names, callback, scope) {
+ var id, callbackList, i, name, fakeName, nativeHandler, capture, win = window;
+
+ // Native event handler function patches the event and executes the callbacks for the expando
+ function defaultNativeHandler(evt) {
+ executeHandlers(fix(evt || win.event), id);
+ }
+
+ // Don't bind to text nodes or comments
+ if (!target || target.nodeType === 3 || target.nodeType === 8) {
+ return;
+ }
+
+ // Create or get events id for the target
+ if (!target[expando]) {
+ id = count++;
+ target[expando] = id;
+ events[id] = {};
+ } else {
+ id = target[expando];
+ }
+
+ // Setup the specified scope or use the target as a default
+ scope = scope || target;
+
+ // Split names and bind each event, enables you to bind multiple events with one call
+ names = names.split(' ');
+ i = names.length;
+ while (i--) {
+ name = names[i];
+ nativeHandler = defaultNativeHandler;
+ fakeName = capture = false;
+
+ // Use ready instead of DOMContentLoaded
+ if (name === "DOMContentLoaded") {
+ name = "ready";
+ }
+
+ // DOM is already ready
+ if (self.domLoaded && name === "ready" && target.readyState == 'complete') {
+ callback.call(scope, fix({type: name}));
+ continue;
+ }
+
+ // Handle mouseenter/mouseleaver
+ if (!hasMouseEnterLeave) {
+ fakeName = mouseEnterLeave[name];
+
+ if (fakeName) {
+ nativeHandler = function(evt) {
+ var current, related;
+
+ current = evt.currentTarget;
+ related = evt.relatedTarget;
+
+ // Check if related is inside the current target if it's not then the event should
+ // be ignored since it's a mouseover/mouseout inside the element
+ if (related && current.contains) {
+ // Use contains for performance
+ related = current.contains(related);
+ } else {
+ while (related && related !== current) {
+ related = related.parentNode;
+ }
+ }
+
+ // Fire fake event
+ if (!related) {
+ evt = fix(evt || win.event);
+ evt.type = evt.type === 'mouseout' ? 'mouseleave' : 'mouseenter';
+ evt.target = current;
+ executeHandlers(evt, id);
+ }
+ };
+ }
+ }
+
+ // Fake bubbeling of focusin/focusout
+ if (!hasFocusIn && (name === "focusin" || name === "focusout")) {
+ capture = true;
+ fakeName = name === "focusin" ? "focus" : "blur";
+ nativeHandler = function(evt) {
+ evt = fix(evt || win.event);
+ evt.type = evt.type === 'focus' ? 'focusin' : 'focusout';
+ executeHandlers(evt, id);
+ };
+ }
+
+ // Setup callback list and bind native event
+ callbackList = events[id][name];
+ if (!callbackList) {
+ events[id][name] = callbackList = [{func: callback, scope: scope}];
+ callbackList.fakeName = fakeName;
+ callbackList.capture = capture;
+
+ // Add the nativeHandler to the callback list so that we can later unbind it
+ callbackList.nativeHandler = nativeHandler;
+
+ // Check if the target has native events support
+
+ if (name === "ready") {
+ bindOnReady(target, nativeHandler, self);
+ } else {
+ addEvent(target, fakeName || name, nativeHandler, capture);
+ }
+ } else {
+ if (name === "ready" && self.domLoaded) {
+ callback({type: name});
+ } else {
+ // If it already has an native handler then just push the callback
+ callbackList.push({func: callback, scope: scope});
+ }
+ }
+ }
+
+ target = callbackList = 0; // Clean memory for IE
+
+ return callback;
+ };
+
+ /**
+ * Unbinds the specified event by name, name and callback or all events on the target.
+ *
+ * @method unbind
+ * @param {Object} target Target node/window or custom object.
+ * @param {String} names Optional event name to unbind.
+ * @param {function} callback Optional callback function to unbind.
+ * @return {EventUtils} Event utils instance.
+ */
+ self.unbind = function(target, names, callback) {
+ var id, callbackList, i, ci, name, eventMap;
+
+ // Don't bind to text nodes or comments
+ if (!target || target.nodeType === 3 || target.nodeType === 8) {
+ return self;
+ }
+
+ // Unbind event or events if the target has the expando
+ id = target[expando];
+ if (id) {
+ eventMap = events[id];
+
+ // Specific callback
+ if (names) {
+ names = names.split(' ');
+ i = names.length;
+ while (i--) {
+ name = names[i];
+ callbackList = eventMap[name];
+
+ // Unbind the event if it exists in the map
+ if (callbackList) {
+ // Remove specified callback
+ if (callback) {
+ ci = callbackList.length;
+ while (ci--) {
+ if (callbackList[ci].func === callback) {
+ var nativeHandler = callbackList.nativeHandler;
+
+ // Clone callbackList since unbind inside a callback would otherwise break the handlers loop
+ callbackList = callbackList.slice(0, ci).concat(callbackList.slice(ci + 1));
+ callbackList.nativeHandler = nativeHandler;
+
+ eventMap[name] = callbackList;
+ }
+ }
+ }
+
+ // Remove all callbacks if there isn't a specified callback or there is no callbacks left
+ if (!callback || callbackList.length === 0) {
+ delete eventMap[name];
+ removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture);
+ }
+ }
+ }
+ } else {
+ // All events for a specific element
+ for (name in eventMap) {
+ callbackList = eventMap[name];
+ removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture);
+ }
+
+ eventMap = {};
+ }
+
+ // Check if object is empty, if it isn't then we won't remove the expando map
+ for (name in eventMap) {
+ return self;
+ }
+
+ // Delete event object
+ delete events[id];
+
+ // Remove expando from target
+ try {
+ // IE will fail here since it can't delete properties from window
+ delete target[expando];
+ } catch (ex) {
+ // IE will set it to null
+ target[expando] = null;
+ }
+ }
+
+ return self;
+ };
+
+ /**
+ * Fires the specified event on the specified target.
+ *
+ * @method fire
+ * @param {Object} target Target node/window or custom object.
+ * @param {String} name Event name to fire.
+ * @param {Object} args Optional arguments to send to the observers.
+ * @return {EventUtils} Event utils instance.
+ */
+ self.fire = function(target, name, args) {
+ var id;
+
+ // Don't bind to text nodes or comments
+ if (!target || target.nodeType === 3 || target.nodeType === 8) {
+ return self;
+ }
+
+ // Build event object by patching the args
+ args = fix(null, args);
+ args.type = name;
+ args.target = target;
+
+ do {
+ // Found an expando that means there is listeners to execute
+ id = target[expando];
+ if (id) {
+ executeHandlers(args, id);
+ }
+
+ // Walk up the DOM
+ target = target.parentNode || target.ownerDocument || target.defaultView || target.parentWindow;
+ } while (target && !args.isPropagationStopped());
+
+ return self;
+ };
+
+ /**
+ * Removes all bound event listeners for the specified target. This will also remove any bound
+ * listeners to child nodes within that target.
+ *
+ * @method clean
+ * @param {Object} target Target node/window object.
+ * @return {EventUtils} Event utils instance.
+ */
+ self.clean = function(target) {
+ var i, children, unbind = self.unbind;
+
+ // Don't bind to text nodes or comments
+ if (!target || target.nodeType === 3 || target.nodeType === 8) {
+ return self;
+ }
+
+ // Unbind any element on the specificed target
+ if (target[expando]) {
+ unbind(target);
+ }
+
+ // Target doesn't have getElementsByTagName it's probably a window object then use it's document to find the children
+ if (!target.getElementsByTagName) {
+ target = target.document;
+ }
+
+ // Remove events from each child element
+ if (target && target.getElementsByTagName) {
+ unbind(target);
+
+ children = target.getElementsByTagName('*');
+ i = children.length;
+ while (i--) {
+ target = children[i];
+
+ if (target[expando]) {
+ unbind(target);
+ }
+ }
+ }
+
+ return self;
+ };
+
+ /**
+ * Destroys the event object. Call this on IE to remove memory leaks.
+ */
+ self.destroy = function() {
+ events = {};
+ };
+
+ // Legacy function for canceling events
+ self.cancel = function(e) {
+ if (e) {
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ }
+
+ return false;
+ };
+ }
+
+ EventUtils.Event = new EventUtils();
+ EventUtils.Event.bind(window, 'ready', function() {});
+
+ return EventUtils;
+});
+
+// Included from: js/tinymce/classes/dom/Sizzle.js
+
+/**
+ * Sizzle.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ *
+ * @ignore-file
+ */
+
+/*jshint bitwise:false, expr:true, noempty:false, sub:true, eqnull:true, latedef:false, maxlen:255 */
+
+/*
+ * Sizzle CSS Selector Engine
+ * Copyright, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+define("tinymce/dom/Sizzle", [], function() {
+var i,
+ cachedruns,
+ Expr,
+ getText,
+ isXML,
+ compile,
+ outermostContext,
+ recompare,
+ sortInput,
+
+ // Local document vars
+ setDocument,
+ document,
+ docElem,
+ documentIsHTML,
+ rbuggyQSA,
+ rbuggyMatches,
+ matches,
+ contains,
+
+ // Instance-specific data
+ expando = "sizzle" + -(new Date()),
+ preferredDoc = window.document,
+ support = {},
+ dirruns = 0,
+ done = 0,
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
+ hasDuplicate = false,
+ sortOrder = function() { return 0; },
+
+ // General-purpose constants
+ strundefined = typeof undefined,
+ MAX_NEGATIVE = 1 << 31,
+
+ // Array methods
+ arr = [],
+ pop = arr.pop,
+ push_native = arr.push,
+ push = arr.push,
+ slice = arr.slice,
+ // Use a stripped-down indexOf if we can't use a native one
+ indexOf = arr.indexOf || function( elem ) {
+ var i = 0,
+ len = this.length;
+ for ( ; i < len; i++ ) {
+ if ( this[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
+
+
+ // Regular expressions
+
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
+ whitespace = "[\\x20\\t\\r\\n\\f]",
+ // http://www.w3.org/TR/css3-syntax/#characters
+ characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
+
+ // Loosely modeled on CSS identifier characters
+ // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+ identifier = characterEncoding.replace( "w", "w#" ),
+
+ // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
+ operators = "([*^$|!~]?=)",
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
+ "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
+
+ // Prefer arguments quoted,
+ // then not containing pseudos/brackets,
+ // then attribute selectors/non-parenthetical expressions,
+ // then anything else
+ // These preferences are here to reduce the number of selectors
+ // needing tokenize in the PSEUDO preFilter
+ pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
+
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+ rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
+ rpseudo = new RegExp( pseudos ),
+ ridentifier = new RegExp( "^" + identifier + "$" ),
+
+ matchExpr = {
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
+ "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
+ "ATTR": new RegExp( "^" + attributes ),
+ "PSEUDO": new RegExp( "^" + pseudos ),
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ // For use in libraries implementing .is()
+ // We use this for POS matching in `select`
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+ },
+
+ rsibling = /[\x20\t\r\n\f]*[+~]/,
+
+ rnative = /^[^{]+\{\s*\[native code/,
+
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
+ rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,
+
+ rinputs = /^(?:input|select|textarea|button)$/i,
+ rheader = /^h\d$/i,
+
+ rescape = /'|\\/g,
+ rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
+
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+ runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
+ funescape = function( _, escaped ) {
+ var high = "0x" + escaped - 0x10000;
+ // NaN means non-codepoint
+ return high !== high ?
+ escaped :
+ // BMP codepoint
+ high < 0 ?
+ String.fromCharCode( high + 0x10000 ) :
+ // Supplemental Plane codepoint (surrogate pair)
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+ };
+
+// Optimize for push.apply( _, NodeList )
+try {
+ push.apply(
+ (arr = slice.call( preferredDoc.childNodes )),
+ preferredDoc.childNodes
+ );
+ // Support: Android<4.0
+ // Detect silently failing push.apply
+ arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+ push = { apply: arr.length ?
+
+ // Leverage slice if possible
+ function( target, els ) {
+ push_native.apply( target, slice.call(els) );
+ } :
+
+ // Support: IE<9
+ // Otherwise append directly
+ function( target, els ) {
+ var j = target.length,
+ i = 0;
+ // Can't trust NodeList.length
+ while ( (target[j++] = els[i++]) ) {}
+ target.length = j - 1;
+ }
+ };
+}
+
+/**
+ * For feature detection
+ * @param {Function} fn The function to test for native support
+ */
+function isNative( fn ) {
+ return rnative.test( fn + "" );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ * deleting the oldest entry
+ */
+function createCache() {
+ var cache,
+ keys = [];
+
+ cache = function( key, value ) {
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+ if ( keys.push( key += " " ) > Expr.cacheLength ) {
+ // Only keep the most recent entries
+ delete cache[ keys.shift() ];
+ }
+ cache[ key ] = value;
+ return value;
+ };
+
+ return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+ fn[ expando ] = true;
+ return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+ var div = document.createElement("div");
+
+ try {
+ return !!fn( div );
+ } catch (e) {
+ return false;
+ } finally {
+ // release memory in IE
+ div = null;
+ }
+}
+
+function Sizzle( selector, context, results, seed ) {
+ var match, elem, m, nodeType,
+ // QSA vars
+ i, groups, old, nid, newContext, newSelector;
+
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+ setDocument( context );
+ }
+
+ context = context || document;
+ results = results || [];
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( documentIsHTML && !seed ) {
+
+ // Shortcuts
+ if ( (match = rquickExpr.exec( selector )) ) {
+ // Speed-up: Sizzle("#ID")
+ if ( (m = match[1]) ) {
+ if ( nodeType === 9 ) {
+ elem = context.getElementById( m );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE, Opera, and Webkit return items
+ // by name instead of ID
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+ } else {
+ // Context is not a document
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
+ contains( context, elem ) && elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ }
+
+ // Speed-up: Sizzle("TAG")
+ } else if ( match[2] ) {
+ push.apply( results, context.getElementsByTagName( selector ) );
+ return results;
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
+ push.apply( results, context.getElementsByClassName( m ) );
+ return results;
+ }
+ }
+
+ // QSA path
+ if ( support.qsa && !rbuggyQSA.test(selector) ) {
+ old = true;
+ nid = expando;
+ newContext = context;
+ newSelector = nodeType === 9 && selector;
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ groups = tokenize( selector );
+
+ if ( (old = context.getAttribute("id")) ) {
+ nid = old.replace( rescape, "\\$&" );
+ } else {
+ context.setAttribute( "id", nid );
+ }
+ nid = "[id='" + nid + "'] ";
+
+ i = groups.length;
+ while ( i-- ) {
+ groups[i] = nid + toSelector( groups[i] );
+ }
+ newContext = rsibling.test( selector ) && context.parentNode || context;
+ newSelector = groups.join(",");
+ }
+
+ if ( newSelector ) {
+ try {
+ push.apply( results,
+ newContext.querySelectorAll( newSelector )
+ );
+ return results;
+ } catch(qsaError) {
+ } finally {
+ if ( !old ) {
+ context.removeAttribute("id");
+ }
+ }
+ }
+ }
+ }
+
+ // All others
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Detect xml
+ * @param {Element|Object} elem An element or a document
+ */
+isXML = Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+ var doc = node ? node.ownerDocument || node : preferredDoc;
+
+ // If no document and documentElement is available, return
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+ return document;
+ }
+
+ // Set our document
+ document = doc;
+ docElem = doc.documentElement;
+
+ // Support tests
+ documentIsHTML = !isXML( doc );
+
+ // Check if getElementsByTagName("*") returns only elements
+ support.getElementsByTagName = assert(function( div ) {
+ div.appendChild( doc.createComment("") );
+ return !div.getElementsByTagName("*").length;
+ });
+
+ // Check if attributes should be retrieved by attribute nodes
+ support.attributes = assert(function( div ) {
+ div.innerHTML = "<select></select>";
+ var type = typeof div.lastChild.getAttribute("multiple");
+ // IE8 returns a string for some attributes even when not present
+ return type !== "boolean" && type !== "string";
+ });
+
+ // Check if getElementsByClassName can be trusted
+ support.getElementsByClassName = assert(function( div ) {
+ // Opera can't find a second classname (in 9.6)
+ div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
+ if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
+ return false;
+ }
+
+ // Safari 3.2 caches class attributes and doesn't catch changes
+ div.lastChild.className = "e";
+ return div.getElementsByClassName("e").length === 2;
+ });
+
+ // Check if getElementsByName privileges form controls or returns elements by ID
+ // If so, assume (for broader support) that getElementById returns elements by name
+ support.getByName = assert(function( div ) {
+ // Inject content
+ div.id = expando + 0;
+ // Support: Windows 8 Native Apps
+ // Assigning innerHTML with "name" attributes throws uncatchable exceptions
+ // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx
+ div.appendChild( document.createElement("a") ).setAttribute( "name", expando );
+ div.appendChild( document.createElement("i") ).setAttribute( "name", expando );
+ docElem.appendChild( div );
+
+ // Test
+ var pass = doc.getElementsByName &&
+ // buggy browsers will return fewer than the correct 2
+ doc.getElementsByName( expando ).length === 2 +
+ // buggy browsers will return more than the correct 0
+ doc.getElementsByName( expando + 0 ).length;
+
+ // Cleanup
+ docElem.removeChild( div );
+
+ return pass;
+ });
+
+ // Support: Webkit<537.32
+ // Detached nodes confoundingly follow *each other*
+ support.sortDetached = assert(function( div1 ) {
+ return div1.compareDocumentPosition &&
+ // Should return 1, but Webkit returns 4 (following)
+ (div1.compareDocumentPosition( document.createElement("div") ) & 1);
+ });
+
+ // IE6/7 return modified attributes
+ Expr.attrHandle = assert(function( div ) {
+ div.innerHTML = "<a href='#'></a>";
+ return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
+ div.firstChild.getAttribute("href") === "#";
+ }) ?
+ {} :
+ {
+ "href": function( elem ) {
+ return elem.getAttribute( "href", 2 );
+ },
+ "type": function( elem ) {
+ return elem.getAttribute("type");
+ }
+ };
+
+ // ID find and filter
+ if ( support.getByName ) {
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
+ var m = context.getElementById( id );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ };
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ return elem.getAttribute("id") === attrId;
+ };
+ };
+ } else {
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
+ var m = context.getElementById( id );
+
+ return m ?
+ m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
+ [m] :
+ undefined :
+ [];
+ }
+ };
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+ return node && node.value === attrId;
+ };
+ };
+ }
+
+ // Tag
+ Expr.find["TAG"] = support.getElementsByTagName ?
+ function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== strundefined ) {
+ return context.getElementsByTagName( tag );
+ }
+ } :
+ function( tag, context ) {
+ var elem,
+ tmp = [],
+ i = 0,
+ results = context.getElementsByTagName( tag );
+
+ // Filter out possible comments
+ if ( tag === "*" ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem.nodeType === 1 ) {
+ tmp.push( elem );
+ }
+ }
+
+ return tmp;
+ }
+ return results;
+ };
+
+ // Name
+ Expr.find["NAME"] = support.getByName && function( tag, context ) {
+ if ( typeof context.getElementsByName !== strundefined ) {
+ return context.getElementsByName( name );
+ }
+ };
+
+ // Class
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+ if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
+ return context.getElementsByClassName( className );
+ }
+ };
+
+ // QSA and matchesSelector support
+
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+ rbuggyMatches = [];
+
+ // qSa(:focus) reports false when true (Chrome 21),
+ // no need to also add to buggyMatches since matches checks buggyQSA
+ // A support test would require too much code (would include document ready)
+ rbuggyQSA = [ ":focus" ];
+
+ if ( (support.qsa = isNative(doc.querySelectorAll)) ) {
+ // Build QSA regex
+ // Regex strategy adopted from Diego Perini
+ assert(function( div ) {
+ // Select is set to empty string on purpose
+ // This is to test IE's treatment of not explicitly
+ // setting a boolean content attribute,
+ // since its presence should be enough
+ // http://bugs.jquery.com/ticket/12359
+ div.innerHTML = "<select><option selected=''></option></select>";
+
+ // IE8 - Some boolean attributes are not treated correctly
+ if ( !div.querySelectorAll("[selected]").length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
+ }
+
+ // Webkit/Opera - :checked should return selected option elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":checked").length ) {
+ rbuggyQSA.push(":checked");
+ }
+ });
+
+ assert(function( div ) {
+
+ // Opera 10-12/IE8 - ^= $= *= and empty values
+ // Should not select anything
+ div.innerHTML = "<input type='hidden' i=''/>";
+ if ( div.querySelectorAll("[i^='']").length ) {
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
+ }
+
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":enabled").length ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ // Opera 10-11 does not throw on post-comma invalid pseudos
+ div.querySelectorAll("*,:x");
+ rbuggyQSA.push(",.*:");
+ });
+ }
+
+ if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||
+ docElem.mozMatchesSelector ||
+ docElem.webkitMatchesSelector ||
+ docElem.oMatchesSelector ||
+ docElem.msMatchesSelector) )) ) {
+
+ assert(function( div ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9)
+ support.disconnectedMatch = matches.call( div, "div" );
+
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( div, "[s!='']:x" );
+ rbuggyMatches.push( "!=", pseudos );
+ });
+ }
+
+ rbuggyQSA = new RegExp( rbuggyQSA.join("|") );
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
+
+ // Element contains another
+ // Purposefully does not implement inclusive descendant
+ // As in, an element does not contain itself
+ contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
+ function( a, b ) {
+ var adown = a.nodeType === 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a === bup || !!( bup && bup.nodeType === 1 && (
+ adown.contains ?
+ adown.contains( bup ) :
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+ ));
+ } :
+ function( a, b ) {
+ if ( b ) {
+ while ( (b = b.parentNode) ) {
+ if ( b === a ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ // Document order sorting
+ sortOrder = docElem.compareDocumentPosition ?
+ function( a, b ) {
+
+ // Flag for duplicate removal
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );
+
+ if ( compare ) {
+ // Disconnected nodes
+ if ( compare & 1 ||
+ (recompare && b.compareDocumentPosition( a ) === compare) ) {
+
+ // Choose the first element that is related to our preferred document
+ if ( a === doc || contains(preferredDoc, a) ) {
+ return -1;
+ }
+ if ( b === doc || contains(preferredDoc, b) ) {
+ return 1;
+ }
+
+ // Maintain original order
+ return sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+ }
+
+ return compare & 4 ? -1 : 1;
+ }
+
+ // Not directly comparable, sort on existence of method
+ return a.compareDocumentPosition ? -1 : 1;
+ } :
+ function( a, b ) {
+ var cur,
+ i = 0,
+ aup = a.parentNode,
+ bup = b.parentNode,
+ ap = [ a ],
+ bp = [ b ];
+
+ // Exit early if the nodes are identical
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+
+ // Parentless nodes are either documents or disconnected
+ } else if ( !aup || !bup ) {
+ return a === doc ? -1 :
+ b === doc ? 1 :
+ aup ? -1 :
+ bup ? 1 :
+ 0;
+
+ // If the nodes are siblings, we can do a quick check
+ } else if ( aup === bup ) {
+ return siblingCheck( a, b );
+ }
+
+ // Otherwise we need full lists of their ancestors for comparison
+ cur = a;
+ while ( (cur = cur.parentNode) ) {
+ ap.unshift( cur );
+ }
+ cur = b;
+ while ( (cur = cur.parentNode) ) {
+ bp.unshift( cur );
+ }
+
+ // Walk down the tree looking for a discrepancy
+ while ( ap[i] === bp[i] ) {
+ i++;
+ }
+
+ return i ?
+ // Do a sibling check if the nodes have a common ancestor
+ siblingCheck( ap[i], bp[i] ) :
+
+ // Otherwise nodes in our document sort first
+ ap[i] === preferredDoc ? -1 :
+ bp[i] === preferredDoc ? 1 :
+ 0;
+ };
+
+ return document;
+};
+
+Sizzle.matches = function( expr, elements ) {
+ return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace( rattributeQuotes, "='$1']" );
+
+ // rbuggyQSA always contains :focus, so no need for an existence check
+ if ( support.matchesSelector && documentIsHTML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) {
+ try {
+ var ret = matches.call( elem, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || support.disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9
+ elem.document && elem.document.nodeType !== 11 ) {
+ return ret;
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle( expr, document, null, [elem] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+ // Set document vars if needed
+ if ( ( context.ownerDocument || context ) !== document ) {
+ setDocument( context );
+ }
+ return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+ var val;
+
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ if ( documentIsHTML ) {
+ name = name.toLowerCase();
+ }
+ if ( (val = Expr.attrHandle[ name ]) ) {
+ return val( elem );
+ }
+ if ( !documentIsHTML || support.attributes ) {
+ return elem.getAttribute( name );
+ }
+ return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?
+ name :
+ val && val.specified ? val.value : null;
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+// Document sorting and removing duplicates
+Sizzle.uniqueSort = function( results ) {
+ var elem,
+ duplicates = [],
+ j = 0,
+ i = 0;
+
+ // Unless we *know* we can detect duplicates, assume their presence
+ hasDuplicate = !support.detectDuplicates;
+ // Compensate for sort limitations
+ recompare = !support.sortDetached;
+ sortInput = !support.sortStable && results.slice( 0 );
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem === results[ i ] ) {
+ j = duplicates.push( i );
+ }
+ }
+ while ( j-- ) {
+ results.splice( duplicates[ j ], 1 );
+ }
+ }
+
+ return results;
+};
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns Returns -1 if a precedes b, 1 if a follows b
+ */
+function siblingCheck( a, b ) {
+ var cur = b && a,
+ diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );
+
+ // Use IE sourceIndex if available on both nodes
+ if ( diff ) {
+ return diff;
+ }
+
+ // Check if b follows a
+ if ( cur ) {
+ while ( (cur = cur.nextSibling) ) {
+ if ( cur === b ) {
+ return -1;
+ }
+ }
+ }
+
+ return a ? 1 : -1;
+}
+
+// Returns a function to use in pseudos for input types
+function createInputPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === type;
+ };
+}
+
+// Returns a function to use in pseudos for buttons
+function createButtonPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && elem.type === type;
+ };
+}
+
+// Returns a function to use in pseudos for positionals
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
+
+ // Match elements found at the specified indexes
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
+ });
+ });
+}
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
+
+ if ( !nodeType ) {
+ // If no nodeType, this is expected to be an array
+ for ( ; (node = elem[i]); i++ ) {
+ // Do not traverse comment nodes
+ ret += getText( node );
+ }
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ // Use textContent for elements
+ // innerText usage removed for consistency of new lines (see #11153)
+ if ( typeof elem.textContent === "string" ) {
+ return elem.textContent;
+ } else {
+ // Traverse its children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ // Do not include comment or processing instruction nodes
+
+ return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+ // Can be adjusted by the user
+ cacheLength: 50,
+
+ createPseudo: markFunction,
+
+ match: matchExpr,
+
+ find: {},
+
+ relative: {
+ ">": { dir: "parentNode", first: true },
+ " ": { dir: "parentNode" },
+ "+": { dir: "previousSibling", first: true },
+ "~": { dir: "previousSibling" }
+ },
+
+ preFilter: {
+ "ATTR": function( match ) {
+ match[1] = match[1].replace( runescape, funescape );
+
+ // Move the given value to match[3] whether quoted or unquoted
+ match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
+
+ if ( match[2] === "~=" ) {
+ match[3] = " " + match[3] + " ";
+ }
+
+ return match.slice( 0, 4 );
+ },
+
+ "CHILD": function( match ) {
+ /* matches from matchExpr["CHILD"]
+ 1 type (only|nth|...)
+ 2 what (child|of-type)
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
+ 5 sign of xn-component
+ 6 x of xn-component
+ 7 sign of y-component
+ 8 y of y-component
+ */
+ match[1] = match[1].toLowerCase();
+
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
+ // nth-* requires argument
+ if ( !match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // numeric x and y parameters for Expr.filter.CHILD
+ // remember that false/true cast respectively to 0/1
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+ // other types prohibit arguments
+ } else if ( match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ return match;
+ },
+
+ "PSEUDO": function( match ) {
+ var excess,
+ unquoted = !match[5] && match[2];
+
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
+ return null;
+ }
+
+ // Accept quoted arguments as-is
+ if ( match[4] ) {
+ match[2] = match[4];
+
+ // Strip excess characters from unquoted arguments
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
+ // Get excess from tokenize (recursively)
+ (excess = tokenize( unquoted, true )) &&
+ // advance to the next closing parenthesis
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+ // excess is a negative index
+ match[0] = match[0].slice( 0, excess );
+ match[2] = unquoted.slice( 0, excess );
+ }
+
+ // Return only captures needed by the pseudo filter method (type and argument)
+ return match.slice( 0, 3 );
+ }
+ },
+
+ filter: {
+
+ "TAG": function( nodeName ) {
+ if ( nodeName === "*" ) {
+ return function() { return true; };
+ }
+
+ nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
+ return function( elem ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
+ },
+
+ "CLASS": function( className ) {
+ var pattern = classCache[ className + " " ];
+
+ return pattern ||
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+ classCache( className, function( elem ) {
+ return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
+ });
+ },
+
+ "ATTR": function( name, operator, check ) {
+ return function( elem ) {
+ var result = Sizzle.attr( elem, name );
+
+ if ( result == null ) {
+ return operator === "!=";
+ }
+ if ( !operator ) {
+ return true;
+ }
+
+ result += "";
+
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.slice( -check.length ) === check :
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+ false;
+ };
+ },
+
+ "CHILD": function( type, what, argument, first, last ) {
+ var simple = type.slice( 0, 3 ) !== "nth",
+ forward = type.slice( -4 ) !== "last",
+ ofType = what === "of-type";
+
+ return first === 1 && last === 0 ?
+
+ // Shortcut for :nth-*(n)
+ function( elem ) {
+ return !!elem.parentNode;
+ } :
+
+ function( elem, context, xml ) {
+ var cache, outerCache, node, diff, nodeIndex, start,
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
+ parent = elem.parentNode,
+ name = ofType && elem.nodeName.toLowerCase(),
+ useCache = !xml && !ofType;
+
+ if ( parent ) {
+
+ // :(first|last|only)-(child|of-type)
+ if ( simple ) {
+ while ( dir ) {
+ node = elem;
+ while ( (node = node[ dir ]) ) {
+ if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ // Reverse direction for :only-* (if we haven't yet done so)
+ start = dir = type === "only" && !start && "nextSibling";
+ }
+ return true;
+ }
+
+ start = [ forward ? parent.firstChild : parent.lastChild ];
+
+ // non-xml :nth-child(...) stores cache data on `parent`
+ if ( forward && useCache ) {
+ // Seek `elem` from a previously-cached index
+ outerCache = parent[ expando ] || (parent[ expando ] = {});
+ cache = outerCache[ type ] || [];
+ nodeIndex = cache[0] === dirruns && cache[1];
+ diff = cache[0] === dirruns && cache[2];
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+ // Fallback to seeking `elem` from the start
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ // When found, cache indexes on `parent` and break
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
+ break;
+ }
+ }
+
+ // Use previously-cached element index if available
+ } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
+ diff = cache[1];
+
+ // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
+ } else {
+ // Use the same loop as above to seek `elem` from the start
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
+ // Cache the index of each encountered element
+ if ( useCache ) {
+ (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
+ }
+
+ if ( node === elem ) {
+ break;
+ }
+ }
+ }
+ }
+
+ // Incorporate the offset, then check against cycle size
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
+ }
+ };
+ },
+
+ "PSEUDO": function( pseudo, argument ) {
+ // pseudo-class names are case-insensitive
+ // http://www.w3.org/TR/selectors/#pseudo-classes
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+ // Remember that setFilters inherits from pseudos
+ var args,
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
+
+ // The user may use createPseudo to indicate that
+ // arguments are needed to create the filter function
+ // just as Sizzle does
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ // But maintain support for old signatures
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf.call( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
+ return fn( elem, 0, args );
+ };
+ }
+
+ return fn;
+ }
+ },
+
+ pseudos: {
+ // Potentially complex pseudos
+ "not": markFunction(function( selector ) {
+ // Trim the selector passed to compile
+ // to avoid treating leading and trailing
+ // spaces as combinators
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
+
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
+
+ // Match elements unmatched by `matcher`
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
+ }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ return !results.pop();
+ };
+ }),
+
+ "has": markFunction(function( selector ) {
+ return function( elem ) {
+ return Sizzle( selector, elem ).length > 0;
+ };
+ }),
+
+ "contains": markFunction(function( text ) {
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
+ // "Whether an element is represented by a :lang() selector
+ // is based solely on the element's language value
+ // being equal to the identifier C,
+ // or beginning with the identifier C immediately followed by "-".
+ // The matching of C against the element's language value is performed case-insensitively.
+ // The identifier C does not have to be a valid language name."
+ // http://www.w3.org/TR/selectors/#lang-pseudo
+ "lang": markFunction( function( lang ) {
+ // lang value must be a valid identifier
+ if ( !ridentifier.test(lang || "") ) {
+ Sizzle.error( "unsupported lang: " + lang );
+ }
+ lang = lang.replace( runescape, funescape ).toLowerCase();
+ return function( elem ) {
+ var elemLang;
+ do {
+ if ( (elemLang = documentIsHTML ?
+ elem.lang :
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+
+ elemLang = elemLang.toLowerCase();
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+ }
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+ return false;
+ };
+ }),
+
+ // Miscellaneous
+ "target": function( elem ) {
+ var hash = window.location && window.location.hash;
+ return hash && hash.slice( 1 ) === elem.id;
+ },
+
+ "root": function( elem ) {
+ return elem === docElem;
+ },
+
+ "focus": function( elem ) {
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+ },
+
+ // Boolean properties
+ "enabled": function( elem ) {
+ return elem.disabled === false;
+ },
+
+ "disabled": function( elem ) {
+ return elem.disabled === true;
+ },
+
+ "checked": function( elem ) {
+ // In CSS3, :checked should return both checked and selected elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ var nodeName = elem.nodeName.toLowerCase();
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+ },
+
+ "selected": function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ // Contents
+ "empty": function( elem ) {
+ // http://www.w3.org/TR/selectors/#empty-pseudo
+ // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
+ // not comment, processing instructions, or others
+ // Thanks to Diego Perini for the nodeName shortcut
+ // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ "parent": function( elem ) {
+ return !Expr.pseudos["empty"]( elem );
+ },
+
+ // Element/input types
+ "header": function( elem ) {
+ return rheader.test( elem.nodeName );
+ },
+
+ "input": function( elem ) {
+ return rinputs.test( elem.nodeName );
+ },
+
+ "button": function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === "button" || name === "button";
+ },
+
+ "text": function( elem ) {
+ var attr;
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
+ // use getAttribute instead to test this case
+ return elem.nodeName.toLowerCase() === "input" &&
+ elem.type === "text" &&
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
+ },
+
+ // Position-in-collection
+ "first": createPositionalPseudo(function() {
+ return [ 0 ];
+ }),
+
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
+ return [ length - 1 ];
+ }),
+
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
+
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 0;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 1;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
+ }
+};
+
+// Add button/input type pseudos
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+ Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+ Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+function tokenize( selector, parseOnly ) {
+ var matched, match, tokens, type,
+ soFar, groups, preFilters,
+ cached = tokenCache[ selector + " " ];
+
+ if ( cached ) {
+ return parseOnly ? 0 : cached.slice( 0 );
+ }
+
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+
+ while ( soFar ) {
+
+ // Comma and first run
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
+ if ( match ) {
+ // Don't consume trailing commas as valid
+ soFar = soFar.slice( match[0].length ) || soFar;
+ }
+ groups.push( tokens = [] );
+ }
+
+ matched = false;
+
+ // Combinators
+ if ( (match = rcombinators.exec( soFar )) ) {
+ matched = match.shift();
+ tokens.push( {
+ value: matched,
+ // Cast descendant combinators to space
+ type: match[0].replace( rtrim, " " )
+ } );
+ soFar = soFar.slice( matched.length );
+ }
+
+ // Filters
+ for ( type in Expr.filter ) {
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+ (match = preFilters[ type ]( match ))) ) {
+ matched = match.shift();
+ tokens.push( {
+ value: matched,
+ type: type,
+ matches: match
+ } );
+ soFar = soFar.slice( matched.length );
+ }
+ }
+
+ if ( !matched ) {
+ break;
+ }
+ }
+
+ // Return the length of the invalid excess
+ // if we're just parsing
+ // Otherwise, throw an error or return tokens
+ return parseOnly ?
+ soFar.length :
+ soFar ?
+ Sizzle.error( selector ) :
+ // Cache the tokens
+ tokenCache( selector, groups ).slice( 0 );
+}
+
+function toSelector( tokens ) {
+ var i = 0,
+ len = tokens.length,
+ selector = "";
+ for ( ; i < len; i++ ) {
+ selector += tokens[i].value;
+ }
+ return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+ var dir = combinator.dir,
+ checkNonElements = base && dir === "parentNode",
+ doneName = done++;
+
+ return combinator.first ?
+ // Check against closest ancestor/preceding element
+ function( elem, context, xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ return matcher( elem, context, xml );
+ }
+ }
+ } :
+
+ // Check against all ancestor/preceding elements
+ function( elem, context, xml ) {
+ var data, cache, outerCache,
+ dirkey = dirruns + " " + doneName;
+
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
+ if ( xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ if ( matcher( elem, context, xml ) ) {
+ return true;
+ }
+ }
+ }
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
+ if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
+ if ( (data = cache[1]) === true || data === cachedruns ) {
+ return data === true;
+ }
+ } else {
+ cache = outerCache[ dir ] = [ dirkey ];
+ cache[1] = matcher( elem, context, xml ) || cachedruns;
+ if ( cache[1] === true ) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ };
+}
+
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
+ } :
+ matchers[0];
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
+
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
+ }
+ }
+ }
+
+ return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ var temp, i, elem,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
+
+ // Get initial elements from seed or context
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
+
+ matcherOut = matcher ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+ // ...intermediate processing is necessary
+ [] :
+
+ // ...otherwise use results directly
+ results :
+ matcherIn;
+
+ // Find primary matches
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
+
+ // Apply postFilter
+ if ( postFilter ) {
+ temp = condense( matcherOut, postMap );
+ postFilter( temp, [], context, xml );
+
+ // Un-match failing elements by moving them back to matcherIn
+ i = temp.length;
+ while ( i-- ) {
+ if ( (elem = temp[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
+
+ if ( seed ) {
+ if ( postFinder || preFilter ) {
+ if ( postFinder ) {
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
+ temp = [];
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ // Restore matcherIn since elem is not yet a final match
+ temp.push( (matcherIn[i] = elem) );
+ }
+ }
+ postFinder( null, (matcherOut = []), temp, xml );
+ }
+
+ // Move matched elements from seed to results to keep them synchronized
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) &&
+ (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
+
+ seed[temp] = !(results[temp] = elem);
+ }
+ }
+ }
+
+ // Add elements to results, through postFinder if defined
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
+}
+
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
+
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf.call( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ } ];
+
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+ } else {
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ // Return special upon seeing a positional matcher
+ if ( matcher[ expando ] ) {
+ // Find the next relative operator (if any) for proper handling
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
+ }
+ }
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && toSelector( tokens )
+ );
+ }
+ matchers.push( matcher );
+ }
+ }
+
+ return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ // A counter to specify which element is currently being matched
+ var matcherCachedRuns = 0,
+ bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, expandContext ) {
+ var elem, j, matcher,
+ setMatched = [],
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ outermost = expandContext != null,
+ contextBackup = outermostContext,
+ // We must always have either seed elements or context
+ elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
+ // Use integer dirruns iff this is the outermost matcher
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
+
+ if ( outermost ) {
+ outermostContext = context !== document && context;
+ cachedruns = matcherCachedRuns;
+ }
+
+ // Add elements passing elementMatchers directly to results
+ // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ j = 0;
+ while ( (matcher = elementMatchers[j++]) ) {
+ if ( matcher( elem, context, xml ) ) {
+ results.push( elem );
+ break;
+ }
+ }
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ cachedruns = ++matcherCachedRuns;
+ }
+ }
+
+ // Track unmatched elements for set filters
+ if ( bySet ) {
+ // They will have gone through all possible matchers
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
+
+ // Lengthen the array for every element, matched or not
+ if ( seed ) {
+ unmatched.push( elem );
+ }
+ }
+ }
+
+ // Apply set filters to unmatched elements
+ matchedCount += i;
+ if ( bySet && i !== matchedCount ) {
+ j = 0;
+ while ( (matcher = setMatchers[j++]) ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
+
+ if ( seed ) {
+ // Reintegrate element matches to eliminate the need for sorting
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
+ }
+ }
+ }
+
+ // Discard index placeholder values to get only actual matches
+ setMatched = condense( setMatched );
+ }
+
+ // Add matches to results
+ push.apply( results, setMatched );
+
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
+
+ Sizzle.uniqueSort( results );
+ }
+ }
+
+ // Override manipulation of globals by nested matchers
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
+ }
+
+ return unmatched;
+ };
+
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ selector + " " ];
+
+ if ( !cached ) {
+ // Generate a function of recursive functions that can be used to check each element
+ if ( !group ) {
+ group = tokenize( selector );
+ }
+ i = group.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( group[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
+ } else {
+ elementMatchers.push( cached );
+ }
+ }
+
+ // Cache the compiled function
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+ }
+ return cached;
+};
+
+function multipleContexts( selector, contexts, results ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results );
+ }
+ return results;
+}
+
+function select( selector, context, results, seed ) {
+ var i, tokens, token, type, find,
+ match = tokenize( selector );
+
+ if ( !seed ) {
+ // Try to minimize operations if there is only one group
+ if ( match.length === 1 ) {
+
+ // Take a shortcut and set the context if the root selector is an ID
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ context.nodeType === 9 && documentIsHTML &&
+ Expr.relative[ tokens[1].type ] ) {
+
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+ if ( !context ) {
+ return results;
+ }
+
+ selector = selector.slice( tokens.shift().value.length );
+ }
+
+ // Fetch a seed set for right-to-left matching
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+ while ( i-- ) {
+ token = tokens[i];
+
+ // Abort if we hit a combinator
+ if ( Expr.relative[ (type = token.type) ] ) {
+ break;
+ }
+ if ( (find = Expr.find[ type ]) ) {
+ // Search, expanding context for leading sibling combinators
+ if ( (seed = find(
+ token.matches[0].replace( runescape, funescape ),
+ rsibling.test( tokens[0].type ) && context.parentNode || context
+ )) ) {
+
+ // If seed is empty or no tokens remain, we can return early
+ tokens.splice( i, 1 );
+ selector = seed.length && toSelector( tokens );
+ if ( !selector ) {
+ push.apply( results, seed );
+ return results;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Compile and execute a filtering function
+ // Provide `match` to avoid retokenization if we modified the selector above
+ compile( selector, match )(
+ seed,
+ context,
+ !documentIsHTML,
+ results,
+ rsibling.test( selector )
+ );
+ return results;
+}
+
+// Deprecated
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Easy API for creating new setFilters
+function setFilters() {}
+setFilters.prototype = Expr.filters = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+// Check sort stability
+support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
+
+// Initialize with the default document
+setDocument();
+
+// Always assume the presence of duplicates if sort doesn't
+// pass them to our comparison function (as in Google Chrome).
+[0, 0].sort( sortOrder );
+support.detectDuplicates = hasDuplicate;
+
+/*
+// EXPOSE
+if ( typeof define === "function" && define.amd ) {
+ define(function() { return Sizzle; });
+} else {
+ window.Sizzle = Sizzle;
+}
+*/
+
+// EXPOSE
+return Sizzle;
+});
+
+// Included from: js/tinymce/classes/dom/DomQuery.js
+
+/**
+ * DomQuery.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ *
+ * Some of this logic is based on jQuery code that is released under
+ * MIT license that grants us to sublicense it under LGPL.
+ *
+ * @ignore-file
+ */
+
+/**
+ * @class tinymce.dom.DomQuery
+ */
+define("tinymce/dom/DomQuery", [
+ "tinymce/dom/EventUtils",
+ "tinymce/dom/Sizzle"
+], function(EventUtils, Sizzle) {
+ var doc = document, push = Array.prototype.push, slice = Array.prototype.slice;
+ var rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/;
+ var Event = EventUtils.Event;
+
+ function isDefined(obj) {
+ return typeof obj !== "undefined";
+ }
+
+ function isString(obj) {
+ return typeof obj === "string";
+ }
+
+ function createFragment(html) {
+ var frag, node, container;
+
+ container = doc.createElement("div");
+ frag = doc.createDocumentFragment();
+ container.innerHTML = html;
+
+ while ((node = container.firstChild)) {
+ frag.appendChild(node);
+ }
+
+ return frag;
+ }
+
+ function domManipulate(targetNodes, sourceItem, callback) {
+ var i;
+
+ if (typeof sourceItem === "string") {
+ sourceItem = createFragment(sourceItem);
+ } else if (sourceItem.length) {
+ for (i = 0; i < sourceItem.length; i++) {
+ domManipulate(targetNodes, sourceItem[i], callback);
+ }
+
+ return targetNodes;
+ }
+
+ i = targetNodes.length;
+ while (i--) {
+ callback.call(targetNodes[i], sourceItem.parentNode ? sourceItem : sourceItem);
+ }
+
+ return targetNodes;
+ }
+
+ function hasClass(node, className) {
+ return node && className && (' ' + node.className + ' ').indexOf(' ' + className + ' ') !== -1;
+ }
+
+ /**
+ * Makes a map object out of a string that gets separated by a delimiter.
+ *
+ * @method makeMap
+ * @param {String} items Item string to split.
+ * @param {Object} map Optional object to add items to.
+ * @return {Object} name/value object with items as keys.
+ */
+ function makeMap(items, map) {
+ var i;
+
+ items = items || [];
+
+ if (typeof(items) == "string") {
+ items = items.split(' ');
+ }
+
+ map = map || {};
+
+ i = items.length;
+ while (i--) {
+ map[items[i]] = {};
+ }
+
+ return map;
+ }
+
+ var numericCssMap = makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom');
+
+ function DomQuery(selector, context) {
+ return new DomQuery.fn.init(selector, context);
+ }
+
+ /**
+ * Extends the specified object with another object.
+ *
+ * @method extend
+ * @param {Object} target Object to extend.
+ * @param {Object..} obj Multiple objects to extend with.
+ * @return {Object} Same as target, the extended object.
+ */
+ function extend(target) {
+ var args = arguments, arg, i, key;
+
+ for (i = 1; i < args.length; i++) {
+ arg = args[i];
+
+ for (key in arg) {
+ target[key] = arg[key];
+ }
+ }
+
+ return target;
+ }
+
+ /**
+ * Converts the specified object into a real JavaScript array.
+ *
+ * @method toArray
+ * @param {Object} obj Object to convert into array.
+ * @return {Array} Array object based in input.
+ */
+ function toArray(obj) {
+ var array = [], i, l;
+
+ for (i = 0, l = obj.length; i < l; i++) {
+ array[i] = obj[i];
+ }
+
+ return array;
+ }
+
+ /**
+ * Returns the index of the specified item inside the array.
+ *
+ * @method inArray
+ * @param {Object} item Item to look for.
+ * @param {Array} array Array to look for item in.
+ * @return {Number} Index of the item or -1.
+ */
+ function inArray(item, array) {
+ var i;
+
+ if (array.indexOf) {
+ return array.indexOf(item);
+ }
+
+ i = array.length;
+ while (i--) {
+ if (array[i] === item) {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ /**
+ * Returns true/false if the specified object is an array.
+ *
+ * @method isArray
+ * @param {Object} obj Object to check if it's an array.
+ * @return {Boolean} true/false if the input object is array or not.
+ */
+ var isArray = Array.isArray || function(obj) {
+ return Object.prototype.toString.call(obj) === "[object Array]";
+ };
+
+ var whiteSpaceRegExp = /^\s*|\s*$/g;
+ var trim = function(str) {
+ return (str === null || str === undefined) ? '' : ("" + str).replace(whiteSpaceRegExp, '');
+ };
+
+ /**
+ * Executes the callback function for each item in array/object. If you return false in the
+ * callback it will break the loop.
+ *
+ * @method each
+ * @param {Object} obj Object to iterate.
+ * @param {function} callback Callback function to execute for each item.
+ */
+ function each(obj, callback) {
+ var length, key, i, undef, value;
+
+ if (obj) {
+ length = obj.length;
+
+ if (length === undef) {
+ // Loop object items
+ for (key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ value = obj[key];
+ if (callback.call(value, value, key) === false) {
+ break;
+ }
+ }
+ }
+ } else {
+ // Loop array items
+ for (i = 0; i < length; i++) {
+ value = obj[i];
+ if (callback.call(value, value, key) === false) {
+ break;
+ }
+ }
+ }
+ }
+
+ return obj;
+ }
+
+ DomQuery.fn = DomQuery.prototype = {
+ constructor: DomQuery,
+ selector: "",
+ length: 0,
+
+ init: function(selector, context) {
+ var self = this, match, node;
+
+ if (!selector) {
+ return self;
+ }
+
+ if (selector.nodeType) {
+ self.context = self[0] = selector;
+ self.length = 1;
+
+ return self;
+ }
+
+ if (isString(selector)) {
+ if (selector.charAt(0) === "<" && selector.charAt(selector.length - 1) === ">" && selector.length >= 3) {
+ match = [null, selector, null];
+ } else {
+ match = rquickExpr.exec(selector);
+ }
+
+ if (match) {
+ if (match[1]) {
+ node = createFragment(selector).firstChild;
+ while (node) {
+ this.add(node);
+ node = node.nextSibling;
+ }
+ } else {
+ node = doc.getElementById(match[2]);
+
+ if (node.id !== match[2]) {
+ return self.find(selector);
+ }
+
+ self.length = 1;
+ self[0] = node;
+ }
+ } else {
+ return DomQuery(context || document).find(selector);
+ }
+ } else {
+ this.add(selector);
+ }
+
+ return self;
+ },
+
+ toArray: function() {
+ return toArray(this);
+ },
+
+ add: function(items) {
+ var self = this;
+
+ // Force single item into array
+ if (!isArray(items)) {
+ if (items instanceof DomQuery) {
+ self.add(items.toArray());
+ } else {
+ push.call(self, items);
+ }
+ } else {
+ push.apply(self, items);
+ }
+
+ return self;
+ },
+
+ attr: function(name, value) {
+ var self = this;
+
+ if (typeof name === "object") {
+ each(name, function(value, name) {
+ self.attr(name, value);
+ });
+ } else if (isDefined(value)) {
+ this.each(function() {
+ if (this.nodeType === 1) {
+ this.setAttribute(name, value);
+ }
+ });
+ } else {
+ return self[0] && self[0].nodeType === 1 ? self[0].getAttribute(name) : undefined;
+ }
+
+ return self;
+ },
+
+ css: function(name, value) {
+ var self = this;
+
+ if (typeof name === "object") {
+ each(name, function(value, name) {
+ self.css(name, value);
+ });
+ } else {
+ // Camelcase it, if needed
+ name = name.replace(/-(\D)/g, function(a, b) {
+ return b.toUpperCase();
+ });
+
+ if (isDefined(value)) {
+ // Default px suffix on these
+ if (typeof(value) === 'number' && !numericCssMap[name]) {
+ value += 'px';
+ }
+
+ self.each(function() {
+ var style = this.style;
+
+ // IE specific opacity
+ if (name === "opacity" && this.runtimeStyle && typeof(this.runtimeStyle.opacity) === "undefined") {
+ style.filter = value === '' ? '' : "alpha(opacity=" + (value * 100) + ")";
+ }
+
+ try {
+ style[name] = value;
+ } catch (ex) {
+ // Ignore
+ }
+ });
+ } else {
+ return self[0] ? self[0].style[name] : undefined;
+ }
+ }
+
+ return self;
+ },
+
+ remove: function() {
+ var self = this, node, i = this.length;
+
+ while (i--) {
+ node = self[i];
+ Event.clean(node);
+
+ if (node.parentNode) {
+ node.parentNode.removeChild(node);
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ var self = this, node, i = this.length;
+
+ while (i--) {
+ node = self[i];
+ while (node.firstChild) {
+ node.removeChild(node.firstChild);
+ }
+ }
+
+ return this;
+ },
+
+ html: function(value) {
+ var self = this, i;
+
+ if (isDefined(value)) {
+ i = self.length;
+ while (i--) {
+ self[i].innerHTML = value;
+ }
+
+ return self;
+ }
+
+ return self[0] ? self[0].innerHTML : '';
+ },
+
+ text: function(value) {
+ var self = this, i;
+
+ if (isDefined(value)) {
+ i = self.length;
+ while (i--) {
+ self[i].innerText = self[0].textContent = value;
+ }
+
+ return self;
+ }
+
+ return self[0] ? self[0].innerText || self[0].textContent : '';
+ },
+
+ append: function() {
+ return domManipulate(this, arguments, function(node) {
+ if (this.nodeType === 1) {
+ this.appendChild(node);
+ }
+ });
+ },
+
+ prepend: function() {
+ return domManipulate(this, arguments, function(node) {
+ if (this.nodeType === 1) {
+ this.insertBefore(node, this.firstChild);
+ }
+ });
+ },
+
+ before: function() {
+ var self = this;
+
+ if (self[0] && self[0].parentNode) {
+ return domManipulate(self, arguments, function(node) {
+ this.parentNode.insertBefore(node, this.nextSibling);
+ });
+ }
+
+ return self;
+ },
+
+ after: function() {
+ var self = this;
+
+ if (self[0] && self[0].parentNode) {
+ return domManipulate(self, arguments, function(node) {
+ this.parentNode.insertBefore(node, this);
+ });
+ }
+
+ return self;
+ },
+
+ appendTo: function(val) {
+ DomQuery(val).append(this);
+
+ return this;
+ },
+
+ addClass: function(className) {
+ return this.toggleClass(className, true);
+ },
+
+ removeClass: function(className) {
+ return this.toggleClass(className, false);
+ },
+
+ toggleClass: function(className, state) {
+ var self = this;
+
+ if (className.indexOf(' ') !== -1) {
+ each(className.split(' '), function() {
+ self.toggleClass(this, state);
+ });
+ } else {
+ self.each(function() {
+ var node = this, existingClassName;
+
+ if (hasClass(node, className) !== state) {
+ existingClassName = node.className;
+
+ if (state) {
+ node.className += existingClassName ? ' ' + className : className;
+ } else {
+ node.className = trim((" " + existingClassName + " ").replace(' ' + className + ' ', ' '));
+ }
+ }
+ });
+ }
+
+ return self;
+ },
+
+ hasClass: function(className) {
+ return hasClass(this[0], className);
+ },
+
+ each: function(callback) {
+ return each(this, callback);
+ },
+
+ on: function(name, callback) {
+ return this.each(function() {
+ Event.bind(this, name, callback);
+ });
+ },
+
+ off: function(name, callback) {
+ return this.each(function() {
+ Event.unbind(this, name, callback);
+ });
+ },
+
+ show: function() {
+ return this.css('display', '');
+ },
+
+ hide: function() {
+ return this.css('display', 'none');
+ },
+
+ slice: function() {
+ return new DomQuery(slice.apply(this, arguments));
+ },
+
+ eq: function(index) {
+ return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
+ },
+
+ first: function() {
+ return this.eq(0);
+ },
+
+ last: function() {
+ return this.eq(-1);
+ },
+
+ replaceWith: function(content) {
+ var self = this;
+
+ if (self[0]) {
+ self[0].parentNode.replaceChild(DomQuery(content)[0], self[0]);
+ }
+
+ return self;
+ },
+
+ wrap: function(wrapper) {
+ wrapper = DomQuery(wrapper)[0];
+
+ return this.each(function() {
+ var self = this, newWrapper = wrapper.cloneNode(false);
+ self.parentNode.insertBefore(newWrapper, self);
+ newWrapper.appendChild(self);
+ });
+ },
+
+ unwrap: function() {
+ return this.each(function() {
+ var self = this, node = self.firstChild, currentNode;
+
+ while (node) {
+ currentNode = node;
+ node = node.nextSibling;
+ self.parentNode.insertBefore(currentNode, self);
+ }
+ });
+ },
+
+ clone: function() {
+ var result = [];
+
+ this.each(function() {
+ result.push(this.cloneNode(true));
+ });
+
+ return DomQuery(result);
+ },
+
+ find: function(selector) {
+ var i, l, ret = [];
+
+ for (i = 0, l = this.length; i < l; i++) {
+ DomQuery.find(selector, this[i], ret);
+ }
+
+ return DomQuery(ret);
+ },
+
+ push: push,
+ sort: [].sort,
+ splice: [].splice
+ };
+
+ // Static members
+ extend(DomQuery, {
+ extend: extend,
+ toArray: toArray,
+ inArray: inArray,
+ isArray: isArray,
+ each: each,
+ trim: trim,
+ makeMap: makeMap,
+
+ // Sizzle
+ find: Sizzle,
+ expr: Sizzle.selectors,
+ unique: Sizzle.uniqueSort,
+ text: Sizzle.getText,
+ isXMLDoc: Sizzle.isXML,
+ contains: Sizzle.contains,
+ filter: function(expr, elems, not) {
+ if (not) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 ?
+ DomQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : [] :
+ DomQuery.find.matches(expr, elems);
+ }
+ });
+
+ function dir(el, prop, until) {
+ var matched = [], cur = el[prop];
+
+ while (cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !DomQuery(cur).is(until))) {
+ if (cur.nodeType === 1) {
+ matched.push(cur);
+ }
+
+ cur = cur[prop];
+ }
+
+ return matched;
+ }
+
+ function sibling(n, el, siblingName, nodeType) {
+ var r = [];
+
+ for(; n; n = n[siblingName]) {
+ if ((!nodeType || n.nodeType === nodeType) && n !== el) {
+ r.push(n);
+ }
+ }
+
+ return r;
+ }
+
+ each({
+ parent: function(node) {
+ var parent = node.parentNode;
+
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+
+ parents: function(node) {
+ return dir(node, "parentNode");
+ },
+
+ parentsUntil: function(node, until) {
+ return dir(node, "parentNode", until);
+ },
+
+ next: function(node) {
+ return sibling(node, 'nextSibling', 1);
+ },
+
+ prev: function(node) {
+ return sibling(node, 'previousSibling', 1);
+ },
+
+ nextNodes: function(node) {
+ return sibling(node, 'nextSibling');
+ },
+
+ prevNodes: function(node) {
+ return sibling(node, 'previousSibling');
+ },
+
+ children: function(node) {
+ return sibling(node.firstChild, 'nextSibling', 1);
+ },
+
+ contents: function(node) {
+ return toArray((node.nodeName === "iframe" ? node.contentDocument || node.contentWindow.document : node).childNodes);
+ }
+ }, function(name, fn){
+ DomQuery.fn[name] = function(selector) {
+ var self = this, result;
+
+ if (self.length > 1) {
+ throw new Error("DomQuery only supports traverse functions on a single node.");
+ }
+
+ if (self[0]) {
+ result = fn(self[0], selector);
+ }
+
+ result = DomQuery(result);
+
+ if (selector && name !== "parentsUntil") {
+ return result.filter(selector);
+ }
+
+ return result;
+ };
+ });
+
+ DomQuery.fn.filter = function(selector) {
+ return DomQuery.filter(selector);
+ };
+
+ DomQuery.fn.is = function(selector) {
+ return !!selector && this.filter(selector).length > 0;
+ };
+
+ DomQuery.fn.init.prototype = DomQuery.fn;
+
+ return DomQuery;
+});
+
+// Included from: js/tinymce/classes/html/Styles.js
+
+/**
+ * Styles.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to parse CSS styles it also compresses styles to reduce the output size.
+ *
+ * @example
+ * var Styles = new tinymce.html.Styles({
+ * url_converter: function(url) {
+ * return url;
+ * }
+ * });
+ *
+ * styles = Styles.parse('border: 1px solid red');
+ * styles.color = 'red';
+ *
+ * console.log(new tinymce.html.StyleSerializer().serialize(styles));
+ *
+ * @class tinymce.html.Styles
+ * @version 3.4
+ */
+define("tinymce/html/Styles", [], function() {
+ return function(settings, schema) {
+ /*jshint maxlen:255 */
+ var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,
+ urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,
+ styleRegExp = /\s*([^:]+):\s*([^;]+);?/g,
+ trimRightRegExp = /\s+$/,
+ undef, i, encodingLookup = {}, encodingItems, invisibleChar = '\uFEFF';
+
+ settings = settings || {};
+
+ encodingItems = ('\\" \\\' \\; \\: ; : ' + invisibleChar).split(' ');
+ for (i = 0; i < encodingItems.length; i++) {
+ encodingLookup[encodingItems[i]] = invisibleChar + i;
+ encodingLookup[invisibleChar + i] = encodingItems[i];
+ }
+
+ function toHex(match, r, g, b) {
+ function hex(val) {
+ val = parseInt(val, 10).toString(16);
+
+ return val.length > 1 ? val : '0' + val; // 0 -> 00
+ }
+
+ return '#' + hex(r) + hex(g) + hex(b);
+ }
+
+ return {
+ /**
+ * Parses the specified RGB color value and returns a hex version of that color.
+ *
+ * @method toHex
+ * @param {String} color RGB string value like rgb(1,2,3)
+ * @return {String} Hex version of that RGB value like #FF00FF.
+ */
+ toHex: function(color) {
+ return color.replace(rgbRegExp, toHex);
+ },
+
+ /**
+ * Parses the specified style value into an object collection. This parser will also
+ * merge and remove any redundant items that browsers might have added. It will also convert non hex
+ * colors to hex values. Urls inside the styles will also be converted to absolute/relative based on settings.
+ *
+ * @method parse
+ * @param {String} css Style value to parse for example: border:1px solid red;.
+ * @return {Object} Object representation of that style like {border: '1px solid red'}
+ */
+ parse: function(css) {
+ var styles = {}, matches, name, value, isEncoded, urlConverter = settings.url_converter;
+ var urlConverterScope = settings.url_converter_scope || this;
+
+ function compress(prefix, suffix, noJoin) {
+ var top, right, bottom, left;
+
+ top = styles[prefix + '-top' + suffix];
+ if (!top) {
+ return;
+ }
+
+ right = styles[prefix + '-right' + suffix];
+ if (!right) {
+ return;
+ }
+
+ bottom = styles[prefix + '-bottom' + suffix];
+ if (!bottom) {
+ return;
+ }
+
+ left = styles[prefix + '-left' + suffix];
+ if (!left) {
+ return;
+ }
+
+ var box = [top, right, bottom, left];
+ i = box.length - 1;
+ while (i--) {
+ if (box[i] !== box[i + 1]) {
+ break;
+ }
+ }
+
+ if (i > -1 && noJoin) {
+ return;
+ }
+
+ styles[prefix + suffix] = i == -1 ? box[0] : box.join(' ');
+ delete styles[prefix + '-top' + suffix];
+ delete styles[prefix + '-right' + suffix];
+ delete styles[prefix + '-bottom' + suffix];
+ delete styles[prefix + '-left' + suffix];
+ }
+
+ /**
+ * Checks if the specific style can be compressed in other words if all border-width are equal.
+ */
+ function canCompress(key) {
+ var value = styles[key], i;
+
+ if (!value) {
+ return;
+ }
+
+ value = value.split(' ');
+ i = value.length;
+ while (i--) {
+ if (value[i] !== value[0]) {
+ return false;
+ }
+ }
+
+ styles[key] = value[0];
+
+ return true;
+ }
+
+ /**
+ * Compresses multiple styles into one style.
+ */
+ function compress2(target, a, b, c) {
+ if (!canCompress(a)) {
+ return;
+ }
+
+ if (!canCompress(b)) {
+ return;
+ }
+
+ if (!canCompress(c)) {
+ return;
+ }
+
+ // Compress
+ styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];
+ delete styles[a];
+ delete styles[b];
+ delete styles[c];
+ }
+
+ // Encodes the specified string by replacing all \" \' ; : with _<num>
+ function encode(str) {
+ isEncoded = true;
+
+ return encodingLookup[str];
+ }
+
+ // Decodes the specified string by replacing all _<num> with it's original value \" \' etc
+ // It will also decode the \" \' if keep_slashes is set to fale or omitted
+ function decode(str, keep_slashes) {
+ if (isEncoded) {
+ str = str.replace(/\uFEFF[0-9]/g, function(str) {
+ return encodingLookup[str];
+ });
+ }
+
+ if (!keep_slashes) {
+ str = str.replace(/\\([\'\";:])/g, "$1");
+ }
+
+ return str;
+ }
+
+ function processUrl(match, url, url2, url3, str, str2) {
+ str = str || str2;
+
+ if (str) {
+ str = decode(str);
+
+ // Force strings into single quote format
+ return "'" + str.replace(/\'/g, "\\'") + "'";
+ }
+
+ url = decode(url || url2 || url3);
+
+ if (!settings.allow_script_urls && /(java|vb)script:/i.test(url.replace(/[\s\r\n]+/, ''))) {
+ return "";
+ }
+
+ // Convert the URL to relative/absolute depending on config
+ if (urlConverter) {
+ url = urlConverter.call(urlConverterScope, url, 'style');
+ }
+
+ // Output new URL format
+ return "url('" + url.replace(/\'/g, "\\'") + "')";
+ }
+
+ if (css) {
+ css = css.replace(/[\u0000-\u001F]/g, '');
+
+ // Encode \" \' % and ; and : inside strings so they don't interfere with the style parsing
+ css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function(str) {
+ return str.replace(/[;:]/g, encode);
+ });
+
+ // Parse styles
+ while ((matches = styleRegExp.exec(css))) {
+ name = matches[1].replace(trimRightRegExp, '').toLowerCase();
+ value = matches[2].replace(trimRightRegExp, '');
+
+ if (name && value.length > 0) {
+ if (!settings.allow_script_urls && (name == "behavior" || /expression\s*\(/.test(value))) {
+ continue;
+ }
+
+ // Opera will produce 700 instead of bold in their style values
+ if (name === 'font-weight' && value === '700') {
+ value = 'bold';
+ } else if (name === 'color' || name === 'background-color') { // Lowercase colors like RED
+ value = value.toLowerCase();
+ }
+
+ // Convert RGB colors to HEX
+ value = value.replace(rgbRegExp, toHex);
+
+ // Convert URLs and force them into url('value') format
+ value = value.replace(urlOrStrRegExp, processUrl);
+ styles[name] = isEncoded ? decode(value, true) : value;
+ }
+
+ styleRegExp.lastIndex = matches.index + matches[0].length;
+ }
+ // Compress the styles to reduce it's size for example IE will expand styles
+ compress("border", "", true);
+ compress("border", "-width");
+ compress("border", "-color");
+ compress("border", "-style");
+ compress("padding", "");
+ compress("margin", "");
+ compress2('border', 'border-width', 'border-style', 'border-color');
+
+ // Remove pointless border, IE produces these
+ if (styles.border === 'medium none') {
+ delete styles.border;
+ }
+
+ // IE 11 will produce a border-image: none when getting the style attribute from <p style="border: 1px solid red"></p>
+ // So lets asume it shouldn't be there
+ if (styles['border-image'] === 'none') {
+ delete styles['border-image'];
+ }
+ }
+
+ return styles;
+ },
+
+ /**
+ * Serializes the specified style object into a string.
+ *
+ * @method serialize
+ * @param {Object} styles Object to serialize as string for example: {border: '1px solid red'}
+ * @param {String} element_name Optional element name, if specified only the styles that matches the schema will be serialized.
+ * @return {String} String representation of the style object for example: border: 1px solid red.
+ */
+ serialize: function(styles, element_name) {
+ var css = '', name, value;
+
+ function serializeStyles(name) {
+ var styleList, i, l, value;
+
+ styleList = schema.styles[name];
+ if (styleList) {
+ for (i = 0, l = styleList.length; i < l; i++) {
+ name = styleList[i];
+ value = styles[name];
+
+ if (value !== undef && value.length > 0) {
+ css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';
+ }
+ }
+ }
+ }
+
+ // Serialize styles according to schema
+ if (element_name && schema && schema.styles) {
+ // Serialize global styles and element specific styles
+ serializeStyles('*');
+ serializeStyles(element_name);
+ } else {
+ // Output the styles in the order they are inside the object
+ for (name in styles) {
+ value = styles[name];
+
+ if (value !== undef && value.length > 0) {
+ css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';
+ }
+ }
+ }
+
+ return css;
+ }
+ };
+ };
+});
+
+// Included from: js/tinymce/classes/dom/TreeWalker.js
+
+/**
+ * TreeWalker.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * TreeWalker class enables you to walk the DOM in a linear manner.
+ *
+ * @class tinymce.dom.TreeWalker
+ */
+define("tinymce/dom/TreeWalker", [], function() {
+ return function(start_node, root_node) {
+ var node = start_node;
+
+ function findSibling(node, start_name, sibling_name, shallow) {
+ var sibling, parent;
+
+ if (node) {
+ // Walk into nodes if it has a start
+ if (!shallow && node[start_name]) {
+ return node[start_name];
+ }
+
+ // Return the sibling if it has one
+ if (node != root_node) {
+ sibling = node[sibling_name];
+ if (sibling) {
+ return sibling;
+ }
+
+ // Walk up the parents to look for siblings
+ for (parent = node.parentNode; parent && parent != root_node; parent = parent.parentNode) {
+ sibling = parent[sibling_name];
+ if (sibling) {
+ return sibling;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns the current node.
+ *
+ * @method current
+ * @return {Node} Current node where the walker is.
+ */
+ this.current = function() {
+ return node;
+ };
+
+ /**
+ * Walks to the next node in tree.
+ *
+ * @method next
+ * @return {Node} Current node where the walker is after moving to the next node.
+ */
+ this.next = function(shallow) {
+ node = findSibling(node, 'firstChild', 'nextSibling', shallow);
+ return node;
+ };
+
+ /**
+ * Walks to the previous node in tree.
+ *
+ * @method prev
+ * @return {Node} Current node where the walker is after moving to the previous node.
+ */
+ this.prev = function(shallow) {
+ node = findSibling(node, 'lastChild', 'previousSibling', shallow);
+ return node;
+ };
+ };
+});
+
+// Included from: js/tinymce/classes/util/Tools.js
+
+/**
+ * Tools.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains various utlity functions. These are also exposed
+ * directly on the tinymce namespace.
+ *
+ * @class tinymce.util.Tools
+ */
+define("tinymce/util/Tools", [], function() {
+ /**
+ * Removes whitespace from the beginning and end of a string.
+ *
+ * @method trim
+ * @param {String} s String to remove whitespace from.
+ * @return {String} New string with removed whitespace.
+ */
+ var whiteSpaceRegExp = /^\s*|\s*$/g;
+ var trim = function(str) {
+ return (str === null || str === undefined) ? '' : ("" + str).replace(whiteSpaceRegExp, '');
+ };
+
+ /**
+ * Returns true/false if the object is an array or not.
+ *
+ * @method isArray
+ * @param {Object} obj Object to check.
+ * @return {boolean} true/false state if the object is an array or not.
+ */
+ var isArray = Array.isArray || function(obj) {
+ return Object.prototype.toString.call(obj) === "[object Array]";
+ };
+
+ /**
+ * Checks if a object is of a specific type for example an array.
+ *
+ * @method is
+ * @param {Object} o Object to check type of.
+ * @param {string} t Optional type to check for.
+ * @return {Boolean} true/false if the object is of the specified type.
+ */
+ function is(o, t) {
+ if (!t) {
+ return o !== undefined;
+ }
+
+ if (t == 'array' && isArray(o)) {
+ return true;
+ }
+
+ return typeof(o) == t;
+ }
+
+ /**
+ * Converts the specified object into a real JavaScript array.
+ *
+ * @method toArray
+ * @param {Object} obj Object to convert into array.
+ * @return {Array} Array object based in input.
+ */
+ function toArray(obj) {
+ var array = [], i, l;
+
+ for (i = 0, l = obj.length; i < l; i++) {
+ array[i] = obj[i];
+ }
+
+ return array;
+ }
+
+ /**
+ * Makes a name/object map out of an array with names.
+ *
+ * @method makeMap
+ * @param {Array/String} items Items to make map out of.
+ * @param {String} delim Optional delimiter to split string by.
+ * @param {Object} map Optional map to add items to.
+ * @return {Object} Name/value map of items.
+ */
+ function makeMap(items, delim, map) {
+ var i;
+
+ items = items || [];
+ delim = delim || ',';
+
+ if (typeof(items) == "string") {
+ items = items.split(delim);
+ }
+
+ map = map || {};
+
+ i = items.length;
+ while (i--) {
+ map[items[i]] = {};
+ }
+
+ return map;
+ }
+
+ /**
+ * Performs an iteration of all items in a collection such as an object or array. This method will execure the
+ * callback function for each item in the collection, if the callback returns false the iteration will terminate.
+ * The callback has the following format: cb(value, key_or_index).
+ *
+ * @method each
+ * @param {Object} o Collection to iterate.
+ * @param {function} cb Callback function to execute for each item.
+ * @param {Object} s Optional scope to execute the callback in.
+ * @example
+ * // Iterate an array
+ * tinymce.each([1,2,3], function(v, i) {
+ * console.debug("Value: " + v + ", Index: " + i);
+ * });
+ *
+ * // Iterate an object
+ * tinymce.each({a: 1, b: 2, c: 3], function(v, k) {
+ * console.debug("Value: " + v + ", Key: " + k);
+ * });
+ */
+ function each(o, cb, s) {
+ var n, l;
+
+ if (!o) {
+ return 0;
+ }
+
+ s = s || o;
+
+ if (o.length !== undefined) {
+ // Indexed arrays, needed for Safari
+ for (n=0, l = o.length; n < l; n++) {
+ if (cb.call(s, o[n], n, o) === false) {
+ return 0;
+ }
+ }
+ } else {
+ // Hashtables
+ for (n in o) {
+ if (o.hasOwnProperty(n)) {
+ if (cb.call(s, o[n], n, o) === false) {
+ return 0;
+ }
+ }
+ }
+ }
+
+ return 1;
+ }
+
+ /**
+ * Creates a new array by the return value of each iteration function call. This enables you to convert
+ * one array list into another.
+ *
+ * @method map
+ * @param {Array} a Array of items to iterate.
+ * @param {function} f Function to call for each item. It's return value will be the new value.
+ * @return {Array} Array with new values based on function return values.
+ */
+ function map(a, f) {
+ var o = [];
+
+ each(a, function(v) {
+ o.push(f(v));
+ });
+
+ return o;
+ }
+
+ /**
+ * Filters out items from the input array by calling the specified function for each item.
+ * If the function returns false the item will be excluded if it returns true it will be included.
+ *
+ * @method grep
+ * @param {Array} a Array of items to loop though.
+ * @param {function} f Function to call for each item. Include/exclude depends on it's return value.
+ * @return {Array} New array with values imported and filtered based in input.
+ * @example
+ * // Filter out some items, this will return an array with 4 and 5
+ * var items = tinymce.grep([1,2,3,4,5], function(v) {return v > 3;});
+ */
+ function grep(a, f) {
+ var o = [];
+
+ each(a, function(v) {
+ if (!f || f(v)) {
+ o.push(v);
+ }
+ });
+
+ return o;
+ }
+
+ /**
+ * Creates a class, subclass or static singleton.
+ * More details on this method can be found in the Wiki.
+ *
+ * @method create
+ * @param {String} s Class name, inheritage and prefix.
+ * @param {Object} p Collection of methods to add to the class.
+ * @param {Object} root Optional root object defaults to the global window object.
+ * @example
+ * // Creates a basic class
+ * tinymce.create('tinymce.somepackage.SomeClass', {
+ * SomeClass: function() {
+ * // Class constructor
+ * },
+ *
+ * method: function() {
+ * // Some method
+ * }
+ * });
+ *
+ * // Creates a basic subclass class
+ * tinymce.create('tinymce.somepackage.SomeSubClass:tinymce.somepackage.SomeClass', {
+ * SomeSubClass: function() {
+ * // Class constructor
+ * this.parent(); // Call parent constructor
+ * },
+ *
+ * method: function() {
+ * // Some method
+ * this.parent(); // Call parent method
+ * },
+ *
+ * 'static': {
+ * staticMethod: function() {
+ * // Static method
+ * }
+ * }
+ * });
+ *
+ * // Creates a singleton/static class
+ * tinymce.create('static tinymce.somepackage.SomeSingletonClass', {
+ * method: function() {
+ * // Some method
+ * }
+ * });
+ */
+ function create(s, p, root) {
+ var t = this, sp, ns, cn, scn, c, de = 0;
+
+ // Parse : <prefix> <class>:<super class>
+ s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);
+ cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name
+
+ // Create namespace for new class
+ ns = t.createNS(s[3].replace(/\.\w+$/, ''), root);
+
+ // Class already exists
+ if (ns[cn]) {
+ return;
+ }
+
+ // Make pure static class
+ if (s[2] == 'static') {
+ ns[cn] = p;
+
+ if (this.onCreate) {
+ this.onCreate(s[2], s[3], ns[cn]);
+ }
+
+ return;
+ }
+
+ // Create default constructor
+ if (!p[cn]) {
+ p[cn] = function() {};
+ de = 1;
+ }
+
+ // Add constructor and methods
+ ns[cn] = p[cn];
+ t.extend(ns[cn].prototype, p);
+
+ // Extend
+ if (s[5]) {
+ sp = t.resolve(s[5]).prototype;
+ scn = s[5].match(/\.(\w+)$/i)[1]; // Class name
+
+ // Extend constructor
+ c = ns[cn];
+ if (de) {
+ // Add passthrough constructor
+ ns[cn] = function() {
+ return sp[scn].apply(this, arguments);
+ };
+ } else {
+ // Add inherit constructor
+ ns[cn] = function() {
+ this.parent = sp[scn];
+ return c.apply(this, arguments);
+ };
+ }
+ ns[cn].prototype[cn] = ns[cn];
+
+ // Add super methods
+ t.each(sp, function(f, n) {
+ ns[cn].prototype[n] = sp[n];
+ });
+
+ // Add overridden methods
+ t.each(p, function(f, n) {
+ // Extend methods if needed
+ if (sp[n]) {
+ ns[cn].prototype[n] = function() {
+ this.parent = sp[n];
+ return f.apply(this, arguments);
+ };
+ } else {
+ if (n != cn) {
+ ns[cn].prototype[n] = f;
+ }
+ }
+ });
+ }
+
+ // Add static methods
+ /*jshint sub:true*/
+ t.each(p['static'], function(f, n) {
+ ns[cn][n] = f;
+ });
+ }
+
+ /**
+ * Returns the index of a value in an array, this method will return -1 if the item wasn't found.
+ *
+ * @method inArray
+ * @param {Array} a Array/Object to search for value in.
+ * @param {Object} v Value to check for inside the array.
+ * @return {Number/String} Index of item inside the array inside an object. Or -1 if it wasn't found.
+ * @example
+ * // Get index of value in array this will alert 1 since 2 is at that index
+ * alert(tinymce.inArray([1,2,3], 2));
+ */
+ function inArray(a, v) {
+ var i, l;
+
+ if (a) {
+ for (i = 0, l = a.length; i < l; i++) {
+ if (a[i] === v) {
+ return i;
+ }
+ }
+ }
+
+ return -1;
+ }
+
+ function extend(obj, ext) {
+ var i, l, name, args = arguments, value;
+
+ for (i = 1, l = args.length; i < l; i++) {
+ ext = args[i];
+ for (name in ext) {
+ if (ext.hasOwnProperty(name)) {
+ value = ext[name];
+
+ if (value !== undefined) {
+ obj[name] = value;
+ }
+ }
+ }
+ }
+
+ return obj;
+ }
+
+ /**
+ * Executed the specified function for each item in a object tree.
+ *
+ * @method walk
+ * @param {Object} o Object tree to walk though.
+ * @param {function} f Function to call for each item.
+ * @param {String} n Optional name of collection inside the objects to walk for example childNodes.
+ * @param {String} s Optional scope to execute the function in.
+ */
+ function walk(o, f, n, s) {
+ s = s || this;
+
+ if (o) {
+ if (n) {
+ o = o[n];
+ }
+
+ each(o, function(o, i) {
+ if (f.call(s, o, i, n) === false) {
+ return false;
+ }
+
+ walk(o, f, n, s);
+ });
+ }
+ }
+
+ /**
+ * Creates a namespace on a specific object.
+ *
+ * @method createNS
+ * @param {String} n Namespace to create for example a.b.c.d.
+ * @param {Object} o Optional object to add namespace to, defaults to window.
+ * @return {Object} New namespace object the last item in path.
+ * @example
+ * // Create some namespace
+ * tinymce.createNS('tinymce.somepackage.subpackage');
+ *
+ * // Add a singleton
+ * var tinymce.somepackage.subpackage.SomeSingleton = {
+ * method: function() {
+ * // Some method
+ * }
+ * };
+ */
+ function createNS(n, o) {
+ var i, v;
+
+ o = o || window;
+
+ n = n.split('.');
+ for (i=0; i<n.length; i++) {
+ v = n[i];
+
+ if (!o[v]) {
+ o[v] = {};
+ }
+
+ o = o[v];
+ }
+
+ return o;
+ }
+
+ /**
+ * Resolves a string and returns the object from a specific structure.
+ *
+ * @method resolve
+ * @param {String} n Path to resolve for example a.b.c.d.
+ * @param {Object} o Optional object to search though, defaults to window.
+ * @return {Object} Last object in path or null if it couldn't be resolved.
+ * @example
+ * // Resolve a path into an object reference
+ * var obj = tinymce.resolve('a.b.c.d');
+ */
+ function resolve(n, o) {
+ var i, l;
+
+ o = o || window;
+
+ n = n.split('.');
+ for (i = 0, l = n.length; i < l; i++) {
+ o = o[n[i]];
+
+ if (!o) {
+ break;
+ }
+ }
+
+ return o;
+ }
+
+ /**
+ * Splits a string but removes the whitespace before and after each value.
+ *
+ * @method explode
+ * @param {string} s String to split.
+ * @param {string} d Delimiter to split by.
+ * @example
+ * // Split a string into an array with a,b,c
+ * var arr = tinymce.explode('a, b, c');
+ */
+ function explode(s, d) {
+ if (!s || is(s, 'array')) {
+ return s;
+ }
+
+ return map(s.split(d || ','), trim);
+ }
+
+ return {
+ trim: trim,
+ isArray: isArray,
+ is: is,
+ toArray: toArray,
+ makeMap: makeMap,
+ each: each,
+ map: map,
+ grep: grep,
+ inArray: inArray,
+ extend: extend,
+ create: create,
+ walk: walk,
+ createNS: createNS,
+ resolve: resolve,
+ explode: explode
+ };
+});
+
+// Included from: js/tinymce/classes/dom/Range.js
+
+/**
+ * Range.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/dom/Range", [
+ "tinymce/util/Tools"
+], function(Tools) {
+ // Range constructor
+ function Range(dom) {
+ var t = this,
+ doc = dom.doc,
+ EXTRACT = 0,
+ CLONE = 1,
+ DELETE = 2,
+ TRUE = true,
+ FALSE = false,
+ START_OFFSET = 'startOffset',
+ START_CONTAINER = 'startContainer',
+ END_CONTAINER = 'endContainer',
+ END_OFFSET = 'endOffset',
+ extend = Tools.extend,
+ nodeIndex = dom.nodeIndex;
+
+ function createDocumentFragment() {
+ return doc.createDocumentFragment();
+ }
+
+ function setStart(n, o) {
+ _setEndPoint(TRUE, n, o);
+ }
+
+ function setEnd(n, o) {
+ _setEndPoint(FALSE, n, o);
+ }
+
+ function setStartBefore(n) {
+ setStart(n.parentNode, nodeIndex(n));
+ }
+
+ function setStartAfter(n) {
+ setStart(n.parentNode, nodeIndex(n) + 1);
+ }
+
+ function setEndBefore(n) {
+ setEnd(n.parentNode, nodeIndex(n));
+ }
+
+ function setEndAfter(n) {
+ setEnd(n.parentNode, nodeIndex(n) + 1);
+ }
+
+ function collapse(ts) {
+ if (ts) {
+ t[END_CONTAINER] = t[START_CONTAINER];
+ t[END_OFFSET] = t[START_OFFSET];
+ } else {
+ t[START_CONTAINER] = t[END_CONTAINER];
+ t[START_OFFSET] = t[END_OFFSET];
+ }
+
+ t.collapsed = TRUE;
+ }
+
+ function selectNode(n) {
+ setStartBefore(n);
+ setEndAfter(n);
+ }
+
+ function selectNodeContents(n) {
+ setStart(n, 0);
+ setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length);
+ }
+
+ function compareBoundaryPoints(h, r) {
+ var sc = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[END_OFFSET],
+ rsc = r.startContainer, rso = r.startOffset, rec = r.endContainer, reo = r.endOffset;
+
+ // Check START_TO_START
+ if (h === 0) {
+ return _compareBoundaryPoints(sc, so, rsc, rso);
+ }
+
+ // Check START_TO_END
+ if (h === 1) {
+ return _compareBoundaryPoints(ec, eo, rsc, rso);
+ }
+
+ // Check END_TO_END
+ if (h === 2) {
+ return _compareBoundaryPoints(ec, eo, rec, reo);
+ }
+
+ // Check END_TO_START
+ if (h === 3) {
+ return _compareBoundaryPoints(sc, so, rec, reo);
+ }
+ }
+
+ function deleteContents() {
+ _traverse(DELETE);
+ }
+
+ function extractContents() {
+ return _traverse(EXTRACT);
+ }
+
+ function cloneContents() {
+ return _traverse(CLONE);
+ }
+
+ function insertNode(n) {
+ var startContainer = this[START_CONTAINER],
+ startOffset = this[START_OFFSET], nn, o;
+
+ // Node is TEXT_NODE or CDATA
+ if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) {
+ if (!startOffset) {
+ // At the start of text
+ startContainer.parentNode.insertBefore(n, startContainer);
+ } else if (startOffset >= startContainer.nodeValue.length) {
+ // At the end of text
+ dom.insertAfter(n, startContainer);
+ } else {
+ // Middle, need to split
+ nn = startContainer.splitText(startOffset);
+ startContainer.parentNode.insertBefore(n, nn);
+ }
+ } else {
+ // Insert element node
+ if (startContainer.childNodes.length > 0) {
+ o = startContainer.childNodes[startOffset];
+ }
+
+ if (o) {
+ startContainer.insertBefore(n, o);
+ } else {
+ if (startContainer.nodeType == 3) {
+ dom.insertAfter(n, startContainer);
+ } else {
+ startContainer.appendChild(n);
+ }
+ }
+ }
+ }
+
+ function surroundContents(n) {
+ var f = t.extractContents();
+
+ t.insertNode(n);
+ n.appendChild(f);
+ t.selectNode(n);
+ }
+
+ function cloneRange() {
+ return extend(new Range(dom), {
+ startContainer: t[START_CONTAINER],
+ startOffset: t[START_OFFSET],
+ endContainer: t[END_CONTAINER],
+ endOffset: t[END_OFFSET],
+ collapsed: t.collapsed,
+ commonAncestorContainer: t.commonAncestorContainer
+ });
+ }
+
+ // Private methods
+
+ function _getSelectedNode(container, offset) {
+ var child;
+
+ if (container.nodeType == 3 /* TEXT_NODE */) {
+ return container;
+ }
+
+ if (offset < 0) {
+ return container;
+ }
+
+ child = container.firstChild;
+ while (child && offset > 0) {
+ --offset;
+ child = child.nextSibling;
+ }
+
+ if (child) {
+ return child;
+ }
+
+ return container;
+ }
+
+ function _isCollapsed() {
+ return (t[START_CONTAINER] == t[END_CONTAINER] && t[START_OFFSET] == t[END_OFFSET]);
+ }
+
+ function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) {
+ var c, offsetC, n, cmnRoot, childA, childB;
+
+ // In the first case the boundary-points have the same container. A is before B
+ // if its offset is less than the offset of B, A is equal to B if its offset is
+ // equal to the offset of B, and A is after B if its offset is greater than the
+ // offset of B.
+ if (containerA == containerB) {
+ if (offsetA == offsetB) {
+ return 0; // equal
+ }
+
+ if (offsetA < offsetB) {
+ return -1; // before
+ }
+
+ return 1; // after
+ }
+
+ // In the second case a child node C of the container of A is an ancestor
+ // container of B. In this case, A is before B if the offset of A is less than or
+ // equal to the index of the child node C and A is after B otherwise.
+ c = containerB;
+ while (c && c.parentNode != containerA) {
+ c = c.parentNode;
+ }
+
+ if (c) {
+ offsetC = 0;
+ n = containerA.firstChild;
+
+ while (n != c && offsetC < offsetA) {
+ offsetC++;
+ n = n.nextSibling;
+ }
+
+ if (offsetA <= offsetC) {
+ return -1; // before
+ }
+
+ return 1; // after
+ }
+
+ // In the third case a child node C of the container of B is an ancestor container
+ // of A. In this case, A is before B if the index of the child node C is less than
+ // the offset of B and A is after B otherwise.
+ c = containerA;
+ while (c && c.parentNode != containerB) {
+ c = c.parentNode;
+ }
+
+ if (c) {
+ offsetC = 0;
+ n = containerB.firstChild;
+
+ while (n != c && offsetC < offsetB) {
+ offsetC++;
+ n = n.nextSibling;
+ }
+
+ if (offsetC < offsetB) {
+ return -1; // before
+ }
+
+ return 1; // after
+ }
+
+ // In the fourth case, none of three other cases hold: the containers of A and B
+ // are siblings or descendants of sibling nodes. In this case, A is before B if
+ // the container of A is before the container of B in a pre-order traversal of the
+ // Ranges' context tree and A is after B otherwise.
+ cmnRoot = dom.findCommonAncestor(containerA, containerB);
+ childA = containerA;
+
+ while (childA && childA.parentNode != cmnRoot) {
+ childA = childA.parentNode;
+ }
+
+ if (!childA) {
+ childA = cmnRoot;
+ }
+
+ childB = containerB;
+ while (childB && childB.parentNode != cmnRoot) {
+ childB = childB.parentNode;
+ }
+
+ if (!childB) {
+ childB = cmnRoot;
+ }
+
+ if (childA == childB) {
+ return 0; // equal
+ }
+
+ n = cmnRoot.firstChild;
+ while (n) {
+ if (n == childA) {
+ return -1; // before
+ }
+
+ if (n == childB) {
+ return 1; // after
+ }
+
+ n = n.nextSibling;
+ }
+ }
+
+ function _setEndPoint(st, n, o) {
+ var ec, sc;
+
+ if (st) {
+ t[START_CONTAINER] = n;
+ t[START_OFFSET] = o;
+ } else {
+ t[END_CONTAINER] = n;
+ t[END_OFFSET] = o;
+ }
+
+ // If one boundary-point of a Range is set to have a root container
+ // other than the current one for the Range, the Range is collapsed to
+ // the new position. This enforces the restriction that both boundary-
+ // points of a Range must have the same root container.
+ ec = t[END_CONTAINER];
+ while (ec.parentNode) {
+ ec = ec.parentNode;
+ }
+
+ sc = t[START_CONTAINER];
+ while (sc.parentNode) {
+ sc = sc.parentNode;
+ }
+
+ if (sc == ec) {
+ // The start position of a Range is guaranteed to never be after the
+ // end position. To enforce this restriction, if the start is set to
+ // be at a position after the end, the Range is collapsed to that
+ // position.
+ if (_compareBoundaryPoints(t[START_CONTAINER], t[START_OFFSET], t[END_CONTAINER], t[END_OFFSET]) > 0) {
+ t.collapse(st);
+ }
+ } else {
+ t.collapse(st);
+ }
+
+ t.collapsed = _isCollapsed();
+ t.commonAncestorContainer = dom.findCommonAncestor(t[START_CONTAINER], t[END_CONTAINER]);
+ }
+
+ function _traverse(how) {
+ var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep;
+
+ if (t[START_CONTAINER] == t[END_CONTAINER]) {
+ return _traverseSameContainer(how);
+ }
+
+ for (c = t[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {
+ if (p == t[START_CONTAINER]) {
+ return _traverseCommonStartContainer(c, how);
+ }
+
+ ++endContainerDepth;
+ }
+
+ for (c = t[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {
+ if (p == t[END_CONTAINER]) {
+ return _traverseCommonEndContainer(c, how);
+ }
+
+ ++startContainerDepth;
+ }
+
+ depthDiff = startContainerDepth - endContainerDepth;
+
+ startNode = t[START_CONTAINER];
+ while (depthDiff > 0) {
+ startNode = startNode.parentNode;
+ depthDiff--;
+ }
+
+ endNode = t[END_CONTAINER];
+ while (depthDiff < 0) {
+ endNode = endNode.parentNode;
+ depthDiff++;
+ }
+
+ // ascend the ancestor hierarchy until we have a common parent.
+ for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) {
+ startNode = sp;
+ endNode = ep;
+ }
+
+ return _traverseCommonAncestors(startNode, endNode, how);
+ }
+
+ function _traverseSameContainer(how) {
+ var frag, s, sub, n, cnt, sibling, xferNode, start, len;
+
+ if (how != DELETE) {
+ frag = createDocumentFragment();
+ }
+
+ // If selection is empty, just return the fragment
+ if (t[START_OFFSET] == t[END_OFFSET]) {
+ return frag;
+ }
+
+ // Text node needs special case handling
+ if (t[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) {
+ // get the substring
+ s = t[START_CONTAINER].nodeValue;
+ sub = s.substring(t[START_OFFSET], t[END_OFFSET]);
+
+ // set the original text node to its new value
+ if (how != CLONE) {
+ n = t[START_CONTAINER];
+ start = t[START_OFFSET];
+ len = t[END_OFFSET] - t[START_OFFSET];
+
+ if (start === 0 && len >= n.nodeValue.length - 1) {
+ n.parentNode.removeChild(n);
+ } else {
+ n.deleteData(start, len);
+ }
+
+ // Nothing is partially selected, so collapse to start point
+ t.collapse(TRUE);
+ }
+
+ if (how == DELETE) {
+ return;
+ }
+
+ if (sub.length > 0) {
+ frag.appendChild(doc.createTextNode(sub));
+ }
+
+ return frag;
+ }
+
+ // Copy nodes between the start/end offsets.
+ n = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]);
+ cnt = t[END_OFFSET] - t[START_OFFSET];
+
+ while (n && cnt > 0) {
+ sibling = n.nextSibling;
+ xferNode = _traverseFullySelected(n, how);
+
+ if (frag) {
+ frag.appendChild(xferNode);
+ }
+
+ --cnt;
+ n = sibling;
+ }
+
+ // Nothing is partially selected, so collapse to start point
+ if (how != CLONE) {
+ t.collapse(TRUE);
+ }
+
+ return frag;
+ }
+
+ function _traverseCommonStartContainer(endAncestor, how) {
+ var frag, n, endIdx, cnt, sibling, xferNode;
+
+ if (how != DELETE) {
+ frag = createDocumentFragment();
+ }
+
+ n = _traverseRightBoundary(endAncestor, how);
+
+ if (frag) {
+ frag.appendChild(n);
+ }
+
+ endIdx = nodeIndex(endAncestor);
+ cnt = endIdx - t[START_OFFSET];
+
+ if (cnt <= 0) {
+ // Collapse to just before the endAncestor, which
+ // is partially selected.
+ if (how != CLONE) {
+ t.setEndBefore(endAncestor);
+ t.collapse(FALSE);
+ }
+
+ return frag;
+ }
+
+ n = endAncestor.previousSibling;
+ while (cnt > 0) {
+ sibling = n.previousSibling;
+ xferNode = _traverseFullySelected(n, how);
+
+ if (frag) {
+ frag.insertBefore(xferNode, frag.firstChild);
+ }
+
+ --cnt;
+ n = sibling;
+ }
+
+ // Collapse to just before the endAncestor, which
+ // is partially selected.
+ if (how != CLONE) {
+ t.setEndBefore(endAncestor);
+ t.collapse(FALSE);
+ }
+
+ return frag;
+ }
+
+ function _traverseCommonEndContainer(startAncestor, how) {
+ var frag, startIdx, n, cnt, sibling, xferNode;
+
+ if (how != DELETE) {
+ frag = createDocumentFragment();
+ }
+
+ n = _traverseLeftBoundary(startAncestor, how);
+ if (frag) {
+ frag.appendChild(n);
+ }
+
+ startIdx = nodeIndex(startAncestor);
+ ++startIdx; // Because we already traversed it
+
+ cnt = t[END_OFFSET] - startIdx;
+ n = startAncestor.nextSibling;
+ while (n && cnt > 0) {
+ sibling = n.nextSibling;
+ xferNode = _traverseFullySelected(n, how);
+
+ if (frag) {
+ frag.appendChild(xferNode);
+ }
+
+ --cnt;
+ n = sibling;
+ }
+
+ if (how != CLONE) {
+ t.setStartAfter(startAncestor);
+ t.collapse(TRUE);
+ }
+
+ return frag;
+ }
+
+ function _traverseCommonAncestors(startAncestor, endAncestor, how) {
+ var n, frag, commonParent, startOffset, endOffset, cnt, sibling, nextSibling;
+
+ if (how != DELETE) {
+ frag = createDocumentFragment();
+ }
+
+ n = _traverseLeftBoundary(startAncestor, how);
+ if (frag) {
+ frag.appendChild(n);
+ }
+
+ commonParent = startAncestor.parentNode;
+ startOffset = nodeIndex(startAncestor);
+ endOffset = nodeIndex(endAncestor);
+ ++startOffset;
+
+ cnt = endOffset - startOffset;
+ sibling = startAncestor.nextSibling;
+
+ while (cnt > 0) {
+ nextSibling = sibling.nextSibling;
+ n = _traverseFullySelected(sibling, how);
+
+ if (frag) {
+ frag.appendChild(n);
+ }
+
+ sibling = nextSibling;
+ --cnt;
+ }
+
+ n = _traverseRightBoundary(endAncestor, how);
+
+ if (frag) {
+ frag.appendChild(n);
+ }
+
+ if (how != CLONE) {
+ t.setStartAfter(startAncestor);
+ t.collapse(TRUE);
+ }
+
+ return frag;
+ }
+
+ function _traverseRightBoundary(root, how) {
+ var next = _getSelectedNode(t[END_CONTAINER], t[END_OFFSET] - 1), parent, clonedParent;
+ var prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != t[END_CONTAINER];
+
+ if (next == root) {
+ return _traverseNode(next, isFullySelected, FALSE, how);
+ }
+
+ parent = next.parentNode;
+ clonedParent = _traverseNode(parent, FALSE, FALSE, how);
+
+ while (parent) {
+ while (next) {
+ prevSibling = next.previousSibling;
+ clonedChild = _traverseNode(next, isFullySelected, FALSE, how);
+
+ if (how != DELETE) {
+ clonedParent.insertBefore(clonedChild, clonedParent.firstChild);
+ }
+
+ isFullySelected = TRUE;
+ next = prevSibling;
+ }
+
+ if (parent == root) {
+ return clonedParent;
+ }
+
+ next = parent.previousSibling;
+ parent = parent.parentNode;
+
+ clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how);
+
+ if (how != DELETE) {
+ clonedGrandParent.appendChild(clonedParent);
+ }
+
+ clonedParent = clonedGrandParent;
+ }
+ }
+
+ function _traverseLeftBoundary(root, how) {
+ var next = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]), isFullySelected = next != t[START_CONTAINER];
+ var parent, clonedParent, nextSibling, clonedChild, clonedGrandParent;
+
+ if (next == root) {
+ return _traverseNode(next, isFullySelected, TRUE, how);
+ }
+
+ parent = next.parentNode;
+ clonedParent = _traverseNode(parent, FALSE, TRUE, how);
+
+ while (parent) {
+ while (next) {
+ nextSibling = next.nextSibling;
+ clonedChild = _traverseNode(next, isFullySelected, TRUE, how);
+
+ if (how != DELETE) {
+ clonedParent.appendChild(clonedChild);
+ }
+
+ isFullySelected = TRUE;
+ next = nextSibling;
+ }
+
+ if (parent == root) {
+ return clonedParent;
+ }
+
+ next = parent.nextSibling;
+ parent = parent.parentNode;
+
+ clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how);
+
+ if (how != DELETE) {
+ clonedGrandParent.appendChild(clonedParent);
+ }
+
+ clonedParent = clonedGrandParent;
+ }
+ }
+
+ function _traverseNode(n, isFullySelected, isLeft, how) {
+ var txtValue, newNodeValue, oldNodeValue, offset, newNode;
+
+ if (isFullySelected) {
+ return _traverseFullySelected(n, how);
+ }
+
+ if (n.nodeType == 3 /* TEXT_NODE */) {
+ txtValue = n.nodeValue;
+
+ if (isLeft) {
+ offset = t[START_OFFSET];
+ newNodeValue = txtValue.substring(offset);
+ oldNodeValue = txtValue.substring(0, offset);
+ } else {
+ offset = t[END_OFFSET];
+ newNodeValue = txtValue.substring(0, offset);
+ oldNodeValue = txtValue.substring(offset);
+ }
+
+ if (how != CLONE) {
+ n.nodeValue = oldNodeValue;
+ }
+
+ if (how == DELETE) {
+ return;
+ }
+
+ newNode = dom.clone(n, FALSE);
+ newNode.nodeValue = newNodeValue;
+
+ return newNode;
+ }
+
+ if (how == DELETE) {
+ return;
+ }
+
+ return dom.clone(n, FALSE);
+ }
+
+ function _traverseFullySelected(n, how) {
+ if (how != DELETE) {
+ return how == CLONE ? dom.clone(n, TRUE) : n;
+ }
+
+ n.parentNode.removeChild(n);
+ }
+
+ function toStringIE() {
+ return dom.create('body', null, cloneContents()).outerText;
+ }
+
+ extend(t, {
+ // Inital states
+ startContainer: doc,
+ startOffset: 0,
+ endContainer: doc,
+ endOffset: 0,
+ collapsed: TRUE,
+ commonAncestorContainer: doc,
+
+ // Range constants
+ START_TO_START: 0,
+ START_TO_END: 1,
+ END_TO_END: 2,
+ END_TO_START: 3,
+
+ // Public methods
+ setStart: setStart,
+ setEnd: setEnd,
+ setStartBefore: setStartBefore,
+ setStartAfter: setStartAfter,
+ setEndBefore: setEndBefore,
+ setEndAfter: setEndAfter,
+ collapse: collapse,
+ selectNode: selectNode,
+ selectNodeContents: selectNodeContents,
+ compareBoundaryPoints: compareBoundaryPoints,
+ deleteContents: deleteContents,
+ extractContents: extractContents,
+ cloneContents: cloneContents,
+ insertNode: insertNode,
+ surroundContents: surroundContents,
+ cloneRange: cloneRange,
+ toStringIE: toStringIE
+ });
+
+ return t;
+ }
+
+ // Older IE versions doesn't let you override toString by it's constructor so we have to stick it in the prototype
+ Range.prototype.toString = function() {
+ return this.toStringIE();
+ };
+
+ return Range;
+});
+
+// Included from: js/tinymce/classes/html/Entities.js
+
+/**
+ * Entities.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint bitwise:false */
+
+/**
+ * Entity encoder class.
+ *
+ * @class tinymce.html.Entities
+ * @static
+ * @version 3.4
+ */
+define("tinymce/html/Entities", [
+ "tinymce/util/Tools"
+], function(Tools) {
+ var makeMap = Tools.makeMap;
+
+ var namedEntities, baseEntities, reverseEntities,
+ attrsCharsRegExp = /[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
+ textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
+ rawCharsRegExp = /[<>&\"\']/g,
+ entityRegExp = /&(#x|#)?([\w]+);/g,
+ asciiMap = {
+ 128: "\u20AC", 130: "\u201A", 131: "\u0192", 132: "\u201E", 133: "\u2026", 134: "\u2020",
+ 135: "\u2021", 136: "\u02C6", 137: "\u2030", 138: "\u0160", 139: "\u2039", 140: "\u0152",
+ 142: "\u017D", 145: "\u2018", 146: "\u2019", 147: "\u201C", 148: "\u201D", 149: "\u2022",
+ 150: "\u2013", 151: "\u2014", 152: "\u02DC", 153: "\u2122", 154: "\u0161", 155: "\u203A",
+ 156: "\u0153", 158: "\u017E", 159: "\u0178"
+ };
+
+ // Raw entities
+ baseEntities = {
+ '\"': '"', // Needs to be escaped since the YUI compressor would otherwise break the code
+ "'": ''',
+ '<': '<',
+ '>': '>',
+ '&': '&'
+ };
+
+ // Reverse lookup table for raw entities
+ reverseEntities = {
+ '<': '<',
+ '>': '>',
+ '&': '&',
+ '"': '"',
+ ''': "'"
+ };
+
+ // Decodes text by using the browser
+ function nativeDecode(text) {
+ var elm;
+
+ elm = document.createElement("div");
+ elm.innerHTML = text;
+
+ return elm.textContent || elm.innerText || text;
+ }
+
+ // Build a two way lookup table for the entities
+ function buildEntitiesLookup(items, radix) {
+ var i, chr, entity, lookup = {};
+
+ if (items) {
+ items = items.split(',');
+ radix = radix || 10;
+
+ // Build entities lookup table
+ for (i = 0; i < items.length; i += 2) {
+ chr = String.fromCharCode(parseInt(items[i], radix));
+
+ // Only add non base entities
+ if (!baseEntities[chr]) {
+ entity = '&' + items[i + 1] + ';';
+ lookup[chr] = entity;
+ lookup[entity] = chr;
+ }
+ }
+
+ return lookup;
+ }
+ }
+
+ // Unpack entities lookup where the numbers are in radix 32 to reduce the size
+ namedEntities = buildEntitiesLookup(
+ '50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' +
+ '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' +
+ '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' +
+ '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' +
+ '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' +
+ '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' +
+ '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' +
+ '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' +
+ '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' +
+ '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' +
+ 'sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' +
+ 'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' +
+ 't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' +
+ 'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' +
+ 'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' +
+ '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' +
+ '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' +
+ '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' +
+ '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' +
+ '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' +
+ 'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' +
+ 'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' +
+ 'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' +
+ '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' +
+ '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro', 32);
+
+ var Entities = {
+ /**
+ * Encodes the specified string using raw entities. This means only the required XML base entities will be endoded.
+ *
+ * @method encodeRaw
+ * @param {String} text Text to encode.
+ * @param {Boolean} attr Optional flag to specify if the text is attribute contents.
+ * @return {String} Entity encoded text.
+ */
+ encodeRaw: function(text, attr) {
+ return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
+ return baseEntities[chr] || chr;
+ });
+ },
+
+ /**
+ * Encoded the specified text with both the attributes and text entities. This function will produce larger text contents
+ * since it doesn't know if the context is within a attribute or text node. This was added for compatibility
+ * and is exposed as the DOMUtils.encode function.
+ *
+ * @method encodeAllRaw
+ * @param {String} text Text to encode.
+ * @return {String} Entity encoded text.
+ */
+ encodeAllRaw: function(text) {
+ return ('' + text).replace(rawCharsRegExp, function(chr) {
+ return baseEntities[chr] || chr;
+ });
+ },
+
+ /**
+ * Encodes the specified string using numeric entities. The core entities will be
+ * encoded as named ones but all non lower ascii characters will be encoded into numeric entities.
+ *
+ * @method encodeNumeric
+ * @param {String} text Text to encode.
+ * @param {Boolean} attr Optional flag to specify if the text is attribute contents.
+ * @return {String} Entity encoded text.
+ */
+ encodeNumeric: function(text, attr) {
+ return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
+ // Multi byte sequence convert it to a single entity
+ if (chr.length > 1) {
+ return '&#' + (((chr.charCodeAt(0) - 0xD800) * 0x400) + (chr.charCodeAt(1) - 0xDC00) + 0x10000) + ';';
+ }
+
+ return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';';
+ });
+ },
+
+ /**
+ * Encodes the specified string using named entities. The core entities will be encoded
+ * as named ones but all non lower ascii characters will be encoded into named entities.
+ *
+ * @method encodeNamed
+ * @param {String} text Text to encode.
+ * @param {Boolean} attr Optional flag to specify if the text is attribute contents.
+ * @param {Object} entities Optional parameter with entities to use.
+ * @return {String} Entity encoded text.
+ */
+ encodeNamed: function(text, attr, entities) {
+ entities = entities || namedEntities;
+
+ return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
+ return baseEntities[chr] || entities[chr] || chr;
+ });
+ },
+
+ /**
+ * Returns an encode function based on the name(s) and it's optional entities.
+ *
+ * @method getEncodeFunc
+ * @param {String} name Comma separated list of encoders for example named,numeric.
+ * @param {String} entities Optional parameter with entities to use instead of the built in set.
+ * @return {function} Encode function to be used.
+ */
+ getEncodeFunc: function(name, entities) {
+ entities = buildEntitiesLookup(entities) || namedEntities;
+
+ function encodeNamedAndNumeric(text, attr) {
+ return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
+ return baseEntities[chr] || entities[chr] || '&#' + chr.charCodeAt(0) + ';' || chr;
+ });
+ }
+
+ function encodeCustomNamed(text, attr) {
+ return Entities.encodeNamed(text, attr, entities);
+ }
+
+ // Replace + with , to be compatible with previous TinyMCE versions
+ name = makeMap(name.replace(/\+/g, ','));
+
+ // Named and numeric encoder
+ if (name.named && name.numeric) {
+ return encodeNamedAndNumeric;
+ }
+
+ // Named encoder
+ if (name.named) {
+ // Custom names
+ if (entities) {
+ return encodeCustomNamed;
+ }
+
+ return Entities.encodeNamed;
+ }
+
+ // Numeric
+ if (name.numeric) {
+ return Entities.encodeNumeric;
+ }
+
+ // Raw encoder
+ return Entities.encodeRaw;
+ },
+
+ /**
+ * Decodes the specified string, this will replace entities with raw UTF characters.
+ *
+ * @method decode
+ * @param {String} text Text to entity decode.
+ * @return {String} Entity decoded string.
+ */
+ decode: function(text) {
+ return text.replace(entityRegExp, function(all, numeric, value) {
+ if (numeric) {
+ value = parseInt(value, numeric.length === 2 ? 16 : 10);
+
+ // Support upper UTF
+ if (value > 0xFFFF) {
+ value -= 0x10000;
+
+ return String.fromCharCode(0xD800 + (value >> 10), 0xDC00 + (value & 0x3FF));
+ } else {
+ return asciiMap[value] || String.fromCharCode(value);
+ }
+ }
+
+ return reverseEntities[all] || namedEntities[all] || nativeDecode(all);
+ });
+ }
+ };
+
+ return Entities;
+});
+
+// Included from: js/tinymce/classes/Env.js
+
+/**
+ * Env.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class contains various environment constants like browser versions etc.
+ * Normally you don't want to sniff specific browser versions but sometimes you have
+ * to when it's impossible to feature detect. So use this with care.
+ *
+ * @class tinymce.Env
+ * @static
+ */
+define("tinymce/Env", [], function() {
+ var nav = navigator, userAgent = nav.userAgent;
+ var opera, webkit, ie, ie11, gecko, mac, iDevice;
+
+ opera = window.opera && window.opera.buildNumber;
+ webkit = /WebKit/.test(userAgent);
+ ie = !webkit && !opera && (/MSIE/gi).test(userAgent) && (/Explorer/gi).test(nav.appName);
+ ie = ie && /MSIE (\w+)\./.exec(userAgent)[1];
+ ie11 = userAgent.indexOf('Trident/') != -1 && (userAgent.indexOf('rv:') != -1 || nav.appName.indexOf('Netscape') != -1) ? 11 : false;
+ ie = ie || ie11;
+ gecko = !webkit && !ie11 && /Gecko/.test(userAgent);
+ mac = userAgent.indexOf('Mac') != -1;
+ iDevice = /(iPad|iPhone)/.test(userAgent);
+
+ // Is a iPad/iPhone and not on iOS5 sniff the WebKit version since older iOS WebKit versions
+ // says it has contentEditable support but there is no visible caret.
+ var contentEditable = !iDevice || userAgent.match(/AppleWebKit\/(\d*)/)[1] >= 534;
+
+ return {
+ /**
+ * Constant that is true if the browser is Opera.
+ *
+ * @property opera
+ * @type Boolean
+ * @final
+ */
+ opera: opera,
+
+ /**
+ * Constant that is true if the browser is WebKit (Safari/Chrome).
+ *
+ * @property webKit
+ * @type Boolean
+ * @final
+ */
+ webkit: webkit,
+
+ /**
+ * Constant that is more than zero if the browser is IE.
+ *
+ * @property ie
+ * @type Boolean
+ * @final
+ */
+ ie: ie,
+
+ /**
+ * Constant that is true if the browser is Gecko.
+ *
+ * @property gecko
+ * @type Boolean
+ * @final
+ */
+ gecko: gecko,
+
+ /**
+ * Constant that is true if the os is Mac OS.
+ *
+ * @property mac
+ * @type Boolean
+ * @final
+ */
+ mac: mac,
+
+ /**
+ * Constant that is true if the os is iOS.
+ *
+ * @property iOS
+ * @type Boolean
+ * @final
+ */
+ iOS: iDevice,
+
+ /**
+ * Constant that is true if the browser supports editing.
+ *
+ * @property contentEditable
+ * @type Boolean
+ * @final
+ */
+ contentEditable: contentEditable,
+
+ /**
+ * Transparent image data url.
+ *
+ * @property transparentSrc
+ * @type Boolean
+ * @final
+ */
+ transparentSrc: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
+
+ /**
+ * Returns true/false if the browser can or can't place the caret after a inline block like an image.
+ *
+ * @property noCaretAfter
+ * @type Boolean
+ * @final
+ */
+ caretAfter: ie != 8,
+
+ /**
+ * Constant that is true if the browser supports native DOM Ranges. IE 9+.
+ *
+ * @property range
+ * @type Boolean
+ */
+ range: window.getSelection && "Range" in window,
+
+ /**
+ * Returns the IE document mode for non IE browsers this will fake IE 10.
+ *
+ * @property documentMode
+ * @type Number
+ */
+ documentMode: ie ? (document.documentMode || 7) : 10
+ };
+});
+
+// Included from: js/tinymce/classes/dom/DOMUtils.js
+
+/**
+ * DOMUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Utility class for various DOM manipulation and retrieval functions.
+ *
+ * @class tinymce.dom.DOMUtils
+ * @example
+ * // Add a class to an element by id in the page
+ * tinymce.DOM.addClass('someid', 'someclass');
+ *
+ * // Add a class to an element by id inside the editor
+ * tinymce.activeEditor.dom.addClass('someid', 'someclass');
+ */
+define("tinymce/dom/DOMUtils", [
+ "tinymce/dom/Sizzle",
+ "tinymce/html/Styles",
+ "tinymce/dom/EventUtils",
+ "tinymce/dom/TreeWalker",
+ "tinymce/dom/Range",
+ "tinymce/html/Entities",
+ "tinymce/Env",
+ "tinymce/util/Tools"
+], function(Sizzle, Styles, EventUtils, TreeWalker, Range, Entities, Env, Tools) {
+ // Shorten names
+ var each = Tools.each, is = Tools.is, grep = Tools.grep, trim = Tools.trim, extend = Tools.extend;
+ var isWebKit = Env.webkit, isIE = Env.ie;
+ var simpleSelectorRe = /^([a-z0-9],?)+$/i;
+ var whiteSpaceRegExp = /^[ \t\r\n]*$/;
+ var numericCssMap = Tools.makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom', ' ');
+
+ /**
+ * Constructs a new DOMUtils instance. Consult the Wiki for more details on settings etc for this class.
+ *
+ * @constructor
+ * @method DOMUtils
+ * @param {Document} d Document reference to bind the utility class to.
+ * @param {settings} s Optional settings collection.
+ */
+ function DOMUtils(doc, settings) {
+ var self = this, blockElementsMap;
+
+ self.doc = doc;
+ self.win = window;
+ self.files = {};
+ self.counter = 0;
+ self.stdMode = !isIE || doc.documentMode >= 8;
+ self.boxModel = !isIE || doc.compatMode == "CSS1Compat" || self.stdMode;
+ self.hasOuterHTML = "outerHTML" in doc.createElement("a");
+ this.boundEvents = [];
+
+ self.settings = settings = extend({
+ keep_values: false,
+ hex_colors: 1
+ }, settings);
+
+ self.schema = settings.schema;
+ self.styles = new Styles({
+ url_converter: settings.url_converter,
+ url_converter_scope: settings.url_converter_scope
+ }, settings.schema);
+
+ self.fixDoc(doc);
+ self.events = settings.ownEvents ? new EventUtils(settings.proxy) : EventUtils.Event;
+ blockElementsMap = settings.schema ? settings.schema.getBlockElements() : {};
+
+ /**
+ * Returns true/false if the specified element is a block element or not.
+ *
+ * @method isBlock
+ * @param {Node/String} node Element/Node to check.
+ * @return {Boolean} True/False state if the node is a block element or not.
+ */
+ self.isBlock = function(node) {
+ // Fix for #5446
+ if (!node) {
+ return false;
+ }
+
+ // This function is called in module pattern style since it might be executed with the wrong this scope
+ var type = node.nodeType;
+
+ // If it's a node then check the type and use the nodeName
+ if (type) {
+ return !!(type === 1 && blockElementsMap[node.nodeName]);
+ }
+
+ return !!blockElementsMap[node];
+ };
+ }
+
+ DOMUtils.prototype = {
+ root: null,
+ 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"
+ },
+
+ fixDoc: function(doc) {
+ var settings = this.settings, name;
+
+ if (isIE && settings.schema) {
+ // Add missing HTML 4/5 elements to IE
+ ('abbr article aside audio canvas ' +
+ 'details figcaption figure footer ' +
+ 'header hgroup mark menu meter nav ' +
+ 'output progress section summary ' +
+ 'time video').replace(/\w+/g, function(name) {
+ doc.createElement(name);
+ });
+
+ // Create all custom elements
+ for (name in settings.schema.getCustomElements()) {
+ doc.createElement(name);
+ }
+ }
+ },
+
+ clone: function(node, deep) {
+ var self = this, clone, doc;
+
+ // TODO: Add feature detection here in the future
+ if (!isIE || node.nodeType !== 1 || deep) {
+ return node.cloneNode(deep);
+ }
+
+ doc = self.doc;
+
+ // Make a HTML5 safe shallow copy
+ if (!deep) {
+ clone = doc.createElement(node.nodeName);
+
+ // Copy attribs
+ each(self.getAttribs(node), function(attr) {
+ self.setAttrib(clone, attr.nodeName, self.getAttrib(node, attr.nodeName));
+ });
+
+ return clone;
+ }
+/*
+ // Setup HTML5 patched document fragment
+ if (!self.frag) {
+ self.frag = doc.createDocumentFragment();
+ self.fixDoc(self.frag);
+ }
+
+ // Make a deep copy by adding it to the document fragment then removing it this removed the :section
+ clone = doc.createElement('div');
+ self.frag.appendChild(clone);
+ clone.innerHTML = node.outerHTML;
+ self.frag.removeChild(clone);
+*/
+ return clone.firstChild;
+ },
+
+ /**
+ * Returns the root node of the document. This is normally the body but might be a DIV. Parents like getParent will not
+ * go above the point of this root node.
+ *
+ * @method getRoot
+ * @return {Element} Root element for the utility class.
+ */
+ getRoot: function() {
+ var self = this;
+
+ return self.get(self.settings.root_element) || self.doc.body;
+ },
+
+ /**
+ * Returns the viewport of the window.
+ *
+ * @method getViewPort
+ * @param {Window} win Optional window to get viewport of.
+ * @return {Object} Viewport object with fields x, y, w and h.
+ */
+ getViewPort: function(win) {
+ var doc, rootElm;
+
+ win = !win ? this.win : win;
+ doc = win.document;
+ rootElm = this.boxModel ? doc.documentElement : doc.body;
+
+ // Returns viewport size excluding scrollbars
+ return {
+ x: win.pageXOffset || rootElm.scrollLeft,
+ y: win.pageYOffset || rootElm.scrollTop,
+ w: win.innerWidth || rootElm.clientWidth,
+ h: win.innerHeight || rootElm.clientHeight
+ };
+ },
+
+ /**
+ * Returns the rectangle for a specific element.
+ *
+ * @method getRect
+ * @param {Element/String} elm Element object or element ID to get rectangle from.
+ * @return {object} Rectangle for specified element object with x, y, w, h fields.
+ */
+ getRect: function(elm) {
+ var self = this, pos, size;
+
+ elm = self.get(elm);
+ pos = self.getPos(elm);
+ size = self.getSize(elm);
+
+ return {
+ x: pos.x, y: pos.y,
+ w: size.w, h: size.h
+ };
+ },
+
+ /**
+ * Returns the size dimensions of the specified element.
+ *
+ * @method getSize
+ * @param {Element/String} elm Element object or element ID to get rectangle from.
+ * @return {object} Rectangle for specified element object with w, h fields.
+ */
+ getSize: function(elm) {
+ var self = this, w, h;
+
+ elm = self.get(elm);
+ w = self.getStyle(elm, 'width');
+ h = self.getStyle(elm, 'height');
+
+ // Non pixel value, then force offset/clientWidth
+ if (w.indexOf('px') === -1) {
+ w = 0;
+ }
+
+ // Non pixel value, then force offset/clientWidth
+ if (h.indexOf('px') === -1) {
+ h = 0;
+ }
+
+ return {
+ w: parseInt(w, 10) || elm.offsetWidth || elm.clientWidth,
+ h: parseInt(h, 10) || elm.offsetHeight || elm.clientHeight
+ };
+ },
+
+ /**
+ * Returns a node by the specified selector function. This function will
+ * loop through all parent nodes and call the specified function for each node.
+ * If the function then returns true indicating that it has found what it was looking for, the loop execution will then end
+ * and the node it found will be returned.
+ *
+ * @method getParent
+ * @param {Node/String} node DOM node to search parents on or ID string.
+ * @param {function} selector Selection function or CSS selector to execute on each node.
+ * @param {Node} root Optional root element, never go below this point.
+ * @return {Node} DOM Node or null if it wasn't found.
+ */
+ getParent: function(node, selector, root) {
+ return this.getParents(node, selector, root, false);
+ },
+
+ /**
+ * Returns a node list of all parents matching the specified selector function or pattern.
+ * If the function then returns true indicating that it has found what it was looking for and that node will be collected.
+ *
+ * @method getParents
+ * @param {Node/String} node DOM node to search parents on or ID string.
+ * @param {function} selector Selection function to execute on each node or CSS pattern.
+ * @param {Node} root Optional root element, never go below this point.
+ * @return {Array} Array of nodes or null if it wasn't found.
+ */
+ getParents: function(node, selector, root, collect) {
+ var self = this, selectorVal, result = [];
+
+ node = self.get(node);
+ collect = collect === undefined;
+
+ // Default root on inline mode
+ root = root || (self.getRoot().nodeName != 'BODY' ? self.getRoot().parentNode : null);
+
+ // Wrap node name as func
+ if (is(selector, 'string')) {
+ selectorVal = selector;
+
+ if (selector === '*') {
+ selector = function(node) {return node.nodeType == 1;};
+ } else {
+ selector = function(node) {
+ return self.is(node, selectorVal);
+ };
+ }
+ }
+
+ while (node) {
+ if (node == root || !node.nodeType || node.nodeType === 9) {
+ break;
+ }
+
+ if (!selector || selector(node)) {
+ if (collect) {
+ result.push(node);
+ } else {
+ return node;
+ }
+ }
+
+ node = node.parentNode;
+ }
+
+ return collect ? result : null;
+ },
+
+ /**
+ * Returns the specified element by ID or the input element if it isn't a string.
+ *
+ * @method get
+ * @param {String/Element} n Element id to look for or element to just pass though.
+ * @return {Element} Element matching the specified id or null if it wasn't found.
+ */
+ get: function(elm) {
+ var name;
+
+ if (elm && this.doc && typeof(elm) == 'string') {
+ name = elm;
+ elm = this.doc.getElementById(elm);
+
+ // IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick
+ if (elm && elm.id !== name) {
+ return this.doc.getElementsByName(name)[1];
+ }
+ }
+
+ return elm;
+ },
+
+ /**
+ * Returns the next node that matches selector or function
+ *
+ * @method getNext
+ * @param {Node} node Node to find siblings from.
+ * @param {String/function} selector Selector CSS expression or function.
+ * @return {Node} Next node item matching the selector or null if it wasn't found.
+ */
+ getNext: function(node, selector) {
+ return this._findSib(node, selector, 'nextSibling');
+ },
+
+ /**
+ * Returns the previous node that matches selector or function
+ *
+ * @method getPrev
+ * @param {Node} node Node to find siblings from.
+ * @param {String/function} selector Selector CSS expression or function.
+ * @return {Node} Previous node item matching the selector or null if it wasn't found.
+ */
+ getPrev: function(node, selector) {
+ return this._findSib(node, selector, 'previousSibling');
+ },
+
+ // #ifndef jquery
+
+ /**
+ * Selects specific elements by a CSS level 3 pattern. For example "div#a1 p.test".
+ * This function is optimized for the most common patterns needed in TinyMCE but it also performs well enough
+ * on more complex patterns.
+ *
+ * @method select
+ * @param {String} selector CSS level 3 pattern to select/find elements by.
+ * @param {Object} scope Optional root element/scope element to search in.
+ * @return {Array} Array with all matched elements.
+ * @example
+ * // Adds a class to all paragraphs in the currently active editor
+ * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass');
+ *
+ * // Adds a class to all spans that have the test class in the currently active editor
+ * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('span.test'), 'someclass')
+ */
+ select: function(selector, scope) {
+ var self = this;
+
+ //Sizzle.selectors.cacheLength = 0;
+ return Sizzle(selector, self.get(scope) || self.get(self.settings.root_element) || self.doc, []);
+ },
+
+ /**
+ * Returns true/false if the specified element matches the specified css pattern.
+ *
+ * @method is
+ * @param {Node/NodeList} elm DOM node to match or an array of nodes to match.
+ * @param {String} selector CSS pattern to match the element against.
+ */
+ is: function(elm, selector) {
+ var i;
+
+ // If it isn't an array then try to do some simple selectors instead of Sizzle for to boost performance
+ if (elm.length === undefined) {
+ // Simple all selector
+ if (selector === '*') {
+ return elm.nodeType == 1;
+ }
+
+ // Simple selector just elements
+ if (simpleSelectorRe.test(selector)) {
+ selector = selector.toLowerCase().split(/,/);
+ elm = elm.nodeName.toLowerCase();
+
+ for (i = selector.length - 1; i >= 0; i--) {
+ if (selector[i] == elm) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+
+ // Is non element
+ if (elm.nodeType && elm.nodeType != 1) {
+ return false;
+ }
+
+ return Sizzle.matches(selector, elm.nodeType ? [elm] : elm).length > 0;
+ },
+
+ // #endif
+
+ /**
+ * Adds the specified element to another element or elements.
+ *
+ * @method add
+ * @param {String/Element/Array} parentElm Element id string, DOM node element or array of ids or elements to add to.
+ * @param {String/Element} name Name of new element to add or existing element to add.
+ * @param {Object} attrs Optional object collection with arguments to add to the new element(s).
+ * @param {String} html Optional inner HTML contents to add for each element.
+ * @return {Element/Array} Element that got created, or an array of created elements if multiple input elements
+ * were passed in.
+ * @example
+ * // Adds a new paragraph to the end of the active editor
+ * tinymce.activeEditor.dom.add(tinymce.activeEditor.getBody(), 'p', {title: 'my title'}, 'Some content');
+ */
+ add: function(parentElm, name, attrs, html, create) {
+ var self = this;
+
+ return this.run(parentElm, function(parentElm) {
+ var newElm;
+
+ newElm = is(name, 'string') ? self.doc.createElement(name) : name;
+ self.setAttribs(newElm, attrs);
+
+ if (html) {
+ if (html.nodeType) {
+ newElm.appendChild(html);
+ } else {
+ self.setHTML(newElm, html);
+ }
+ }
+
+ return !create ? parentElm.appendChild(newElm) : newElm;
+ });
+ },
+
+ /**
+ * Creates a new element.
+ *
+ * @method create
+ * @param {String} name Name of new element.
+ * @param {Object} attrs Optional object name/value collection with element attributes.
+ * @param {String} html Optional HTML string to set as inner HTML of the element.
+ * @return {Element} HTML DOM node element that got created.
+ * @example
+ * // Adds an element where the caret/selection is in the active editor
+ * var el = tinymce.activeEditor.dom.create('div', {id: 'test', 'class': 'myclass'}, 'some content');
+ * tinymce.activeEditor.selection.setNode(el);
+ */
+ create: function(name, attrs, html) {
+ return this.add(this.doc.createElement(name), name, attrs, html, 1);
+ },
+
+ /**
+ * Creates HTML string for element. The element will be closed unless an empty inner HTML string is passed in.
+ *
+ * @method createHTML
+ * @param {String} name Name of new element.
+ * @param {Object} attrs Optional object name/value collection with element attributes.
+ * @param {String} html Optional HTML string to set as inner HTML of the element.
+ * @return {String} String with new HTML element, for example: <a href="#">test</a>.
+ * @example
+ * // Creates a html chunk and inserts it at the current selection/caret location
+ * tinymce.activeEditor.selection.setContent(tinymce.activeEditor.dom.createHTML('a', {href: 'test.html'}, 'some line'));
+ */
+ createHTML: function(name, attrs, html) {
+ var outHtml = '', key;
+
+ outHtml += '<' + name;
+
+ for (key in attrs) {
+ if (attrs.hasOwnProperty(key) && attrs[key] !== null) {
+ outHtml += ' ' + key + '="' + this.encode(attrs[key]) + '"';
+ }
+ }
+
+ // A call to tinymce.is doesn't work for some odd reason on IE9 possible bug inside their JS runtime
+ if (typeof(html) != "undefined") {
+ return outHtml + '>' + html + '</' + name + '>';
+ }
+
+ return outHtml + ' />';
+ },
+
+ /**
+ * Creates a document fragment out of the specified HTML string.
+ *
+ * @method createFragment
+ * @param {String} html Html string to create fragment from.
+ * @return {DocumentFragment} Document fragment node.
+ */
+ createFragment: function(html) {
+ var frag, node, doc = this.doc, container;
+
+ container = doc.createElement("div");
+ frag = doc.createDocumentFragment();
+
+ if (html) {
+ container.innerHTML = html;
+ }
+
+ while ((node = container.firstChild)) {
+ frag.appendChild(node);
+ }
+
+ return frag;
+ },
+
+ /**
+ * Removes/deletes the specified element(s) from the DOM.
+ *
+ * @method remove
+ * @param {String/Element/Array} node ID of element or DOM element object or array containing multiple elements/ids.
+ * @param {Boolean} keep_children Optional state to keep children or not. If set to true all children will be
+ * placed at the location of the removed element.
+ * @return {Element/Array} HTML DOM element that got removed, or an array of removed elements if multiple input elements
+ * were passed in.
+ * @example
+ * // Removes all paragraphs in the active editor
+ * tinymce.activeEditor.dom.remove(tinymce.activeEditor.dom.select('p'));
+ *
+ * // Removes an element by id in the document
+ * tinymce.DOM.remove('mydiv');
+ */
+ remove: function(node, keep_children) {
+ return this.run(node, function(node) {
+ var child, parent = node.parentNode;
+
+ if (!parent) {
+ return null;
+ }
+
+ if (keep_children) {
+ while ((child = node.firstChild)) {
+ // IE 8 will crash if you don't remove completely empty text nodes
+ if (!isIE || child.nodeType !== 3 || child.nodeValue) {
+ parent.insertBefore(child, node);
+ } else {
+ node.removeChild(child);
+ }
+ }
+ }
+
+ return parent.removeChild(node);
+ });
+ },
+
+ /**
+ * Sets the CSS style value on a HTML element. The name can be a camelcase string
+ * or the CSS style name like background-color.
+ *
+ * @method setStyle
+ * @param {String/Element/Array} n HTML element/Element ID or Array of elements/ids to set CSS style value on.
+ * @param {String} na Name of the style value to set.
+ * @param {String} v Value to set on the style.
+ * @example
+ * // Sets a style value on all paragraphs in the currently active editor
+ * tinymce.activeEditor.dom.setStyle(tinymce.activeEditor.dom.select('p'), 'background-color', 'red');
+ *
+ * // Sets a style value to an element by id in the current document
+ * tinymce.DOM.setStyle('mydiv', 'background-color', 'red');
+ */
+ setStyle: function(elm, name, value) {
+ return this.run(elm, function(elm) {
+ var self = this, style, key;
+
+ if (name) {
+ if (typeof(name) === 'string') {
+ style = elm.style;
+
+ // Camelcase it, if needed
+ name = name.replace(/-(\D)/g, function(a, b) {
+ return b.toUpperCase();
+ });
+
+ // Default px suffix on these
+ if (typeof(value) === 'number' && !numericCssMap[name]) {
+ value += 'px';
+ }
+
+ // IE specific opacity
+ if (name === "opacity" && elm.runtimeStyle && typeof(elm.runtimeStyle.opacity) === "undefined") {
+ style.filter = value === '' ? '' : "alpha(opacity=" + (value * 100) + ")";
+ }
+
+ if (name == "float") {
+ // Old IE vs modern browsers
+ name = "cssFloat" in elm.style ? "cssFloat" : "styleFloat";
+ }
+
+ try {
+ style[name] = value;
+ } catch (ex) {
+ // Ignore IE errors
+ }
+
+ // Force update of the style data
+ if (self.settings.update_styles) {
+ elm.removeAttribute('data-mce-style');
+ }
+ } else {
+ for (key in name) {
+ self.setStyle(elm, key, name[key]);
+ }
+ }
+ }
+ });
+ },
+
+ /**
+ * Returns the current style or runtime/computed value of an element.
+ *
+ * @method getStyle
+ * @param {String/Element} elm HTML element or element id string to get style from.
+ * @param {String} name Style name to return.
+ * @param {Boolean} computed Computed style.
+ * @return {String} Current style or computed style value of an element.
+ */
+ getStyle: function(elm, name, computed) {
+ elm = this.get(elm);
+
+ if (!elm) {
+ return;
+ }
+
+ // W3C
+ if (this.doc.defaultView && computed) {
+ // Remove camelcase
+ name = name.replace(/[A-Z]/g, function(a){
+ return '-' + a;
+ });
+
+ try {
+ return this.doc.defaultView.getComputedStyle(elm, null).getPropertyValue(name);
+ } catch (ex) {
+ // Old safari might fail
+ return null;
+ }
+ }
+
+ // Camelcase it, if needed
+ name = name.replace(/-(\D)/g, function(a, b) {
+ return b.toUpperCase();
+ });
+
+ if (name == 'float') {
+ name = isIE ? 'styleFloat' : 'cssFloat';
+ }
+
+ // IE & Opera
+ if (elm.currentStyle && computed) {
+ return elm.currentStyle[name];
+ }
+
+ return elm.style ? elm.style[name] : undefined;
+ },
+
+ /**
+ * Sets multiple styles on the specified element(s).
+ *
+ * @method setStyles
+ * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set styles on.
+ * @param {Object} o Name/Value collection of style items to add to the element(s).
+ * @example
+ * // Sets styles on all paragraphs in the currently active editor
+ * tinymce.activeEditor.dom.setStyles(tinymce.activeEditor.dom.select('p'), {'background-color': 'red', 'color': 'green'});
+ *
+ * // Sets styles to an element by id in the current document
+ * tinymce.DOM.setStyles('mydiv', {'background-color': 'red', 'color': 'green'});
+ */
+ setStyles: function(elm, styles) {
+ this.setStyle(elm, styles);
+ },
+
+ css: function(elm, name, value) {
+ this.setStyle(elm, name, value);
+ },
+
+ /**
+ * Removes all attributes from an element or elements.
+ *
+ * @method removeAllAttribs
+ * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to remove attributes from.
+ */
+ removeAllAttribs: function(e) {
+ return this.run(e, function(e) {
+ var i, attrs = e.attributes;
+ for (i = attrs.length - 1; i >= 0; i--) {
+ e.removeAttributeNode(attrs.item(i));
+ }
+ });
+ },
+
+ /**
+ * Sets the specified attribute of an element or elements.
+ *
+ * @method setAttrib
+ * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set attribute on.
+ * @param {String} n Name of attribute to set.
+ * @param {String} v Value to set on the attribute - if this value is falsy like null, 0 or '' it will remove the attribute instead.
+ * @example
+ * // Sets class attribute on all paragraphs in the active editor
+ * tinymce.activeEditor.dom.setAttrib(tinymce.activeEditor.dom.select('p'), 'class', 'myclass');
+ *
+ * // Sets class attribute on a specific element in the current page
+ * tinymce.dom.setAttrib('mydiv', 'class', 'myclass');
+ */
+ setAttrib: function(e, n, v) {
+ var t = this;
+
+ // What's the point
+ if (!e || !n) {
+ return;
+ }
+
+ return this.run(e, function(e) {
+ var s = t.settings;
+ var originalValue = e.getAttribute(n);
+ if (v !== null) {
+ switch (n) {
+ case "style":
+ if (!is(v, 'string')) {
+ each(v, function(v, n) {
+ t.setStyle(e, n, v);
+ });
+
+ return;
+ }
+
+ // No mce_style for elements with these since they might get resized by the user
+ if (s.keep_values) {
+ if (v) {
+ e.setAttribute('data-mce-style', v, 2);
+ } else {
+ e.removeAttribute('data-mce-style', 2);
+ }
+ }
+
+ e.style.cssText = v;
+ break;
+
+ case "class":
+ e.className = v || ''; // Fix IE null bug
+ break;
+
+ case "src":
+ case "href":
+ if (s.keep_values) {
+ if (s.url_converter) {
+ v = s.url_converter.call(s.url_converter_scope || t, v, n, e);
+ }
+
+ t.setAttrib(e, 'data-mce-' + n, v, 2);
+ }
+
+ break;
+
+ case "shape":
+ e.setAttribute('data-mce-style', v);
+ break;
+ }
+ }
+ if (is(v) && v !== null && v.length !== 0) {
+ e.setAttribute(n, '' + v, 2);
+ } else {
+ e.removeAttribute(n, 2);
+ }
+
+ // fire onChangeAttrib event for attributes that have changed
+ if (originalValue != v && s.onSetAttrib) {
+ s.onSetAttrib({attrElm: e, attrName: n, attrValue: v});
+ }
+ });
+ },
+
+ /**
+ * Sets two or more specified attributes of an element or elements.
+ *
+ * @method setAttribs
+ * @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set attributes on.
+ * @param {Object} attrs Name/Value collection of attribute items to add to the element(s).
+ * @example
+ * // Sets class and title attributes on all paragraphs in the active editor
+ * tinymce.activeEditor.dom.setAttribs(tinymce.activeEditor.dom.select('p'), {'class': 'myclass', title: 'some title'});
+ *
+ * // Sets class and title attributes on a specific element in the current page
+ * tinymce.DOM.setAttribs('mydiv', {'class': 'myclass', title: 'some title'});
+ */
+ setAttribs: function(elm, attrs) {
+ var self = this;
+
+ return this.run(elm, function(elm) {
+ each(attrs, function(value, name) {
+ self.setAttrib(elm, name, value);
+ });
+ });
+ },
+
+ /**
+ * Returns the specified attribute by name.
+ *
+ * @method getAttrib
+ * @param {String/Element} elm Element string id or DOM element to get attribute from.
+ * @param {String} name Name of attribute to get.
+ * @param {String} defaultVal Optional default value to return if the attribute didn't exist.
+ * @return {String} Attribute value string, default value or null if the attribute wasn't found.
+ */
+ getAttrib: function(elm, name, defaultVal) {
+ var value, self = this, undef;
+
+ elm = self.get(elm);
+
+ if (!elm || elm.nodeType !== 1) {
+ return defaultVal === undef ? false : defaultVal;
+ }
+
+ if (!is(defaultVal)) {
+ defaultVal = '';
+ }
+
+ // Try the mce variant for these
+ if (/^(src|href|style|coords|shape)$/.test(name)) {
+ value = elm.getAttribute("data-mce-" + name);
+
+ if (value) {
+ return value;
+ }
+ }
+
+ if (isIE && self.props[name]) {
+ value = elm[self.props[name]];
+ value = value && value.nodeValue ? value.nodeValue : value;
+ }
+
+ if (!value) {
+ value = elm.getAttribute(name, 2);
+ }
+
+ // Check boolean attribs
+ if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(name)) {
+ if (elm[self.props[name]] === true && value === '') {
+ return name;
+ }
+
+ return value ? name : '';
+ }
+
+ // Inner input elements will override attributes on form elements
+ if (elm.nodeName === "FORM" && elm.getAttributeNode(name)) {
+ return elm.getAttributeNode(name).nodeValue;
+ }
+
+ if (name === 'style') {
+ value = value || elm.style.cssText;
+
+ if (value) {
+ value = self.serializeStyle(self.parseStyle(value), elm.nodeName);
+
+ if (self.settings.keep_values) {
+ elm.setAttribute('data-mce-style', value);
+ }
+ }
+ }
+
+ // Remove Apple and WebKit stuff
+ if (isWebKit && name === "class" && value) {
+ value = value.replace(/(apple|webkit)\-[a-z\-]+/gi, '');
+ }
+
+ // Handle IE issues
+ if (isIE) {
+ switch (name) {
+ case 'rowspan':
+ case 'colspan':
+ // IE returns 1 as default value
+ if (value === 1) {
+ value = '';
+ }
+
+ break;
+
+ case 'size':
+ // IE returns +0 as default value for size
+ if (value === '+0' || value === 20 || value === 0) {
+ value = '';
+ }
+
+ break;
+
+ case 'width':
+ case 'height':
+ case 'vspace':
+ case 'checked':
+ case 'disabled':
+ case 'readonly':
+ if (value === 0) {
+ value = '';
+ }
+
+ break;
+
+ case 'hspace':
+ // IE returns -1 as default value
+ if (value === -1) {
+ value = '';
+ }
+
+ break;
+
+ case 'maxlength':
+ case 'tabindex':
+ // IE returns default value
+ if (value === 32768 || value === 2147483647 || value === '32768') {
+ value = '';
+ }
+
+ break;
+
+ case 'multiple':
+ case 'compact':
+ case 'noshade':
+ case 'nowrap':
+ if (value === 65535) {
+ return name;
+ }
+
+ return defaultVal;
+
+ case 'shape':
+ value = value.toLowerCase();
+ break;
+
+ default:
+ // IE has odd anonymous function for event attributes
+ if (name.indexOf('on') === 0 && value) {
+ value = ('' + value).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, '$1');
+ }
+ }
+ }
+
+ return (value !== undef && value !== null && value !== '') ? '' + value : defaultVal;
+ },
+
+ /**
+ * Returns the absolute x, y position of a node. The position will be returned in an object with x, y fields.
+ *
+ * @method getPos
+ * @param {Element/String} elm HTML element or element id to get x, y position from.
+ * @param {Element} rootElm Optional root element to stop calculations at.
+ * @return {object} Absolute position of the specified element object with x, y fields.
+ */
+ getPos: function(elm, rootElm) {
+ var self = this, x = 0, y = 0, offsetParent, doc = self.doc, pos;
+
+ elm = self.get(elm);
+ rootElm = rootElm || doc.body;
+
+ if (elm) {
+ // Use getBoundingClientRect if it exists since it's faster than looping offset nodes
+ if (rootElm === doc.body && elm.getBoundingClientRect) {
+ pos = elm.getBoundingClientRect();
+ rootElm = self.boxModel ? doc.documentElement : doc.body;
+
+ // Add scroll offsets from documentElement or body since IE with the wrong box model will use d.body and so do WebKit
+ // Also remove the body/documentelement clientTop/clientLeft on IE 6, 7 since they offset the position
+ x = pos.left + (doc.documentElement.scrollLeft || doc.body.scrollLeft) - rootElm.clientTop;
+ y = pos.top + (doc.documentElement.scrollTop || doc.body.scrollTop) - rootElm.clientLeft;
+
+ return {x: x, y: y};
+ }
+
+ offsetParent = elm;
+ while (offsetParent && offsetParent != rootElm && offsetParent.nodeType) {
+ x += offsetParent.offsetLeft || 0;
+ y += offsetParent.offsetTop || 0;
+ offsetParent = offsetParent.offsetParent;
+ }
+
+ offsetParent = elm.parentNode;
+ while (offsetParent && offsetParent != rootElm && offsetParent.nodeType) {
+ x -= offsetParent.scrollLeft || 0;
+ y -= offsetParent.scrollTop || 0;
+ offsetParent = offsetParent.parentNode;
+ }
+ }
+
+ return {x: x, y: y};
+ },
+
+ /**
+ * Parses the specified style value into an object collection. This parser will also
+ * merge and remove any redundant items that browsers might have added. It will also convert non-hex
+ * colors to hex values. Urls inside the styles will also be converted to absolute/relative based on settings.
+ *
+ * @method parseStyle
+ * @param {String} cssText Style value to parse, for example: border:1px solid red;.
+ * @return {Object} Object representation of that style, for example: {border: '1px solid red'}
+ */
+ parseStyle: function(cssText) {
+ return this.styles.parse(cssText);
+ },
+
+ /**
+ * Serializes the specified style object into a string.
+ *
+ * @method serializeStyle
+ * @param {Object} styles Object to serialize as string, for example: {border: '1px solid red'}
+ * @param {String} name Optional element name.
+ * @return {String} String representation of the style object, for example: border: 1px solid red.
+ */
+ serializeStyle: function(styles, name) {
+ return this.styles.serialize(styles, name);
+ },
+
+ /**
+ * Adds a style element at the top of the document with the specified cssText content.
+ *
+ * @method addStyle
+ * @param {String} cssText CSS Text style to add to top of head of document.
+ */
+ addStyle: function(cssText) {
+ var self = this, doc = self.doc, head, styleElm;
+
+ // Prevent inline from loading the same styles twice
+ if (self !== DOMUtils.DOM && doc === document) {
+ var addedStyles = DOMUtils.DOM.addedStyles;
+
+ addedStyles = addedStyles || [];
+ if (addedStyles[cssText]) {
+ return;
+ }
+
+ addedStyles[cssText] = true;
+ DOMUtils.DOM.addedStyles = addedStyles;
+ }
+
+ // Create style element if needed
+ styleElm = doc.getElementById('mceDefaultStyles');
+ if (!styleElm) {
+ styleElm = doc.createElement('style');
+ styleElm.id = 'mceDefaultStyles';
+ styleElm.type = 'text/css';
+
+ head = doc.getElementsByTagName('head')[0];
+ if (head.firstChild) {
+ head.insertBefore(styleElm, head.firstChild);
+ } else {
+ head.appendChild(styleElm);
+ }
+ }
+
+ // Append style data to old or new style element
+ if (styleElm.styleSheet) {
+ styleElm.styleSheet.cssText += cssText;
+ } else {
+ styleElm.appendChild(doc.createTextNode(cssText));
+ }
+ },
+
+ /**
+ * Imports/loads the specified CSS file into the document bound to the class.
+ *
+ * @method loadCSS
+ * @param {String} u URL to CSS file to load.
+ * @example
+ * // Loads a CSS file dynamically into the current document
+ * tinymce.DOM.loadCSS('somepath/some.css');
+ *
+ * // Loads a CSS file into the currently active editor instance
+ * tinymce.activeEditor.dom.loadCSS('somepath/some.css');
+ *
+ * // Loads a CSS file into an editor instance by id
+ * tinymce.get('someid').dom.loadCSS('somepath/some.css');
+ *
+ * // Loads multiple CSS files into the current document
+ * tinymce.DOM.loadCSS('somepath/some.css,somepath/someother.css');
+ */
+ loadCSS: function(url) {
+ var self = this, doc = self.doc, head;
+
+ // Prevent inline from loading the same CSS file twice
+ if (self !== DOMUtils.DOM && doc === document) {
+ DOMUtils.DOM.loadCSS(url);
+ return;
+ }
+
+ if (!url) {
+ url = '';
+ }
+
+ head = doc.getElementsByTagName('head')[0];
+
+ each(url.split(','), function(url) {
+ var link;
+
+ if (self.files[url]) {
+ return;
+ }
+
+ self.files[url] = true;
+ link = self.create('link', {rel: 'stylesheet', href: url});
+
+ // IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug
+ // This fix seems to resolve that issue by recalcing the document once a stylesheet finishes loading
+ // It's ugly but it seems to work fine.
+ if (isIE && doc.documentMode && doc.recalc) {
+ link.onload = function() {
+ if (doc.recalc) {
+ doc.recalc();
+ }
+
+ link.onload = null;
+ };
+ }
+
+ head.appendChild(link);
+ });
+ },
+
+ /**
+ * Adds a class to the specified element or elements.
+ *
+ * @method addClass
+ * @param {String/Element/Array} elm Element ID string or DOM element or array with elements or IDs.
+ * @param {String} cls Class name to add to each element.
+ * @return {String/Array} String with new class value or array with new class values for all elements.
+ * @example
+ * // Adds a class to all paragraphs in the active editor
+ * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'myclass');
+ *
+ * // Adds a class to a specific element in the current page
+ * tinymce.DOM.addClass('mydiv', 'myclass');
+ */
+ addClass: function(elm, cls) {
+ return this.run(elm, function(elm) {
+ var clsVal;
+
+ if (!cls) {
+ return 0;
+ }
+
+ if (this.hasClass(elm, cls)) {
+ return elm.className;
+ }
+
+ clsVal = this.removeClass(elm, cls);
+ elm.className = clsVal = (clsVal !== '' ? (clsVal + ' ') : '') + cls;
+
+ return clsVal;
+ });
+ },
+
+ /**
+ * Removes a class from the specified element or elements.
+ *
+ * @method removeClass
+ * @param {String/Element/Array} elm Element ID string or DOM element or array with elements or IDs.
+ * @param {String} cls Class name to remove from each element.
+ * @return {String/Array} String of remaining class name(s), or an array of strings if multiple input elements
+ * were passed in.
+ * @example
+ * // Removes a class from all paragraphs in the active editor
+ * tinymce.activeEditor.dom.removeClass(tinymce.activeEditor.dom.select('p'), 'myclass');
+ *
+ * // Removes a class from a specific element in the current page
+ * tinymce.DOM.removeClass('mydiv', 'myclass');
+ */
+ removeClass: function(elm, cls) {
+ var self = this, re;
+
+ return self.run(elm, function(elm) {
+ var val;
+
+ if (self.hasClass(elm, cls)) {
+ if (!re) {
+ re = new RegExp("(^|\\s+)" + cls + "(\\s+|$)", "g");
+ }
+
+ val = elm.className.replace(re, ' ');
+ val = trim(val != ' ' ? val : '');
+
+ elm.className = val;
+
+ // Empty class attr
+ if (!val) {
+ elm.removeAttribute('class');
+ elm.removeAttribute('className');
+ }
+
+ return val;
+ }
+
+ return elm.className;
+ });
+ },
+
+ /**
+ * Returns true if the specified element has the specified class.
+ *
+ * @method hasClass
+ * @param {String/Element} n HTML element or element id string to check CSS class on.
+ * @param {String} c CSS class to check for.
+ * @return {Boolean} true/false if the specified element has the specified class.
+ */
+ hasClass: function(elm, cls) {
+ elm = this.get(elm);
+
+ if (!elm || !cls) {
+ return false;
+ }
+
+ return (' ' + elm.className + ' ').indexOf(' ' + cls + ' ') !== -1;
+ },
+
+ /**
+ * Toggles the specified class on/off.
+ *
+ * @method toggleClass
+ * @param {Element} elm Element to toggle class on.
+ * @param {[type]} cls Class to toggle on/off.
+ * @param {[type]} state Optional state to set.
+ */
+ toggleClass: function(elm, cls, state) {
+ state = state === undefined ? !this.hasClass(elm, cls) : state;
+
+ if (this.hasClass(elm, cls) !== state) {
+ if (state) {
+ this.addClass(elm, cls);
+ } else {
+ this.removeClass(elm, cls);
+ }
+ }
+ },
+
+ /**
+ * Shows the specified element(s) by ID by setting the "display" style.
+ *
+ * @method show
+ * @param {String/Element/Array} elm ID of DOM element or DOM element or array with elements or IDs to show.
+ */
+ show: function(elm) {
+ return this.setStyle(elm, 'display', 'block');
+ },
+
+ /**
+ * Hides the specified element(s) by ID by setting the "display" style.
+ *
+ * @method hide
+ * @param {String/Element/Array} e ID of DOM element or DOM element or array with elements or IDs to hide.
+ * @example
+ * // Hides an element by id in the document
+ * tinymce.DOM.hide('myid');
+ */
+ hide: function(elm) {
+ return this.setStyle(elm, 'display', 'none');
+ },
+
+ /**
+ * Returns true/false if the element is hidden or not by checking the "display" style.
+ *
+ * @method isHidden
+ * @param {String/Element} e Id or element to check display state on.
+ * @return {Boolean} true/false if the element is hidden or not.
+ */
+ isHidden: function(elm) {
+ elm = this.get(elm);
+
+ return !elm || elm.style.display == 'none' || this.getStyle(elm, 'display') == 'none';
+ },
+
+ /**
+ * Returns a unique id. This can be useful when generating elements on the fly.
+ * This method will not check if the element already exists.
+ *
+ * @method uniqueId
+ * @param {String} prefix Optional prefix to add in front of all ids - defaults to "mce_".
+ * @return {String} Unique id.
+ */
+ uniqueId: function(prefix) {
+ return (!prefix ? 'mce_' : prefix) + (this.counter++);
+ },
+
+ /**
+ * Sets the specified HTML content inside the element or elements. The HTML will first be processed. This means
+ * URLs will get converted, hex color values fixed etc. Check processHTML for details.
+ *
+ * @method setHTML
+ * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set HTML inside of.
+ * @param {String} h HTML content to set as inner HTML of the element.
+ * @example
+ * // Sets the inner HTML of all paragraphs in the active editor
+ * tinymce.activeEditor.dom.setHTML(tinymce.activeEditor.dom.select('p'), 'some inner html');
+ *
+ * // Sets the inner HTML of an element by id in the document
+ * tinymce.DOM.setHTML('mydiv', 'some inner html');
+ */
+ setHTML: function(element, html) {
+ var self = this;
+
+ return self.run(element, function(element) {
+ if (isIE) {
+ // Remove all child nodes, IE keeps empty text nodes in DOM
+ while (element.firstChild) {
+ element.removeChild(element.firstChild);
+ }
+
+ try {
+ // IE will remove comments from the beginning
+ // unless you padd the contents with something
+ element.innerHTML = '<br />' + html;
+ element.removeChild(element.firstChild);
+ } catch (ex) {
+ // IE sometimes produces an unknown runtime error on innerHTML if it's a block element
+ // within a block element for example a div inside a p
+ // This seems to fix this problem
+
+ // Create new div with HTML contents and a BR in front to keep comments
+ var newElement = self.create('div');
+ newElement.innerHTML = '<br />' + html;
+
+ // Add all children from div to target
+ each (grep(newElement.childNodes), function(node, i) {
+ // Skip br element
+ if (i && element.canHaveHTML) {
+ element.appendChild(node);
+ }
+ });
+ }
+ } else {
+ element.innerHTML = html;
+ }
+
+ return html;
+ });
+ },
+
+ /**
+ * Returns the outer HTML of an element.
+ *
+ * @method getOuterHTML
+ * @param {String/Element} elm Element ID or element object to get outer HTML from.
+ * @return {String} Outer HTML string.
+ * @example
+ * tinymce.DOM.getOuterHTML(editorElement);
+ * tinymce.activeEditor.getOuterHTML(tinymce.activeEditor.getBody());
+ */
+ getOuterHTML: function(elm) {
+ var doc, self = this;
+
+ elm = self.get(elm);
+
+ if (!elm) {
+ return null;
+ }
+
+ if (elm.nodeType === 1 && self.hasOuterHTML) {
+ return elm.outerHTML;
+ }
+
+ doc = (elm.ownerDocument || self.doc).createElement("body");
+ doc.appendChild(elm.cloneNode(true));
+
+ return doc.innerHTML;
+ },
+
+ /**
+ * Sets the specified outer HTML on an element or elements.
+ *
+ * @method setOuterHTML
+ * @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set outer HTML on.
+ * @param {Object} html HTML code to set as outer value for the element.
+ * @param {Document} doc Optional document scope to use in this process - defaults to the document of the DOM class.
+ * @example
+ * // Sets the outer HTML of all paragraphs in the active editor
+ * tinymce.activeEditor.dom.setOuterHTML(tinymce.activeEditor.dom.select('p'), '<div>some html</div>');
+ *
+ * // Sets the outer HTML of an element by id in the document
+ * tinymce.DOM.setOuterHTML('mydiv', '<div>some html</div>');
+ */
+ setOuterHTML: function(elm, html, doc) {
+ var self = this;
+
+ return self.run(elm, function(elm) {
+ function set() {
+ var node, tempElm;
+
+ tempElm = doc.createElement("body");
+ tempElm.innerHTML = html;
+
+ node = tempElm.lastChild;
+ while (node) {
+ self.insertAfter(node.cloneNode(true), elm);
+ node = node.previousSibling;
+ }
+
+ self.remove(elm);
+ }
+
+ // Only set HTML on elements
+ if (elm.nodeType == 1) {
+ doc = doc || elm.ownerDocument || self.doc;
+
+ if (isIE) {
+ try {
+ // Try outerHTML for IE it sometimes produces an unknown runtime error
+ if (elm.nodeType == 1 && self.hasOuterHTML) {
+ elm.outerHTML = html;
+ } else {
+ set();
+ }
+ } catch (ex) {
+ // Fix for unknown runtime error
+ set();
+ }
+ } else {
+ set();
+ }
+ }
+ });
+ },
+
+ /**
+ * Entity decodes a string. This method decodes any HTML entities, such as å.
+ *
+ * @method decode
+ * @param {String} s String to decode entities on.
+ * @return {String} Entity decoded string.
+ */
+ decode: Entities.decode,
+
+ /**
+ * Entity encodes a string. This method encodes the most common entities, such as <>"&.
+ *
+ * @method encode
+ * @param {String} text String to encode with entities.
+ * @return {String} Entity encoded string.
+ */
+ encode: Entities.encodeAllRaw,
+
+ /**
+ * Inserts an element after the reference element.
+ *
+ * @method insertAfter
+ * @param {Element} node Element to insert after the reference.
+ * @param {Element/String/Array} reference_node Reference element, element id or array of elements to insert after.
+ * @return {Element/Array} Element that got added or an array with elements.
+ */
+ insertAfter: function(node, reference_node) {
+ reference_node = this.get(reference_node);
+
+ return this.run(node, function(node) {
+ var parent, nextSibling;
+
+ parent = reference_node.parentNode;
+ nextSibling = reference_node.nextSibling;
+
+ if (nextSibling) {
+ parent.insertBefore(node, nextSibling);
+ } else {
+ parent.appendChild(node);
+ }
+
+ return node;
+ });
+ },
+
+ /**
+ * Replaces the specified element or elements with the new element specified. The new element will
+ * be cloned if multiple input elements are passed in.
+ *
+ * @method replace
+ * @param {Element} newElm New element to replace old ones with.
+ * @param {Element/String/Array} oldELm Element DOM node, element id or array of elements or ids to replace.
+ * @param {Boolean} k Optional keep children state, if set to true child nodes from the old object will be added to new ones.
+ */
+ replace: function(newElm, oldElm, keepChildren) {
+ var self = this;
+
+ return self.run(oldElm, function(oldElm) {
+ if (is(oldElm, 'array')) {
+ newElm = newElm.cloneNode(true);
+ }
+
+ if (keepChildren) {
+ each(grep(oldElm.childNodes), function(node) {
+ newElm.appendChild(node);
+ });
+ }
+
+ return oldElm.parentNode.replaceChild(newElm, oldElm);
+ });
+ },
+
+ /**
+ * Renames the specified element and keeps its attributes and children.
+ *
+ * @method rename
+ * @param {Element} elm Element to rename.
+ * @param {String} name Name of the new element.
+ * @return {Element} New element or the old element if it needed renaming.
+ */
+ rename: function(elm, name) {
+ var self = this, newElm;
+
+ if (elm.nodeName != name.toUpperCase()) {
+ // Rename block element
+ newElm = self.create(name);
+
+ // Copy attribs to new block
+ each(self.getAttribs(elm), function(attr_node) {
+ self.setAttrib(newElm, attr_node.nodeName, self.getAttrib(elm, attr_node.nodeName));
+ });
+
+ // Replace block
+ self.replace(newElm, elm, 1);
+ }
+
+ return newElm || elm;
+ },
+
+ /**
+ * Find the common ancestor of two elements. This is a shorter method than using the DOM Range logic.
+ *
+ * @method findCommonAncestor
+ * @param {Element} a Element to find common ancestor of.
+ * @param {Element} b Element to find common ancestor of.
+ * @return {Element} Common ancestor element of the two input elements.
+ */
+ findCommonAncestor: function(a, b) {
+ var ps = a, pe;
+
+ while (ps) {
+ pe = b;
+
+ while (pe && ps != pe) {
+ pe = pe.parentNode;
+ }
+
+ if (ps == pe) {
+ break;
+ }
+
+ ps = ps.parentNode;
+ }
+
+ if (!ps && a.ownerDocument) {
+ return a.ownerDocument.documentElement;
+ }
+
+ return ps;
+ },
+
+ /**
+ * Parses the specified RGB color value and returns a hex version of that color.
+ *
+ * @method toHex
+ * @param {String} rgbVal RGB string value like rgb(1,2,3)
+ * @return {String} Hex version of that RGB value like #FF00FF.
+ */
+ toHex: function(rgbVal) {
+ return this.styles.toHex(Tools.trim(rgbVal));
+ },
+
+ /**
+ * Executes the specified function on the element by id or dom element node or array of elements/id.
+ *
+ * @method run
+ * @param {String/Element/Array} Element ID or DOM element object or array with ids or elements.
+ * @param {function} f Function to execute for each item.
+ * @param {Object} s Optional scope to execute the function in.
+ * @return {Object/Array} Single object, or an array of objects if multiple input elements were passed in.
+ */
+ run: function(elm, func, scope) {
+ var self = this, result;
+
+ if (typeof(elm) === 'string') {
+ elm = self.get(elm);
+ }
+
+ if (!elm) {
+ return false;
+ }
+
+ scope = scope || this;
+ if (!elm.nodeType && (elm.length || elm.length === 0)) {
+ result = [];
+
+ each(elm, function(elm, i) {
+ if (elm) {
+ if (typeof(elm) == 'string') {
+ elm = self.get(elm);
+ }
+
+ result.push(func.call(scope, elm, i));
+ }
+ });
+
+ return result;
+ }
+
+ return func.call(scope, elm);
+ },
+
+ /**
+ * Returns a NodeList with attributes for the element.
+ *
+ * @method getAttribs
+ * @param {HTMLElement/string} elm Element node or string id to get attributes from.
+ * @return {NodeList} NodeList with attributes.
+ */
+ getAttribs: function(elm) {
+ var attrs;
+
+ elm = this.get(elm);
+
+ if (!elm) {
+ return [];
+ }
+
+ if (isIE) {
+ attrs = [];
+
+ // Object will throw exception in IE
+ if (elm.nodeName == 'OBJECT') {
+ return elm.attributes;
+ }
+
+ // IE doesn't keep the selected attribute if you clone option elements
+ if (elm.nodeName === 'OPTION' && this.getAttrib(elm, 'selected')) {
+ attrs.push({specified: 1, nodeName: 'selected'});
+ }
+
+ // It's crazy that this is faster in IE but it's because it returns all attributes all the time
+ var attrRegExp = /<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;
+ elm.cloneNode(false).outerHTML.replace(attrRegExp, '').replace(/[\w:\-]+/gi, function(a) {
+ attrs.push({specified: 1, nodeName: a});
+ });
+
+ return attrs;
+ }
+
+ return elm.attributes;
+ },
+
+ /**
+ * Returns true/false if the specified node is to be considered empty or not.
+ *
+ * @example
+ * tinymce.DOM.isEmpty(node, {img: true});
+ * @method isEmpty
+ * @param {Object} elements Optional name/value object with elements that are automatically treated as non-empty elements.
+ * @return {Boolean} true/false if the node is empty or not.
+ */
+ isEmpty: function(node, elements) {
+ var self = this, i, attributes, type, walker, name, brCount = 0;
+
+ node = node.firstChild;
+ if (node) {
+ walker = new TreeWalker(node, node.parentNode);
+ elements = elements || self.schema ? self.schema.getNonEmptyElements() : null;
+
+ do {
+ type = node.nodeType;
+
+ if (type === 1) {
+ // Ignore bogus elements
+ if (node.getAttribute('data-mce-bogus')) {
+ continue;
+ }
+
+ // Keep empty elements like <img />
+ name = node.nodeName.toLowerCase();
+ if (elements && elements[name]) {
+ // Ignore single BR elements in blocks like <p><br /></p> or <p><span><br /></span></p>
+ if (name === 'br') {
+ brCount++;
+ continue;
+ }
+
+ return false;
+ }
+
+ // Keep elements with data-bookmark attributes or name attribute like <a name="1"></a>
+ attributes = self.getAttribs(node);
+ i = node.attributes.length;
+ while (i--) {
+ name = node.attributes[i].nodeName;
+ if (name === "name" || name === 'data-mce-bookmark') {
+ return false;
+ }
+ }
+ }
+
+ // Keep comment nodes
+ if (type == 8) {
+ return false;
+ }
+
+ // Keep non whitespace text nodes
+ if ((type === 3 && !whiteSpaceRegExp.test(node.nodeValue))) {
+ return false;
+ }
+ } while ((node = walker.next()));
+ }
+
+ return brCount <= 1;
+ },
+
+ /**
+ * Creates a new DOM Range object. This will use the native DOM Range API if it's
+ * available. If it's not, it will fall back to the custom TinyMCE implementation.
+ *
+ * @method createRng
+ * @return {DOMRange} DOM Range object.
+ * @example
+ * var rng = tinymce.DOM.createRng();
+ * alert(rng.startContainer + "," + rng.startOffset);
+ */
+ createRng: function() {
+ var doc = this.doc;
+
+ return doc.createRange ? doc.createRange() : new Range(this);
+ },
+
+ /**
+ * Returns the index of the specified node within its parent.
+ *
+ * @method nodeIndex
+ * @param {Node} node Node to look for.
+ * @param {boolean} normalized Optional true/false state if the index is what it would be after a normalization.
+ * @return {Number} Index of the specified node.
+ */
+ nodeIndex: function(node, normalized) {
+ var idx = 0, lastNodeType, lastNode, nodeType;
+
+ if (node) {
+ for (lastNodeType = node.nodeType, node = node.previousSibling, lastNode = node; node; node = node.previousSibling) {
+ nodeType = node.nodeType;
+
+ // Normalize text nodes
+ if (normalized && nodeType == 3) {
+ if (nodeType == lastNodeType || !node.nodeValue.length) {
+ continue;
+ }
+ }
+ idx++;
+ lastNodeType = nodeType;
+ }
+ }
+
+ return idx;
+ },
+
+ /**
+ * Splits an element into two new elements and places the specified split
+ * element or elements between the new ones. For example splitting the paragraph at the bold element in
+ * this example <p>abc<b>abc</b>123</p> would produce <p>abc</p><b>abc</b><p>123</p>.
+ *
+ * @method split
+ * @param {Element} parentElm Parent element to split.
+ * @param {Element} splitElm Element to split at.
+ * @param {Element} replacementElm Optional replacement element to replace the split element with.
+ * @return {Element} Returns the split element or the replacement element if that is specified.
+ */
+ split: function(parentElm, splitElm, replacementElm) {
+ var self = this, r = self.createRng(), bef, aft, pa;
+
+ // W3C valid browsers tend to leave empty nodes to the left/right side of the contents - this makes sense
+ // but we don't want that in our code since it serves no purpose for the end user
+ // For example splitting this html at the bold element:
+ // <p>text 1<span><b>CHOP</b></span>text 2</p>
+ // would produce:
+ // <p>text 1<span></span></p><b>CHOP</b><p><span></span>text 2</p>
+ // this function will then trim off empty edges and produce:
+ // <p>text 1</p><b>CHOP</b><p>text 2</p>
+ function trimNode(node) {
+ var i, children = node.childNodes, type = node.nodeType;
+
+ function surroundedBySpans(node) {
+ var previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN';
+ var nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN';
+ return previousIsSpan && nextIsSpan;
+ }
+
+ if (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') {
+ return;
+ }
+
+ for (i = children.length - 1; i >= 0; i--) {
+ trimNode(children[i]);
+ }
+
+ if (type != 9) {
+ // Keep non whitespace text nodes
+ if (type == 3 && node.nodeValue.length > 0) {
+ // If parent element isn't a block or there isn't any useful contents for example "<p> </p>"
+ // Also keep text nodes with only spaces if surrounded by spans.
+ // eg. "<p><span>a</span> <span>b</span></p>" should keep space between a and b
+ var trimmedLength = trim(node.nodeValue).length;
+ if (!self.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node)) {
+ return;
+ }
+ } else if (type == 1) {
+ // If the only child is a bookmark then move it up
+ children = node.childNodes;
+
+ // TODO fix this complex if
+ if (children.length == 1 && children[0] && children[0].nodeType == 1 &&
+ children[0].getAttribute('data-mce-type') == 'bookmark') {
+ node.parentNode.insertBefore(children[0], node);
+ }
+
+ // Keep non empty elements or img, hr etc
+ if (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) {
+ return;
+ }
+ }
+
+ self.remove(node);
+ }
+
+ return node;
+ }
+
+ if (parentElm && splitElm) {
+ // Get before chunk
+ r.setStart(parentElm.parentNode, self.nodeIndex(parentElm));
+ r.setEnd(splitElm.parentNode, self.nodeIndex(splitElm));
+ bef = r.extractContents();
+
+ // Get after chunk
+ r = self.createRng();
+ r.setStart(splitElm.parentNode, self.nodeIndex(splitElm) + 1);
+ r.setEnd(parentElm.parentNode, self.nodeIndex(parentElm) + 1);
+ aft = r.extractContents();
+
+ // Insert before chunk
+ pa = parentElm.parentNode;
+ pa.insertBefore(trimNode(bef), parentElm);
+
+ // Insert middle chunk
+ if (replacementElm) {
+ pa.replaceChild(replacementElm, splitElm);
+ } else {
+ pa.insertBefore(splitElm, parentElm);
+ }
+
+ // Insert after chunk
+ pa.insertBefore(trimNode(aft), parentElm);
+ self.remove(parentElm);
+
+ return replacementElm || splitElm;
+ }
+ },
+
+ /**
+ * Adds an event handler to the specified object.
+ *
+ * @method bind
+ * @param {Element/Document/Window/Array} target Target element to bind events to.
+ * handler to or an array of elements/ids/documents.
+ * @param {String} name Name of event handler to add, for example: click.
+ * @param {function} func Function to execute when the event occurs.
+ * @param {Object} scope Optional scope to execute the function in.
+ * @return {function} Function callback handler the same as the one passed in.
+ */
+ bind: function(target, name, func, scope) {
+ var self = this;
+
+ if (Tools.isArray(target)) {
+ var i = target.length;
+
+ while (i--) {
+ target[i] = self.bind(target[i], name, func, scope);
+ }
+
+ return target;
+ }
+
+ // Collect all window/document events bound by editor instance
+ if (self.settings.collect && (target === self.doc || target === self.win)) {
+ self.boundEvents.push([target, name, func, scope]);
+ }
+
+ return self.events.bind(target, name, func, scope || self);
+ },
+
+ /**
+ * Removes the specified event handler by name and function from an element or collection of elements.
+ *
+ * @method unbind
+ * @param {Element/Document/Window/Array} target Target element to unbind events on.
+ * @param {String} name Event handler name, for example: "click"
+ * @param {function} func Function to remove.
+ * @return {bool/Array} Bool state of true if the handler was removed, or an array of states if multiple input elements
+ * were passed in.
+ */
+ unbind: function(target, name, func) {
+ var self = this, i;
+
+ if (Tools.isArray(target)) {
+ i = target.length;
+
+ while (i--) {
+ target[i] = self.unbind(target[i], name, func);
+ }
+
+ return target;
+ }
+
+ // Remove any bound events matching the input
+ if (self.boundEvents && (target === self.doc || target === self.win)) {
+ i = self.boundEvents.length;
+
+ while (i--) {
+ var item = self.boundEvents[i];
+
+ if (target == item[0] && (!name || name == item[1]) && (!func || func == item[2])) {
+ this.events.unbind(item[0], item[1], item[2]);
+ }
+ }
+ }
+
+ return this.events.unbind(target, name, func);
+ },
+
+ /**
+ * Fires the specified event name with object on target.
+ *
+ * @method fire
+ * @param {Node/Document/Window} target Target element or object to fire event on.
+ * @param {String} name Name of the event to fire.
+ * @param {Object} evt Event object to send.
+ * @return {Event} Event object.
+ */
+ fire: function(target, name, evt) {
+ return this.events.fire(target, name, evt);
+ },
+
+ // Returns the content editable state of a node
+ getContentEditable: function(node) {
+ var contentEditable;
+
+ // Check type
+ if (node.nodeType != 1) {
+ return null;
+ }
+
+ // Check for fake content editable
+ contentEditable = node.getAttribute("data-mce-contenteditable");
+ if (contentEditable && contentEditable !== "inherit") {
+ return contentEditable;
+ }
+
+ // Check for real content editable
+ return node.contentEditable !== "inherit" ? node.contentEditable : null;
+ },
+
+ /**
+ * Destroys all internal references to the DOM to solve IE leak issues.
+ *
+ * @method destroy
+ */
+ destroy: function() {
+ var self = this;
+
+ // Unbind all events bound to window/document by editor instance
+ if (self.boundEvents) {
+ var i = self.boundEvents.length;
+
+ while (i--) {
+ var item = self.boundEvents[i];
+ this.events.unbind(item[0], item[1], item[2]);
+ }
+
+ self.boundEvents = null;
+ }
+
+ // Restore sizzle document to window.document
+ // Since the current document might be removed producing "Permission denied" on IE see #6325
+ if (Sizzle.setDocument) {
+ Sizzle.setDocument();
+ }
+
+ self.win = self.doc = self.root = self.events = self.frag = null;
+ },
+
+ // #ifdef debug
+
+ dumpRng: function(r) {
+ return (
+ 'startContainer: ' + r.startContainer.nodeName +
+ ', startOffset: ' + r.startOffset +
+ ', endContainer: ' + r.endContainer.nodeName +
+ ', endOffset: ' + r.endOffset
+ );
+ },
+
+ // #endif
+
+ _findSib: function(node, selector, name) {
+ var self = this, func = selector;
+
+ if (node) {
+ // If expression make a function of it using is
+ if (typeof(func) == 'string') {
+ func = function(node) {
+ return self.is(node, selector);
+ };
+ }
+
+ // Loop all siblings
+ for (node = node[name]; node; node = node[name]) {
+ if (func(node)) {
+ return node;
+ }
+ }
+ }
+
+ return null;
+ }
+ };
+
+ /**
+ * Instance of DOMUtils for the current document.
+ *
+ * @static
+ * @property DOM
+ * @type tinymce.dom.DOMUtils
+ * @example
+ * // Example of how to add a class to some element by id
+ * tinymce.DOM.addClass('someid', 'someclass');
+ */
+ DOMUtils.DOM = new DOMUtils(document);
+
+ return DOMUtils;
+});
+
+// Included from: js/tinymce/classes/dom/ScriptLoader.js
+
+/**
+ * ScriptLoader.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*globals console*/
+
+/**
+ * This class handles asynchronous/synchronous loading of JavaScript files it will execute callbacks
+ * when various items gets loaded. This class is useful to load external JavaScript files.
+ *
+ * @class tinymce.dom.ScriptLoader
+ * @example
+ * // Load a script from a specific URL using the global script loader
+ * tinymce.ScriptLoader.load('somescript.js');
+ *
+ * // Load a script using a unique instance of the script loader
+ * var scriptLoader = new tinymce.dom.ScriptLoader();
+ *
+ * scriptLoader.load('somescript.js');
+ *
+ * // Load multiple scripts
+ * var scriptLoader = new tinymce.dom.ScriptLoader();
+ *
+ * scriptLoader.add('somescript1.js');
+ * scriptLoader.add('somescript2.js');
+ * scriptLoader.add('somescript3.js');
+ *
+ * scriptLoader.loadQueue(function() {
+ * alert('All scripts are now loaded.');
+ * });
+ */
+define("tinymce/dom/ScriptLoader", [
+ "tinymce/dom/DOMUtils",
+ "tinymce/util/Tools"
+], function(DOMUtils, Tools) {
+ var DOM = DOMUtils.DOM;
+ var each = Tools.each, grep = Tools.grep;
+
+ function ScriptLoader() {
+ var QUEUED = 0,
+ LOADING = 1,
+ LOADED = 2,
+ states = {},
+ queue = [],
+ scriptLoadedCallbacks = {},
+ queueLoadedCallbacks = [],
+ loading = 0,
+ undef;
+
+ /**
+ * Loads a specific script directly without adding it to the load queue.
+ *
+ * @method load
+ * @param {String} url Absolute URL to script to add.
+ * @param {function} callback Optional callback function to execute ones this script gets loaded.
+ * @param {Object} scope Optional scope to execute callback in.
+ */
+ function loadScript(url, callback) {
+ var dom = DOM, elm, id;
+
+ // Execute callback when script is loaded
+ function done() {
+ dom.remove(id);
+
+ if (elm) {
+ elm.onreadystatechange = elm.onload = elm = null;
+ }
+
+ callback();
+ }
+
+ function error() {
+ // Report the error so it's easier for people to spot loading errors
+ if (typeof(console) !== "undefined" && console.log) {
+ console.log("Failed to load: " + url);
+ }
+
+ // We can't mark it as done if there is a load error since
+ // A) We don't want to produce 404 errors on the server and
+ // B) the onerror event won't fire on all browsers.
+ // done();
+ }
+
+ id = dom.uniqueId();
+
+ // Create new script element
+ elm = document.createElement('script');
+ elm.id = id;
+ elm.type = 'text/javascript';
+ elm.src = url;
+
+ // Seems that onreadystatechange works better on IE 10 onload seems to fire incorrectly
+ if ("onreadystatechange" in elm) {
+ elm.onreadystatechange = function() {
+ if (/loaded|complete/.test(elm.readyState)) {
+ done();
+ }
+ };
+ } else {
+ elm.onload = done;
+ }
+
+ // Add onerror event will get fired on some browsers but not all of them
+ elm.onerror = error;
+
+ // Add script to document
+ (document.getElementsByTagName('head')[0] || document.body).appendChild(elm);
+ }
+
+ /**
+ * Returns true/false if a script has been loaded or not.
+ *
+ * @method isDone
+ * @param {String} url URL to check for.
+ * @return {Boolean} true/false if the URL is loaded.
+ */
+ this.isDone = function(url) {
+ return states[url] == LOADED;
+ };
+
+ /**
+ * Marks a specific script to be loaded. This can be useful if a script got loaded outside
+ * the script loader or to skip it from loading some script.
+ *
+ * @method markDone
+ * @param {string} u Absolute URL to the script to mark as loaded.
+ */
+ this.markDone = function(url) {
+ states[url] = LOADED;
+ };
+
+ /**
+ * Adds a specific script to the load queue of the script loader.
+ *
+ * @method add
+ * @param {String} url Absolute URL to script to add.
+ * @param {function} callback Optional callback function to execute ones this script gets loaded.
+ * @param {Object} scope Optional scope to execute callback in.
+ */
+ this.add = this.load = function(url, callback, scope) {
+ var state = states[url];
+
+ // Add url to load queue
+ if (state == undef) {
+ queue.push(url);
+ states[url] = QUEUED;
+ }
+
+ if (callback) {
+ // Store away callback for later execution
+ if (!scriptLoadedCallbacks[url]) {
+ scriptLoadedCallbacks[url] = [];
+ }
+
+ scriptLoadedCallbacks[url].push({
+ func: callback,
+ scope: scope || this
+ });
+ }
+ };
+
+ /**
+ * Starts the loading of the queue.
+ *
+ * @method loadQueue
+ * @param {function} callback Optional callback to execute when all queued items are loaded.
+ * @param {Object} scope Optional scope to execute the callback in.
+ */
+ this.loadQueue = function(callback, scope) {
+ this.loadScripts(queue, callback, scope);
+ };
+
+ /**
+ * Loads the specified queue of files and executes the callback ones they are loaded.
+ * This method is generally not used outside this class but it might be useful in some scenarios.
+ *
+ * @method loadScripts
+ * @param {Array} scripts Array of queue items to load.
+ * @param {function} callback Optional callback to execute ones all items are loaded.
+ * @param {Object} scope Optional scope to execute callback in.
+ */
+ this.loadScripts = function(scripts, callback, scope) {
+ var loadScripts;
+
+ function execScriptLoadedCallbacks(url) {
+ // Execute URL callback functions
+ each(scriptLoadedCallbacks[url], function(callback) {
+ callback.func.call(callback.scope);
+ });
+
+ scriptLoadedCallbacks[url] = undef;
+ }
+
+ queueLoadedCallbacks.push({
+ func: callback,
+ scope: scope || this
+ });
+
+ loadScripts = function() {
+ var loadingScripts = grep(scripts);
+
+ // Current scripts has been handled
+ scripts.length = 0;
+
+ // Load scripts that needs to be loaded
+ each(loadingScripts, function(url) {
+ // Script is already loaded then execute script callbacks directly
+ if (states[url] == LOADED) {
+ execScriptLoadedCallbacks(url);
+ return;
+ }
+
+ // Is script not loading then start loading it
+ if (states[url] != LOADING) {
+ states[url] = LOADING;
+ loading++;
+
+ loadScript(url, function() {
+ states[url] = LOADED;
+ loading--;
+
+ execScriptLoadedCallbacks(url);
+
+ // Load more scripts if they where added by the recently loaded script
+ loadScripts();
+ });
+ }
+ });
+
+ // No scripts are currently loading then execute all pending queue loaded callbacks
+ if (!loading) {
+ each(queueLoadedCallbacks, function(callback) {
+ callback.func.call(callback.scope);
+ });
+
+ queueLoadedCallbacks.length = 0;
+ }
+ };
+
+ loadScripts();
+ };
+ }
+
+ ScriptLoader.ScriptLoader = new ScriptLoader();
+
+ return ScriptLoader;
+});
+
+// Included from: js/tinymce/classes/AddOnManager.js
+
+/**
+ * AddOnManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles the loading of themes/plugins or other add-ons and their language packs.
+ *
+ * @class tinymce.AddOnManager
+ */
+define("tinymce/AddOnManager", [
+ "tinymce/dom/ScriptLoader",
+ "tinymce/util/Tools"
+], function(ScriptLoader, Tools) {
+ var each = Tools.each;
+
+ function AddOnManager() {
+ var self = this;
+
+ self.items = [];
+ self.urls = {};
+ self.lookup = {};
+ }
+
+ AddOnManager.prototype = {
+ /**
+ * Returns the specified add on by the short name.
+ *
+ * @method get
+ * @param {String} name Add-on to look for.
+ * @return {tinymce.Theme/tinymce.Plugin} Theme or plugin add-on instance or undefined.
+ */
+ get: function(name) {
+ if (this.lookup[name]) {
+ return this.lookup[name].instance;
+ } else {
+ return undefined;
+ }
+ },
+
+ dependencies: function(name) {
+ var result;
+
+ if (this.lookup[name]) {
+ result = this.lookup[name].dependencies;
+ }
+
+ return result || [];
+ },
+
+ /**
+ * Loads a language pack for the specified add-on.
+ *
+ * @method requireLangPack
+ * @param {String} name Short name of the add-on.
+ * @param {String} languages Optional comma or space separated list of languages to check if it matches the name.
+ */
+ requireLangPack: function(name, languages) {
+ if (AddOnManager.language && AddOnManager.languageLoad !== false) {
+ if (languages && new RegExp('([, ]|\\b)' + AddOnManager.language + '([, ]|\\b)').test(languages) === false) {
+ return;
+ }
+
+ ScriptLoader.ScriptLoader.add(this.urls[name] + '/langs/' + AddOnManager.language + '.js');
+ }
+ },
+
+ /**
+ * Adds a instance of the add-on by it's short name.
+ *
+ * @method add
+ * @param {String} id Short name/id for the add-on.
+ * @param {tinymce.Theme/tinymce.Plugin} addOn Theme or plugin to add.
+ * @return {tinymce.Theme/tinymce.Plugin} The same theme or plugin instance that got passed in.
+ * @example
+ * // Create a simple plugin
+ * tinymce.create('tinymce.plugins.TestPlugin', {
+ * TestPlugin: function(ed, url) {
+ * ed.on('click', function(e) {
+ * ed.windowManager.alert('Hello World!');
+ * });
+ * }
+ * });
+ *
+ * // Register plugin using the add method
+ * tinymce.PluginManager.add('test', tinymce.plugins.TestPlugin);
+ *
+ * // Initialize TinyMCE
+ * tinymce.init({
+ * ...
+ * plugins: '-test' // Init the plugin but don't try to load it
+ * });
+ */
+ add: function(id, addOn, dependencies) {
+ this.items.push(addOn);
+ this.lookup[id] = {instance: addOn, dependencies: dependencies};
+
+ return addOn;
+ },
+
+ createUrl: function(baseUrl, dep) {
+ if (typeof dep === "object") {
+ return dep;
+ } else {
+ return {prefix: baseUrl.prefix, resource: dep, suffix: baseUrl.suffix};
+ }
+ },
+
+ /**
+ * Add a set of components that will make up the add-on. Using the url of the add-on name as the base url.
+ * This should be used in development mode. A new compressor/javascript munger process will ensure that the
+ * components are put together into the plugin.js file and compressed correctly.
+ *
+ * @method addComponents
+ * @param {String} pluginName name of the plugin to load scripts from (will be used to get the base url for the plugins).
+ * @param {Array} scripts Array containing the names of the scripts to load.
+ */
+ addComponents: function(pluginName, scripts) {
+ var pluginUrl = this.urls[pluginName];
+
+ each(scripts, function(script) {
+ ScriptLoader.ScriptLoader.add(pluginUrl + "/" + script);
+ });
+ },
+
+ /**
+ * Loads an add-on from a specific url.
+ *
+ * @method load
+ * @param {String} n Short name of the add-on that gets loaded.
+ * @param {String} u URL to the add-on that will get loaded.
+ * @param {function} cb Optional callback to execute ones the add-on is loaded.
+ * @param {Object} s Optional scope to execute the callback in.
+ * @example
+ * // Loads a plugin from an external URL
+ * tinymce.PluginManager.load('myplugin', '/some/dir/someplugin/plugin.js');
+ *
+ * // Initialize TinyMCE
+ * tinymce.init({
+ * ...
+ * plugins: '-myplugin' // Don't try to load it again
+ * });
+ */
+ load: function(n, u, cb, s) {
+ var t = this, url = u;
+
+ function loadDependencies() {
+ var dependencies = t.dependencies(n);
+
+ each(dependencies, function(dep) {
+ var newUrl = t.createUrl(u, dep);
+
+ t.load(newUrl.resource, newUrl, undefined, undefined);
+ });
+
+ if (cb) {
+ if (s) {
+ cb.call(s);
+ } else {
+ cb.call(ScriptLoader);
+ }
+ }
+ }
+
+ if (t.urls[n]) {
+ return;
+ }
+
+ if (typeof u === "object") {
+ url = u.prefix + u.resource + u.suffix;
+ }
+
+ if (url.indexOf('/') !== 0 && url.indexOf('://') == -1) {
+ url = AddOnManager.baseURL + '/' + url;
+ }
+
+ t.urls[n] = url.substring(0, url.lastIndexOf('/'));
+
+ if (t.lookup[n]) {
+ loadDependencies();
+ } else {
+ ScriptLoader.ScriptLoader.add(url, loadDependencies, s);
+ }
+ }
+ };
+
+ AddOnManager.PluginManager = new AddOnManager();
+ AddOnManager.ThemeManager = new AddOnManager();
+
+ return AddOnManager;
+});
+
+/**
+ * TinyMCE theme class.
+ *
+ * @class tinymce.Theme
+ */
+
+/**
+ * This method is responsible for rendering/generating the overall user interface with toolbars, buttons, iframe containers etc.
+ *
+ * @method renderUI
+ * @param {Object} obj Object parameter containing the targetNode DOM node that will be replaced visually with an editor instance.
+ * @return {Object} an object with items like iframeContainer, editorContainer, sizeContainer, deltaWidth, deltaHeight.
+ */
+
+/**
+ * Plugin base class, this is a pseudo class that describes how a plugin is to be created for TinyMCE. The methods below are all optional.
+ *
+ * @class tinymce.Plugin
+ * @example
+ * tinymce.PluginManager.add('example', function(editor, url) {
+ * // Add a button that opens a window
+ * editor.addButton('example', {
+ * text: 'My button',
+ * icon: false,
+ * onclick: function() {
+ * // Open window
+ * editor.windowManager.open({
+ * title: 'Example plugin',
+ * body: [
+ * {type: 'textbox', name: 'title', label: 'Title'}
+ * ],
+ * onsubmit: function(e) {
+ * // Insert content when the window form is submitted
+ * editor.insertContent('Title: ' + e.data.title);
+ * }
+ * });
+ * }
+ * });
+ *
+ * // Adds a menu item to the tools menu
+ * editor.addMenuItem('example', {
+ * text: 'Example plugin',
+ * context: 'tools',
+ * onclick: function() {
+ * // Open window with a specific url
+ * editor.windowManager.open({
+ * title: 'TinyMCE site',
+ * url: 'http://www.tinymce.com',
+ * width: 800,
+ * height: 600,
+ * buttons: [{
+ * text: 'Close',
+ * onclick: 'close'
+ * }]
+ * });
+ * }
+ * });
+ * });
+ */
+
+// Included from: js/tinymce/classes/html/Node.js
+
+/**
+ * Node.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is a minimalistic implementation of a DOM like node used by the DomParser class.
+ *
+ * @example
+ * var node = new tinymce.html.Node('strong', 1);
+ * someRoot.append(node);
+ *
+ * @class tinymce.html.Node
+ * @version 3.4
+ */
+define("tinymce/html/Node", [], function() {
+ var whiteSpaceRegExp = /^[ \t\r\n]*$/, typeLookup = {
+ '#text': 3,
+ '#comment': 8,
+ '#cdata': 4,
+ '#pi': 7,
+ '#doctype': 10,
+ '#document-fragment': 11
+ };
+
+ // Walks the tree left/right
+ function walk(node, root_node, prev) {
+ var sibling, parent, startName = prev ? 'lastChild' : 'firstChild', siblingName = prev ? 'prev' : 'next';
+
+ // Walk into nodes if it has a start
+ if (node[startName]) {
+ return node[startName];
+ }
+
+ // Return the sibling if it has one
+ if (node !== root_node) {
+ sibling = node[siblingName];
+
+ if (sibling) {
+ return sibling;
+ }
+
+ // Walk up the parents to look for siblings
+ for (parent = node.parent; parent && parent !== root_node; parent = parent.parent) {
+ sibling = parent[siblingName];
+
+ if (sibling) {
+ return sibling;
+ }
+ }
+ }
+ }
+
+ /**
+ * Constructs a new Node instance.
+ *
+ * @constructor
+ * @method Node
+ * @param {String} name Name of the node type.
+ * @param {Number} type Numeric type representing the node.
+ */
+ function Node(name, type) {
+ this.name = name;
+ this.type = type;
+
+ if (type === 1) {
+ this.attributes = [];
+ this.attributes.map = {};
+ }
+ }
+
+ Node.prototype = {
+ /**
+ * Replaces the current node with the specified one.
+ *
+ * @example
+ * someNode.replace(someNewNode);
+ *
+ * @method replace
+ * @param {tinymce.html.Node} node Node to replace the current node with.
+ * @return {tinymce.html.Node} The old node that got replaced.
+ */
+ replace: function(node) {
+ var self = this;
+
+ if (node.parent) {
+ node.remove();
+ }
+
+ self.insert(node, self);
+ self.remove();
+
+ return self;
+ },
+
+ /**
+ * Gets/sets or removes an attribute by name.
+ *
+ * @example
+ * someNode.attr("name", "value"); // Sets an attribute
+ * console.log(someNode.attr("name")); // Gets an attribute
+ * someNode.attr("name", null); // Removes an attribute
+ *
+ * @method attr
+ * @param {String} name Attribute name to set or get.
+ * @param {String} value Optional value to set.
+ * @return {String/tinymce.html.Node} String or undefined on a get operation or the current node on a set operation.
+ */
+ attr: function(name, value) {
+ var self = this, attrs, i, undef;
+
+ if (typeof name !== "string") {
+ for (i in name) {
+ self.attr(i, name[i]);
+ }
+
+ return self;
+ }
+
+ if ((attrs = self.attributes)) {
+ if (value !== undef) {
+ // Remove attribute
+ if (value === null) {
+ if (name in attrs.map) {
+ delete attrs.map[name];
+
+ i = attrs.length;
+ while (i--) {
+ if (attrs[i].name === name) {
+ attrs = attrs.splice(i, 1);
+ return self;
+ }
+ }
+ }
+
+ return self;
+ }
+
+ // Set attribute
+ if (name in attrs.map) {
+ // Set attribute
+ i = attrs.length;
+ while (i--) {
+ if (attrs[i].name === name) {
+ attrs[i].value = value;
+ break;
+ }
+ }
+ } else {
+ attrs.push({name: name, value: value});
+ }
+
+ attrs.map[name] = value;
+
+ return self;
+ } else {
+ return attrs.map[name];
+ }
+ }
+ },
+
+ /**
+ * Does a shallow clones the node into a new node. It will also exclude id attributes since
+ * there should only be one id per document.
+ *
+ * @example
+ * var clonedNode = node.clone();
+ *
+ * @method clone
+ * @return {tinymce.html.Node} New copy of the original node.
+ */
+ clone: function() {
+ var self = this, clone = new Node(self.name, self.type), i, l, selfAttrs, selfAttr, cloneAttrs;
+
+ // Clone element attributes
+ if ((selfAttrs = self.attributes)) {
+ cloneAttrs = [];
+ cloneAttrs.map = {};
+
+ for (i = 0, l = selfAttrs.length; i < l; i++) {
+ selfAttr = selfAttrs[i];
+
+ // Clone everything except id
+ if (selfAttr.name !== 'id') {
+ cloneAttrs[cloneAttrs.length] = {name: selfAttr.name, value: selfAttr.value};
+ cloneAttrs.map[selfAttr.name] = selfAttr.value;
+ }
+ }
+
+ clone.attributes = cloneAttrs;
+ }
+
+ clone.value = self.value;
+ clone.shortEnded = self.shortEnded;
+
+ return clone;
+ },
+
+ /**
+ * Wraps the node in in another node.
+ *
+ * @example
+ * node.wrap(wrapperNode);
+ *
+ * @method wrap
+ */
+ wrap: function(wrapper) {
+ var self = this;
+
+ self.parent.insert(wrapper, self);
+ wrapper.append(self);
+
+ return self;
+ },
+
+ /**
+ * Unwraps the node in other words it removes the node but keeps the children.
+ *
+ * @example
+ * node.unwrap();
+ *
+ * @method unwrap
+ */
+ unwrap: function() {
+ var self = this, node, next;
+
+ for (node = self.firstChild; node; ) {
+ next = node.next;
+ self.insert(node, self, true);
+ node = next;
+ }
+
+ self.remove();
+ },
+
+ /**
+ * Removes the node from it's parent.
+ *
+ * @example
+ * node.remove();
+ *
+ * @method remove
+ * @return {tinymce.html.Node} Current node that got removed.
+ */
+ remove: function() {
+ var self = this, parent = self.parent, next = self.next, prev = self.prev;
+
+ if (parent) {
+ if (parent.firstChild === self) {
+ parent.firstChild = next;
+
+ if (next) {
+ next.prev = null;
+ }
+ } else {
+ prev.next = next;
+ }
+
+ if (parent.lastChild === self) {
+ parent.lastChild = prev;
+
+ if (prev) {
+ prev.next = null;
+ }
+ } else {
+ next.prev = prev;
+ }
+
+ self.parent = self.next = self.prev = null;
+ }
+
+ return self;
+ },
+
+ /**
+ * Appends a new node as a child of the current node.
+ *
+ * @example
+ * node.append(someNode);
+ *
+ * @method append
+ * @param {tinymce.html.Node} node Node to append as a child of the current one.
+ * @return {tinymce.html.Node} The node that got appended.
+ */
+ append: function(node) {
+ var self = this, last;
+
+ if (node.parent) {
+ node.remove();
+ }
+
+ last = self.lastChild;
+ if (last) {
+ last.next = node;
+ node.prev = last;
+ self.lastChild = node;
+ } else {
+ self.lastChild = self.firstChild = node;
+ }
+
+ node.parent = self;
+
+ return node;
+ },
+
+ /**
+ * Inserts a node at a specific position as a child of the current node.
+ *
+ * @example
+ * parentNode.insert(newChildNode, oldChildNode);
+ *
+ * @method insert
+ * @param {tinymce.html.Node} node Node to insert as a child of the current node.
+ * @param {tinymce.html.Node} ref_node Reference node to set node before/after.
+ * @param {Boolean} before Optional state to insert the node before the reference node.
+ * @return {tinymce.html.Node} The node that got inserted.
+ */
+ insert: function(node, ref_node, before) {
+ var parent;
+
+ if (node.parent) {
+ node.remove();
+ }
+
+ parent = ref_node.parent || this;
+
+ if (before) {
+ if (ref_node === parent.firstChild) {
+ parent.firstChild = node;
+ } else {
+ ref_node.prev.next = node;
+ }
+
+ node.prev = ref_node.prev;
+ node.next = ref_node;
+ ref_node.prev = node;
+ } else {
+ if (ref_node === parent.lastChild) {
+ parent.lastChild = node;
+ } else {
+ ref_node.next.prev = node;
+ }
+
+ node.next = ref_node.next;
+ node.prev = ref_node;
+ ref_node.next = node;
+ }
+
+ node.parent = parent;
+
+ return node;
+ },
+
+ /**
+ * Get all children by name.
+ *
+ * @method getAll
+ * @param {String} name Name of the child nodes to collect.
+ * @return {Array} Array with child nodes matchin the specified name.
+ */
+ getAll: function(name) {
+ var self = this, node, collection = [];
+
+ for (node = self.firstChild; node; node = walk(node, self)) {
+ if (node.name === name) {
+ collection.push(node);
+ }
+ }
+
+ return collection;
+ },
+
+ /**
+ * Removes all children of the current node.
+ *
+ * @method empty
+ * @return {tinymce.html.Node} The current node that got cleared.
+ */
+ empty: function() {
+ var self = this, nodes, i, node;
+
+ // Remove all children
+ if (self.firstChild) {
+ nodes = [];
+
+ // Collect the children
+ for (node = self.firstChild; node; node = walk(node, self)) {
+ nodes.push(node);
+ }
+
+ // Remove the children
+ i = nodes.length;
+ while (i--) {
+ node = nodes[i];
+ node.parent = node.firstChild = node.lastChild = node.next = node.prev = null;
+ }
+ }
+
+ self.firstChild = self.lastChild = null;
+
+ return self;
+ },
+
+ /**
+ * Returns true/false if the node is to be considered empty or not.
+ *
+ * @example
+ * node.isEmpty({img: true});
+ * @method isEmpty
+ * @param {Object} elements Name/value object with elements that are automatically treated as non empty elements.
+ * @return {Boolean} true/false if the node is empty or not.
+ */
+ isEmpty: function(elements) {
+ var self = this, node = self.firstChild, i, name;
+
+ if (node) {
+ do {
+ if (node.type === 1) {
+ // Ignore bogus elements
+ if (node.attributes.map['data-mce-bogus']) {
+ continue;
+ }
+
+ // Keep empty elements like <img />
+ if (elements[node.name]) {
+ return false;
+ }
+
+ // Keep elements with data attributes or name attribute like <a name="1"></a>
+ i = node.attributes.length;
+ while (i--) {
+ name = node.attributes[i].name;
+ if (name === "name" || name.indexOf('data-mce-') === 0) {
+ return false;
+ }
+ }
+ }
+
+ // Keep comments
+ if (node.type === 8) {
+ return false;
+ }
+
+ // Keep non whitespace text nodes
+ if ((node.type === 3 && !whiteSpaceRegExp.test(node.value))) {
+ return false;
+ }
+ } while ((node = walk(node, self)));
+ }
+
+ return true;
+ },
+
+ /**
+ * Walks to the next or previous node and returns that node or null if it wasn't found.
+ *
+ * @method walk
+ * @param {Boolean} prev Optional previous node state defaults to false.
+ * @return {tinymce.html.Node} Node that is next to or previous of the current node.
+ */
+ walk: function(prev) {
+ return walk(this, null, prev);
+ }
+ };
+
+ /**
+ * Creates a node of a specific type.
+ *
+ * @static
+ * @method create
+ * @param {String} name Name of the node type to create for example "b" or "#text".
+ * @param {Object} attrs Name/value collection of attributes that will be applied to elements.
+ */
+ Node.create = function(name, attrs) {
+ var node, attrName;
+
+ // Create node
+ node = new Node(name, typeLookup[name] || 1);
+
+ // Add attributes if needed
+ if (attrs) {
+ for (attrName in attrs) {
+ node.attr(attrName, attrs[attrName]);
+ }
+ }
+
+ return node;
+ };
+
+ return Node;
+});
+
+// Included from: js/tinymce/classes/html/Schema.js
+
+/**
+ * Schema.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Schema validator class.
+ *
+ * @class tinymce.html.Schema
+ * @example
+ * if (tinymce.activeEditor.schema.isValidChild('p', 'span'))
+ * alert('span is valid child of p.');
+ *
+ * if (tinymce.activeEditor.schema.getElementRule('p'))
+ * alert('P is a valid element.');
+ *
+ * @class tinymce.html.Schema
+ * @version 3.4
+ */
+define("tinymce/html/Schema", [
+ "tinymce/util/Tools"
+], function(Tools) {
+ var mapCache = {};
+ var makeMap = Tools.makeMap, each = Tools.each, extend = Tools.extend, explode = Tools.explode, inArray = Tools.inArray;
+
+ function split(items, delim) {
+ return items ? items.split(delim || ' ') : [];
+ }
+
+ /**
+ * Builds a schema lookup table
+ *
+ * @private
+ * @param {String} type html4, html5 or html5-strict schema type.
+ * @return {Object} Schema lookup table.
+ */
+ function compileSchema(type) {
+ var schema = {}, globalAttributes, eventAttributes, blockContent;
+ var phrasingContent, flowContent, html4BlockContent, html4PhrasingContent;
+
+ function add(name, attributes, children) {
+ var ni, i, attributesOrder, args = arguments;
+
+ function arrayToMap(array) {
+ var map = {}, i, l;
+
+ for (i = 0, l = array.length; i < l; i++) {
+ map[array[i]] = {};
+ }
+
+ return map;
+ }
+
+ children = children || [];
+ attributes = attributes || "";
+
+ if (typeof(children) === "string") {
+ children = split(children);
+ }
+
+ // Split string children
+ for (i = 3; i < args.length; i++) {
+ if (typeof(args[i]) === "string") {
+ args[i] = split(args[i]);
+ }
+
+ children.push.apply(children, args[i]);
+ }
+
+ name = split(name);
+ ni = name.length;
+ while (ni--) {
+ attributesOrder = [].concat(globalAttributes, split(attributes));
+ schema[name[ni]] = {
+ attributes: arrayToMap(attributesOrder),
+ attributesOrder: attributesOrder,
+ children: arrayToMap(children)
+ };
+ }
+ }
+
+ function addAttrs(name, attributes) {
+ var ni, schemaItem, i, l;
+
+ name = split(name);
+ ni = name.length;
+ attributes = split(attributes);
+ while (ni--) {
+ schemaItem = schema[name[ni]];
+ for (i = 0, l = attributes.length; i < l; i++) {
+ schemaItem.attributes[attributes[i]] = {};
+ schemaItem.attributesOrder.push(attributes[i]);
+ }
+ }
+ }
+
+ // Use cached schema
+ if (mapCache[type]) {
+ return mapCache[type];
+ }
+
+ // Attributes present on all elements
+ globalAttributes = split("id accesskey class dir lang style tabindex title");
+
+ // Event attributes can be opt-in/opt-out
+ eventAttributes = split("onabort onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu oncuechange " +
+ "ondblclick ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended " +
+ "onerror onfocus oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart " +
+ "onmousedown onmousemove onmouseout onmouseover onmouseup onmousewheel onpause onplay onplaying onprogress onratechange " +
+ "onreset onscroll onseeked onseeking onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate onvolumechange " +
+ "onwaiting"
+ );
+
+ // Block content elements
+ blockContent = split(
+ "address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"
+ );
+
+ // Phrasing content elements from the HTML5 spec (inline)
+ phrasingContent = split(
+ "a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd " +
+ "label map noscript object q s samp script select small span strong sub sup " +
+ "textarea u var #text #comment"
+ );
+
+ // Add HTML5 items to globalAttributes, blockContent, phrasingContent
+ if (type != "html4") {
+ globalAttributes.push.apply(globalAttributes, split("contenteditable contextmenu draggable dropzone " +
+ "hidden spellcheck translate"));
+ blockContent.push.apply(blockContent, split("article aside details dialog figure header footer hgroup section nav"));
+ phrasingContent.push.apply(phrasingContent, split("audio canvas command datalist mark meter output progress time wbr " +
+ "video ruby bdi keygen"));
+ }
+
+ // Add HTML4 elements unless it's html5-strict
+ if (type != "html5-strict") {
+ globalAttributes.push("xml:lang");
+
+ html4PhrasingContent = split("acronym applet basefont big font strike tt");
+ phrasingContent.push.apply(phrasingContent, html4PhrasingContent);
+
+ each(html4PhrasingContent, function(name) {
+ add(name, "", phrasingContent);
+ });
+
+ html4BlockContent = split("center dir isindex noframes");
+ blockContent.push.apply(blockContent, html4BlockContent);
+
+ // Flow content elements from the HTML5 spec (block+inline)
+ flowContent = [].concat(blockContent, phrasingContent);
+
+ each(html4BlockContent, function(name) {
+ add(name, "", flowContent);
+ });
+ }
+
+ // Flow content elements from the HTML5 spec (block+inline)
+ flowContent = flowContent || [].concat(blockContent, phrasingContent);
+
+ // HTML4 base schema TODO: Move HTML5 specific attributes to HTML5 specific if statement
+ // Schema items <element name>, <specific attributes>, <children ..>
+ add("html", "manifest", "head body");
+ add("head", "", "base command link meta noscript script style title");
+ add("title hr noscript br");
+ add("base", "href target");
+ add("link", "href rel media hreflang type sizes hreflang");
+ add("meta", "name http-equiv content charset");
+ add("style", "media type scoped");
+ add("script", "src async defer type charset");
+ add("body", "onafterprint onbeforeprint onbeforeunload onblur onerror onfocus " +
+ "onhashchange onload onmessage onoffline ononline onpagehide onpageshow " +
+ "onpopstate onresize onscroll onstorage onunload", flowContent);
+ add("address dt dd div caption", "", flowContent);
+ add("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn", "", phrasingContent);
+ add("blockquote", "cite", flowContent);
+ add("ol", "reversed start type", "li");
+ add("ul", "", "li");
+ add("li", "value", flowContent);
+ add("dl", "", "dt dd");
+ add("a", "href target rel media hreflang type", phrasingContent);
+ add("q", "cite", phrasingContent);
+ add("ins del", "cite datetime", flowContent);
+ add("img", "src alt usemap ismap width height");
+ add("iframe", "src name width height", flowContent);
+ add("embed", "src type width height");
+ add("object", "data type typemustmatch name usemap form width height", flowContent, "param");
+ add("param", "name value");
+ add("map", "name", flowContent, "area");
+ add("area", "alt coords shape href target rel media hreflang type");
+ add("table", "border", "caption colgroup thead tfoot tbody tr" + (type == "html4" ? " col" : ""));
+ add("colgroup", "span", "col");
+ add("col", "span");
+ add("tbody thead tfoot", "", "tr");
+ add("tr", "", "td th");
+ add("td", "colspan rowspan headers", flowContent);
+ add("th", "colspan rowspan headers scope abbr", flowContent);
+ add("form", "accept-charset action autocomplete enctype method name novalidate target", flowContent);
+ add("fieldset", "disabled form name", flowContent, "legend");
+ add("label", "form for", phrasingContent);
+ add("input", "accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate " +
+ "formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"
+ );
+ add("button", "disabled form formaction formenctype formmethod formnovalidate formtarget name type value",
+ type == "html4" ? flowContent : phrasingContent);
+ add("select", "disabled form multiple name required size", "option optgroup");
+ add("optgroup", "disabled label", "option");
+ add("option", "disabled label selected value");
+ add("textarea", "cols dirname disabled form maxlength name readonly required rows wrap");
+ add("menu", "type label", flowContent, "li");
+ add("noscript", "", flowContent);
+
+ // Extend with HTML5 elements
+ if (type != "html4") {
+ add("wbr");
+ add("ruby", "", phrasingContent, "rt rp");
+ add("figcaption", "", flowContent);
+ add("mark rt rp summary bdi", "", phrasingContent);
+ add("canvas", "width height", flowContent);
+ add("video", "src crossorigin poster preload autoplay mediagroup loop " +
+ "muted controls width height", flowContent, "track source");
+ add("audio", "src crossorigin preload autoplay mediagroup loop muted controls", flowContent, "track source");
+ add("source", "src type media");
+ add("track", "kind src srclang label default");
+ add("datalist", "", phrasingContent, "option");
+ add("article section nav aside header footer", "", flowContent);
+ add("hgroup", "", "h1 h2 h3 h4 h5 h6");
+ add("figure", "", flowContent, "figcaption");
+ add("time", "datetime", phrasingContent);
+ add("dialog", "open", flowContent);
+ add("command", "type label icon disabled checked radiogroup command");
+ add("output", "for form name", phrasingContent);
+ add("progress", "value max", phrasingContent);
+ add("meter", "value min max low high optimum", phrasingContent);
+ add("details", "open", flowContent, "summary");
+ add("keygen", "autofocus challenge disabled form keytype name");
+ }
+
+ // Extend with HTML4 attributes unless it's html5-strict
+ if (type != "html5-strict") {
+ addAttrs("script", "language xml:space");
+ addAttrs("style", "xml:space");
+ addAttrs("object", "declare classid codebase codetype archive standby align border hspace vspace");
+ addAttrs("param", "valuetype type");
+ addAttrs("a", "charset name rev shape coords");
+ addAttrs("br", "clear");
+ addAttrs("applet", "codebase archive code object alt name width height align hspace vspace");
+ addAttrs("img", "name longdesc align border hspace vspace");
+ addAttrs("iframe", "longdesc frameborder marginwidth marginheight scrolling align");
+ addAttrs("font basefont", "size color face");
+ addAttrs("input", "usemap align");
+ addAttrs("select", "onchange");
+ addAttrs("textarea");
+ addAttrs("h1 h2 h3 h4 h5 h6 div p legend caption", "align");
+ addAttrs("ul", "type compact");
+ addAttrs("li", "type");
+ addAttrs("ol dl menu dir", "compact");
+ addAttrs("pre", "width xml:space");
+ addAttrs("hr", "align noshade size width");
+ addAttrs("isindex", "prompt");
+ addAttrs("table", "summary width frame rules cellspacing cellpadding align bgcolor");
+ addAttrs("col", "width align char charoff valign");
+ addAttrs("colgroup", "width align char charoff valign");
+ addAttrs("thead", "align char charoff valign");
+ addAttrs("tr", "align char charoff valign bgcolor");
+ addAttrs("th", "axis align char charoff valign nowrap bgcolor width height");
+ addAttrs("form", "accept");
+ addAttrs("td", "abbr axis scope align char charoff valign nowrap bgcolor width height");
+ addAttrs("tfoot", "align char charoff valign");
+ addAttrs("tbody", "align char charoff valign");
+ addAttrs("area", "nohref");
+ addAttrs("body", "background bgcolor text link vlink alink");
+ }
+
+ // Extend with HTML5 attributes unless it's html4
+ if (type != "html4") {
+ addAttrs("input button select textarea", "autofocus");
+ addAttrs("input textarea", "placeholder");
+ addAttrs("a", "download");
+ addAttrs("link script img", "crossorigin");
+ addAttrs("iframe", "srcdoc sandbox seamless allowfullscreen");
+ }
+
+ // Special: iframe, ruby, video, audio, label
+
+ // Delete children of the same name from it's parent
+ // For example: form can't have a child of the name form
+ each(split('a form meter progress dfn'), function(name) {
+ if (schema[name]) {
+ delete schema[name].children[name];
+ }
+ });
+
+ // Delete header, footer, sectioning and heading content descendants
+ /*each('dt th address', function(name) {
+ delete schema[name].children[name];
+ });*/
+
+ // Caption can't have tables
+ delete schema.caption.children.table;
+
+ // TODO: LI:s can only have value if parent is OL
+
+ // TODO: Handle transparent elements
+ // a ins del canvas map
+
+ mapCache[type] = schema;
+
+ return schema;
+ }
+
+ /**
+ * Constructs a new Schema instance.
+ *
+ * @constructor
+ * @method Schema
+ * @param {Object} settings Name/value settings object.
+ */
+ return function(settings) {
+ var self = this, elements = {}, children = {}, patternElements = [], validStyles, schemaItems;
+ var whiteSpaceElementsMap, selfClosingElementsMap, shortEndedElementsMap, boolAttrMap;
+ var blockElementsMap, nonEmptyElementsMap, textBlockElementsMap, customElementsMap = {}, specialElements = {};
+
+ // Creates an lookup table map object for the specified option or the default value
+ function createLookupTable(option, default_value, extendWith) {
+ var value = settings[option];
+
+ if (!value) {
+ // Get cached default map or make it if needed
+ value = mapCache[option];
+
+ if (!value) {
+ value = makeMap(default_value, ' ', makeMap(default_value.toUpperCase(), ' '));
+ value = extend(value, extendWith);
+
+ mapCache[option] = value;
+ }
+ } else {
+ // Create custom map
+ value = makeMap(value, ',', makeMap(value.toUpperCase(), ' '));
+ }
+
+ return value;
+ }
+
+ settings = settings || {};
+ schemaItems = compileSchema(settings.schema);
+
+ // Allow all elements and attributes if verify_html is set to false
+ if (settings.verify_html === false) {
+ settings.valid_elements = '*[*]';
+ }
+
+ // Build styles list
+ if (settings.valid_styles) {
+ validStyles = {};
+
+ // Convert styles into a rule list
+ each(settings.valid_styles, function(value, key) {
+ validStyles[key] = explode(value);
+ });
+ }
+
+ // Setup map objects
+ whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea video audio iframe object');
+ selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr');
+ shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link ' +
+ 'meta param embed source wbr track');
+ boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize ' +
+ 'noshade nowrap readonly selected autoplay loop controls');
+ nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object script', shortEndedElementsMap);
+ textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' +
+ 'blockquote center dir fieldset header footer article section hgroup aside nav figure');
+ blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' +
+ 'th tr td li ol ul caption dl dt dd noscript menu isindex samp option ' +
+ 'datalist select optgroup', textBlockElementsMap);
+
+ each((settings.special || 'script noscript style textarea').split(' '), function(name) {
+ specialElements[name] = new RegExp('<\/' + name + '[^>]*>','gi');
+ });
+
+ // Converts a wildcard expression string to a regexp for example *a will become /.*a/.
+ function patternToRegExp(str) {
+ return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$');
+ }
+
+ // Parses the specified valid_elements string and adds to the current rules
+ // This function is a bit hard to read since it's heavily optimized for speed
+ function addValidElements(valid_elements) {
+ var ei, el, ai, al, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder,
+ prefix, outputName, globalAttributes, globalAttributesOrder, key, value,
+ elementRuleRegExp = /^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,
+ attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,
+ hasPatternsRegExp = /[*?+]/;
+
+ if (valid_elements) {
+ // Split valid elements into an array with rules
+ valid_elements = split(valid_elements, ',');
+
+ if (elements['@']) {
+ globalAttributes = elements['@'].attributes;
+ globalAttributesOrder = elements['@'].attributesOrder;
+ }
+
+ // Loop all rules
+ for (ei = 0, el = valid_elements.length; ei < el; ei++) {
+ // Parse element rule
+ matches = elementRuleRegExp.exec(valid_elements[ei]);
+ if (matches) {
+ // Setup local names for matches
+ prefix = matches[1];
+ elementName = matches[2];
+ outputName = matches[3];
+ attrData = matches[5];
+
+ // Create new attributes and attributesOrder
+ attributes = {};
+ attributesOrder = [];
+
+ // Create the new element
+ element = {
+ attributes: attributes,
+ attributesOrder: attributesOrder
+ };
+
+ // Padd empty elements prefix
+ if (prefix === '#') {
+ element.paddEmpty = true;
+ }
+
+ // Remove empty elements prefix
+ if (prefix === '-') {
+ element.removeEmpty = true;
+ }
+
+ if (matches[4] === '!') {
+ element.removeEmptyAttrs = true;
+ }
+
+ // Copy attributes from global rule into current rule
+ if (globalAttributes) {
+ for (key in globalAttributes) {
+ attributes[key] = globalAttributes[key];
+ }
+
+ attributesOrder.push.apply(attributesOrder, globalAttributesOrder);
+ }
+
+ // Attributes defined
+ if (attrData) {
+ attrData = split(attrData, '|');
+ for (ai = 0, al = attrData.length; ai < al; ai++) {
+ matches = attrRuleRegExp.exec(attrData[ai]);
+ if (matches) {
+ attr = {};
+ attrType = matches[1];
+ attrName = matches[2].replace(/::/g, ':');
+ prefix = matches[3];
+ value = matches[4];
+
+ // Required
+ if (attrType === '!') {
+ element.attributesRequired = element.attributesRequired || [];
+ element.attributesRequired.push(attrName);
+ attr.required = true;
+ }
+
+ // Denied from global
+ if (attrType === '-') {
+ delete attributes[attrName];
+ attributesOrder.splice(inArray(attributesOrder, attrName), 1);
+ continue;
+ }
+
+ // Default value
+ if (prefix) {
+ // Default value
+ if (prefix === '=') {
+ element.attributesDefault = element.attributesDefault || [];
+ element.attributesDefault.push({name: attrName, value: value});
+ attr.defaultValue = value;
+ }
+
+ // Forced value
+ if (prefix === ':') {
+ element.attributesForced = element.attributesForced || [];
+ element.attributesForced.push({name: attrName, value: value});
+ attr.forcedValue = value;
+ }
+
+ // Required values
+ if (prefix === '<') {
+ attr.validValues = makeMap(value, '?');
+ }
+ }
+
+ // Check for attribute patterns
+ if (hasPatternsRegExp.test(attrName)) {
+ element.attributePatterns = element.attributePatterns || [];
+ attr.pattern = patternToRegExp(attrName);
+ element.attributePatterns.push(attr);
+ } else {
+ // Add attribute to order list if it doesn't already exist
+ if (!attributes[attrName]) {
+ attributesOrder.push(attrName);
+ }
+
+ attributes[attrName] = attr;
+ }
+ }
+ }
+ }
+
+ // Global rule, store away these for later usage
+ if (!globalAttributes && elementName == '@') {
+ globalAttributes = attributes;
+ globalAttributesOrder = attributesOrder;
+ }
+
+ // Handle substitute elements such as b/strong
+ if (outputName) {
+ element.outputName = elementName;
+ elements[outputName] = element;
+ }
+
+ // Add pattern or exact element
+ if (hasPatternsRegExp.test(elementName)) {
+ element.pattern = patternToRegExp(elementName);
+ patternElements.push(element);
+ } else {
+ elements[elementName] = element;
+ }
+ }
+ }
+ }
+ }
+
+ function setValidElements(valid_elements) {
+ elements = {};
+ patternElements = [];
+
+ addValidElements(valid_elements);
+
+ each(schemaItems, function(element, name) {
+ children[name] = element.children;
+ });
+ }
+
+ // Adds custom non HTML elements to the schema
+ function addCustomElements(custom_elements) {
+ var customElementRegExp = /^(~)?(.+)$/;
+
+ if (custom_elements) {
+ each(split(custom_elements, ','), function(rule) {
+ var matches = customElementRegExp.exec(rule),
+ inline = matches[1] === '~',
+ cloneName = inline ? 'span' : 'div',
+ name = matches[2];
+
+ children[name] = children[cloneName];
+ customElementsMap[name] = cloneName;
+
+ // If it's not marked as inline then add it to valid block elements
+ if (!inline) {
+ blockElementsMap[name.toUpperCase()] = {};
+ blockElementsMap[name] = {};
+ }
+
+ // Add elements clone if needed
+ if (!elements[name]) {
+ var customRule = elements[cloneName];
+
+ customRule = extend({}, customRule);
+ delete customRule.removeEmptyAttrs;
+ delete customRule.removeEmpty;
+
+ elements[name] = customRule;
+ }
+
+ // Add custom elements at span/div positions
+ each(children, function(element) {
+ if (element[cloneName]) {
+ element[name] = element[cloneName];
+ }
+ });
+ });
+ }
+ }
+
+ // Adds valid children to the schema object
+ function addValidChildren(valid_children) {
+ var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/;
+
+ if (valid_children) {
+ each(split(valid_children, ','), function(rule) {
+ var matches = childRuleRegExp.exec(rule), parent, prefix;
+
+ if (matches) {
+ prefix = matches[1];
+
+ // Add/remove items from default
+ if (prefix) {
+ parent = children[matches[2]];
+ } else {
+ parent = children[matches[2]] = {'#comment': {}};
+ }
+
+ parent = children[matches[2]];
+
+ each(split(matches[3], '|'), function(child) {
+ if (prefix === '-') {
+ delete parent[child];
+ } else {
+ parent[child] = {};
+ }
+ });
+ }
+ });
+ }
+ }
+
+ function getElementRule(name) {
+ var element = elements[name], i;
+
+ // Exact match found
+ if (element) {
+ return element;
+ }
+
+ // No exact match then try the patterns
+ i = patternElements.length;
+ while (i--) {
+ element = patternElements[i];
+
+ if (element.pattern.test(name)) {
+ return element;
+ }
+ }
+ }
+
+ if (!settings.valid_elements) {
+ // No valid elements defined then clone the elements from the schema spec
+ each(schemaItems, function(element, name) {
+ elements[name] = {
+ attributes: element.attributes,
+ attributesOrder: element.attributesOrder
+ };
+
+ children[name] = element.children;
+ });
+
+ // Switch these on HTML4
+ if (settings.schema != "html5") {
+ each(split('strong/b em/i'), function(item) {
+ item = split(item, '/');
+ elements[item[1]].outputName = item[0];
+ });
+ }
+
+ // Add default alt attribute for images
+ elements.img.attributesDefault = [{name: 'alt', value: ''}];
+
+ // Remove these if they are empty by default
+ each(split('ol ul sub sup blockquote span font a table tbody tr strong em b i'), function(name) {
+ if (elements[name]) {
+ elements[name].removeEmpty = true;
+ }
+ });
+
+ // Padd these by default
+ each(split('p h1 h2 h3 h4 h5 h6 th td pre div address caption'), function(name) {
+ elements[name].paddEmpty = true;
+ });
+
+ // Remove these if they have no attributes
+ each(split('span'), function(name) {
+ elements[name].removeEmptyAttrs = true;
+ });
+
+ // Remove these by default
+ // TODO: Reenable in 4.1
+ /*each(split('script style'), function(name) {
+ delete elements[name];
+ });*/
+ } else {
+ setValidElements(settings.valid_elements);
+ }
+
+ addCustomElements(settings.custom_elements);
+ addValidChildren(settings.valid_children);
+ addValidElements(settings.extended_valid_elements);
+
+ // Todo: Remove this when we fix list handling to be valid
+ addValidChildren('+ol[ul|ol],+ul[ul|ol]');
+
+ // Delete invalid elements
+ if (settings.invalid_elements) {
+ each(explode(settings.invalid_elements), function(item) {
+ if (elements[item]) {
+ delete elements[item];
+ }
+ });
+ }
+
+ // If the user didn't allow span only allow internal spans
+ if (!getElementRule('span')) {
+ addValidElements('span[!data-mce-type|*]');
+ }
+
+ /**
+ * Name/value map object with valid parents and children to those parents.
+ *
+ * @example
+ * children = {
+ * div:{p:{}, h1:{}}
+ * };
+ * @field children
+ * @type Object
+ */
+ self.children = children;
+
+ /**
+ * Name/value map object with valid styles for each element.
+ *
+ * @field styles
+ * @type Object
+ */
+ self.styles = validStyles;
+
+ /**
+ * Returns a map with boolean attributes.
+ *
+ * @method getBoolAttrs
+ * @return {Object} Name/value lookup map for boolean attributes.
+ */
+ self.getBoolAttrs = function() {
+ return boolAttrMap;
+ };
+
+ /**
+ * Returns a map with block elements.
+ *
+ * @method getBlockElements
+ * @return {Object} Name/value lookup map for block elements.
+ */
+ self.getBlockElements = function() {
+ return blockElementsMap;
+ };
+
+ /**
+ * Returns a map with text block elements. Such as: p,h1-h6,div,address
+ *
+ * @method getTextBlockElements
+ * @return {Object} Name/value lookup map for block elements.
+ */
+ self.getTextBlockElements = function() {
+ return textBlockElementsMap;
+ };
+
+ /**
+ * Returns a map with short ended elements such as BR or IMG.
+ *
+ * @method getShortEndedElements
+ * @return {Object} Name/value lookup map for short ended elements.
+ */
+ self.getShortEndedElements = function() {
+ return shortEndedElementsMap;
+ };
+
+ /**
+ * Returns a map with self closing tags such as <li>.
+ *
+ * @method getSelfClosingElements
+ * @return {Object} Name/value lookup map for self closing tags elements.
+ */
+ self.getSelfClosingElements = function() {
+ return selfClosingElementsMap;
+ };
+
+ /**
+ * Returns a map with elements that should be treated as contents regardless if it has text
+ * content in them or not such as TD, VIDEO or IMG.
+ *
+ * @method getNonEmptyElements
+ * @return {Object} Name/value lookup map for non empty elements.
+ */
+ self.getNonEmptyElements = function() {
+ return nonEmptyElementsMap;
+ };
+
+ /**
+ * Returns a map with elements where white space is to be preserved like PRE or SCRIPT.
+ *
+ * @method getWhiteSpaceElements
+ * @return {Object} Name/value lookup map for white space elements.
+ */
+ self.getWhiteSpaceElements = function() {
+ return whiteSpaceElementsMap;
+ };
+
+ /**
+ * Returns a map with special elements. These are elements that needs to be parsed
+ * in a special way such as script, style, textarea etc. The map object values
+ * are regexps used to find the end of the element.
+ *
+ * @method getSpecialElements
+ * @return {Object} Name/value lookup map for special elements.
+ */
+ self.getSpecialElements = function() {
+ return specialElements;
+ };
+
+ /**
+ * Returns true/false if the specified element and it's child is valid or not
+ * according to the schema.
+ *
+ * @method isValidChild
+ * @param {String} name Element name to check for.
+ * @param {String} child Element child to verify.
+ * @return {Boolean} True/false if the element is a valid child of the specified parent.
+ */
+ self.isValidChild = function(name, child) {
+ var parent = children[name];
+
+ return !!(parent && parent[child]);
+ };
+
+ /**
+ * Returns true/false if the specified element name and optional attribute is
+ * valid according to the schema.
+ *
+ * @method isValid
+ * @param {String} name Name of element to check.
+ * @param {String} attr Optional attribute name to check for.
+ * @return {Boolean} True/false if the element and attribute is valid.
+ */
+ self.isValid = function(name, attr) {
+ var attrPatterns, i, rule = getElementRule(name);
+
+ // Check if it's a valid element
+ if (rule) {
+ if (attr) {
+ // Check if attribute name exists
+ if (rule.attributes[attr]) {
+ return true;
+ }
+
+ // Check if attribute matches a regexp pattern
+ attrPatterns = rule.attributePatterns;
+ if (attrPatterns) {
+ i = attrPatterns.length;
+ while (i--) {
+ if (attrPatterns[i].pattern.test(name)) {
+ return true;
+ }
+ }
+ }
+ } else {
+ return true;
+ }
+ }
+
+ // No match
+ return false;
+ };
+
+ /**
+ * Returns true/false if the specified element is valid or not
+ * according to the schema.
+ *
+ * @method getElementRule
+ * @param {String} name Element name to check for.
+ * @return {Object} Element object or undefined if the element isn't valid.
+ */
+ self.getElementRule = getElementRule;
+
+ /**
+ * Returns an map object of all custom elements.
+ *
+ * @method getCustomElements
+ * @return {Object} Name/value map object of all custom elements.
+ */
+ self.getCustomElements = function() {
+ return customElementsMap;
+ };
+
+ /**
+ * Parses a valid elements string and adds it to the schema. The valid elements
+ format is for example "element[attr=default|otherattr]".
+ * Existing rules will be replaced with the ones specified, so this extends the schema.
+ *
+ * @method addValidElements
+ * @param {String} valid_elements String in the valid elements format to be parsed.
+ */
+ self.addValidElements = addValidElements;
+
+ /**
+ * Parses a valid elements string and sets it to the schema. The valid elements
+ * format is for example "element[attr=default|otherattr]".
+ * Existing rules will be replaced with the ones specified, so this extends the schema.
+ *
+ * @method setValidElements
+ * @param {String} valid_elements String in the valid elements format to be parsed.
+ */
+ self.setValidElements = setValidElements;
+
+ /**
+ * Adds custom non HTML elements to the schema.
+ *
+ * @method addCustomElements
+ * @param {String} custom_elements Comma separated list of custom elements to add.
+ */
+ self.addCustomElements = addCustomElements;
+
+ /**
+ * Parses a valid children string and adds them to the schema structure. The valid children
+ * format is for example: "element[child1|child2]".
+ *
+ * @method addValidChildren
+ * @param {String} valid_children Valid children elements string to parse
+ */
+ self.addValidChildren = addValidChildren;
+
+ self.elements = elements;
+ };
+});
+
+// Included from: js/tinymce/classes/html/SaxParser.js
+
+/**
+ * SaxParser.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class parses HTML code using pure JavaScript and executes various events for each item it finds. It will
+ * always execute the events in the right order for tag soup code like <b><p></b></p>. It will also remove elements
+ * and attributes that doesn't fit the schema if the validate setting is enabled.
+ *
+ * @example
+ * var parser = new tinymce.html.SaxParser({
+ * validate: true,
+ *
+ * comment: function(text) {
+ * console.log('Comment:', text);
+ * },
+ *
+ * cdata: function(text) {
+ * console.log('CDATA:', text);
+ * },
+ *
+ * text: function(text, raw) {
+ * console.log('Text:', text, 'Raw:', raw);
+ * },
+ *
+ * start: function(name, attrs, empty) {
+ * console.log('Start:', name, attrs, empty);
+ * },
+ *
+ * end: function(name) {
+ * console.log('End:', name);
+ * },
+ *
+ * pi: function(name, text) {
+ * console.log('PI:', name, text);
+ * },
+ *
+ * doctype: function(text) {
+ * console.log('DocType:', text);
+ * }
+ * }, schema);
+ * @class tinymce.html.SaxParser
+ * @version 3.4
+ */
+define("tinymce/html/SaxParser", [
+ "tinymce/html/Schema",
+ "tinymce/html/Entities",
+ "tinymce/util/Tools"
+], function(Schema, Entities, Tools) {
+ var each = Tools.each;
+
+ /**
+ * Constructs a new SaxParser instance.
+ *
+ * @constructor
+ * @method SaxParser
+ * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks.
+ * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing.
+ */
+ return function(settings, schema) {
+ var self = this, noop = function() {};
+
+ settings = settings || {};
+ self.schema = schema = schema || new Schema();
+
+ if (settings.fix_self_closing !== false) {
+ settings.fix_self_closing = true;
+ }
+
+ // Add handler functions from settings and setup default handlers
+ each('comment cdata text start end pi doctype'.split(' '), function(name) {
+ if (name) {
+ self[name] = settings[name] || noop;
+ }
+ });
+
+ /**
+ * Parses the specified HTML string and executes the callbacks for each item it finds.
+ *
+ * @example
+ * new SaxParser({...}).parse('<b>text</b>');
+ * @method parse
+ * @param {String} html Html string to sax parse.
+ */
+ self.parse = function(html) {
+ var self = this, matches, index = 0, value, endRegExp, stack = [], attrList, i, text, name;
+ var isInternalElement, removeInternalElements, shortEndedElements, fillAttrsMap, isShortEnded;
+ var validate, elementRule, isValidElement, attr, attribsValue, validAttributesMap, validAttributePatterns;
+ var attributesRequired, attributesDefault, attributesForced;
+ var anyAttributesRequired, selfClosing, tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0;
+ var decode = Entities.decode, fixSelfClosing, filteredUrlAttrs = Tools.makeMap('src,href');
+ var scriptUriRegExp = /(java|vb)script:/i;
+
+ function processEndTag(name) {
+ var pos, i;
+
+ // Find position of parent of the same type
+ pos = stack.length;
+ while (pos--) {
+ if (stack[pos].name === name) {
+ break;
+ }
+ }
+
+ // Found parent
+ if (pos >= 0) {
+ // Close all the open elements
+ for (i = stack.length - 1; i >= pos; i--) {
+ name = stack[i];
+
+ if (name.valid) {
+ self.end(name.name);
+ }
+ }
+
+ // Remove the open elements from the stack
+ stack.length = pos;
+ }
+ }
+
+ function parseAttribute(match, name, value, val2, val3) {
+ var attrRule, i, trimRegExp = /[\s\u0000-\u001F]+/g;
+
+ name = name.toLowerCase();
+ value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute
+
+ // Validate name and value pass through all data- attributes
+ if (validate && !isInternalElement && name.indexOf('data-') !== 0) {
+ attrRule = validAttributesMap[name];
+
+ // Find rule by pattern matching
+ if (!attrRule && validAttributePatterns) {
+ i = validAttributePatterns.length;
+ while (i--) {
+ attrRule = validAttributePatterns[i];
+ if (attrRule.pattern.test(name)) {
+ break;
+ }
+ }
+
+ // No rule matched
+ if (i === -1) {
+ attrRule = null;
+ }
+ }
+
+ // No attribute rule found
+ if (!attrRule) {
+ return;
+ }
+
+ // Validate value
+ if (attrRule.validValues && !(value in attrRule.validValues)) {
+ return;
+ }
+ }
+
+ // Block any javascript: urls
+ if (filteredUrlAttrs[name] && !settings.allow_script_urls) {
+ var uri = value.replace(trimRegExp, '');
+
+ try {
+ // Might throw malformed URI sequence
+ uri = decodeURIComponent(uri);
+ if (scriptUriRegExp.test(uri)) {
+ return;
+ }
+ } catch (ex) {
+ // Fallback to non UTF-8 decoder
+ uri = unescape(uri);
+ if (scriptUriRegExp.test(uri)) {
+ return;
+ }
+ }
+ }
+
+ // Add attribute to list and map
+ attrList.map[name] = value;
+ attrList.push({
+ name: name,
+ value: value
+ });
+ }
+
+ // Precompile RegExps and map objects
+ tokenRegExp = new RegExp('<(?:' +
+ '(?:!--([\\w\\W]*?)-->)|' + // Comment
+ '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + // CDATA
+ '(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE
+ '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI
+ '(?:\\/([^>]+)>)|' + // End element
+ '(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + // Start element
+ ')', 'g');
+
+ attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;
+
+ // Setup lookup tables for empty elements and boolean attributes
+ shortEndedElements = schema.getShortEndedElements();
+ selfClosing = settings.self_closing_elements || schema.getSelfClosingElements();
+ fillAttrsMap = schema.getBoolAttrs();
+ validate = settings.validate;
+ removeInternalElements = settings.remove_internals;
+ fixSelfClosing = settings.fix_self_closing;
+ specialElements = schema.getSpecialElements();
+
+ while ((matches = tokenRegExp.exec(html))) {
+ // Text
+ if (index < matches.index) {
+ self.text(decode(html.substr(index, matches.index - index)));
+ }
+
+ if ((value = matches[6])) { // End element
+ value = value.toLowerCase();
+
+ // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements
+ if (value.charAt(0) === ':') {
+ value = value.substr(1);
+ }
+
+ processEndTag(value);
+ } else if ((value = matches[7])) { // Start element
+ value = value.toLowerCase();
+
+ // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements
+ if (value.charAt(0) === ':') {
+ value = value.substr(1);
+ }
+
+ isShortEnded = value in shortEndedElements;
+
+ // Is self closing tag for example an <li> after an open <li>
+ if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) {
+ processEndTag(value);
+ }
+
+ // Validate element
+ if (!validate || (elementRule = schema.getElementRule(value))) {
+ isValidElement = true;
+
+ // Grab attributes map and patters when validation is enabled
+ if (validate) {
+ validAttributesMap = elementRule.attributes;
+ validAttributePatterns = elementRule.attributePatterns;
+ }
+
+ // Parse attributes
+ if ((attribsValue = matches[8])) {
+ isInternalElement = attribsValue.indexOf('data-mce-type') !== -1; // Check if the element is an internal element
+
+ // If the element has internal attributes then remove it if we are told to do so
+ if (isInternalElement && removeInternalElements) {
+ isValidElement = false;
+ }
+
+ attrList = [];
+ attrList.map = {};
+
+ attribsValue.replace(attrRegExp, parseAttribute);
+ } else {
+ attrList = [];
+ attrList.map = {};
+ }
+
+ // Process attributes if validation is enabled
+ if (validate && !isInternalElement) {
+ attributesRequired = elementRule.attributesRequired;
+ attributesDefault = elementRule.attributesDefault;
+ attributesForced = elementRule.attributesForced;
+ anyAttributesRequired = elementRule.removeEmptyAttrs;
+
+ // Check if any attribute exists
+ if (anyAttributesRequired && !attrList.length) {
+ isValidElement = false;
+ }
+
+ // Handle forced attributes
+ if (attributesForced) {
+ i = attributesForced.length;
+ while (i--) {
+ attr = attributesForced[i];
+ name = attr.name;
+ attrValue = attr.value;
+
+ if (attrValue === '{$uid}') {
+ attrValue = 'mce_' + idCount++;
+ }
+
+ attrList.map[name] = attrValue;
+ attrList.push({name: name, value: attrValue});
+ }
+ }
+
+ // Handle default attributes
+ if (attributesDefault) {
+ i = attributesDefault.length;
+ while (i--) {
+ attr = attributesDefault[i];
+ name = attr.name;
+
+ if (!(name in attrList.map)) {
+ attrValue = attr.value;
+
+ if (attrValue === '{$uid}') {
+ attrValue = 'mce_' + idCount++;
+ }
+
+ attrList.map[name] = attrValue;
+ attrList.push({name: name, value: attrValue});
+ }
+ }
+ }
+
+ // Handle required attributes
+ if (attributesRequired) {
+ i = attributesRequired.length;
+ while (i--) {
+ if (attributesRequired[i] in attrList.map) {
+ break;
+ }
+ }
+
+ // None of the required attributes where found
+ if (i === -1) {
+ isValidElement = false;
+ }
+ }
+
+ // Invalidate element if it's marked as bogus
+ if (attrList.map['data-mce-bogus']) {
+ isValidElement = false;
+ }
+ }
+
+ if (isValidElement) {
+ self.start(value, attrList, isShortEnded);
+ }
+ } else {
+ isValidElement = false;
+ }
+
+ // Treat script, noscript and style a bit different since they may include code that looks like elements
+ if ((endRegExp = specialElements[value])) {
+ endRegExp.lastIndex = index = matches.index + matches[0].length;
+
+ if ((matches = endRegExp.exec(html))) {
+ if (isValidElement) {
+ text = html.substr(index, matches.index - index);
+ }
+
+ index = matches.index + matches[0].length;
+ } else {
+ text = html.substr(index);
+ index = html.length;
+ }
+
+ if (isValidElement) {
+ if (text.length > 0) {
+ self.text(text, true);
+ }
+
+ self.end(value);
+ }
+
+ tokenRegExp.lastIndex = index;
+ continue;
+ }
+
+ // Push value on to stack
+ if (!isShortEnded) {
+ if (!attribsValue || attribsValue.indexOf('/') != attribsValue.length - 1) {
+ stack.push({name: value, valid: isValidElement});
+ } else if (isValidElement) {
+ self.end(value);
+ }
+ }
+ } else if ((value = matches[1])) { // Comment
+ // Padd comment value to avoid browsers from parsing invalid comments as HTML
+ if (value.charAt(0) === '>') {
+ value = ' ' + value;
+ }
+
+ if (!settings.allow_conditional_comments && value.substr(0, 3) === '[if') {
+ value = ' ' + value;
+ }
+
+ self.comment(value);
+ } else if ((value = matches[2])) { // CDATA
+ self.cdata(value);
+ } else if ((value = matches[3])) { // DOCTYPE
+ self.doctype(value);
+ } else if ((value = matches[4])) { // PI
+ self.pi(value, matches[5]);
+ }
+
+ index = matches.index + matches[0].length;
+ }
+
+ // Text
+ if (index < html.length) {
+ self.text(decode(html.substr(index)));
+ }
+
+ // Close any open elements
+ for (i = stack.length - 1; i >= 0; i--) {
+ value = stack[i];
+
+ if (value.valid) {
+ self.end(value.name);
+ }
+ }
+ };
+ };
+});
+
+// Included from: js/tinymce/classes/html/DomParser.js
+
+/**
+ * DomParser.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class parses HTML code into a DOM like structure of nodes it will remove redundant whitespace and make
+ * sure that the node tree is valid according to the specified schema.
+ * So for example: <p>a<p>b</p>c</p> will become <p>a</p><p>b</p><p>c</p>
+ *
+ * @example
+ * var parser = new tinymce.html.DomParser({validate: true}, schema);
+ * var rootNode = parser.parse('<h1>content</h1>');
+ *
+ * @class tinymce.html.DomParser
+ * @version 3.4
+ */
+define("tinymce/html/DomParser", [
+ "tinymce/html/Node",
+ "tinymce/html/Schema",
+ "tinymce/html/SaxParser",
+ "tinymce/util/Tools"
+], function(Node, Schema, SaxParser, Tools) {
+ var makeMap = Tools.makeMap, each = Tools.each, explode = Tools.explode, extend = Tools.extend;
+
+ /**
+ * Constructs a new DomParser instance.
+ *
+ * @constructor
+ * @method DomParser
+ * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks.
+ * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing.
+ */
+ return function(settings, schema) {
+ var self = this, nodeFilters = {}, attributeFilters = [], matchedNodes = {}, matchedAttributes = {};
+
+ settings = settings || {};
+ settings.validate = "validate" in settings ? settings.validate : true;
+ settings.root_name = settings.root_name || 'body';
+ self.schema = schema = schema || new Schema();
+
+ function fixInvalidChildren(nodes) {
+ var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i;
+ var nonEmptyElements, nonSplitableElements, textBlockElements, sibling, nextNode;
+
+ nonSplitableElements = makeMap('tr,td,th,tbody,thead,tfoot,table');
+ nonEmptyElements = schema.getNonEmptyElements();
+ textBlockElements = schema.getTextBlockElements();
+
+ for (ni = 0; ni < nodes.length; ni++) {
+ node = nodes[ni];
+
+ // Already removed or fixed
+ if (!node.parent || node.fixed) {
+ continue;
+ }
+
+ // If the invalid element is a text block and the text block is within a parent LI element
+ // Then unwrap the first text block and convert other sibling text blocks to LI elements similar to Word/Open Office
+ if (textBlockElements[node.name] && node.parent.name == 'li') {
+ // Move sibling text blocks after LI element
+ sibling = node.next;
+ while (sibling) {
+ if (textBlockElements[sibling.name]) {
+ sibling.name = 'li';
+ sibling.fixed = true;
+ node.parent.insert(sibling, node.parent);
+ } else {
+ break;
+ }
+
+ sibling = sibling.next;
+ }
+
+ // Unwrap current text block
+ node.unwrap(node);
+ continue;
+ }
+
+ // Get list of all parent nodes until we find a valid parent to stick the child into
+ parents = [node];
+ for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) &&
+ !nonSplitableElements[parent.name]; parent = parent.parent) {
+ parents.push(parent);
+ }
+
+ // Found a suitable parent
+ if (parent && parents.length > 1) {
+ // Reverse the array since it makes looping easier
+ parents.reverse();
+
+ // Clone the related parent and insert that after the moved node
+ newParent = currentNode = self.filterNode(parents[0].clone());
+
+ // Start cloning and moving children on the left side of the target node
+ for (i = 0; i < parents.length - 1; i++) {
+ if (schema.isValidChild(currentNode.name, parents[i].name)) {
+ tempNode = self.filterNode(parents[i].clone());
+ currentNode.append(tempNode);
+ } else {
+ tempNode = currentNode;
+ }
+
+ for (childNode = parents[i].firstChild; childNode && childNode != parents[i + 1]; ) {
+ nextNode = childNode.next;
+ tempNode.append(childNode);
+ childNode = nextNode;
+ }
+
+ currentNode = tempNode;
+ }
+
+ if (!newParent.isEmpty(nonEmptyElements)) {
+ parent.insert(newParent, parents[0], true);
+ parent.insert(node, newParent);
+ } else {
+ parent.insert(node, parents[0], true);
+ }
+
+ // Check if the element is empty by looking through it's contents and special treatment for <p><br /></p>
+ parent = parents[0];
+ if (parent.isEmpty(nonEmptyElements) || parent.firstChild === parent.lastChild && parent.firstChild.name === 'br') {
+ parent.empty().remove();
+ }
+ } else if (node.parent) {
+ // If it's an LI try to find a UL/OL for it or wrap it
+ if (node.name === 'li') {
+ sibling = node.prev;
+ if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) {
+ sibling.append(node);
+ continue;
+ }
+
+ sibling = node.next;
+ if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) {
+ sibling.insert(node, sibling.firstChild, true);
+ continue;
+ }
+
+ node.wrap(self.filterNode(new Node('ul', 1)));
+ continue;
+ }
+
+ // Try wrapping the element in a DIV
+ if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) {
+ node.wrap(self.filterNode(new Node('div', 1)));
+ } else {
+ // We failed wrapping it, then remove or unwrap it
+ if (node.name === 'style' || node.name === 'script') {
+ node.empty().remove();
+ } else {
+ node.unwrap();
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Runs the specified node though the element and attributes filters.
+ *
+ * @method filterNode
+ * @param {tinymce.html.Node} Node the node to run filters on.
+ * @return {tinymce.html.Node} The passed in node.
+ */
+ self.filterNode = function(node) {
+ var i, name, list;
+
+ // Run element filters
+ if (name in nodeFilters) {
+ list = matchedNodes[name];
+
+ if (list) {
+ list.push(node);
+ } else {
+ matchedNodes[name] = [node];
+ }
+ }
+
+ // Run attribute filters
+ i = attributeFilters.length;
+ while (i--) {
+ name = attributeFilters[i].name;
+
+ if (name in node.attributes.map) {
+ list = matchedAttributes[name];
+
+ if (list) {
+ list.push(node);
+ } else {
+ matchedAttributes[name] = [node];
+ }
+ }
+ }
+
+ return node;
+ };
+
+ /**
+ * Adds a node filter function to the parser, the parser will collect the specified nodes by name
+ * and then execute the callback ones it has finished parsing the document.
+ *
+ * @example
+ * parser.addNodeFilter('p,h1', function(nodes, name) {
+ * for (var i = 0; i < nodes.length; i++) {
+ * console.log(nodes[i].name);
+ * }
+ * });
+ * @method addNodeFilter
+ * @method {String} name Comma separated list of nodes to collect.
+ * @param {function} callback Callback function to execute once it has collected nodes.
+ */
+ self.addNodeFilter = function(name, callback) {
+ each(explode(name), function(name) {
+ var list = nodeFilters[name];
+
+ if (!list) {
+ nodeFilters[name] = list = [];
+ }
+
+ list.push(callback);
+ });
+ };
+
+ /**
+ * Adds a attribute filter function to the parser, the parser will collect nodes that has the specified attributes
+ * and then execute the callback ones it has finished parsing the document.
+ *
+ * @example
+ * parser.addAttributeFilter('src,href', function(nodes, name) {
+ * for (var i = 0; i < nodes.length; i++) {
+ * console.log(nodes[i].name);
+ * }
+ * });
+ * @method addAttributeFilter
+ * @method {String} name Comma separated list of nodes to collect.
+ * @param {function} callback Callback function to execute once it has collected nodes.
+ */
+ self.addAttributeFilter = function(name, callback) {
+ each(explode(name), function(name) {
+ var i;
+
+ for (i = 0; i < attributeFilters.length; i++) {
+ if (attributeFilters[i].name === name) {
+ attributeFilters[i].callbacks.push(callback);
+ return;
+ }
+ }
+
+ attributeFilters.push({name: name, callbacks: [callback]});
+ });
+ };
+
+ /**
+ * Parses the specified HTML string into a DOM like node tree and returns the result.
+ *
+ * @example
+ * var rootNode = new DomParser({...}).parse('<b>text</b>');
+ * @method parse
+ * @param {String} html Html string to sax parse.
+ * @param {Object} args Optional args object that gets passed to all filter functions.
+ * @return {tinymce.html.Node} Root node containing the tree.
+ */
+ self.parse = function(html, args) {
+ var parser, rootNode, node, nodes, i, l, fi, fl, list, name, validate;
+ var blockElements, startWhiteSpaceRegExp, invalidChildren = [], isInWhiteSpacePreservedElement;
+ var endWhiteSpaceRegExp, allWhiteSpaceRegExp, isAllWhiteSpaceRegExp, whiteSpaceElements;
+ var children, nonEmptyElements, rootBlockName;
+
+ args = args || {};
+ matchedNodes = {};
+ matchedAttributes = {};
+ blockElements = extend(makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements());
+ nonEmptyElements = schema.getNonEmptyElements();
+ children = schema.children;
+ validate = settings.validate;
+ rootBlockName = "forced_root_block" in args ? args.forced_root_block : settings.forced_root_block;
+
+ whiteSpaceElements = schema.getWhiteSpaceElements();
+ startWhiteSpaceRegExp = /^[ \t\r\n]+/;
+ endWhiteSpaceRegExp = /[ \t\r\n]+$/;
+ allWhiteSpaceRegExp = /[ \t\r\n]+/g;
+ isAllWhiteSpaceRegExp = /^[ \t\r\n]+$/;
+
+ function addRootBlocks() {
+ var node = rootNode.firstChild, next, rootBlockNode;
+
+ // Removes whitespace at beginning and end of block so:
+ // <p> x </p> -> <p>x</p>
+ function trim(rootBlockNode) {
+ if (rootBlockNode) {
+ node = rootBlockNode.firstChild;
+ if (node && node.type == 3) {
+ node.value = node.value.replace(startWhiteSpaceRegExp, '');
+ }
+
+ node = rootBlockNode.lastChild;
+ if (node && node.type == 3) {
+ node.value = node.value.replace(endWhiteSpaceRegExp, '');
+ }
+ }
+ }
+
+ // Check if rootBlock is valid within rootNode for example if P is valid in H1 if H1 is the contentEditabe root
+ if (!schema.isValidChild(rootNode.name, rootBlockName.toLowerCase())) {
+ return;
+ }
+
+ while (node) {
+ next = node.next;
+
+ if (node.type == 3 || (node.type == 1 && node.name !== 'p' &&
+ !blockElements[node.name] && !node.attr('data-mce-type'))) {
+ if (!rootBlockNode) {
+ // Create a new root block element
+ rootBlockNode = createNode(rootBlockName, 1);
+ rootBlockNode.attr(settings.forced_root_block_attrs);
+ rootNode.insert(rootBlockNode, node);
+ rootBlockNode.append(node);
+ } else {
+ rootBlockNode.append(node);
+ }
+ } else {
+ trim(rootBlockNode);
+ rootBlockNode = null;
+ }
+
+ node = next;
+ }
+
+ trim(rootBlockNode);
+ }
+
+ function createNode(name, type) {
+ var node = new Node(name, type), list;
+
+ if (name in nodeFilters) {
+ list = matchedNodes[name];
+
+ if (list) {
+ list.push(node);
+ } else {
+ matchedNodes[name] = [node];
+ }
+ }
+
+ return node;
+ }
+
+ function removeWhitespaceBefore(node) {
+ var textNode, textVal, sibling;
+
+ for (textNode = node.prev; textNode && textNode.type === 3; ) {
+ textVal = textNode.value.replace(endWhiteSpaceRegExp, '');
+
+ if (textVal.length > 0) {
+ textNode.value = textVal;
+ textNode = textNode.prev;
+ } else {
+ sibling = textNode.prev;
+ textNode.remove();
+ textNode = sibling;
+ }
+ }
+ }
+
+ function cloneAndExcludeBlocks(input) {
+ var name, output = {};
+
+ for (name in input) {
+ if (name !== 'li' && name != 'p') {
+ output[name] = input[name];
+ }
+ }
+
+ return output;
+ }
+
+ parser = new SaxParser({
+ validate: validate,
+ allow_script_urls: settings.allow_script_urls,
+ allow_conditional_comments: settings.allow_conditional_comments,
+
+ // Exclude P and LI from DOM parsing since it's treated better by the DOM parser
+ self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()),
+
+ cdata: function(text) {
+ node.append(createNode('#cdata', 4)).value = text;
+ },
+
+ text: function(text, raw) {
+ var textNode;
+
+ // Trim all redundant whitespace on non white space elements
+ if (!isInWhiteSpacePreservedElement) {
+ text = text.replace(allWhiteSpaceRegExp, ' ');
+
+ if (node.lastChild && blockElements[node.lastChild.name]) {
+ text = text.replace(startWhiteSpaceRegExp, '');
+ }
+ }
+
+ // Do we need to create the node
+ if (text.length !== 0) {
+ textNode = createNode('#text', 3);
+ textNode.raw = !!raw;
+ node.append(textNode).value = text;
+ }
+ },
+
+ comment: function(text) {
+ node.append(createNode('#comment', 8)).value = text;
+ },
+
+ pi: function(name, text) {
+ node.append(createNode(name, 7)).value = text;
+ removeWhitespaceBefore(node);
+ },
+
+ doctype: function(text) {
+ var newNode;
+
+ newNode = node.append(createNode('#doctype', 10));
+ newNode.value = text;
+ removeWhitespaceBefore(node);
+ },
+
+ start: function(name, attrs, empty) {
+ var newNode, attrFiltersLen, elementRule, attrName, parent;
+
+ elementRule = validate ? schema.getElementRule(name) : {};
+ if (elementRule) {
+ newNode = createNode(elementRule.outputName || name, 1);
+ newNode.attributes = attrs;
+ newNode.shortEnded = empty;
+
+ node.append(newNode);
+
+ // Check if node is valid child of the parent node is the child is
+ // unknown we don't collect it since it's probably a custom element
+ parent = children[node.name];
+ if (parent && children[newNode.name] && !parent[newNode.name]) {
+ invalidChildren.push(newNode);
+ }
+
+ attrFiltersLen = attributeFilters.length;
+ while (attrFiltersLen--) {
+ attrName = attributeFilters[attrFiltersLen].name;
+
+ if (attrName in attrs.map) {
+ list = matchedAttributes[attrName];
+
+ if (list) {
+ list.push(newNode);
+ } else {
+ matchedAttributes[attrName] = [newNode];
+ }
+ }
+ }
+
+ // Trim whitespace before block
+ if (blockElements[name]) {
+ removeWhitespaceBefore(newNode);
+ }
+
+ // Change current node if the element wasn't empty i.e not <br /> or <img />
+ if (!empty) {
+ node = newNode;
+ }
+
+ // Check if we are inside a whitespace preserved element
+ if (!isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
+ isInWhiteSpacePreservedElement = true;
+ }
+ }
+ },
+
+ end: function(name) {
+ var textNode, elementRule, text, sibling, tempNode;
+
+ elementRule = validate ? schema.getElementRule(name) : {};
+ if (elementRule) {
+ if (blockElements[name]) {
+ if (!isInWhiteSpacePreservedElement) {
+ // Trim whitespace of the first node in a block
+ textNode = node.firstChild;
+ if (textNode && textNode.type === 3) {
+ text = textNode.value.replace(startWhiteSpaceRegExp, '');
+
+ // Any characters left after trim or should we remove it
+ if (text.length > 0) {
+ textNode.value = text;
+ textNode = textNode.next;
+ } else {
+ sibling = textNode.next;
+ textNode.remove();
+ textNode = sibling;
+
+ // Remove any pure whitespace siblings
+ while (textNode && textNode.type === 3) {
+ text = textNode.value;
+ sibling = textNode.next;
+
+ if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
+ textNode.remove();
+ textNode = sibling;
+ }
+
+ textNode = sibling;
+ }
+ }
+ }
+
+ // Trim whitespace of the last node in a block
+ textNode = node.lastChild;
+ if (textNode && textNode.type === 3) {
+ text = textNode.value.replace(endWhiteSpaceRegExp, '');
+
+ // Any characters left after trim or should we remove it
+ if (text.length > 0) {
+ textNode.value = text;
+ textNode = textNode.prev;
+ } else {
+ sibling = textNode.prev;
+ textNode.remove();
+ textNode = sibling;
+
+ // Remove any pure whitespace siblings
+ while (textNode && textNode.type === 3) {
+ text = textNode.value;
+ sibling = textNode.prev;
+
+ if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
+ textNode.remove();
+ textNode = sibling;
+ }
+
+ textNode = sibling;
+ }
+ }
+ }
+ }
+
+ // Trim start white space
+ // Removed due to: #5424
+ /*textNode = node.prev;
+ if (textNode && textNode.type === 3) {
+ text = textNode.value.replace(startWhiteSpaceRegExp, '');
+
+ if (text.length > 0)
+ textNode.value = text;
+ else
+ textNode.remove();
+ }*/
+ }
+
+ // Check if we exited a whitespace preserved element
+ if (isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
+ isInWhiteSpacePreservedElement = false;
+ }
+
+ // Handle empty nodes
+ if (elementRule.removeEmpty || elementRule.paddEmpty) {
+ if (node.isEmpty(nonEmptyElements)) {
+ if (elementRule.paddEmpty) {
+ node.empty().append(new Node('#text', '3')).value = '\u00a0';
+ } else {
+ // Leave nodes that have a name like <a name="name">
+ if (!node.attributes.map.name && !node.attributes.map.id) {
+ tempNode = node.parent;
+ node.empty().remove();
+ node = tempNode;
+ return;
+ }
+ }
+ }
+ }
+
+ node = node.parent;
+ }
+ }
+ }, schema);
+
+ rootNode = node = new Node(args.context || settings.root_name, 11);
+
+ parser.parse(html);
+
+ // Fix invalid children or report invalid children in a contextual parsing
+ if (validate && invalidChildren.length) {
+ if (!args.context) {
+ fixInvalidChildren(invalidChildren);
+ } else {
+ args.invalid = true;
+ }
+ }
+
+ // Wrap nodes in the root into block elements if the root is body
+ if (rootBlockName && (rootNode.name == 'body' || args.isRootContent)) {
+ addRootBlocks();
+ }
+
+ // Run filters only when the contents is valid
+ if (!args.invalid) {
+ // Run node filters
+ for (name in matchedNodes) {
+ list = nodeFilters[name];
+ nodes = matchedNodes[name];
+
+ // Remove already removed children
+ fi = nodes.length;
+ while (fi--) {
+ if (!nodes[fi].parent) {
+ nodes.splice(fi, 1);
+ }
+ }
+
+ for (i = 0, l = list.length; i < l; i++) {
+ list[i](nodes, name, args);
+ }
+ }
+
+ // Run attribute filters
+ for (i = 0, l = attributeFilters.length; i < l; i++) {
+ list = attributeFilters[i];
+
+ if (list.name in matchedAttributes) {
+ nodes = matchedAttributes[list.name];
+
+ // Remove already removed children
+ fi = nodes.length;
+ while (fi--) {
+ if (!nodes[fi].parent) {
+ nodes.splice(fi, 1);
+ }
+ }
+
+ for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) {
+ list.callbacks[fi](nodes, list.name, args);
+ }
+ }
+ }
+ }
+
+ return rootNode;
+ };
+
+ // Remove <br> at end of block elements Gecko and WebKit injects BR elements to
+ // make it possible to place the caret inside empty blocks. This logic tries to remove
+ // these elements and keep br elements that where intended to be there intact
+ if (settings.remove_trailing_brs) {
+ self.addNodeFilter('br', function(nodes) {
+ var i, l = nodes.length, node, blockElements = extend({}, schema.getBlockElements());
+ var nonEmptyElements = schema.getNonEmptyElements(), parent, lastParent, prev, prevName;
+ var elementRule, textNode;
+
+ // Remove brs from body element as well
+ blockElements.body = 1;
+
+ // Must loop forwards since it will otherwise remove all brs in <p>a<br><br><br></p>
+ for (i = 0; i < l; i++) {
+ node = nodes[i];
+ parent = node.parent;
+
+ if (blockElements[node.parent.name] && node === parent.lastChild) {
+ // Loop all nodes to the left of the current node and check for other BR elements
+ // excluding bookmarks since they are invisible
+ prev = node.prev;
+ while (prev) {
+ prevName = prev.name;
+
+ // Ignore bookmarks
+ if (prevName !== "span" || prev.attr('data-mce-type') !== 'bookmark') {
+ // Found a non BR element
+ if (prevName !== "br") {
+ break;
+ }
+
+ // Found another br it's a <br><br> structure then don't remove anything
+ if (prevName === 'br') {
+ node = null;
+ break;
+ }
+ }
+
+ prev = prev.prev;
+ }
+
+ if (node) {
+ node.remove();
+
+ // Is the parent to be considered empty after we removed the BR
+ if (parent.isEmpty(nonEmptyElements)) {
+ elementRule = schema.getElementRule(parent.name);
+
+ // Remove or padd the element depending on schema rule
+ if (elementRule) {
+ if (elementRule.removeEmpty) {
+ parent.remove();
+ } else if (elementRule.paddEmpty) {
+ parent.empty().append(new Node('#text', 3)).value = '\u00a0';
+ }
+ }
+ }
+ }
+ } else {
+ // Replaces BR elements inside inline elements like <p><b><i><br></i></b></p>
+ // so they become <p><b><i> </i></b></p>
+ lastParent = node;
+ while (parent && parent.firstChild === lastParent && parent.lastChild === lastParent) {
+ lastParent = parent;
+
+ if (blockElements[parent.name]) {
+ break;
+ }
+
+ parent = parent.parent;
+ }
+
+ if (lastParent === parent) {
+ textNode = new Node('#text', 3);
+ textNode.value = '\u00a0';
+ node.replace(textNode);
+ }
+ }
+ }
+ });
+ }
+
+ // Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included.
+ if (!settings.allow_html_in_named_anchor) {
+ self.addAttributeFilter('id,name', function(nodes) {
+ var i = nodes.length, sibling, prevSibling, parent, node;
+
+ while (i--) {
+ node = nodes[i];
+ if (node.name === 'a' && node.firstChild && !node.attr('href')) {
+ parent = node.parent;
+
+ // Move children after current node
+ sibling = node.lastChild;
+ do {
+ prevSibling = sibling.prev;
+ parent.insert(sibling, node);
+ sibling = prevSibling;
+ } while (sibling);
+ }
+ }
+ });
+ }
+ };
+});
+
+// Included from: js/tinymce/classes/html/Writer.js
+
+/**
+ * Writer.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to write HTML tags out it can be used with the Serializer or the SaxParser.
+ *
+ * @class tinymce.html.Writer
+ * @example
+ * var writer = new tinymce.html.Writer({indent: true});
+ * var parser = new tinymce.html.SaxParser(writer).parse('<p><br></p>');
+ * console.log(writer.getContent());
+ *
+ * @class tinymce.html.Writer
+ * @version 3.4
+ */
+define("tinymce/html/Writer", [
+ "tinymce/html/Entities",
+ "tinymce/util/Tools"
+], function(Entities, Tools) {
+ var makeMap = Tools.makeMap;
+
+ /**
+ * Constructs a new Writer instance.
+ *
+ * @constructor
+ * @method Writer
+ * @param {Object} settings Name/value settings object.
+ */
+ return function(settings) {
+ var html = [], indent, indentBefore, indentAfter, encode, htmlOutput;
+
+ settings = settings || {};
+ indent = settings.indent;
+ indentBefore = makeMap(settings.indent_before || '');
+ indentAfter = makeMap(settings.indent_after || '');
+ encode = Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities);
+ htmlOutput = settings.element_format == "html";
+
+ return {
+ /**
+ * Writes the a start element such as <p id="a">.
+ *
+ * @method start
+ * @param {String} name Name of the element.
+ * @param {Array} attrs Optional attribute array or undefined if it hasn't any.
+ * @param {Boolean} empty Optional empty state if the tag should end like <br />.
+ */
+ start: function(name, attrs, empty) {
+ var i, l, attr, value;
+
+ if (indent && indentBefore[name] && html.length > 0) {
+ value = html[html.length - 1];
+
+ if (value.length > 0 && value !== '\n') {
+ html.push('\n');
+ }
+ }
+
+ html.push('<', name);
+
+ if (attrs) {
+ for (i = 0, l = attrs.length; i < l; i++) {
+ attr = attrs[i];
+ html.push(' ', attr.name, '="', encode(attr.value, true), '"');
+ }
+ }
+
+ if (!empty || htmlOutput) {
+ html[html.length] = '>';
+ } else {
+ html[html.length] = ' />';
+ }
+
+ if (empty && indent && indentAfter[name] && html.length > 0) {
+ value = html[html.length - 1];
+
+ if (value.length > 0 && value !== '\n') {
+ html.push('\n');
+ }
+ }
+ },
+
+ /**
+ * Writes the a end element such as </p>.
+ *
+ * @method end
+ * @param {String} name Name of the element.
+ */
+ end: function(name) {
+ var value;
+
+ /*if (indent && indentBefore[name] && html.length > 0) {
+ value = html[html.length - 1];
+
+ if (value.length > 0 && value !== '\n')
+ html.push('\n');
+ }*/
+
+ html.push('</', name, '>');
+
+ if (indent && indentAfter[name] && html.length > 0) {
+ value = html[html.length - 1];
+
+ if (value.length > 0 && value !== '\n') {
+ html.push('\n');
+ }
+ }
+ },
+
+ /**
+ * Writes a text node.
+ *
+ * @method text
+ * @param {String} text String to write out.
+ * @param {Boolean} raw Optional raw state if true the contents wont get encoded.
+ */
+ text: function(text, raw) {
+ if (text.length > 0) {
+ html[html.length] = raw ? text : encode(text);
+ }
+ },
+
+ /**
+ * Writes a cdata node such as <![CDATA[data]]>.
+ *
+ * @method cdata
+ * @param {String} text String to write out inside the cdata.
+ */
+ cdata: function(text) {
+ html.push('<![CDATA[', text, ']]>');
+ },
+
+ /**
+ * Writes a comment node such as <!-- Comment -->.
+ *
+ * @method cdata
+ * @param {String} text String to write out inside the comment.
+ */
+ comment: function(text) {
+ html.push('<!--', text, '-->');
+ },
+
+ /**
+ * Writes a PI node such as <?xml attr="value" ?>.
+ *
+ * @method pi
+ * @param {String} name Name of the pi.
+ * @param {String} text String to write out inside the pi.
+ */
+ pi: function(name, text) {
+ if (text) {
+ html.push('<?', name, ' ', text, '?>');
+ } else {
+ html.push('<?', name, '?>');
+ }
+
+ if (indent) {
+ html.push('\n');
+ }
+ },
+
+ /**
+ * Writes a doctype node such as <!DOCTYPE data>.
+ *
+ * @method doctype
+ * @param {String} text String to write out inside the doctype.
+ */
+ doctype: function(text) {
+ html.push('<!DOCTYPE', text, '>', indent ? '\n' : '');
+ },
+
+ /**
+ * Resets the internal buffer if one wants to reuse the writer.
+ *
+ * @method reset
+ */
+ reset: function() {
+ html.length = 0;
+ },
+
+ /**
+ * Returns the contents that got serialized.
+ *
+ * @method getContent
+ * @return {String} HTML contents that got written down.
+ */
+ getContent: function() {
+ return html.join('').replace(/\n$/, '');
+ }
+ };
+ };
+});
+
+// Included from: js/tinymce/classes/html/Serializer.js
+
+/**
+ * Serializer.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to serialize down the DOM tree into a string using a Writer instance.
+ *
+ *
+ * @example
+ * new tinymce.html.Serializer().serialize(new tinymce.html.DomParser().parse('<p>text</p>'));
+ * @class tinymce.html.Serializer
+ * @version 3.4
+ */
+define("tinymce/html/Serializer", [
+ "tinymce/html/Writer",
+ "tinymce/html/Schema"
+], function(Writer, Schema) {
+ /**
+ * Constructs a new Serializer instance.
+ *
+ * @constructor
+ * @method Serializer
+ * @param {Object} settings Name/value settings object.
+ * @param {tinymce.html.Schema} schema Schema instance to use.
+ */
+ return function(settings, schema) {
+ var self = this, writer = new Writer(settings);
+
+ settings = settings || {};
+ settings.validate = "validate" in settings ? settings.validate : true;
+
+ self.schema = schema = schema || new Schema();
+ self.writer = writer;
+
+ /**
+ * Serializes the specified node into a string.
+ *
+ * @example
+ * new tinymce.html.Serializer().serialize(new tinymce.html.DomParser().parse('<p>text</p>'));
+ * @method serialize
+ * @param {tinymce.html.Node} node Node instance to serialize.
+ * @return {String} String with HTML based on DOM tree.
+ */
+ self.serialize = function(node) {
+ var handlers, validate;
+
+ validate = settings.validate;
+
+ handlers = {
+ // #text
+ 3: function(node) {
+ writer.text(node.value, node.raw);
+ },
+
+ // #comment
+ 8: function(node) {
+ writer.comment(node.value);
+ },
+
+ // Processing instruction
+ 7: function(node) {
+ writer.pi(node.name, node.value);
+ },
+
+ // Doctype
+ 10: function(node) {
+ writer.doctype(node.value);
+ },
+
+ // CDATA
+ 4: function(node) {
+ writer.cdata(node.value);
+ },
+
+ // Document fragment
+ 11: function(node) {
+ if ((node = node.firstChild)) {
+ do {
+ walk(node);
+ } while ((node = node.next));
+ }
+ }
+ };
+
+ writer.reset();
+
+ function walk(node) {
+ var handler = handlers[node.type], name, isEmpty, attrs, attrName, attrValue, sortedAttrs, i, l, elementRule;
+
+ if (!handler) {
+ name = node.name;
+ isEmpty = node.shortEnded;
+ attrs = node.attributes;
+
+ // Sort attributes
+ if (validate && attrs && attrs.length > 1) {
+ sortedAttrs = [];
+ sortedAttrs.map = {};
+
+ elementRule = schema.getElementRule(node.name);
+ for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) {
+ attrName = elementRule.attributesOrder[i];
+
+ if (attrName in attrs.map) {
+ attrValue = attrs.map[attrName];
+ sortedAttrs.map[attrName] = attrValue;
+ sortedAttrs.push({name: attrName, value: attrValue});
+ }
+ }
+
+ for (i = 0, l = attrs.length; i < l; i++) {
+ attrName = attrs[i].name;
+
+ if (!(attrName in sortedAttrs.map)) {
+ attrValue = attrs.map[attrName];
+ sortedAttrs.map[attrName] = attrValue;
+ sortedAttrs.push({name: attrName, value: attrValue});
+ }
+ }
+
+ attrs = sortedAttrs;
+ }
+
+ writer.start(node.name, attrs, isEmpty);
+
+ if (!isEmpty) {
+ if ((node = node.firstChild)) {
+ do {
+ walk(node);
+ } while ((node = node.next));
+ }
+
+ writer.end(name);
+ }
+ } else {
+ handler(node);
+ }
+ }
+
+ // Serialize element and treat all non elements as fragments
+ if (node.type == 1 && !settings.inner) {
+ walk(node);
+ } else {
+ handlers[11](node);
+ }
+
+ return writer.getContent();
+ };
+ };
+});
+
+// Included from: js/tinymce/classes/dom/Serializer.js
+
+/**
+ * Serializer.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to serialize DOM trees into a string. Consult the TinyMCE Wiki API for
+ * more details and examples on how to use this class.
+ *
+ * @class tinymce.dom.Serializer
+ */
+define("tinymce/dom/Serializer", [
+ "tinymce/dom/DOMUtils",
+ "tinymce/html/DomParser",
+ "tinymce/html/Entities",
+ "tinymce/html/Serializer",
+ "tinymce/html/Node",
+ "tinymce/html/Schema",
+ "tinymce/Env",
+ "tinymce/util/Tools"
+], function(DOMUtils, DomParser, Entities, Serializer, Node, Schema, Env, Tools) {
+ var each = Tools.each, trim = Tools.trim;
+ var DOM = DOMUtils.DOM;
+
+ /**
+ * Constructs a new DOM serializer class.
+ *
+ * @constructor
+ * @method Serializer
+ * @param {Object} settings Serializer settings object.
+ * @param {tinymce.Editor} editor Optional editor to bind events to and get schema/dom from.
+ */
+ return function(settings, editor) {
+ var dom, schema, htmlParser;
+
+ if (editor) {
+ dom = editor.dom;
+ schema = editor.schema;
+ }
+
+ // Default DOM and Schema if they are undefined
+ dom = dom || DOM;
+ schema = schema || new Schema(settings);
+ settings.entity_encoding = settings.entity_encoding || 'named';
+ settings.remove_trailing_brs = "remove_trailing_brs" in settings ? settings.remove_trailing_brs : true;
+
+ htmlParser = new DomParser(settings, schema);
+
+ // Convert move data-mce-src, data-mce-href and data-mce-style into nodes or process them if needed
+ htmlParser.addAttributeFilter('src,href,style', function(nodes, name) {
+ var i = nodes.length, node, value, internalName = 'data-mce-' + name;
+ var urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope, undef;
+
+ while (i--) {
+ node = nodes[i];
+
+ value = node.attributes.map[internalName];
+ if (value !== undef) {
+ // Set external name to internal value and remove internal
+ node.attr(name, value.length > 0 ? value : null);
+ node.attr(internalName, null);
+ } else {
+ // No internal attribute found then convert the value we have in the DOM
+ value = node.attributes.map[name];
+
+ if (name === "style") {
+ value = dom.serializeStyle(dom.parseStyle(value), node.name);
+ } else if (urlConverter) {
+ value = urlConverter.call(urlConverterScope, value, name, node.name);
+ }
+
+ node.attr(name, value.length > 0 ? value : null);
+ }
+ }
+ });
+
+ // Remove internal classes mceItem<..> or mceSelected
+ htmlParser.addAttributeFilter('class', function(nodes) {
+ var i = nodes.length, node, value;
+
+ while (i--) {
+ node = nodes[i];
+ value = node.attr('class').replace(/(?:^|\s)mce-item-\w+(?!\S)/g, '');
+ node.attr('class', value.length > 0 ? value : null);
+ }
+ });
+
+ // Remove bookmark elements
+ htmlParser.addAttributeFilter('data-mce-type', function(nodes, name, args) {
+ var i = nodes.length, node;
+
+ while (i--) {
+ node = nodes[i];
+
+ if (node.attributes.map['data-mce-type'] === 'bookmark' && !args.cleanup) {
+ node.remove();
+ }
+ }
+ });
+
+ // Remove expando attributes
+ htmlParser.addAttributeFilter('data-mce-expando', function(nodes, name) {
+ var i = nodes.length;
+
+ while (i--) {
+ nodes[i].attr(name, null);
+ }
+ });
+
+ htmlParser.addNodeFilter('noscript', function(nodes) {
+ var i = nodes.length, node;
+
+ while (i--) {
+ node = nodes[i].firstChild;
+
+ if (node) {
+ node.value = Entities.decode(node.value);
+ }
+ }
+ });
+
+ // Force script into CDATA sections and remove the mce- prefix also add comments around styles
+ htmlParser.addNodeFilter('script,style', function(nodes, name) {
+ var i = nodes.length, node, value;
+
+ function trim(value) {
+ /*jshint maxlen:255 */
+ return value.replace(/(<!--\[CDATA\[|\]\]-->)/g, '\n')
+ .replace(/^[\r\n]*|[\r\n]*$/g, '')
+ .replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi, '')
+ .replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g, '');
+ }
+
+ while (i--) {
+ node = nodes[i];
+ value = node.firstChild ? node.firstChild.value : '';
+
+ if (name === "script") {
+ // Remove mce- prefix from script elements and remove default text/javascript mime type (HTML5)
+ var type = (node.attr('type') || 'text/javascript').replace(/^mce\-/, '');
+ node.attr('type', type === 'text/javascript' ? null : type);
+
+ if (value.length > 0) {
+ node.firstChild.value = '// <![CDATA[\n' + trim(value) + '\n// ]]>';
+ }
+ } else {
+ if (value.length > 0) {
+ node.firstChild.value = '<!--\n' + trim(value) + '\n-->';
+ }
+ }
+ }
+ });
+
+ // Convert comments to cdata and handle protected comments
+ htmlParser.addNodeFilter('#comment', function(nodes) {
+ var i = nodes.length, node;
+
+ while (i--) {
+ node = nodes[i];
+
+ if (node.value.indexOf('[CDATA[') === 0) {
+ node.name = '#cdata';
+ node.type = 4;
+ node.value = node.value.replace(/^\[CDATA\[|\]\]$/g, '');
+ } else if (node.value.indexOf('mce:protected ') === 0) {
+ node.name = "#text";
+ node.type = 3;
+ node.raw = true;
+ node.value = unescape(node.value).substr(14);
+ }
+ }
+ });
+
+ htmlParser.addNodeFilter('xml:namespace,input', function(nodes, name) {
+ var i = nodes.length, node;
+
+ while (i--) {
+ node = nodes[i];
+ if (node.type === 7) {
+ node.remove();
+ } else if (node.type === 1) {
+ if (name === "input" && !("type" in node.attributes.map)) {
+ node.attr('type', 'text');
+ }
+ }
+ }
+ });
+
+ // Fix list elements, TODO: Replace this later
+ if (settings.fix_list_elements) {
+ htmlParser.addNodeFilter('ul,ol', function(nodes) {
+ var i = nodes.length, node, parentNode;
+
+ while (i--) {
+ node = nodes[i];
+ parentNode = node.parent;
+
+ if (parentNode.name === 'ul' || parentNode.name === 'ol') {
+ if (node.prev && node.prev.name === 'li') {
+ node.prev.append(node);
+ }
+ }
+ }
+ });
+ }
+
+ // Remove internal data attributes
+ htmlParser.addAttributeFilter('data-mce-src,data-mce-href,data-mce-style,data-mce-selected', function(nodes, name) {
+ var i = nodes.length;
+
+ while (i--) {
+ nodes[i].attr(name, null);
+ }
+ });
+
+ // Return public methods
+ return {
+ /**
+ * Schema instance that was used to when the Serializer was constructed.
+ *
+ * @field {tinymce.html.Schema} schema
+ */
+ schema: schema,
+
+ /**
+ * Adds a node filter function to the parser used by the serializer, the parser will collect the specified nodes by name
+ * and then execute the callback ones it has finished parsing the document.
+ *
+ * @example
+ * parser.addNodeFilter('p,h1', function(nodes, name) {
+ * for (var i = 0; i < nodes.length; i++) {
+ * console.log(nodes[i].name);
+ * }
+ * });
+ * @method addNodeFilter
+ * @method {String} name Comma separated list of nodes to collect.
+ * @param {function} callback Callback function to execute once it has collected nodes.
+ */
+ addNodeFilter: htmlParser.addNodeFilter,
+
+ /**
+ * Adds a attribute filter function to the parser used by the serializer, the parser will
+ * collect nodes that has the specified attributes
+ * and then execute the callback ones it has finished parsing the document.
+ *
+ * @example
+ * parser.addAttributeFilter('src,href', function(nodes, name) {
+ * for (var i = 0; i < nodes.length; i++) {
+ * console.log(nodes[i].name);
+ * }
+ * });
+ * @method addAttributeFilter
+ * @method {String} name Comma separated list of nodes to collect.
+ * @param {function} callback Callback function to execute once it has collected nodes.
+ */
+ addAttributeFilter: htmlParser.addAttributeFilter,
+
+ /**
+ * Serializes the specified browser DOM node into a HTML string.
+ *
+ * @method serialize
+ * @param {DOMNode} node DOM node to serialize.
+ * @param {Object} args Arguments option that gets passed to event handlers.
+ */
+ serialize: function(node, args) {
+ var self = this, impl, doc, oldDoc, htmlSerializer, content;
+
+ // Explorer won't clone contents of script and style and the
+ // selected index of select elements are cleared on a clone operation.
+ if (Env.ie && dom.select('script,style,select,map').length > 0) {
+ content = node.innerHTML;
+ node = node.cloneNode(false);
+ dom.setHTML(node, content);
+ } else {
+ node = node.cloneNode(true);
+ }
+
+ // Nodes needs to be attached to something in WebKit/Opera
+ // This fix will make DOM ranges and make Sizzle happy!
+ impl = node.ownerDocument.implementation;
+ if (impl.createHTMLDocument) {
+ // Create an empty HTML document
+ doc = impl.createHTMLDocument("");
+
+ // Add the element or it's children if it's a body element to the new document
+ each(node.nodeName == 'BODY' ? node.childNodes : [node], function(node) {
+ doc.body.appendChild(doc.importNode(node, true));
+ });
+
+ // Grab first child or body element for serialization
+ if (node.nodeName != 'BODY') {
+ node = doc.body.firstChild;
+ } else {
+ node = doc.body;
+ }
+
+ // set the new document in DOMUtils so createElement etc works
+ oldDoc = dom.doc;
+ dom.doc = doc;
+ }
+
+ args = args || {};
+ args.format = args.format || 'html';
+
+ // Don't wrap content if we want selected html
+ if (args.selection) {
+ args.forced_root_block = '';
+ }
+
+ // Pre process
+ if (!args.no_events) {
+ args.node = node;
+ self.onPreProcess(args);
+ }
+
+ // Setup serializer
+ htmlSerializer = new Serializer(settings, schema);
+
+ // Parse and serialize HTML
+ args.content = htmlSerializer.serialize(
+ htmlParser.parse(trim(args.getInner ? node.innerHTML : dom.getOuterHTML(node)), args)
+ );
+
+ // Replace all BOM characters for now until we can find a better solution
+ if (!args.cleanup) {
+ args.content = args.content.replace(/\uFEFF/g, '');
+ }
+
+ // Post process
+ if (!args.no_events) {
+ self.onPostProcess(args);
+ }
+
+ // Restore the old document if it was changed
+ if (oldDoc) {
+ dom.doc = oldDoc;
+ }
+
+ args.node = null;
+
+ return args.content;
+ },
+
+ /**
+ * Adds valid elements rules to the serializers schema instance this enables you to specify things
+ * like what elements should be outputted and what attributes specific elements might have.
+ * Consult the Wiki for more details on this format.
+ *
+ * @method addRules
+ * @param {String} rules Valid elements rules string to add to schema.
+ */
+ addRules: function(rules) {
+ schema.addValidElements(rules);
+ },
+
+ /**
+ * Sets the valid elements rules to the serializers schema instance this enables you to specify things
+ * like what elements should be outputted and what attributes specific elements might have.
+ * Consult the Wiki for more details on this format.
+ *
+ * @method setRules
+ * @param {String} rules Valid elements rules string.
+ */
+ setRules: function(rules) {
+ schema.setValidElements(rules);
+ },
+
+ onPreProcess: function(args) {
+ if (editor) {
+ editor.fire('PreProcess', args);
+ }
+ },
+
+ onPostProcess: function(args) {
+ if (editor) {
+ editor.fire('PostProcess', args);
+ }
+ }
+ };
+ };
+});
+
+// Included from: js/tinymce/classes/dom/TridentSelection.js
+
+/**
+ * TridentSelection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Selection class for old explorer versions. This one fakes the
+ * native selection object available on modern browsers.
+ *
+ * @class tinymce.dom.TridentSelection
+ */
+define("tinymce/dom/TridentSelection", [], function() {
+ function Selection(selection) {
+ var self = this, dom = selection.dom, FALSE = false;
+
+ function getPosition(rng, start) {
+ var checkRng, startIndex = 0, endIndex, inside,
+ children, child, offset, index, position = -1, parent;
+
+ // Setup test range, collapse it and get the parent
+ checkRng = rng.duplicate();
+ checkRng.collapse(start);
+ parent = checkRng.parentElement();
+
+ // Check if the selection is within the right document
+ if (parent.ownerDocument !== selection.dom.doc) {
+ return;
+ }
+
+ // IE will report non editable elements as it's parent so look for an editable one
+ while (parent.contentEditable === "false") {
+ parent = parent.parentNode;
+ }
+
+ // If parent doesn't have any children then return that we are inside the element
+ if (!parent.hasChildNodes()) {
+ return {node: parent, inside: 1};
+ }
+
+ // Setup node list and endIndex
+ children = parent.children;
+ endIndex = children.length - 1;
+
+ // Perform a binary search for the position
+ while (startIndex <= endIndex) {
+ index = Math.floor((startIndex + endIndex) / 2);
+
+ // Move selection to node and compare the ranges
+ child = children[index];
+ checkRng.moveToElementText(child);
+ position = checkRng.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', rng);
+
+ // Before/after or an exact match
+ if (position > 0) {
+ endIndex = index - 1;
+ } else if (position < 0) {
+ startIndex = index + 1;
+ } else {
+ return {node: child};
+ }
+ }
+
+ // Check if child position is before or we didn't find a position
+ if (position < 0) {
+ // No element child was found use the parent element and the offset inside that
+ if (!child) {
+ checkRng.moveToElementText(parent);
+ checkRng.collapse(true);
+ child = parent;
+ inside = true;
+ } else {
+ checkRng.collapse(false);
+ }
+
+ // Walk character by character in text node until we hit the selected range endpoint,
+ // hit the end of document or parent isn't the right one
+ // We need to walk char by char since rng.text or rng.htmlText will trim line endings
+ offset = 0;
+ while (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) !== 0) {
+ if (checkRng.move('character', 1) === 0 || parent != checkRng.parentElement()) {
+ break;
+ }
+
+ offset++;
+ }
+ } else {
+ // Child position is after the selection endpoint
+ checkRng.collapse(true);
+
+ // Walk character by character in text node until we hit the selected range endpoint, hit
+ // the end of document or parent isn't the right one
+ offset = 0;
+ while (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) !== 0) {
+ if (checkRng.move('character', -1) === 0 || parent != checkRng.parentElement()) {
+ break;
+ }
+
+ offset++;
+ }
+ }
+
+ return {node: child, position: position, offset: offset, inside: inside};
+ }
+
+ // Returns a W3C DOM compatible range object by using the IE Range API
+ function getRange() {
+ var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark;
+
+ // If selection is outside the current document just return an empty range
+ element = ieRange.item ? ieRange.item(0) : ieRange.parentElement();
+ if (element.ownerDocument != dom.doc) {
+ return domRange;
+ }
+
+ collapsed = selection.isCollapsed();
+
+ // Handle control selection
+ if (ieRange.item) {
+ domRange.setStart(element.parentNode, dom.nodeIndex(element));
+ domRange.setEnd(domRange.startContainer, domRange.startOffset + 1);
+
+ return domRange;
+ }
+
+ function findEndPoint(start) {
+ var endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue;
+
+ container = endPoint.node;
+ offset = endPoint.offset;
+
+ if (endPoint.inside && !container.hasChildNodes()) {
+ domRange[start ? 'setStart' : 'setEnd'](container, 0);
+ return;
+ }
+
+ if (offset === undef) {
+ domRange[start ? 'setStartBefore' : 'setEndAfter'](container);
+ return;
+ }
+
+ if (endPoint.position < 0) {
+ sibling = endPoint.inside ? container.firstChild : container.nextSibling;
+
+ if (!sibling) {
+ domRange[start ? 'setStartAfter' : 'setEndAfter'](container);
+ return;
+ }
+
+ if (!offset) {
+ if (sibling.nodeType == 3) {
+ domRange[start ? 'setStart' : 'setEnd'](sibling, 0);
+ } else {
+ domRange[start ? 'setStartBefore' : 'setEndBefore'](sibling);
+ }
+
+ return;
+ }
+
+ // Find the text node and offset
+ while (sibling) {
+ nodeValue = sibling.nodeValue;
+ textNodeOffset += nodeValue.length;
+
+ // We are at or passed the position we where looking for
+ if (textNodeOffset >= offset) {
+ container = sibling;
+ textNodeOffset -= offset;
+ textNodeOffset = nodeValue.length - textNodeOffset;
+ break;
+ }
+
+ sibling = sibling.nextSibling;
+ }
+ } else {
+ // Find the text node and offset
+ sibling = container.previousSibling;
+
+ if (!sibling) {
+ return domRange[start ? 'setStartBefore' : 'setEndBefore'](container);
+ }
+
+ // If there isn't any text to loop then use the first position
+ if (!offset) {
+ if (container.nodeType == 3) {
+ domRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length);
+ } else {
+ domRange[start ? 'setStartAfter' : 'setEndAfter'](sibling);
+ }
+
+ return;
+ }
+
+ while (sibling) {
+ textNodeOffset += sibling.nodeValue.length;
+
+ // We are at or passed the position we where looking for
+ if (textNodeOffset >= offset) {
+ container = sibling;
+ textNodeOffset -= offset;
+ break;
+ }
+
+ sibling = sibling.previousSibling;
+ }
+ }
+
+ domRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset);
+ }
+
+ try {
+ // Find start point
+ findEndPoint(true);
+
+ // Find end point if needed
+ if (!collapsed) {
+ findEndPoint();
+ }
+ } catch (ex) {
+ // IE has a nasty bug where text nodes might throw "invalid argument" when you
+ // access the nodeValue or other properties of text nodes. This seems to happend when
+ // text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it.
+ if (ex.number == -2147024809) {
+ // Get the current selection
+ bookmark = self.getBookmark(2);
+
+ // Get start element
+ tmpRange = ieRange.duplicate();
+ tmpRange.collapse(true);
+ element = tmpRange.parentElement();
+
+ // Get end element
+ if (!collapsed) {
+ tmpRange = ieRange.duplicate();
+ tmpRange.collapse(false);
+ element2 = tmpRange.parentElement();
+ element2.innerHTML = element2.innerHTML;
+ }
+
+ // Remove the broken elements
+ element.innerHTML = element.innerHTML;
+
+ // Restore the selection
+ self.moveToBookmark(bookmark);
+
+ // Since the range has moved we need to re-get it
+ ieRange = selection.getRng();
+
+ // Find start point
+ findEndPoint(true);
+
+ // Find end point if needed
+ if (!collapsed) {
+ findEndPoint();
+ }
+ } else {
+ throw ex; // Throw other errors
+ }
+ }
+
+ return domRange;
+ }
+
+ this.getBookmark = function(type) {
+ var rng = selection.getRng(), bookmark = {};
+
+ function getIndexes(node) {
+ var parent, root, children, i, indexes = [];
+
+ parent = node.parentNode;
+ root = dom.getRoot().parentNode;
+
+ while (parent != root && parent.nodeType !== 9) {
+ children = parent.children;
+
+ i = children.length;
+ while (i--) {
+ if (node === children[i]) {
+ indexes.push(i);
+ break;
+ }
+ }
+
+ node = parent;
+ parent = parent.parentNode;
+ }
+
+ return indexes;
+ }
+
+ function getBookmarkEndPoint(start) {
+ var position;
+
+ position = getPosition(rng, start);
+ if (position) {
+ return {
+ position: position.position,
+ offset: position.offset,
+ indexes: getIndexes(position.node),
+ inside: position.inside
+ };
+ }
+ }
+
+ // Non ubstructive bookmark
+ if (type === 2) {
+ // Handle text selection
+ if (!rng.item) {
+ bookmark.start = getBookmarkEndPoint(true);
+
+ if (!selection.isCollapsed()) {
+ bookmark.end = getBookmarkEndPoint();
+ }
+ } else {
+ bookmark.start = {ctrl: true, indexes: getIndexes(rng.item(0))};
+ }
+ }
+
+ return bookmark;
+ };
+
+ this.moveToBookmark = function(bookmark) {
+ var rng, body = dom.doc.body;
+
+ function resolveIndexes(indexes) {
+ var node, i, idx, children;
+
+ node = dom.getRoot();
+ for (i = indexes.length - 1; i >= 0; i--) {
+ children = node.children;
+ idx = indexes[i];
+
+ if (idx <= children.length - 1) {
+ node = children[idx];
+ }
+ }
+
+ return node;
+ }
+
+ function setBookmarkEndPoint(start) {
+ var endPoint = bookmark[start ? 'start' : 'end'], moveLeft, moveRng, undef, offset;
+
+ if (endPoint) {
+ moveLeft = endPoint.position > 0;
+
+ moveRng = body.createTextRange();
+ moveRng.moveToElementText(resolveIndexes(endPoint.indexes));
+
+ offset = endPoint.offset;
+ if (offset !== undef) {
+ moveRng.collapse(endPoint.inside || moveLeft);
+ moveRng.moveStart('character', moveLeft ? -offset : offset);
+ } else {
+ moveRng.collapse(start);
+ }
+
+ rng.setEndPoint(start ? 'StartToStart' : 'EndToStart', moveRng);
+
+ if (start) {
+ rng.collapse(true);
+ }
+ }
+ }
+
+ if (bookmark.start) {
+ if (bookmark.start.ctrl) {
+ rng = body.createControlRange();
+ rng.addElement(resolveIndexes(bookmark.start.indexes));
+ rng.select();
+ } else {
+ rng = body.createTextRange();
+ setBookmarkEndPoint(true);
+ setBookmarkEndPoint();
+ rng.select();
+ }
+ }
+ };
+
+ this.addRange = function(rng) {
+ var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, sibling,
+ doc = selection.dom.doc, body = doc.body, nativeRng, ctrlElm;
+
+ function setEndPoint(start) {
+ var container, offset, marker, tmpRng, nodes;
+
+ marker = dom.create('a');
+ container = start ? startContainer : endContainer;
+ offset = start ? startOffset : endOffset;
+ tmpRng = ieRng.duplicate();
+
+ if (container == doc || container == doc.documentElement) {
+ container = body;
+ offset = 0;
+ }
+
+ if (container.nodeType == 3) {
+ container.parentNode.insertBefore(marker, container);
+ tmpRng.moveToElementText(marker);
+ tmpRng.moveStart('character', offset);
+ dom.remove(marker);
+ ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng);
+ } else {
+ nodes = container.childNodes;
+
+ if (nodes.length) {
+ if (offset >= nodes.length) {
+ dom.insertAfter(marker, nodes[nodes.length - 1]);
+ } else {
+ container.insertBefore(marker, nodes[offset]);
+ }
+
+ tmpRng.moveToElementText(marker);
+ } else if (container.canHaveHTML) {
+ // Empty node selection for example <div>|</div>
+ // Setting innerHTML with a span marker then remove that marker seems to keep empty block elements open
+ container.innerHTML = '<span></span>';
+ marker = container.firstChild;
+ tmpRng.moveToElementText(marker);
+ tmpRng.collapse(FALSE); // Collapse false works better than true for some odd reason
+ }
+
+ ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng);
+ dom.remove(marker);
+ }
+ }
+
+ // Setup some shorter versions
+ startContainer = rng.startContainer;
+ startOffset = rng.startOffset;
+ endContainer = rng.endContainer;
+ endOffset = rng.endOffset;
+ ieRng = body.createTextRange();
+
+ // If single element selection then try making a control selection out of it
+ if (startContainer == endContainer && startContainer.nodeType == 1) {
+ // Trick to place the caret inside an empty block element like <p></p>
+ if (startOffset == endOffset && !startContainer.hasChildNodes()) {
+ if (startContainer.canHaveHTML) {
+ // Check if previous sibling is an empty block if it is then we need to render it
+ // IE would otherwise move the caret into the sibling instead of the empty startContainer see: #5236
+ // Example this: <p></p><p>|</p> would become this: <p>|</p><p></p>
+ sibling = startContainer.previousSibling;
+ if (sibling && !sibling.hasChildNodes() && dom.isBlock(sibling)) {
+ sibling.innerHTML = '';
+ } else {
+ sibling = null;
+ }
+
+ startContainer.innerHTML = '<span></span><span></span>';
+ ieRng.moveToElementText(startContainer.lastChild);
+ ieRng.select();
+ dom.doc.selection.clear();
+ startContainer.innerHTML = '';
+
+ if (sibling) {
+ sibling.innerHTML = '';
+ }
+ return;
+ } else {
+ startOffset = dom.nodeIndex(startContainer);
+ startContainer = startContainer.parentNode;
+ }
+ }
+
+ if (startOffset == endOffset - 1) {
+ try {
+ ctrlElm = startContainer.childNodes[startOffset];
+ ctrlRng = body.createControlRange();
+ ctrlRng.addElement(ctrlElm);
+ ctrlRng.select();
+
+ // Check if the range produced is on the correct element and is a control range
+ // On IE 8 it will select the parent contentEditable container if you select an inner element see: #5398
+ nativeRng = selection.getRng();
+ if (nativeRng.item && ctrlElm === nativeRng.item(0)) {
+ return;
+ }
+ } catch (ex) {
+ // Ignore
+ }
+ }
+ }
+
+ // Set start/end point of selection
+ setEndPoint(true);
+ setEndPoint();
+
+ // Select the new range and scroll it into view
+ ieRng.select();
+ };
+
+ // Expose range method
+ this.getRangeAt = getRange;
+ }
+
+ return Selection;
+});
+
+// Included from: js/tinymce/classes/util/VK.js
+
+/**
+ * VK.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This file exposes a set of the common KeyCodes for use. Please grow it as needed.
+ */
+define("tinymce/util/VK", [
+ "tinymce/Env"
+], function(Env) {
+ return {
+ BACKSPACE: 8,
+ DELETE: 46,
+ DOWN: 40,
+ ENTER: 13,
+ LEFT: 37,
+ RIGHT: 39,
+ SPACEBAR: 32,
+ TAB: 9,
+ UP: 38,
+
+ modifierPressed: function(e) {
+ return e.shiftKey || e.ctrlKey || e.altKey;
+ },
+
+ metaKeyPressed: function(e) {
+ // Check if ctrl or meta key is pressed also check if alt is false for Polish users
+ return (Env.mac ? e.metaKey : e.ctrlKey) && !e.altKey;
+ }
+ };
+});
+
+// Included from: js/tinymce/classes/dom/ControlSelection.js
+
+/**
+ * ControlSelection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles control selection of elements. Controls are elements
+ * that can be resized and needs to be selected as a whole. It adds custom resize handles
+ * to all browser engines that support properly disabling the built in resize logic.
+ *
+ * @class tinymce.dom.ControlSelection
+ */
+define("tinymce/dom/ControlSelection", [
+ "tinymce/util/VK",
+ "tinymce/util/Tools",
+ "tinymce/Env"
+], function(VK, Tools, Env) {
+ return function(selection, editor) {
+ var dom = editor.dom, each = Tools.each;
+ var selectedElm, selectedElmGhost, resizeHandles, selectedHandle, lastMouseDownEvent;
+ var startX, startY, selectedElmX, selectedElmY, startW, startH, ratio, resizeStarted;
+ var width, height, editableDoc = editor.getDoc(), rootDocument = document, isIE = Env.ie && Env.ie < 11;
+
+ // Details about each resize handle how to scale etc
+ resizeHandles = {
+ // Name: x multiplier, y multiplier, delta size x, delta size y
+ n: [0.5, 0, 0, -1],
+ e: [1, 0.5, 1, 0],
+ s: [0.5, 1, 0, 1],
+ w: [0, 0.5, -1, 0],
+ nw: [0, 0, -1, -1],
+ ne: [1, 0, 1, -1],
+ se: [1, 1, 1, 1],
+ sw: [0, 1, -1, 1]
+ };
+
+ // Add CSS for resize handles, cloned element and selected
+ var rootClass = '.mce-content-body';
+ editor.contentStyles.push(
+ rootClass + ' div.mce-resizehandle {' +
+ 'position: absolute;' +
+ 'border: 1px solid black;' +
+ 'background: #FFF;' +
+ 'width: 5px;' +
+ 'height: 5px;' +
+ 'z-index: 10000' +
+ '}' +
+ rootClass + ' .mce-resizehandle:hover {' +
+ 'background: #000' +
+ '}' +
+ rootClass + ' img[data-mce-selected], hr[data-mce-selected] {' +
+ 'outline: 1px solid black;' +
+ 'resize: none' + // Have been talks about implementing this in browsers
+ '}' +
+ rootClass + ' .mce-clonedresizable {' +
+ 'position: absolute;' +
+ (Env.gecko ? '' : 'outline: 1px dashed black;') + // Gecko produces trails while resizing
+ 'opacity: .5;' +
+ 'filter: alpha(opacity=50);' +
+ 'z-index: 10000' +
+ '}'
+ );
+
+ function isResizable(elm) {
+ if (editor.settings.object_resizing === false) {
+ return false;
+ }
+
+ if (!/TABLE|IMG|DIV/.test(elm.nodeName)) {
+ return false;
+ }
+
+ if (elm.getAttribute('data-mce-resize') === 'false') {
+ return false;
+ }
+
+ return true;
+ }
+
+ function resizeGhostElement(e) {
+ var deltaX, deltaY;
+
+ // Calc new width/height
+ deltaX = e.screenX - startX;
+ deltaY = e.screenY - startY;
+
+ // Calc new size
+ width = deltaX * selectedHandle[2] + startW;
+ height = deltaY * selectedHandle[3] + startH;
+
+ // Never scale down lower than 5 pixels
+ width = width < 5 ? 5 : width;
+ height = height < 5 ? 5 : height;
+
+ // Constrain proportions when modifier key is pressed or if the nw, ne, sw, se corners are moved on an image
+ if (VK.modifierPressed(e) || (selectedElm.nodeName == "IMG" && selectedHandle[2] * selectedHandle[3] !== 0)) {
+ width = Math.round(height / ratio);
+ height = Math.round(width * ratio);
+ }
+
+ // Update ghost size
+ dom.setStyles(selectedElmGhost, {
+ width: width,
+ height: height
+ });
+
+ // Update ghost X position if needed
+ if (selectedHandle[2] < 0 && selectedElmGhost.clientWidth <= width) {
+ dom.setStyle(selectedElmGhost, 'left', selectedElmX + (startW - width));
+ }
+
+ // Update ghost Y position if needed
+ if (selectedHandle[3] < 0 && selectedElmGhost.clientHeight <= height) {
+ dom.setStyle(selectedElmGhost, 'top', selectedElmY + (startH - height));
+ }
+
+ if (!resizeStarted) {
+ editor.fire('ObjectResizeStart', {target: selectedElm, width: startW, height: startH});
+ resizeStarted = true;
+ }
+ }
+
+ function endGhostResize() {
+ resizeStarted = false;
+
+ function setSizeProp(name, value) {
+ if (value) {
+ // Resize by using style or attribute
+ if (selectedElm.style[name] || !editor.schema.isValid(selectedElm.nodeName.toLowerCase(), name)) {
+ dom.setStyle(selectedElm, name, value);
+ } else {
+ dom.setAttrib(selectedElm, name, value);
+ }
+ }
+ }
+
+ // Set width/height properties
+ setSizeProp('width', width);
+ setSizeProp('height', height);
+
+ dom.unbind(editableDoc, 'mousemove', resizeGhostElement);
+ dom.unbind(editableDoc, 'mouseup', endGhostResize);
+
+ if (rootDocument != editableDoc) {
+ dom.unbind(rootDocument, 'mousemove', resizeGhostElement);
+ dom.unbind(rootDocument, 'mouseup', endGhostResize);
+ }
+
+ // Remove ghost and update resize handle positions
+ dom.remove(selectedElmGhost);
+
+ if (!isIE || selectedElm.nodeName == "TABLE") {
+ showResizeRect(selectedElm);
+ }
+
+ editor.fire('ObjectResized', {target: selectedElm, width: width, height: height});
+ editor.nodeChanged();
+ }
+
+ function showResizeRect(targetElm, mouseDownHandleName, mouseDownEvent) {
+ var position, targetWidth, targetHeight, e, rect, offsetParent = editor.getBody();
+
+ // Get position and size of target
+ position = dom.getPos(targetElm, offsetParent);
+ selectedElmX = position.x;
+ selectedElmY = position.y;
+ rect = targetElm.getBoundingClientRect(); // Fix for Gecko offsetHeight for table with caption
+ targetWidth = rect.width || (rect.right - rect.left);
+ targetHeight = rect.height || (rect.bottom - rect.top);
+
+ // Reset width/height if user selects a new image/table
+ if (selectedElm != targetElm) {
+ detachResizeStartListener();
+ selectedElm = targetElm;
+ width = height = 0;
+ }
+
+ // Makes it possible to disable resizing
+ e = editor.fire('ObjectSelected', {target: targetElm});
+
+ if (isResizable(targetElm) && !e.isDefaultPrevented()) {
+ each(resizeHandles, function(handle, name) {
+ var handleElm, handlerContainerElm;
+
+ function startDrag(e) {
+ resizeStarted = true;
+
+ startX = e.screenX;
+ startY = e.screenY;
+ startW = selectedElm.clientWidth;
+ startH = selectedElm.clientHeight;
+ ratio = startH / startW;
+ selectedHandle = handle;
+
+ selectedElmGhost = selectedElm.cloneNode(true);
+ dom.addClass(selectedElmGhost, 'mce-clonedresizable');
+ selectedElmGhost.contentEditable = false; // Hides IE move layer cursor
+ selectedElmGhost.unSelectabe = true;
+ dom.setStyles(selectedElmGhost, {
+ left: selectedElmX,
+ top: selectedElmY,
+ margin: 0
+ });
+
+ selectedElmGhost.removeAttribute('data-mce-selected');
+ editor.getBody().appendChild(selectedElmGhost);
+
+ dom.bind(editableDoc, 'mousemove', resizeGhostElement);
+ dom.bind(editableDoc, 'mouseup', endGhostResize);
+
+ if (rootDocument != editableDoc) {
+ dom.bind(rootDocument, 'mousemove', resizeGhostElement);
+ dom.bind(rootDocument, 'mouseup', endGhostResize);
+ }
+ }
+
+ if (mouseDownHandleName) {
+ // Drag started by IE native resizestart
+ if (name == mouseDownHandleName) {
+ startDrag(mouseDownEvent);
+ }
+
+ return;
+ }
+
+ // Get existing or render resize handle
+ handleElm = dom.get('mceResizeHandle' + name);
+ if (!handleElm) {
+ handlerContainerElm = editor.getBody();
+
+ handleElm = dom.add(handlerContainerElm, 'div', {
+ id: 'mceResizeHandle' + name,
+ 'data-mce-bogus': true,
+ 'class': 'mce-resizehandle',
+ contentEditable: false, // Hides IE move layer cursor
+ unSelectabe: true,
+ style: 'cursor:' + name + '-resize; margin:0; padding:0'
+ });
+
+ dom.bind(handleElm, 'mousedown', function(e) {
+ e.preventDefault();
+ startDrag(e);
+ });
+ } else {
+ dom.show(handleElm);
+ }
+
+ /*
+ var halfHandleW = handleElm.offsetWidth / 2;
+ var halfHandleH = handleElm.offsetHeight / 2;
+
+ // Position element
+ dom.setStyles(handleElm, {
+ left: Math.floor((targetWidth * handle[0] + selectedElmX) - halfHandleW + (handle[2] * halfHandleW)),
+ top: Math.floor((targetHeight * handle[1] + selectedElmY) - halfHandleH + (handle[3] * halfHandleH))
+ });
+ */
+
+ // Position element
+ dom.setStyles(handleElm, {
+ left: (targetWidth * handle[0] + selectedElmX) - (handleElm.offsetWidth / 2),
+ top: (targetHeight * handle[1] + selectedElmY) - (handleElm.offsetHeight / 2)
+ });
+ });
+ } else {
+ hideResizeRect();
+ }
+
+ selectedElm.setAttribute('data-mce-selected', '1');
+ }
+
+ function hideResizeRect() {
+ var name, handleElm;
+
+ if (selectedElm) {
+ selectedElm.removeAttribute('data-mce-selected');
+ }
+
+ for (name in resizeHandles) {
+ handleElm = dom.get('mceResizeHandle' + name);
+ if (handleElm) {
+ dom.unbind(handleElm);
+ dom.remove(handleElm);
+ }
+ }
+ }
+
+ function updateResizeRect(e) {
+ var controlElm;
+
+ function isChildOrEqual(node, parent) {
+ do {
+ if (node === parent) {
+ return true;
+ }
+ } while ((node = node.parentNode));
+ }
+
+ // Remove data-mce-selected from all elements since they might have been copied using Ctrl+c/v
+ each(dom.select('img[data-mce-selected],hr[data-mce-selected]'), function(img) {
+ img.removeAttribute('data-mce-selected');
+ });
+
+ controlElm = e.type == 'mousedown' ? e.target : selection.getNode();
+ controlElm = dom.getParent(controlElm, isIE ? 'table' : 'table,img,hr');
+
+ if (controlElm) {
+ disableGeckoResize();
+
+ if (isChildOrEqual(selection.getStart(), controlElm) && isChildOrEqual(selection.getEnd(), controlElm)) {
+ if (!isIE || (controlElm != selection.getStart() && selection.getStart().nodeName !== 'IMG')) {
+ showResizeRect(controlElm);
+ return;
+ }
+ }
+ }
+
+ hideResizeRect();
+ }
+
+ function attachEvent(elm, name, func) {
+ if (elm && elm.attachEvent) {
+ elm.attachEvent('on' + name, func);
+ }
+ }
+
+ function detachEvent(elm, name, func) {
+ if (elm && elm.detachEvent) {
+ elm.detachEvent('on' + name, func);
+ }
+ }
+
+ function resizeNativeStart(e) {
+ var target = e.srcElement, pos, name, corner, cornerX, cornerY, relativeX, relativeY;
+
+ pos = target.getBoundingClientRect();
+ relativeX = lastMouseDownEvent.clientX - pos.left;
+ relativeY = lastMouseDownEvent.clientY - pos.top;
+
+ // Figure out what corner we are draging on
+ for (name in resizeHandles) {
+ corner = resizeHandles[name];
+
+ cornerX = target.offsetWidth * corner[0];
+ cornerY = target.offsetHeight * corner[1];
+
+ if (Math.abs(cornerX - relativeX) < 8 && Math.abs(cornerY - relativeY) < 8) {
+ selectedHandle = corner;
+ break;
+ }
+ }
+
+ // Remove native selection and let the magic begin
+ resizeStarted = true;
+ editor.getDoc().selection.empty();
+ showResizeRect(target, name, lastMouseDownEvent);
+ }
+
+ function nativeControlSelect(e) {
+ var target = e.srcElement;
+
+ if (target != selectedElm) {
+ detachResizeStartListener();
+
+ if (target.id.indexOf('mceResizeHandle') === 0) {
+ e.returnValue = false;
+ return;
+ }
+
+ if (target.nodeName == 'IMG' || target.nodeName == 'TABLE') {
+ hideResizeRect();
+ selectedElm = target;
+ attachEvent(target, 'resizestart', resizeNativeStart);
+ }
+ }
+ }
+
+ function detachResizeStartListener() {
+ detachEvent(selectedElm, 'resizestart', resizeNativeStart);
+ }
+
+ function disableGeckoResize() {
+ try {
+ // Disable object resizing on Gecko
+ editor.getDoc().execCommand('enableObjectResizing', false, false);
+ } catch (ex) {
+ // Ignore
+ }
+ }
+
+ function controlSelect(elm) {
+ var ctrlRng;
+
+ if (!isIE) {
+ return;
+ }
+
+ ctrlRng = editableDoc.body.createControlRange();
+
+ try {
+ ctrlRng.addElement(elm);
+ ctrlRng.select();
+ return true;
+ } catch (ex) {
+ // Ignore since the element can't be control selected for example a P tag
+ }
+ }
+
+ editor.on('init', function() {
+ if (isIE) {
+ // Hide the resize rect on resize and reselect the image
+ editor.on('ObjectResized', function(e) {
+ if (e.target.nodeName != 'TABLE') {
+ hideResizeRect();
+ controlSelect(e.target);
+ }
+ });
+
+ attachEvent(editor.getBody(), 'controlselect', nativeControlSelect);
+
+ editor.on('mousedown', function(e) {
+ lastMouseDownEvent = e;
+ });
+ } else {
+ disableGeckoResize();
+
+ if (Env.ie >= 11) {
+ // TODO: Drag/drop doesn't work
+ editor.on('mouseup', function(e) {
+ var nodeName = e.target.nodeName;
+
+ if (/^(TABLE|IMG|HR)$/.test(nodeName)) {
+ editor.selection.select(e.target, nodeName == 'TABLE');
+ editor.nodeChanged();
+ }
+ });
+
+ editor.dom.bind(editor.getBody(), 'mscontrolselect', function(e) {
+ if (/^(TABLE|IMG|HR)$/.test(e.target.nodeName)) {
+ e.preventDefault();
+ }
+ });
+ }
+ }
+
+ editor.on('nodechange mousedown mouseup ResizeEditor', updateResizeRect);
+
+ // Update resize rect while typing in a table
+ editor.on('keydown keyup', function(e) {
+ if (selectedElm && selectedElm.nodeName == "TABLE") {
+ updateResizeRect(e);
+ }
+ });
+
+ // Hide rect on focusout since it would float on top of windows otherwise
+ //editor.on('focusout', hideResizeRect);
+ });
+
+ function destroy() {
+ selectedElm = selectedElmGhost = null;
+
+ if (isIE) {
+ detachResizeStartListener();
+ detachEvent(editor.getBody(), 'controlselect', nativeControlSelect);
+ }
+ }
+
+ return {
+ controlSelect: controlSelect,
+ destroy: destroy
+ };
+ };
+});
+
+// Included from: js/tinymce/classes/dom/Selection.js
+
+/**
+ * Selection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles text and control selection it's an crossbrowser utility class.
+ * Consult the TinyMCE Wiki API for more details and examples on how to use this class.
+ *
+ * @class tinymce.dom.Selection
+ * @example
+ * // Getting the currently selected node for the active editor
+ * alert(tinymce.activeEditor.selection.getNode().nodeName);
+ */
+define("tinymce/dom/Selection", [
+ "tinymce/dom/TreeWalker",
+ "tinymce/dom/TridentSelection",
+ "tinymce/dom/ControlSelection",
+ "tinymce/Env",
+ "tinymce/util/Tools"
+], function(TreeWalker, TridentSelection, ControlSelection, Env, Tools) {
+ var each = Tools.each, grep = Tools.grep, trim = Tools.trim;
+ var isIE = Env.ie, isOpera = Env.opera;
+
+ /**
+ * Constructs a new selection instance.
+ *
+ * @constructor
+ * @method Selection
+ * @param {tinymce.dom.DOMUtils} dom DOMUtils object reference.
+ * @param {Window} win Window to bind the selection object to.
+ * @param {tinymce.dom.Serializer} serializer DOM serialization class to use for getContent.
+ */
+ function Selection(dom, win, serializer, editor) {
+ var self = this;
+
+ self.dom = dom;
+ self.win = win;
+ self.serializer = serializer;
+ self.editor = editor;
+
+ self.controlSelection = new ControlSelection(self, editor);
+
+ // No W3C Range support
+ if (!self.win.getSelection) {
+ self.tridentSel = new TridentSelection(self);
+ }
+ }
+
+ Selection.prototype = {
+ /**
+ * Move the selection cursor range to the specified node and offset.
+ * If there is no node specified it will move it to the first suitable location within the body.
+ *
+ * @method setCursorLocation
+ * @param {Node} node Optional node to put the cursor in.
+ * @param {Number} offset Optional offset from the start of the node to put the cursor at.
+ */
+ setCursorLocation: function(node, offset) {
+ var self = this, rng = self.dom.createRng();
+
+ if (!node) {
+ self._moveEndPoint(rng, self.editor.getBody(), true);
+ self.setRng(rng);
+ } else {
+ rng.setStart(node, offset);
+ rng.setEnd(node, offset);
+ self.setRng(rng);
+ self.collapse(false);
+ }
+ },
+
+ /**
+ * Returns the selected contents using the DOM serializer passed in to this class.
+ *
+ * @method getContent
+ * @param {Object} s Optional settings class with for example output format text or html.
+ * @return {String} Selected contents in for example HTML format.
+ * @example
+ * // Alerts the currently selected contents
+ * alert(tinymce.activeEditor.selection.getContent());
+ *
+ * // Alerts the currently selected contents as plain text
+ * alert(tinymce.activeEditor.selection.getContent({format: 'text'}));
+ */
+ getContent: function(args) {
+ var self = this, rng = self.getRng(), tmpElm = self.dom.create("body");
+ var se = self.getSel(), whiteSpaceBefore, whiteSpaceAfter, fragment;
+
+ args = args || {};
+ whiteSpaceBefore = whiteSpaceAfter = '';
+ args.get = true;
+ args.format = args.format || 'html';
+ args.selection = true;
+ self.editor.fire('BeforeGetContent', args);
+
+ if (args.format == 'text') {
+ return self.isCollapsed() ? '' : (rng.text || (se.toString ? se.toString() : ''));
+ }
+
+ if (rng.cloneContents) {
+ fragment = rng.cloneContents();
+
+ if (fragment) {
+ tmpElm.appendChild(fragment);
+ }
+ } else if (rng.item !== undefined || rng.htmlText !== undefined) {
+ // IE will produce invalid markup if elements are present that
+ // it doesn't understand like custom elements or HTML5 elements.
+ // Adding a BR in front of the contents and then remoiving it seems to fix it though.
+ tmpElm.innerHTML = '<br>' + (rng.item ? rng.item(0).outerHTML : rng.htmlText);
+ tmpElm.removeChild(tmpElm.firstChild);
+ } else {
+ tmpElm.innerHTML = rng.toString();
+ }
+
+ // Keep whitespace before and after
+ if (/^\s/.test(tmpElm.innerHTML)) {
+ whiteSpaceBefore = ' ';
+ }
+
+ if (/\s+$/.test(tmpElm.innerHTML)) {
+ whiteSpaceAfter = ' ';
+ }
+
+ args.getInner = true;
+
+ args.content = self.isCollapsed() ? '' : whiteSpaceBefore + self.serializer.serialize(tmpElm, args) + whiteSpaceAfter;
+ self.editor.fire('GetContent', args);
+
+ return args.content;
+ },
+
+ /**
+ * Sets the current selection to the specified content. If any contents is selected it will be replaced
+ * with the contents passed in to this function. If there is no selection the contents will be inserted
+ * where the caret is placed in the editor/page.
+ *
+ * @method setContent
+ * @param {String} content HTML contents to set could also be other formats depending on settings.
+ * @param {Object} args Optional settings object with for example data format.
+ * @example
+ * // Inserts some HTML contents at the current selection
+ * tinymce.activeEditor.selection.setContent('<strong>Some contents</strong>');
+ */
+ setContent: function(content, args) {
+ var self = this, rng = self.getRng(), caretNode, doc = self.win.document, frag, temp;
+
+ args = args || {format: 'html'};
+ args.set = true;
+ args.selection = true;
+ content = args.content = content;
+
+ // Dispatch before set content event
+ if (!args.no_events) {
+ self.editor.fire('BeforeSetContent', args);
+ }
+
+ content = args.content;
+
+ if (rng.insertNode) {
+ // Make caret marker since insertNode places the caret in the beginning of text after insert
+ content += '<span id="__caret">_</span>';
+
+ // Delete and insert new node
+ if (rng.startContainer == doc && rng.endContainer == doc) {
+ // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents
+ doc.body.innerHTML = content;
+ } else {
+ rng.deleteContents();
+
+ if (doc.body.childNodes.length === 0) {
+ doc.body.innerHTML = content;
+ } else {
+ // createContextualFragment doesn't exists in IE 9 DOMRanges
+ if (rng.createContextualFragment) {
+ rng.insertNode(rng.createContextualFragment(content));
+ } else {
+ // Fake createContextualFragment call in IE 9
+ frag = doc.createDocumentFragment();
+ temp = doc.createElement('div');
+
+ frag.appendChild(temp);
+ temp.outerHTML = content;
+
+ rng.insertNode(frag);
+ }
+ }
+ }
+
+ // Move to caret marker
+ caretNode = self.dom.get('__caret');
+
+ // Make sure we wrap it compleatly, Opera fails with a simple select call
+ rng = doc.createRange();
+ rng.setStartBefore(caretNode);
+ rng.setEndBefore(caretNode);
+ self.setRng(rng);
+
+ // Remove the caret position
+ self.dom.remove('__caret');
+
+ try {
+ self.setRng(rng);
+ } catch (ex) {
+ // Might fail on Opera for some odd reason
+ }
+ } else {
+ if (rng.item) {
+ // Delete content and get caret text selection
+ doc.execCommand('Delete', false, null);
+ rng = self.getRng();
+ }
+
+ // Explorer removes spaces from the beginning of pasted contents
+ if (/^\s+/.test(content)) {
+ rng.pasteHTML('<span id="__mce_tmp">_</span>' + content);
+ self.dom.remove('__mce_tmp');
+ } else {
+ rng.pasteHTML(content);
+ }
+ }
+
+ // Dispatch set content event
+ if (!args.no_events) {
+ self.editor.fire('SetContent', args);
+ }
+ },
+
+ /**
+ * Returns the start element of a selection range. If the start is in a text
+ * node the parent element will be returned.
+ *
+ * @method getStart
+ * @return {Element} Start element of selection range.
+ */
+ getStart: function() {
+ var self = this, rng = self.getRng(), startElement, parentElement, checkRng, node;
+
+ if (rng.duplicate || rng.item) {
+ // Control selection, return first item
+ if (rng.item) {
+ return rng.item(0);
+ }
+
+ // Get start element
+ checkRng = rng.duplicate();
+ checkRng.collapse(1);
+ startElement = checkRng.parentElement();
+ if (startElement.ownerDocument !== self.dom.doc) {
+ startElement = self.dom.getRoot();
+ }
+
+ // Check if range parent is inside the start element, then return the inner parent element
+ // This will fix issues when a single element is selected, IE would otherwise return the wrong start element
+ parentElement = node = rng.parentElement();
+ while ((node = node.parentNode)) {
+ if (node == startElement) {
+ startElement = parentElement;
+ break;
+ }
+ }
+
+ return startElement;
+ } else {
+ startElement = rng.startContainer;
+
+ if (startElement.nodeType == 1 && startElement.hasChildNodes()) {
+ startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)];
+ }
+
+ if (startElement && startElement.nodeType == 3) {
+ return startElement.parentNode;
+ }
+
+ return startElement;
+ }
+ },
+
+ /**
+ * Returns the end element of a selection range. If the end is in a text
+ * node the parent element will be returned.
+ *
+ * @method getEnd
+ * @return {Element} End element of selection range.
+ */
+ getEnd: function() {
+ var self = this, rng = self.getRng(), endElement, endOffset;
+
+ if (rng.duplicate || rng.item) {
+ if (rng.item) {
+ return rng.item(0);
+ }
+
+ rng = rng.duplicate();
+ rng.collapse(0);
+ endElement = rng.parentElement();
+ if (endElement.ownerDocument !== self.dom.doc) {
+ endElement = self.dom.getRoot();
+ }
+
+ if (endElement && endElement.nodeName == 'BODY') {
+ return endElement.lastChild || endElement;
+ }
+
+ return endElement;
+ } else {
+ endElement = rng.endContainer;
+ endOffset = rng.endOffset;
+
+ if (endElement.nodeType == 1 && endElement.hasChildNodes()) {
+ endElement = endElement.childNodes[endOffset > 0 ? endOffset - 1 : endOffset];
+ }
+
+ if (endElement && endElement.nodeType == 3) {
+ return endElement.parentNode;
+ }
+
+ return endElement;
+ }
+ },
+
+ /**
+ * Returns a bookmark location for the current selection. This bookmark object
+ * can then be used to restore the selection after some content modification to the document.
+ *
+ * @method getBookmark
+ * @param {Number} type Optional state if the bookmark should be simple or not. Default is complex.
+ * @param {Boolean} normalized Optional state that enables you to get a position that it would be after normalization.
+ * @return {Object} Bookmark object, use moveToBookmark with this object to restore the selection.
+ * @example
+ * // Stores a bookmark of the current selection
+ * var bm = tinymce.activeEditor.selection.getBookmark();
+ *
+ * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
+ *
+ * // Restore the selection bookmark
+ * tinymce.activeEditor.selection.moveToBookmark(bm);
+ */
+ getBookmark: function(type, normalized) {
+ var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, chr = '', styles;
+
+ function findIndex(name, element) {
+ var index = 0;
+
+ each(dom.select(name), function(node, i) {
+ if (node == element) {
+ index = i;
+ }
+ });
+
+ return index;
+ }
+
+ function normalizeTableCellSelection(rng) {
+ function moveEndPoint(start) {
+ var container, offset, childNodes, prefix = start ? 'start' : 'end';
+
+ container = rng[prefix + 'Container'];
+ offset = rng[prefix + 'Offset'];
+
+ if (container.nodeType == 1 && container.nodeName == "TR") {
+ childNodes = container.childNodes;
+ container = childNodes[Math.min(start ? offset : offset - 1, childNodes.length - 1)];
+ if (container) {
+ offset = start ? 0 : container.childNodes.length;
+ rng['set' + (start ? 'Start' : 'End')](container, offset);
+ }
+ }
+ }
+
+ moveEndPoint(true);
+ moveEndPoint();
+
+ return rng;
+ }
+
+ function getLocation() {
+ var rng = t.getRng(true), root = dom.getRoot(), bookmark = {};
+
+ function getPoint(rng, start) {
+ var container = rng[start ? 'startContainer' : 'endContainer'],
+ offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0;
+
+ if (container.nodeType == 3) {
+ if (normalized) {
+ for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) {
+ offset += node.nodeValue.length;
+ }
+ }
+
+ point.push(offset);
+ } else {
+ childNodes = container.childNodes;
+
+ if (offset >= childNodes.length && childNodes.length) {
+ after = 1;
+ offset = Math.max(0, childNodes.length - 1);
+ }
+
+ point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after);
+ }
+
+ for (; container && container != root; container = container.parentNode) {
+ point.push(t.dom.nodeIndex(container, normalized));
+ }
+
+ return point;
+ }
+
+ bookmark.start = getPoint(rng, true);
+
+ if (!t.isCollapsed()) {
+ bookmark.end = getPoint(rng);
+ }
+
+ return bookmark;
+ }
+
+ if (type == 2) {
+ element = t.getNode();
+ name = element.nodeName;
+
+ if (name == 'IMG') {
+ return {name: name, index: findIndex(name, element)};
+ }
+
+ if (t.tridentSel) {
+ return t.tridentSel.getBookmark(type);
+ }
+
+ return getLocation();
+ }
+
+ // Handle simple range
+ if (type) {
+ return {rng: t.getRng()};
+ }
+
+ rng = t.getRng();
+ id = dom.uniqueId();
+ collapsed = t.isCollapsed();
+ styles = 'overflow:hidden;line-height:0px';
+
+ // Explorer method
+ if (rng.duplicate || rng.item) {
+ // Text selection
+ if (!rng.item) {
+ rng2 = rng.duplicate();
+
+ try {
+ // Insert start marker
+ rng.collapse();
+ rng.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_start" style="' + styles + '">' + chr + '</span>');
+
+ // Insert end marker
+ if (!collapsed) {
+ rng2.collapse(false);
+
+ // Detect the empty space after block elements in IE and move the
+ // end back one character <p></p>] becomes <p>]</p>
+ rng.moveToElementText(rng2.parentElement());
+ if (rng.compareEndPoints('StartToEnd', rng2) === 0) {
+ rng2.move('character', -1);
+ }
+
+ rng2.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_end" style="' + styles + '">' + chr + '</span>');
+ }
+ } catch (ex) {
+ // IE might throw unspecified error so lets ignore it
+ return null;
+ }
+ } else {
+ // Control selection
+ element = rng.item(0);
+ name = element.nodeName;
+
+ return {name: name, index: findIndex(name, element)};
+ }
+ } else {
+ element = t.getNode();
+ name = element.nodeName;
+ if (name == 'IMG') {
+ return {name: name, index: findIndex(name, element)};
+ }
+
+ // W3C method
+ rng2 = normalizeTableCellSelection(rng.cloneRange());
+
+ // Insert end marker
+ if (!collapsed) {
+ rng2.collapse(false);
+ rng2.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_end', style: styles}, chr));
+ }
+
+ rng = normalizeTableCellSelection(rng);
+ rng.collapse(true);
+ rng.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_start', style: styles}, chr));
+ }
+
+ t.moveToBookmark({id: id, keep: 1});
+
+ return {id: id};
+ },
+
+ /**
+ * Restores the selection to the specified bookmark.
+ *
+ * @method moveToBookmark
+ * @param {Object} bookmark Bookmark to restore selection from.
+ * @return {Boolean} true/false if it was successful or not.
+ * @example
+ * // Stores a bookmark of the current selection
+ * var bm = tinymce.activeEditor.selection.getBookmark();
+ *
+ * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');
+ *
+ * // Restore the selection bookmark
+ * tinymce.activeEditor.selection.moveToBookmark(bm);
+ */
+ moveToBookmark: function(bookmark) {
+ var t = this, dom = t.dom, rng, root, startContainer, endContainer, startOffset, endOffset;
+
+ function setEndPoint(start) {
+ var point = bookmark[start ? 'start' : 'end'], i, node, offset, children;
+
+ if (point) {
+ offset = point[0];
+
+ // Find container node
+ for (node = root, i = point.length - 1; i >= 1; i--) {
+ children = node.childNodes;
+
+ if (point[i] > children.length - 1) {
+ return;
+ }
+
+ node = children[point[i]];
+ }
+
+ // Move text offset to best suitable location
+ if (node.nodeType === 3) {
+ offset = Math.min(point[0], node.nodeValue.length);
+ }
+
+ // Move element offset to best suitable location
+ if (node.nodeType === 1) {
+ offset = Math.min(point[0], node.childNodes.length);
+ }
+
+ // Set offset within container node
+ if (start) {
+ rng.setStart(node, offset);
+ } else {
+ rng.setEnd(node, offset);
+ }
+ }
+
+ return true;
+ }
+
+ function restoreEndPoint(suffix) {
+ var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep;
+
+ if (marker) {
+ node = marker.parentNode;
+
+ if (suffix == 'start') {
+ if (!keep) {
+ idx = dom.nodeIndex(marker);
+ } else {
+ node = marker.firstChild;
+ idx = 1;
+ }
+
+ startContainer = endContainer = node;
+ startOffset = endOffset = idx;
+ } else {
+ if (!keep) {
+ idx = dom.nodeIndex(marker);
+ } else {
+ node = marker.firstChild;
+ idx = 1;
+ }
+
+ endContainer = node;
+ endOffset = idx;
+ }
+
+ if (!keep) {
+ prev = marker.previousSibling;
+ next = marker.nextSibling;
+
+ // Remove all marker text nodes
+ each(grep(marker.childNodes), function(node) {
+ if (node.nodeType == 3) {
+ node.nodeValue = node.nodeValue.replace(/\uFEFF/g, '');
+ }
+ });
+
+ // Remove marker but keep children if for example contents where inserted into the marker
+ // Also remove duplicated instances of the marker for example by a
+ // split operation or by WebKit auto split on paste feature
+ while ((marker = dom.get(bookmark.id + '_' + suffix))) {
+ dom.remove(marker, 1);
+ }
+
+ // If siblings are text nodes then merge them unless it's Opera since it some how removes the node
+ // and we are sniffing since adding a lot of detection code for a browser with 3% of the market
+ // isn't worth the effort. Sorry, Opera but it's just a fact
+ if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !isOpera) {
+ idx = prev.nodeValue.length;
+ prev.appendData(next.nodeValue);
+ dom.remove(next);
+
+ if (suffix == 'start') {
+ startContainer = endContainer = prev;
+ startOffset = endOffset = idx;
+ } else {
+ endContainer = prev;
+ endOffset = idx;
+ }
+ }
+ }
+ }
+ }
+
+ function addBogus(node) {
+ // Adds a bogus BR element for empty block elements
+ if (dom.isBlock(node) && !node.innerHTML && !isIE) {
+ node.innerHTML = '<br data-mce-bogus="1" />';
+ }
+
+ return node;
+ }
+
+ if (bookmark) {
+ if (bookmark.start) {
+ rng = dom.createRng();
+ root = dom.getRoot();
+
+ if (t.tridentSel) {
+ return t.tridentSel.moveToBookmark(bookmark);
+ }
+
+ if (setEndPoint(true) && setEndPoint()) {
+ t.setRng(rng);
+ }
+ } else if (bookmark.id) {
+ // Restore start/end points
+ restoreEndPoint('start');
+ restoreEndPoint('end');
+
+ if (startContainer) {
+ rng = dom.createRng();
+ rng.setStart(addBogus(startContainer), startOffset);
+ rng.setEnd(addBogus(endContainer), endOffset);
+ t.setRng(rng);
+ }
+ } else if (bookmark.name) {
+ t.select(dom.select(bookmark.name)[bookmark.index]);
+ } else if (bookmark.rng) {
+ t.setRng(bookmark.rng);
+ }
+ }
+ },
+
+ /**
+ * Selects the specified element. This will place the start and end of the selection range around the element.
+ *
+ * @method select
+ * @param {Element} node HMTL DOM element to select.
+ * @param {Boolean} content Optional bool state if the contents should be selected or not on non IE browser.
+ * @return {Element} Selected element the same element as the one that got passed in.
+ * @example
+ * // Select the first paragraph in the active editor
+ * tinymce.activeEditor.selection.select(tinymce.activeEditor.dom.select('p')[0]);
+ */
+ select: function(node, content) {
+ var self = this, dom = self.dom, rng = dom.createRng(), idx;
+
+ // Clear stored range set by FocusManager
+ self.lastFocusBookmark = null;
+
+ if (node) {
+ if (!content && self.controlSelection.controlSelect(node)) {
+ return;
+ }
+
+ idx = dom.nodeIndex(node);
+ rng.setStart(node.parentNode, idx);
+ rng.setEnd(node.parentNode, idx + 1);
+
+ // Find first/last text node or BR element
+ if (content) {
+ self._moveEndPoint(rng, node, true);
+ self._moveEndPoint(rng, node);
+ }
+
+ self.setRng(rng);
+ }
+
+ return node;
+ },
+
+ /**
+ * Returns true/false if the selection range is collapsed or not. Collapsed means if it's a caret or a larger selection.
+ *
+ * @method isCollapsed
+ * @return {Boolean} true/false state if the selection range is collapsed or not.
+ * Collapsed means if it's a caret or a larger selection.
+ */
+ isCollapsed: function() {
+ var self = this, rng = self.getRng(), sel = self.getSel();
+
+ if (!rng || rng.item) {
+ return false;
+ }
+
+ if (rng.compareEndPoints) {
+ return rng.compareEndPoints('StartToEnd', rng) === 0;
+ }
+
+ return !sel || rng.collapsed;
+ },
+
+ /**
+ * Collapse the selection to start or end of range.
+ *
+ * @method collapse
+ * @param {Boolean} to_start Optional boolean state if to collapse to end or not. Defaults to start.
+ */
+ collapse: function(to_start) {
+ var self = this, rng = self.getRng(), node;
+
+ // Control range on IE
+ if (rng.item) {
+ node = rng.item(0);
+ rng = self.win.document.body.createTextRange();
+ rng.moveToElementText(node);
+ }
+
+ rng.collapse(!!to_start);
+ self.setRng(rng);
+ },
+
+ /**
+ * Returns the browsers internal selection object.
+ *
+ * @method getSel
+ * @return {Selection} Internal browser selection object.
+ */
+ getSel: function() {
+ var win = this.win;
+
+ return win.getSelection ? win.getSelection() : win.document.selection;
+ },
+
+ /**
+ * Returns the browsers internal range object.
+ *
+ * @method getRng
+ * @param {Boolean} w3c Forces a compatible W3C range on IE.
+ * @return {Range} Internal browser range object.
+ * @see http://www.quirksmode.org/dom/range_intro.html
+ * @see http://www.dotvoid.com/2001/03/using-the-range-object-in-mozilla/
+ */
+ getRng: function(w3c) {
+ var self = this, selection, rng, elm, doc = self.win.document, ieRng;
+
+ // Use last rng passed from FocusManager if it's available this enables
+ // calls to editor.selection.getStart() to work when caret focus is lost on IE
+ if (!w3c && self.lastFocusBookmark) {
+ var bookmark = self.lastFocusBookmark;
+
+ // Convert bookmark to range IE 11 fix
+ if (bookmark.startContainer) {
+ rng = doc.createRange();
+ rng.setStart(bookmark.startContainer, bookmark.startOffset);
+ rng.setEnd(bookmark.endContainer, bookmark.endOffset);
+ } else {
+ rng = bookmark;
+ }
+
+ return rng;
+ }
+
+ // Found tridentSel object then we need to use that one
+ if (w3c && self.tridentSel) {
+ return self.tridentSel.getRangeAt(0);
+ }
+
+ try {
+ if ((selection = self.getSel())) {
+ if (selection.rangeCount > 0) {
+ rng = selection.getRangeAt(0);
+ } else {
+ rng = selection.createRange ? selection.createRange() : doc.createRange();
+ }
+ }
+ } catch (ex) {
+ // IE throws unspecified error here if TinyMCE is placed in a frame/iframe
+ }
+
+ // We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet
+ if (isIE && rng && rng.setStart) {
+ try {
+ // IE will sometimes throw an exception here
+ ieRng = doc.selection.createRange();
+ } catch (ex) {
+
+ }
+
+ if (ieRng && ieRng.item) {
+ elm = ieRng.item(0);
+ rng = doc.createRange();
+ rng.setStartBefore(elm);
+ rng.setEndAfter(elm);
+ }
+ }
+
+ // No range found then create an empty one
+ // This can occur when the editor is placed in a hidden container element on Gecko
+ // Or on IE when there was an exception
+ if (!rng) {
+ rng = doc.createRange ? doc.createRange() : doc.body.createTextRange();
+ }
+
+ // If range is at start of document then move it to start of body
+ if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) {
+ elm = self.dom.getRoot();
+ rng.setStart(elm, 0);
+ rng.setEnd(elm, 0);
+ }
+
+ if (self.selectedRange && self.explicitRange) {
+ if (rng.compareBoundaryPoints(rng.START_TO_START, self.selectedRange) === 0 &&
+ rng.compareBoundaryPoints(rng.END_TO_END, self.selectedRange) === 0) {
+ // Safari, Opera and Chrome only ever select text which causes the range to change.
+ // This lets us use the originally set range if the selection hasn't been changed by the user.
+ rng = self.explicitRange;
+ } else {
+ self.selectedRange = null;
+ self.explicitRange = null;
+ }
+ }
+
+ return rng;
+ },
+
+ /**
+ * Changes the selection to the specified DOM range.
+ *
+ * @method setRng
+ * @param {Range} rng Range to select.
+ */
+ setRng: function(rng, forward) {
+ var self = this, sel;
+
+ // Is IE specific range
+ if (rng.select) {
+ try {
+ rng.select();
+ } catch (ex) {
+ // Needed for some odd IE bug #1843306
+ }
+
+ return;
+ }
+
+ if (!self.tridentSel) {
+ sel = self.getSel();
+
+ if (sel) {
+ self.explicitRange = rng;
+
+ try {
+ sel.removeAllRanges();
+ sel.addRange(rng);
+ } catch (ex) {
+ // IE might throw errors here if the editor is within a hidden container and selection is changed
+ }
+
+ // Forward is set to false and we have an extend function
+ if (forward === false && sel.extend) {
+ sel.collapse(rng.endContainer, rng.endOffset);
+ sel.extend(rng.startContainer, rng.startOffset);
+ }
+
+ // adding range isn't always successful so we need to check range count otherwise an exception can occur
+ self.selectedRange = sel.rangeCount > 0 ? sel.getRangeAt(0) : null;
+ }
+ } else {
+ // Is W3C Range fake range on IE
+ if (rng.cloneRange) {
+ try {
+ self.tridentSel.addRange(rng);
+ return;
+ } catch (ex) {
+ //IE9 throws an error here if called before selection is placed in the editor
+ }
+ }
+ }
+ },
+
+ /**
+ * Sets the current selection to the specified DOM element.
+ *
+ * @method setNode
+ * @param {Element} elm Element to set as the contents of the selection.
+ * @return {Element} Returns the element that got passed in.
+ * @example
+ * // Inserts a DOM node at current selection/caret location
+ * tinymce.activeEditor.selection.setNode(tinymce.activeEditor.dom.create('img', {src: 'some.gif', title: 'some title'}));
+ */
+ setNode: function(elm) {
+ var self = this;
+
+ self.setContent(self.dom.getOuterHTML(elm));
+
+ return elm;
+ },
+
+ /**
+ * Returns the currently selected element or the common ancestor element for both start and end of the selection.
+ *
+ * @method getNode
+ * @return {Element} Currently selected element or common ancestor element.
+ * @example
+ * // Alerts the currently selected elements node name
+ * alert(tinymce.activeEditor.selection.getNode().nodeName);
+ */
+ getNode: function() {
+ var self = this, rng = self.getRng(), elm;
+ var startContainer = rng.startContainer, endContainer = rng.endContainer;
+ var startOffset = rng.startOffset, endOffset = rng.endOffset, root = self.dom.getRoot();
+
+ function skipEmptyTextNodes(node, forwards) {
+ var orig = node;
+
+ while (node && node.nodeType === 3 && node.length === 0) {
+ node = forwards ? node.nextSibling : node.previousSibling;
+ }
+
+ return node || orig;
+ }
+
+ // Range maybe lost after the editor is made visible again
+ if (!rng) {
+ return root;
+ }
+
+ if (rng.setStart) {
+ elm = rng.commonAncestorContainer;
+
+ // Handle selection a image or other control like element such as anchors
+ if (!rng.collapsed) {
+ if (startContainer == endContainer) {
+ if (endOffset - startOffset < 2) {
+ if (startContainer.hasChildNodes()) {
+ elm = startContainer.childNodes[startOffset];
+ }
+ }
+ }
+
+ // If the anchor node is a element instead of a text node then return this element
+ //if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1)
+ // return sel.anchorNode.childNodes[sel.anchorOffset];
+
+ // Handle cases where the selection is immediately wrapped around a node and return that node instead of it's parent.
+ // This happens when you double click an underlined word in FireFox.
+ if (startContainer.nodeType === 3 && endContainer.nodeType === 3) {
+ if (startContainer.length === startOffset) {
+ startContainer = skipEmptyTextNodes(startContainer.nextSibling, true);
+ } else {
+ startContainer = startContainer.parentNode;
+ }
+
+ if (endOffset === 0) {
+ endContainer = skipEmptyTextNodes(endContainer.previousSibling, false);
+ } else {
+ endContainer = endContainer.parentNode;
+ }
+
+ if (startContainer && startContainer === endContainer) {
+ return startContainer;
+ }
+ }
+ }
+
+ if (elm && elm.nodeType == 3) {
+ return elm.parentNode;
+ }
+
+ return elm;
+ }
+
+ elm = rng.item ? rng.item(0) : rng.parentElement();
+
+ // IE 7 might return elements outside the iframe
+ if (elm.ownerDocument !== self.win.document) {
+ elm = root;
+ }
+
+ return elm;
+ },
+
+ getSelectedBlocks: function(startElm, endElm) {
+ var self = this, dom = self.dom, node, root, selectedBlocks = [];
+
+ root = dom.getRoot();
+ startElm = dom.getParent(startElm || self.getStart(), dom.isBlock);
+ endElm = dom.getParent(endElm || self.getEnd(), dom.isBlock);
+
+ if (startElm && startElm != root) {
+ selectedBlocks.push(startElm);
+ }
+
+ if (startElm && endElm && startElm != endElm) {
+ node = startElm;
+
+ var walker = new TreeWalker(startElm, root);
+ while ((node = walker.next()) && node != endElm) {
+ if (dom.isBlock(node)) {
+ selectedBlocks.push(node);
+ }
+ }
+ }
+
+ if (endElm && startElm != endElm && endElm != root) {
+ selectedBlocks.push(endElm);
+ }
+
+ return selectedBlocks;
+ },
+
+ isForward: function(){
+ var dom = this.dom, sel = this.getSel(), anchorRange, focusRange;
+
+ // No support for selection direction then always return true
+ if (!sel || !sel.anchorNode || !sel.focusNode) {
+ return true;
+ }
+
+ anchorRange = dom.createRng();
+ anchorRange.setStart(sel.anchorNode, sel.anchorOffset);
+ anchorRange.collapse(true);
+
+ focusRange = dom.createRng();
+ focusRange.setStart(sel.focusNode, sel.focusOffset);
+ focusRange.collapse(true);
+
+ return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0;
+ },
+
+ normalize: function() {
+ var self = this, rng, normalized, collapsed;
+
+ function normalizeEndPoint(start) {
+ var container, offset, walker, dom = self.dom, body = dom.getRoot(), node, nonEmptyElementsMap, nodeName;
+ var directionLeft;
+
+ function hasBrBeforeAfter(node, left) {
+ var walker = new TreeWalker(node, dom.getParent(node.parentNode, dom.isBlock) || body);
+
+ while ((node = walker[left ? 'prev' : 'next']())) {
+ if (node.nodeName === "BR") {
+ return true;
+ }
+ }
+ }
+
+ function isPrevNode(node, name) {
+ return node.previousSibling && node.previousSibling.nodeName == name;
+ }
+
+ // Walks the dom left/right to find a suitable text node to move the endpoint into
+ // It will only walk within the current parent block or body and will stop if it hits a block or a BR/IMG
+ function findTextNodeRelative(left, startNode) {
+ var walker, lastInlineElement;
+
+ startNode = startNode || container;
+ walker = new TreeWalker(startNode, dom.getParent(startNode.parentNode, dom.isBlock) || body);
+
+ // Walk left until we hit a text node we can move to or a block/br/img
+ while ((node = walker[left ? 'prev' : 'next']())) {
+ // Found text node that has a length
+ if (node.nodeType === 3 && node.nodeValue.length > 0) {
+ container = node;
+ offset = left ? node.nodeValue.length : 0;
+ normalized = true;
+ return;
+ }
+
+ // Break if we find a block or a BR/IMG/INPUT etc
+ if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
+ return;
+ }
+
+ lastInlineElement = node;
+ }
+
+ // Only fetch the last inline element when in caret mode for now
+ if (collapsed && lastInlineElement) {
+ container = lastInlineElement;
+ normalized = true;
+ offset = 0;
+ }
+ }
+
+ container = rng[(start ? 'start' : 'end') + 'Container'];
+ offset = rng[(start ? 'start' : 'end') + 'Offset'];
+ nonEmptyElementsMap = dom.schema.getNonEmptyElements();
+ directionLeft = start;
+
+ if (container.nodeType == 1 && offset > container.childNodes.length - 1) {
+ directionLeft = false;
+ }
+
+ // If the container is a document move it to the body element
+ if (container.nodeType === 9) {
+ container = dom.getRoot();
+ offset = 0;
+ }
+
+ // If the container is body try move it into the closest text node or position
+ if (container === body) {
+ // If start is before/after a image, table etc
+ if (directionLeft) {
+ node = container.childNodes[offset > 0 ? offset - 1 : 0];
+ if (node) {
+ nodeName = node.nodeName.toLowerCase();
+ if (nonEmptyElementsMap[node.nodeName] || node.nodeName == "TABLE") {
+ return;
+ }
+ }
+ }
+
+ // Resolve the index
+ if (container.hasChildNodes()) {
+ offset = Math.min(!directionLeft && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1);
+ container = container.childNodes[offset];
+ offset = 0;
+
+ // Don't walk into elements that doesn't have any child nodes like a IMG
+ if (container.hasChildNodes() && !/TABLE/.test(container.nodeName)) {
+ // Walk the DOM to find a text node to place the caret at or a BR
+ node = container;
+ walker = new TreeWalker(container, body);
+
+ do {
+ // Found a text node use that position
+ if (node.nodeType === 3 && node.nodeValue.length > 0) {
+ offset = directionLeft ? 0 : node.nodeValue.length;
+ container = node;
+ normalized = true;
+ break;
+ }
+
+ // Found a BR/IMG element that we can place the caret before
+ if (nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
+ offset = dom.nodeIndex(node);
+ container = node.parentNode;
+
+ // Put caret after image when moving the end point
+ if (node.nodeName == "IMG" && !directionLeft) {
+ offset++;
+ }
+
+ normalized = true;
+ break;
+ }
+ } while ((node = (directionLeft ? walker.next() : walker.prev())));
+ }
+ }
+ }
+
+ // Lean the caret to the left if possible
+ if (collapsed) {
+ // So this: <b>x</b><i>|x</i>
+ // Becomes: <b>x|</b><i>x</i>
+ // Seems that only gecko has issues with this
+ if (container.nodeType === 3 && offset === 0) {
+ findTextNodeRelative(true);
+ }
+
+ // Lean left into empty inline elements when the caret is before a BR
+ // So this: <i><b></b><i>|<br></i>
+ // Becomes: <i><b>|</b><i><br></i>
+ // Seems that only gecko has issues with this.
+ // Special edge case for <p><a>x</a>|<br></p> since we don't want <p><a>x|</a><br></p>
+ if (container.nodeType === 1) {
+ node = container.childNodes[offset];
+ if(node && node.nodeName === 'BR' && !isPrevNode(node, 'A') &&
+ !hasBrBeforeAfter(node) && !hasBrBeforeAfter(node, true)) {
+ findTextNodeRelative(true, container.childNodes[offset]);
+ }
+ }
+ }
+
+ // Lean the start of the selection right if possible
+ // So this: x[<b>x]</b>
+ // Becomes: x<b>[x]</b>
+ if (directionLeft && !collapsed && container.nodeType === 3 && offset === container.nodeValue.length) {
+ findTextNodeRelative(false);
+ }
+
+ // Set endpoint if it was normalized
+ if (normalized) {
+ rng['set' + (start ? 'Start' : 'End')](container, offset);
+ }
+ }
+
+ // Normalize only on non IE browsers for now
+ if (isIE) {
+ return;
+ }
+
+ rng = self.getRng();
+ collapsed = rng.collapsed;
+
+ // Normalize the end points
+ normalizeEndPoint(true);
+
+ if (!collapsed) {
+ normalizeEndPoint();
+ }
+
+ // Set the selection if it was normalized
+ if (normalized) {
+ // If it was collapsed then make sure it still is
+ if (collapsed) {
+ rng.collapse(true);
+ }
+
+ //console.log(self.dom.dumpRng(rng));
+ self.setRng(rng, self.isForward());
+ }
+ },
+
+ /**
+ * Executes callback of the current selection matches the specified selector or not and passes the state and args to the callback.
+ *
+ * @method selectorChanged
+ * @param {String} selector CSS selector to check for.
+ * @param {function} callback Callback with state and args when the selector is matches or not.
+ */
+ selectorChanged: function(selector, callback) {
+ var self = this, currentSelectors;
+
+ if (!self.selectorChangedData) {
+ self.selectorChangedData = {};
+ currentSelectors = {};
+
+ self.editor.on('NodeChange', function(e) {
+ var node = e.element, dom = self.dom, parents = dom.getParents(node, null, dom.getRoot()), matchedSelectors = {};
+
+ // Check for new matching selectors
+ each(self.selectorChangedData, function(callbacks, selector) {
+ each(parents, function(node) {
+ if (dom.is(node, selector)) {
+ if (!currentSelectors[selector]) {
+ // Execute callbacks
+ each(callbacks, function(callback) {
+ callback(true, {node: node, selector: selector, parents: parents});
+ });
+
+ currentSelectors[selector] = callbacks;
+ }
+
+ matchedSelectors[selector] = callbacks;
+ return false;
+ }
+ });
+ });
+
+ // Check if current selectors still match
+ each(currentSelectors, function(callbacks, selector) {
+ if (!matchedSelectors[selector]) {
+ delete currentSelectors[selector];
+
+ each(callbacks, function(callback) {
+ callback(false, {node: node, selector: selector, parents: parents});
+ });
+ }
+ });
+ });
+ }
+
+ // Add selector listeners
+ if (!self.selectorChangedData[selector]) {
+ self.selectorChangedData[selector] = [];
+ }
+
+ self.selectorChangedData[selector].push(callback);
+
+ return self;
+ },
+
+ getScrollContainer: function() {
+ var scrollContainer, node = this.dom.getRoot();
+
+ while (node && node.nodeName != 'BODY') {
+ if (node.scrollHeight > node.clientHeight) {
+ scrollContainer = node;
+ break;
+ }
+
+ node = node.parentNode;
+ }
+
+ return scrollContainer;
+ },
+
+ scrollIntoView: function(elm) {
+ var y, viewPort, self = this, dom = self.dom, root = dom.getRoot(), viewPortY, viewPortH;
+
+ function getPos(elm) {
+ var x = 0, y = 0;
+
+ var offsetParent = elm;
+ while (offsetParent && offsetParent.nodeType) {
+ x += offsetParent.offsetLeft || 0;
+ y += offsetParent.offsetTop || 0;
+ offsetParent = offsetParent.offsetParent;
+ }
+
+ return {x: x, y: y};
+ }
+
+ if (root.nodeName != 'BODY') {
+ var scrollContainer = self.getScrollContainer();
+ if (scrollContainer) {
+ y = getPos(elm).y - getPos(scrollContainer).y;
+ viewPortH = scrollContainer.clientHeight;
+ viewPortY = scrollContainer.scrollTop;
+ if (y < viewPortY || y + 25 > viewPortY + viewPortH) {
+ scrollContainer.scrollTop = y < viewPortY ? y : y - viewPortH + 25;
+ }
+
+ return;
+ }
+ }
+
+ viewPort = dom.getViewPort(self.editor.getWin());
+ y = dom.getPos(elm).y;
+ viewPortY = viewPort.y;
+ viewPortH = viewPort.h;
+ if (y < viewPort.y || y + 25 > viewPortY + viewPortH) {
+ self.editor.getWin().scrollTo(0, y < viewPortY ? y : y - viewPortH + 25);
+ }
+ },
+
+ _moveEndPoint: function(rng, node, start) {
+ var root = node, walker = new TreeWalker(node, root);
+ var nonEmptyElementsMap = this.dom.schema.getNonEmptyElements();
+
+ do {
+ // Text node
+ if (node.nodeType == 3 && trim(node.nodeValue).length !== 0) {
+ if (start) {
+ rng.setStart(node, 0);
+ } else {
+ rng.setEnd(node, node.nodeValue.length);
+ }
+
+ return;
+ }
+
+ // BR/IMG/INPUT elements
+ if (nonEmptyElementsMap[node.nodeName]) {
+ if (start) {
+ rng.setStartBefore(node);
+ } else {
+ if (node.nodeName == 'BR') {
+ rng.setEndBefore(node);
+ } else {
+ rng.setEndAfter(node);
+ }
+ }
+
+ return;
+ }
+
+ // Found empty text block old IE can place the selection inside those
+ if (Env.ie && Env.ie < 11 && this.dom.isBlock(node) && this.dom.isEmpty(node)) {
+ if (start) {
+ rng.setStart(node, 0);
+ } else {
+ rng.setEnd(node, 0);
+ }
+
+ return;
+ }
+ } while ((node = (start ? walker.next() : walker.prev())));
+
+ // Failed to find any text node or other suitable location then move to the root of body
+ if (root.nodeName == 'BODY') {
+ if (start) {
+ rng.setStart(root, 0);
+ } else {
+ rng.setEnd(root, root.childNodes.length);
+ }
+ }
+ },
+
+ destroy: function() {
+ this.win = null;
+ this.controlSelection.destroy();
+ }
+ };
+
+ return Selection;
+});
+
+// Included from: js/tinymce/classes/dom/RangeUtils.js
+
+/**
+ * Range.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * RangeUtils
+ *
+ * @class tinymce.dom.RangeUtils
+ * @private
+ */
+define("tinymce/dom/RangeUtils", [
+ "tinymce/util/Tools"
+], function(Tools) {
+ var each = Tools.each;
+
+ function RangeUtils(dom) {
+ /**
+ * Walks the specified range like object and executes the callback for each sibling collection it finds.
+ *
+ * @method walk
+ * @param {Object} rng Range like object.
+ * @param {function} callback Callback function to execute for each sibling collection.
+ */
+ this.walk = function(rng, callback) {
+ var startContainer = rng.startContainer,
+ startOffset = rng.startOffset,
+ endContainer = rng.endContainer,
+ endOffset = rng.endOffset,
+ ancestor, startPoint,
+ endPoint, node, parent, siblings, nodes;
+
+ // Handle table cell selection the table plugin enables
+ // you to fake select table cells and perform formatting actions on them
+ nodes = dom.select('td.mce-item-selected,th.mce-item-selected');
+ if (nodes.length > 0) {
+ each(nodes, function(node) {
+ callback([node]);
+ });
+
+ return;
+ }
+
+ /**
+ * Excludes start/end text node if they are out side the range
+ *
+ * @private
+ * @param {Array} nodes Nodes to exclude items from.
+ * @return {Array} Array with nodes excluding the start/end container if needed.
+ */
+ function exclude(nodes) {
+ var node;
+
+ // First node is excluded
+ node = nodes[0];
+ if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) {
+ nodes.splice(0, 1);
+ }
+
+ // Last node is excluded
+ node = nodes[nodes.length - 1];
+ if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) {
+ nodes.splice(nodes.length - 1, 1);
+ }
+
+ return nodes;
+ }
+
+ /**
+ * Collects siblings
+ *
+ * @private
+ * @param {Node} node Node to collect siblings from.
+ * @param {String} name Name of the sibling to check for.
+ * @return {Array} Array of collected siblings.
+ */
+ function collectSiblings(node, name, end_node) {
+ var siblings = [];
+
+ for (; node && node != end_node; node = node[name]) {
+ siblings.push(node);
+ }
+
+ return siblings;
+ }
+
+ /**
+ * Find an end point this is the node just before the common ancestor root.
+ *
+ * @private
+ * @param {Node} node Node to start at.
+ * @param {Node} root Root/ancestor element to stop just before.
+ * @return {Node} Node just before the root element.
+ */
+ function findEndPoint(node, root) {
+ do {
+ if (node.parentNode == root) {
+ return node;
+ }
+
+ node = node.parentNode;
+ } while(node);
+ }
+
+ function walkBoundary(start_node, end_node, next) {
+ var siblingName = next ? 'nextSibling' : 'previousSibling';
+
+ for (node = start_node, parent = node.parentNode; node && node != end_node; node = parent) {
+ parent = node.parentNode;
+ siblings = collectSiblings(node == start_node ? node : node[siblingName], siblingName);
+
+ if (siblings.length) {
+ if (!next) {
+ siblings.reverse();
+ }
+
+ callback(exclude(siblings));
+ }
+ }
+ }
+
+ // If index based start position then resolve it
+ if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) {
+ startContainer = startContainer.childNodes[startOffset];
+ }
+
+ // If index based end position then resolve it
+ if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) {
+ endContainer = endContainer.childNodes[Math.min(endOffset - 1, endContainer.childNodes.length - 1)];
+ }
+
+ // Same container
+ if (startContainer == endContainer) {
+ return callback(exclude([startContainer]));
+ }
+
+ // Find common ancestor and end points
+ ancestor = dom.findCommonAncestor(startContainer, endContainer);
+
+ // Process left side
+ for (node = startContainer; node; node = node.parentNode) {
+ if (node === endContainer) {
+ return walkBoundary(startContainer, ancestor, true);
+ }
+
+ if (node === ancestor) {
+ break;
+ }
+ }
+
+ // Process right side
+ for (node = endContainer; node; node = node.parentNode) {
+ if (node === startContainer) {
+ return walkBoundary(endContainer, ancestor);
+ }
+
+ if (node === ancestor) {
+ break;
+ }
+ }
+
+ // Find start/end point
+ startPoint = findEndPoint(startContainer, ancestor) || startContainer;
+ endPoint = findEndPoint(endContainer, ancestor) || endContainer;
+
+ // Walk left leaf
+ walkBoundary(startContainer, startPoint, true);
+
+ // Walk the middle from start to end point
+ siblings = collectSiblings(
+ startPoint == startContainer ? startPoint : startPoint.nextSibling,
+ 'nextSibling',
+ endPoint == endContainer ? endPoint.nextSibling : endPoint
+ );
+
+ if (siblings.length) {
+ callback(exclude(siblings));
+ }
+
+ // Walk right leaf
+ walkBoundary(endContainer, endPoint);
+ };
+
+ /**
+ * Splits the specified range at it's start/end points.
+ *
+ * @private
+ * @param {Range/RangeObject} rng Range to split.
+ * @return {Object} Range position object.
+ */
+ this.split = function(rng) {
+ var startContainer = rng.startContainer,
+ startOffset = rng.startOffset,
+ endContainer = rng.endContainer,
+ endOffset = rng.endOffset;
+
+ function splitText(node, offset) {
+ return node.splitText(offset);
+ }
+
+ // Handle single text node
+ if (startContainer == endContainer && startContainer.nodeType == 3) {
+ if (startOffset > 0 && startOffset < startContainer.nodeValue.length) {
+ endContainer = splitText(startContainer, startOffset);
+ startContainer = endContainer.previousSibling;
+
+ if (endOffset > startOffset) {
+ endOffset = endOffset - startOffset;
+ startContainer = endContainer = splitText(endContainer, endOffset).previousSibling;
+ endOffset = endContainer.nodeValue.length;
+ startOffset = 0;
+ } else {
+ endOffset = 0;
+ }
+ }
+ } else {
+ // Split startContainer text node if needed
+ if (startContainer.nodeType == 3 && startOffset > 0 && startOffset < startContainer.nodeValue.length) {
+ startContainer = splitText(startContainer, startOffset);
+ startOffset = 0;
+ }
+
+ // Split endContainer text node if needed
+ if (endContainer.nodeType == 3 && endOffset > 0 && endOffset < endContainer.nodeValue.length) {
+ endContainer = splitText(endContainer, endOffset).previousSibling;
+ endOffset = endContainer.nodeValue.length;
+ }
+ }
+
+ return {
+ startContainer: startContainer,
+ startOffset: startOffset,
+ endContainer: endContainer,
+ endOffset: endOffset
+ };
+ };
+ }
+
+ /**
+ * Compares two ranges and checks if they are equal.
+ *
+ * @static
+ * @method compareRanges
+ * @param {DOMRange} rng1 First range to compare.
+ * @param {DOMRange} rng2 First range to compare.
+ * @return {Boolean} true/false if the ranges are equal.
+ */
+ RangeUtils.compareRanges = function(rng1, rng2) {
+ if (rng1 && rng2) {
+ // Compare native IE ranges
+ if (rng1.item || rng1.duplicate) {
+ // Both are control ranges and the selected element matches
+ if (rng1.item && rng2.item && rng1.item(0) === rng2.item(0)) {
+ return true;
+ }
+
+ // Both are text ranges and the range matches
+ if (rng1.isEqual && rng2.isEqual && rng2.isEqual(rng1)) {
+ return true;
+ }
+ } else {
+ // Compare w3c ranges
+ return rng1.startContainer == rng2.startContainer && rng1.startOffset == rng2.startOffset;
+ }
+ }
+
+ return false;
+ };
+
+ return RangeUtils;
+});
+
+// Included from: js/tinymce/classes/Formatter.js
+
+/**
+ * Formatter.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Text formatter engine class. This class is used to apply formats like bold, italic, font size
+ * etc to the current selection or specific nodes. This engine was build to replace the browsers
+ * default formatting logic for execCommand due to it's inconsistent and buggy behavior.
+ *
+ * @class tinymce.Formatter
+ * @example
+ * tinymce.activeEditor.formatter.register('mycustomformat', {
+ * inline: 'span',
+ * styles: {color: '#ff0000'}
+ * });
+ *
+ * tinymce.activeEditor.formatter.apply('mycustomformat');
+ */
+define("tinymce/Formatter", [
+ "tinymce/dom/TreeWalker",
+ "tinymce/dom/RangeUtils",
+ "tinymce/util/Tools"
+], function(TreeWalker, RangeUtils, Tools) {
+ /**
+ * Constructs a new formatter instance.
+ *
+ * @constructor Formatter
+ * @param {tinymce.Editor} ed Editor instance to construct the formatter engine to.
+ */
+ return function(ed) {
+ var formats = {},
+ dom = ed.dom,
+ selection = ed.selection,
+ rangeUtils = new RangeUtils(dom),
+ isValid = ed.schema.isValidChild,
+ isBlock = dom.isBlock,
+ forcedRootBlock = ed.settings.forced_root_block,
+ nodeIndex = dom.nodeIndex,
+ INVISIBLE_CHAR = '\uFEFF',
+ MCE_ATTR_RE = /^(src|href|style)$/,
+ FALSE = false,
+ TRUE = true,
+ formatChangeData,
+ undef,
+ getContentEditable = dom.getContentEditable,
+ disableCaretContainer,
+ markCaretContainersBogus;
+
+ var each = Tools.each,
+ grep = Tools.grep,
+ walk = Tools.walk,
+ extend = Tools.extend;
+
+ function isTextBlock(name) {
+ if (name.nodeType) {
+ name = name.nodeName;
+ }
+
+ return !!ed.schema.getTextBlockElements()[name.toLowerCase()];
+ }
+
+ function getParents(node, selector) {
+ return dom.getParents(node, selector, dom.getRoot());
+ }
+
+ function isCaretNode(node) {
+ return node.nodeType === 1 && node.id === '_mce_caret';
+ }
+
+ function defaultFormats() {
+ register({
+ alignleft: [
+ {selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', styles: {textAlign: 'left'}, defaultBlock: 'div'},
+ {selector: 'img,table', collapsed: false, styles: {'float': 'left'}}
+ ],
+
+ aligncenter: [
+ {selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', styles: {textAlign: 'center'}, defaultBlock: 'div'},
+ {selector: 'img', collapsed: false, styles: {display: 'block', marginLeft: 'auto', marginRight: 'auto'}},
+ {selector: 'table', collapsed: false, styles: {marginLeft: 'auto', marginRight: 'auto'}}
+ ],
+
+ alignright: [
+ {selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', styles: {textAlign: 'right'}, defaultBlock: 'div'},
+ {selector: 'img,table', collapsed: false, styles: {'float': 'right'}}
+ ],
+
+ alignjustify: [
+ {selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', styles: {textAlign: 'justify'}, defaultBlock: 'div'}
+ ],
+
+ bold: [
+ {inline: 'strong', remove: 'all'},
+ {inline: 'span', styles: {fontWeight: 'bold'}},
+ {inline: 'b', remove: 'all'}
+ ],
+
+ italic: [
+ {inline: 'em', remove: 'all'},
+ {inline: 'span', styles: {fontStyle: 'italic'}},
+ {inline: 'i', remove: 'all'}
+ ],
+
+ underline: [
+ {inline: 'span', styles: {textDecoration: 'underline'}, exact: true},
+ {inline: 'u', remove: 'all'}
+ ],
+
+ strikethrough: [
+ {inline: 'span', styles: {textDecoration: 'line-through'}, exact: true},
+ {inline: 'strike', remove: 'all'}
+ ],
+
+ forecolor: {inline: 'span', styles: {color: '%value'}, wrap_links: false},
+ hilitecolor: {inline: 'span', styles: {backgroundColor: '%value'}, wrap_links: false},
+ fontname: {inline: 'span', styles: {fontFamily: '%value'}},
+ fontsize: {inline: 'span', styles: {fontSize: '%value'}},
+ fontsize_class: {inline: 'span', attributes: {'class': '%value'}},
+ blockquote: {block: 'blockquote', wrapper: 1, remove: 'all'},
+ subscript: {inline: 'sub'},
+ superscript: {inline: 'sup'},
+ code: {inline: 'code'},
+
+ link: {inline: 'a', selector: 'a', remove: 'all', split: true, deep: true,
+ onmatch: function() {
+ return true;
+ },
+
+ onformat: function(elm, fmt, vars) {
+ each(vars, function(value, key) {
+ dom.setAttrib(elm, key, value);
+ });
+ }
+ },
+
+ removeformat: [
+ {
+ selector: 'b,strong,em,i,font,u,strike,sub,sup',
+ remove: 'all',
+ split: true,
+ expand: false,
+ block_expand: true,
+ deep: true
+ },
+ {selector: 'span', attributes: ['style', 'class'], remove: 'empty', split: true, expand: false, deep: true},
+ {selector: '*', attributes: ['style', 'class'], split: false, expand: false, deep: true}
+ ]
+ });
+
+ // Register default block formats
+ each('p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp'.split(/\s/), function(name) {
+ register(name, {block: name, remove: 'all'});
+ });
+
+ // Register user defined formats
+ register(ed.settings.formats);
+ }
+
+ function addKeyboardShortcuts() {
+ // Add some inline shortcuts
+ ed.addShortcut('ctrl+b', 'bold_desc', 'Bold');
+ ed.addShortcut('ctrl+i', 'italic_desc', 'Italic');
+ ed.addShortcut('ctrl+u', 'underline_desc', 'Underline');
+
+ // BlockFormat shortcuts keys
+ for (var i = 1; i <= 6; i++) {
+ ed.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]);
+ }
+
+ ed.addShortcut('ctrl+7', '', ['FormatBlock', false, 'p']);
+ ed.addShortcut('ctrl+8', '', ['FormatBlock', false, 'div']);
+ ed.addShortcut('ctrl+9', '', ['FormatBlock', false, 'address']);
+ }
+
+ // Public functions
+
+ /**
+ * Returns the format by name or all formats if no name is specified.
+ *
+ * @method get
+ * @param {String} name Optional name to retrive by.
+ * @return {Array/Object} Array/Object with all registred formats or a specific format.
+ */
+ function get(name) {
+ return name ? formats[name] : formats;
+ }
+
+ /**
+ * Registers a specific format by name.
+ *
+ * @method register
+ * @param {Object/String} name Name of the format for example "bold".
+ * @param {Object/Array} format Optional format object or array of format variants
+ * can only be omitted if the first arg is an object.
+ */
+ function register(name, format) {
+ if (name) {
+ if (typeof(name) !== 'string') {
+ each(name, function(format, name) {
+ register(name, format);
+ });
+ } else {
+ // Force format into array and add it to internal collection
+ format = format.length ? format : [format];
+
+ each(format, function(format) {
+ // Set deep to false by default on selector formats this to avoid removing
+ // alignment on images inside paragraphs when alignment is changed on paragraphs
+ if (format.deep === undef) {
+ format.deep = !format.selector;
+ }
+
+ // Default to true
+ if (format.split === undef) {
+ format.split = !format.selector || format.inline;
+ }
+
+ // Default to true
+ if (format.remove === undef && format.selector && !format.inline) {
+ format.remove = 'none';
+ }
+
+ // Mark format as a mixed format inline + block level
+ if (format.selector && format.inline) {
+ format.mixed = true;
+ format.block_expand = true;
+ }
+
+ // Split classes if needed
+ if (typeof(format.classes) === 'string') {
+ format.classes = format.classes.split(/\s+/);
+ }
+ });
+
+ formats[name] = format;
+ }
+ }
+ }
+
+ function getTextDecoration(node) {
+ var decoration;
+
+ ed.dom.getParent(node, function(n) {
+ decoration = ed.dom.getStyle(n, 'text-decoration');
+ return decoration && decoration !== 'none';
+ });
+
+ return decoration;
+ }
+
+ function processUnderlineAndColor(node) {
+ var textDecoration;
+ if (node.nodeType === 1 && node.parentNode && node.parentNode.nodeType === 1) {
+ textDecoration = getTextDecoration(node.parentNode);
+ if (ed.dom.getStyle(node, 'color') && textDecoration) {
+ ed.dom.setStyle(node, 'text-decoration', textDecoration);
+ } else if (ed.dom.getStyle(node, 'textdecoration') === textDecoration) {
+ ed.dom.setStyle(node, 'text-decoration', null);
+ }
+ }
+ }
+
+ /**
+ * Applies the specified format to the current selection or specified node.
+ *
+ * @method apply
+ * @param {String} name Name of format to apply.
+ * @param {Object} vars Optional list of variables to replace within format before applying it.
+ * @param {Node} node Optional node to apply the format to defaults to current selection.
+ */
+ function apply(name, vars, node) {
+ var formatList = get(name), format = formatList[0], bookmark, rng, isCollapsed = !node && selection.isCollapsed();
+
+ function setElementFormat(elm, fmt) {
+ fmt = fmt || format;
+
+ if (elm) {
+ if (fmt.onformat) {
+ fmt.onformat(elm, fmt, vars, node);
+ }
+
+ each(fmt.styles, function(value, name) {
+ dom.setStyle(elm, name, replaceVars(value, vars));
+ });
+
+ each(fmt.attributes, function(value, name) {
+ dom.setAttrib(elm, name, replaceVars(value, vars));
+ });
+
+ each(fmt.classes, function(value) {
+ value = replaceVars(value, vars);
+
+ if (!dom.hasClass(elm, value)) {
+ dom.addClass(elm, value);
+ }
+ });
+ }
+ }
+
+ function adjustSelectionToVisibleSelection() {
+ function findSelectionEnd(start, end) {
+ var walker = new TreeWalker(end);
+ for (node = walker.current(); node; node = walker.prev()) {
+ if (node.childNodes.length > 1 || node == start || node.tagName == 'BR') {
+ return node;
+ }
+ }
+ }
+
+ // Adjust selection so that a end container with a end offset of zero is not included in the selection
+ // as this isn't visible to the user.
+ var rng = ed.selection.getRng();
+ var start = rng.startContainer;
+ var end = rng.endContainer;
+
+ if (start != end && rng.endOffset === 0) {
+ var newEnd = findSelectionEnd(start, end);
+ var endOffset = newEnd.nodeType == 3 ? newEnd.length : newEnd.childNodes.length;
+
+ rng.setEnd(newEnd, endOffset);
+ }
+
+ return rng;
+ }
+
+ function applyStyleToList(node, bookmark, wrapElm, newWrappers, process){
+ var nodes = [], listIndex = -1, list, startIndex = -1, endIndex = -1, currentWrapElm;
+
+ // find the index of the first child list.
+ each(node.childNodes, function(n, index) {
+ if (n.nodeName === "UL" || n.nodeName === "OL") {
+ listIndex = index;
+ list = n;
+ return false;
+ }
+ });
+
+ // get the index of the bookmarks
+ each(node.childNodes, function(n, index) {
+ if (n.nodeName === "SPAN" && dom.getAttrib(n, "data-mce-type") == "bookmark") {
+ if (n.id == bookmark.id + "_start") {
+ startIndex = index;
+ } else if (n.id == bookmark.id + "_end") {
+ endIndex = index;
+ }
+ }
+ });
+
+ // if the selection spans across an embedded list, or there isn't an embedded list - handle processing normally
+ if (listIndex <= 0 || (startIndex < listIndex && endIndex > listIndex)) {
+ each(grep(node.childNodes), process);
+ return 0;
+ } else {
+ currentWrapElm = dom.clone(wrapElm, FALSE);
+
+ // create a list of the nodes on the same side of the list as the selection
+ each(grep(node.childNodes), function(n, index) {
+ if ((startIndex < listIndex && index < listIndex) || (startIndex > listIndex && index > listIndex)) {
+ nodes.push(n);
+ n.parentNode.removeChild(n);
+ }
+ });
+
+ // insert the wrapping element either before or after the list.
+ if (startIndex < listIndex) {
+ node.insertBefore(currentWrapElm, list);
+ } else if (startIndex > listIndex) {
+ node.insertBefore(currentWrapElm, list.nextSibling);
+ }
+
+ // add the new nodes to the list.
+ newWrappers.push(currentWrapElm);
+
+ each(nodes, function(node) {
+ currentWrapElm.appendChild(node);
+ });
+
+ return currentWrapElm;
+ }
+ }
+
+ function applyRngStyle(rng, bookmark, node_specific) {
+ var newWrappers = [], wrapName, wrapElm, contentEditable = true;
+
+ // Setup wrapper element
+ wrapName = format.inline || format.block;
+ wrapElm = dom.create(wrapName);
+ setElementFormat(wrapElm);
+
+ rangeUtils.walk(rng, function(nodes) {
+ var currentWrapElm;
+
+ /**
+ * Process a list of nodes wrap them.
+ */
+ function process(node) {
+ var nodeName, parentName, found, hasContentEditableState, lastContentEditable;
+
+ lastContentEditable = contentEditable;
+ nodeName = node.nodeName.toLowerCase();
+ parentName = node.parentNode.nodeName.toLowerCase();
+
+ // Node has a contentEditable value
+ if (node.nodeType === 1 && getContentEditable(node)) {
+ lastContentEditable = contentEditable;
+ contentEditable = getContentEditable(node) === "true";
+ hasContentEditableState = true; // We don't want to wrap the container only it's children
+ }
+
+ // Stop wrapping on br elements
+ if (isEq(nodeName, 'br')) {
+ currentWrapElm = 0;
+
+ // Remove any br elements when we wrap things
+ if (format.block) {
+ dom.remove(node);
+ }
+
+ return;
+ }
+
+ // If node is wrapper type
+ if (format.wrapper && matchNode(node, name, vars)) {
+ currentWrapElm = 0;
+ return;
+ }
+
+ // Can we rename the block
+ // TODO: Break this if up, too complex
+ if (contentEditable && !hasContentEditableState && format.block &&
+ !format.wrapper && isTextBlock(nodeName) && isValid(parentName, wrapName)) {
+ node = dom.rename(node, wrapName);
+ setElementFormat(node);
+ newWrappers.push(node);
+ currentWrapElm = 0;
+ return;
+ }
+
+ // Handle selector patterns
+ if (format.selector) {
+ // Look for matching formats
+ each(formatList, function(format) {
+ // Check collapsed state if it exists
+ if ('collapsed' in format && format.collapsed !== isCollapsed) {
+ return;
+ }
+
+ if (dom.is(node, format.selector) && !isCaretNode(node)) {
+ setElementFormat(node, format);
+ found = true;
+ }
+ });
+
+ // Continue processing if a selector match wasn't found and a inline element is defined
+ if (!format.inline || found) {
+ currentWrapElm = 0;
+ return;
+ }
+ }
+
+ // Is it valid to wrap this item
+ // TODO: Break this if up, too complex
+ if (contentEditable && !hasContentEditableState && isValid(wrapName, nodeName) && isValid(parentName, wrapName) &&
+ !(!node_specific && node.nodeType === 3 &&
+ node.nodeValue.length === 1 &&
+ node.nodeValue.charCodeAt(0) === 65279) &&
+ !isCaretNode(node) &&
+ (!format.inline || !isBlock(node))) {
+ // Start wrapping
+ if (!currentWrapElm) {
+ // Wrap the node
+ currentWrapElm = dom.clone(wrapElm, FALSE);
+ node.parentNode.insertBefore(currentWrapElm, node);
+ newWrappers.push(currentWrapElm);
+ }
+
+ currentWrapElm.appendChild(node);
+ } else if (nodeName == 'li' && bookmark) {
+ // Start wrapping - if we are in a list node and have a bookmark, then
+ // we will always begin by wrapping in a new element.
+ currentWrapElm = applyStyleToList(node, bookmark, wrapElm, newWrappers, process);
+ } else {
+ // Start a new wrapper for possible children
+ currentWrapElm = 0;
+
+ each(grep(node.childNodes), process);
+
+ if (hasContentEditableState) {
+ contentEditable = lastContentEditable; // Restore last contentEditable state from stack
+ }
+
+ // End the last wrapper
+ currentWrapElm = 0;
+ }
+ }
+
+ // Process siblings from range
+ each(nodes, process);
+ });
+
+ // Wrap links inside as well, for example color inside a link when the wrapper is around the link
+ if (format.wrap_links === false) {
+ each(newWrappers, function(node) {
+ function process(node) {
+ var i, currentWrapElm, children;
+
+ if (node.nodeName === 'A') {
+ currentWrapElm = dom.clone(wrapElm, FALSE);
+ newWrappers.push(currentWrapElm);
+
+ children = grep(node.childNodes);
+ for (i = 0; i < children.length; i++) {
+ currentWrapElm.appendChild(children[i]);
+ }
+
+ node.appendChild(currentWrapElm);
+ }
+
+ each(grep(node.childNodes), process);
+ }
+
+ process(node);
+ });
+ }
+
+ // Cleanup
+ each(newWrappers, function(node) {
+ var childCount;
+
+ function getChildCount(node) {
+ var count = 0;
+
+ each(node.childNodes, function(node) {
+ if (!isWhiteSpaceNode(node) && !isBookmarkNode(node)) {
+ count++;
+ }
+ });
+
+ return count;
+ }
+
+ function mergeStyles(node) {
+ var child, clone;
+
+ each(node.childNodes, function(node) {
+ if (node.nodeType == 1 && !isBookmarkNode(node) && !isCaretNode(node)) {
+ child = node;
+ return FALSE; // break loop
+ }
+ });
+
+ // If child was found and of the same type as the current node
+ if (child && matchName(child, format)) {
+ clone = dom.clone(child, FALSE);
+ setElementFormat(clone);
+
+ dom.replace(clone, node, TRUE);
+ dom.remove(child, 1);
+ }
+
+ return clone || node;
+ }
+
+ childCount = getChildCount(node);
+
+ // Remove empty nodes but only if there is multiple wrappers and they are not block
+ // elements so never remove single <h1></h1> since that would remove the
+ // currrent empty block element where the caret is at
+ if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) {
+ dom.remove(node, 1);
+ return;
+ }
+
+ if (format.inline || format.wrapper) {
+ // Merges the current node with it's children of similar type to reduce the number of elements
+ if (!format.exact && childCount === 1) {
+ node = mergeStyles(node);
+ }
+
+ // Remove/merge children
+ each(formatList, function(format) {
+ // Merge all children of similar type will move styles from child to parent
+ // this: <span style="color:red"><b><span style="color:red; font-size:10px">text</span></b></span>
+ // will become: <span style="color:red"><b><span style="font-size:10px">text</span></b></span>
+ each(dom.select(format.inline, node), function(child) {
+ var parent;
+
+ // When wrap_links is set to false we don't want
+ // to remove the format on children within links
+ if (format.wrap_links === false) {
+ parent = child.parentNode;
+
+ do {
+ if (parent.nodeName === 'A') {
+ return;
+ }
+ } while ((parent = parent.parentNode));
+ }
+
+ removeFormat(format, vars, child, format.exact ? child : null);
+ });
+ });
+
+ // Remove child if direct parent is of same type
+ if (matchNode(node.parentNode, name, vars)) {
+ dom.remove(node, 1);
+ node = 0;
+ return TRUE;
+ }
+
+ // Look for parent with similar style format
+ if (format.merge_with_parents) {
+ dom.getParent(node.parentNode, function(parent) {
+ if (matchNode(parent, name, vars)) {
+ dom.remove(node, 1);
+ node = 0;
+ return TRUE;
+ }
+ });
+ }
+
+ // Merge next and previous siblings if they are similar <b>text</b><b>text</b> becomes <b>texttext</b>
+ if (node && format.merge_siblings !== false) {
+ node = mergeSiblings(getNonWhiteSpaceSibling(node), node);
+ node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE));
+ }
+ }
+ });
+ }
+
+ if (format) {
+ if (node) {
+ if (node.nodeType) {
+ rng = dom.createRng();
+ rng.setStartBefore(node);
+ rng.setEndAfter(node);
+ applyRngStyle(expandRng(rng, formatList), null, true);
+ } else {
+ applyRngStyle(node, null, true);
+ }
+ } else {
+ if (!isCollapsed || !format.inline || dom.select('td.mce-item-selected,th.mce-item-selected').length) {
+ // Obtain selection node before selection is unselected by applyRngStyle()
+ var curSelNode = ed.selection.getNode();
+
+ // If the formats have a default block and we can't find a parent block then
+ // start wrapping it with a DIV this is for forced_root_blocks: false
+ // It's kind of a hack but people should be using the default block type P since all desktop editors work that way
+ if (!forcedRootBlock && formatList[0].defaultBlock && !dom.getParent(curSelNode, dom.isBlock)) {
+ apply(formatList[0].defaultBlock);
+ }
+
+ // Apply formatting to selection
+ ed.selection.setRng(adjustSelectionToVisibleSelection());
+ bookmark = selection.getBookmark();
+ applyRngStyle(expandRng(selection.getRng(TRUE), formatList), bookmark);
+
+ // Colored nodes should be underlined so that the color of the underline matches the text color.
+ if (format.styles && (format.styles.color || format.styles.textDecoration)) {
+ walk(curSelNode, processUnderlineAndColor, 'childNodes');
+ processUnderlineAndColor(curSelNode);
+ }
+
+ selection.moveToBookmark(bookmark);
+ moveStart(selection.getRng(TRUE));
+ ed.nodeChanged();
+ } else {
+ performCaretAction('apply', name, vars);
+ }
+ }
+ }
+ }
+
+ /**
+ * Removes the specified format from the current selection or specified node.
+ *
+ * @method remove
+ * @param {String} name Name of format to remove.
+ * @param {Object} vars Optional list of variables to replace within format before removing it.
+ * @param {Node/Range} node Optional node or DOM range to remove the format from defaults to current selection.
+ */
+ function remove(name, vars, node) {
+ var formatList = get(name), format = formatList[0], bookmark, rng, contentEditable = true;
+
+ // Merges the styles for each node
+ function process(node) {
+ var children, i, l, lastContentEditable, hasContentEditableState;
+
+ // Node has a contentEditable value
+ if (node.nodeType === 1 && getContentEditable(node)) {
+ lastContentEditable = contentEditable;
+ contentEditable = getContentEditable(node) === "true";
+ hasContentEditableState = true; // We don't want to wrap the container only it's children
+ }
+
+ // Grab the children first since the nodelist might be changed
+ children = grep(node.childNodes);
+
+ // Process current node
+ if (contentEditable && !hasContentEditableState) {
+ for (i = 0, l = formatList.length; i < l; i++) {
+ if (removeFormat(formatList[i], vars, node, node)) {
+ break;
+ }
+ }
+ }
+
+ // Process the children
+ if (format.deep) {
+ if (children.length) {
+ for (i = 0, l = children.length; i < l; i++) {
+ process(children[i]);
+ }
+
+ if (hasContentEditableState) {
+ contentEditable = lastContentEditable; // Restore last contentEditable state from stack
+ }
+ }
+ }
+ }
+
+ function findFormatRoot(container) {
+ var formatRoot;
+
+ // Find format root
+ each(getParents(container.parentNode).reverse(), function(parent) {
+ var format;
+
+ // Find format root element
+ if (!formatRoot && parent.id != '_start' && parent.id != '_end') {
+ // Is the node matching the format we are looking for
+ format = matchNode(parent, name, vars);
+ if (format && format.split !== false) {
+ formatRoot = parent;
+ }
+ }
+ });
+
+ return formatRoot;
+ }
+
+ function wrapAndSplit(format_root, container, target, split) {
+ var parent, clone, lastClone, firstClone, i, formatRootParent;
+
+ // Format root found then clone formats and split it
+ if (format_root) {
+ formatRootParent = format_root.parentNode;
+
+ for (parent = container.parentNode; parent && parent != formatRootParent; parent = parent.parentNode) {
+ clone = dom.clone(parent, FALSE);
+
+ for (i = 0; i < formatList.length; i++) {
+ if (removeFormat(formatList[i], vars, clone, clone)) {
+ clone = 0;
+ break;
+ }
+ }
+
+ // Build wrapper node
+ if (clone) {
+ if (lastClone) {
+ clone.appendChild(lastClone);
+ }
+
+ if (!firstClone) {
+ firstClone = clone;
+ }
+
+ lastClone = clone;
+ }
+ }
+
+ // Never split block elements if the format is mixed
+ if (split && (!format.mixed || !isBlock(format_root))) {
+ container = dom.split(format_root, container);
+ }
+
+ // Wrap container in cloned formats
+ if (lastClone) {
+ target.parentNode.insertBefore(lastClone, target);
+ firstClone.appendChild(target);
+ }
+ }
+
+ return container;
+ }
+
+ function splitToFormatRoot(container) {
+ return wrapAndSplit(findFormatRoot(container), container, container, true);
+ }
+
+ function unwrap(start) {
+ var node = dom.get(start ? '_start' : '_end'),
+ out = node[start ? 'firstChild' : 'lastChild'];
+
+ // If the end is placed within the start the result will be removed
+ // So this checks if the out node is a bookmark node if it is it
+ // checks for another more suitable node
+ if (isBookmarkNode(out)) {
+ out = out[start ? 'firstChild' : 'lastChild'];
+ }
+
+ dom.remove(node, true);
+
+ return out;
+ }
+
+ function removeRngStyle(rng) {
+ var startContainer, endContainer;
+ var commonAncestorContainer = rng.commonAncestorContainer;
+
+ rng = expandRng(rng, formatList, TRUE);
+
+ if (format.split) {
+ startContainer = getContainer(rng, TRUE);
+ endContainer = getContainer(rng);
+
+ if (startContainer != endContainer) {
+ // WebKit will render the table incorrectly if we wrap a TH or TD in a SPAN
+ // so let's see if we can use the first child instead
+ // This will happen if you triple click a table cell and use remove formatting
+ if (/^(TR|TH|TD)$/.test(startContainer.nodeName) && startContainer.firstChild) {
+ if (startContainer.nodeName == "TR") {
+ startContainer = startContainer.firstChild.firstChild || startContainer;
+ } else {
+ startContainer = startContainer.firstChild || startContainer;
+ }
+ }
+
+ // Try to adjust endContainer as well if cells on the same row were selected - bug #6410
+ if (commonAncestorContainer &&
+ /^T(HEAD|BODY|FOOT|R)$/.test(commonAncestorContainer.nodeName) &&
+ /^(TH|TD)$/.test(endContainer.nodeName) && endContainer.firstChild) {
+ endContainer = endContainer.firstChild || endContainer;
+ }
+
+ // Wrap start/end nodes in span element since these might be cloned/moved
+ startContainer = wrap(startContainer, 'span', {id: '_start', 'data-mce-type': 'bookmark'});
+ endContainer = wrap(endContainer, 'span', {id: '_end', 'data-mce-type': 'bookmark'});
+
+ // Split start/end
+ splitToFormatRoot(startContainer);
+ splitToFormatRoot(endContainer);
+
+ // Unwrap start/end to get real elements again
+ startContainer = unwrap(TRUE);
+ endContainer = unwrap();
+ } else {
+ startContainer = endContainer = splitToFormatRoot(startContainer);
+ }
+
+ // Update range positions since they might have changed after the split operations
+ rng.startContainer = startContainer.parentNode;
+ rng.startOffset = nodeIndex(startContainer);
+ rng.endContainer = endContainer.parentNode;
+ rng.endOffset = nodeIndex(endContainer) + 1;
+ }
+
+ // Remove items between start/end
+ rangeUtils.walk(rng, function(nodes) {
+ each(nodes, function(node) {
+ process(node);
+
+ // Remove parent span if it only contains text-decoration: underline, yet a parent node is also underlined.
+ if (node.nodeType === 1 && ed.dom.getStyle(node, 'text-decoration') === 'underline' &&
+ node.parentNode && getTextDecoration(node.parentNode) === 'underline') {
+ removeFormat({
+ 'deep': false,
+ 'exact': true,
+ 'inline': 'span',
+ 'styles': {
+ 'textDecoration': 'underline'
+ }
+ }, null, node);
+ }
+ });
+ });
+ }
+
+ // Handle node
+ if (node) {
+ if (node.nodeType) {
+ rng = dom.createRng();
+ rng.setStartBefore(node);
+ rng.setEndAfter(node);
+ removeRngStyle(rng);
+ } else {
+ removeRngStyle(node);
+ }
+
+ return;
+ }
+
+ if (!selection.isCollapsed() || !format.inline || dom.select('td.mce-item-selected,th.mce-item-selected').length) {
+ bookmark = selection.getBookmark();
+ removeRngStyle(selection.getRng(TRUE));
+ selection.moveToBookmark(bookmark);
+
+ // Check if start element still has formatting then we are at: "<b>text|</b>text"
+ // and need to move the start into the next text node
+ if (format.inline && match(name, vars, selection.getStart())) {
+ moveStart(selection.getRng(true));
+ }
+
+ ed.nodeChanged();
+ } else {
+ performCaretAction('remove', name, vars);
+ }
+ }
+
+ /**
+ * Toggles the specified format on/off.
+ *
+ * @method toggle
+ * @param {String} name Name of format to apply/remove.
+ * @param {Object} vars Optional list of variables to replace within format before applying/removing it.
+ * @param {Node} node Optional node to apply the format to or remove from. Defaults to current selection.
+ */
+ function toggle(name, vars, node) {
+ var fmt = get(name);
+
+ if (match(name, vars, node) && (!('toggle' in fmt[0]) || fmt[0].toggle)) {
+ remove(name, vars, node);
+ } else {
+ apply(name, vars, node);
+ }
+ }
+
+ /**
+ * Return true/false if the specified node has the specified format.
+ *
+ * @method matchNode
+ * @param {Node} node Node to check the format on.
+ * @param {String} name Format name to check.
+ * @param {Object} vars Optional list of variables to replace before checking it.
+ * @param {Boolean} similar Match format that has similar properties.
+ * @return {Object} Returns the format object it matches or undefined if it doesn't match.
+ */
+ function matchNode(node, name, vars, similar) {
+ var formatList = get(name), format, i, classes;
+
+ function matchItems(node, format, item_name) {
+ var key, value, items = format[item_name], i;
+
+ // Custom match
+ if (format.onmatch) {
+ return format.onmatch(node, format, item_name);
+ }
+
+ // Check all items
+ if (items) {
+ // Non indexed object
+ if (items.length === undef) {
+ for (key in items) {
+ if (items.hasOwnProperty(key)) {
+ if (item_name === 'attributes') {
+ value = dom.getAttrib(node, key);
+ } else {
+ value = getStyle(node, key);
+ }
+
+ if (similar && !value && !format.exact) {
+ return;
+ }
+
+ if ((!similar || format.exact) && !isEq(value, normalizeStyleValue(replaceVars(items[key], vars), key))) {
+ return;
+ }
+ }
+ }
+ } else {
+ // Only one match needed for indexed arrays
+ for (i = 0; i < items.length; i++) {
+ if (item_name === 'attributes' ? dom.getAttrib(node, items[i]) : getStyle(node, items[i])) {
+ return format;
+ }
+ }
+ }
+ }
+
+ return format;
+ }
+
+ if (formatList && node) {
+ // Check each format in list
+ for (i = 0; i < formatList.length; i++) {
+ format = formatList[i];
+
+ // Name name, attributes, styles and classes
+ if (matchName(node, format) && matchItems(node, format, 'attributes') && matchItems(node, format, 'styles')) {
+ // Match classes
+ if ((classes = format.classes)) {
+ for (i = 0; i < classes.length; i++) {
+ if (!dom.hasClass(node, classes[i])) {
+ return;
+ }
+ }
+ }
+
+ return format;
+ }
+ }
+ }
+ }
+
+ /**
+ * Matches the current selection or specified node against the specified format name.
+ *
+ * @method match
+ * @param {String} name Name of format to match.
+ * @param {Object} vars Optional list of variables to replace before checking it.
+ * @param {Node} node Optional node to check.
+ * @return {boolean} true/false if the specified selection/node matches the format.
+ */
+ function match(name, vars, node) {
+ var startNode;
+
+ function matchParents(node) {
+ var root = dom.getRoot();
+
+ if (node === root) {
+ return false;
+ }
+
+ // Find first node with similar format settings
+ node = dom.getParent(node, function(node) {
+ return node.parentNode === root || !!matchNode(node, name, vars, true);
+ });
+
+ // Do an exact check on the similar format element
+ return matchNode(node, name, vars);
+ }
+
+ // Check specified node
+ if (node) {
+ return matchParents(node);
+ }
+
+ // Check selected node
+ node = selection.getNode();
+ if (matchParents(node)) {
+ return TRUE;
+ }
+
+ // Check start node if it's different
+ startNode = selection.getStart();
+ if (startNode != node) {
+ if (matchParents(startNode)) {
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+ }
+
+ /**
+ * Matches the current selection against the array of formats and returns a new array with matching formats.
+ *
+ * @method matchAll
+ * @param {Array} names Name of format to match.
+ * @param {Object} vars Optional list of variables to replace before checking it.
+ * @return {Array} Array with matched formats.
+ */
+ function matchAll(names, vars) {
+ var startElement, matchedFormatNames = [], checkedMap = {};
+
+ // Check start of selection for formats
+ startElement = selection.getStart();
+ dom.getParent(startElement, function(node) {
+ var i, name;
+
+ for (i = 0; i < names.length; i++) {
+ name = names[i];
+
+ if (!checkedMap[name] && matchNode(node, name, vars)) {
+ checkedMap[name] = true;
+ matchedFormatNames.push(name);
+ }
+ }
+ }, dom.getRoot());
+
+ return matchedFormatNames;
+ }
+
+ /**
+ * Returns true/false if the specified format can be applied to the current selection or not. It
+ * will currently only check the state for selector formats, it returns true on all other format types.
+ *
+ * @method canApply
+ * @param {String} name Name of format to check.
+ * @return {boolean} true/false if the specified format can be applied to the current selection/node.
+ */
+ function canApply(name) {
+ var formatList = get(name), startNode, parents, i, x, selector;
+
+ if (formatList) {
+ startNode = selection.getStart();
+ parents = getParents(startNode);
+
+ for (x = formatList.length - 1; x >= 0; x--) {
+ selector = formatList[x].selector;
+
+ // Format is not selector based then always return TRUE
+ // Is it has a defaultBlock then it's likely it can be applied for example align on a non block element line
+ if (!selector || formatList[x].defaultBlock) {
+ return TRUE;
+ }
+
+ for (i = parents.length - 1; i >= 0; i--) {
+ if (dom.is(parents[i], selector)) {
+ return TRUE;
+ }
+ }
+ }
+ }
+
+ return FALSE;
+ }
+
+ /**
+ * Executes the specified callback when the current selection matches the formats or not.
+ *
+ * @method formatChanged
+ * @param {String} formats Comma separated list of formats to check for.
+ * @param {function} callback Callback with state and args when the format is changed/toggled on/off.
+ * @param {Boolean} similar True/false state if the match should handle similar or exact formats.
+ */
+ function formatChanged(formats, callback, similar) {
+ var currentFormats;
+
+ // Setup format node change logic
+ if (!formatChangeData) {
+ formatChangeData = {};
+ currentFormats = {};
+
+ ed.on('NodeChange', function(e) {
+ var parents = getParents(e.element), matchedFormats = {};
+
+ // Check for new formats
+ each(formatChangeData, function(callbacks, format) {
+ each(parents, function(node) {
+ if (matchNode(node, format, {}, callbacks.similar)) {
+ if (!currentFormats[format]) {
+ // Execute callbacks
+ each(callbacks, function(callback) {
+ callback(true, {node: node, format: format, parents: parents});
+ });
+
+ currentFormats[format] = callbacks;
+ }
+
+ matchedFormats[format] = callbacks;
+ return false;
+ }
+ });
+ });
+
+ // Check if current formats still match
+ each(currentFormats, function(callbacks, format) {
+ if (!matchedFormats[format]) {
+ delete currentFormats[format];
+
+ each(callbacks, function(callback) {
+ callback(false, {node: e.element, format: format, parents: parents});
+ });
+ }
+ });
+ });
+ }
+
+ // Add format listeners
+ each(formats.split(','), function(format) {
+ if (!formatChangeData[format]) {
+ formatChangeData[format] = [];
+ formatChangeData[format].similar = similar;
+ }
+
+ formatChangeData[format].push(callback);
+ });
+
+ return this;
+ }
+
+ // Expose to public
+ extend(this, {
+ get: get,
+ register: register,
+ apply: apply,
+ remove: remove,
+ toggle: toggle,
+ match: match,
+ matchAll: matchAll,
+ matchNode: matchNode,
+ canApply: canApply,
+ formatChanged: formatChanged
+ });
+
+ // Initialize
+ defaultFormats();
+ addKeyboardShortcuts();
+ ed.on('BeforeGetContent', function() {
+ if (markCaretContainersBogus) {
+ markCaretContainersBogus();
+ }
+ });
+ ed.on('mouseup keydown', function(e) {
+ if (disableCaretContainer) {
+ disableCaretContainer(e);
+ }
+ });
+
+ // Private functions
+
+ /**
+ * Checks if the specified nodes name matches the format inline/block or selector.
+ *
+ * @private
+ * @param {Node} node Node to match against the specified format.
+ * @param {Object} format Format object o match with.
+ * @return {boolean} true/false if the format matches.
+ */
+ function matchName(node, format) {
+ // Check for inline match
+ if (isEq(node, format.inline)) {
+ return TRUE;
+ }
+
+ // Check for block match
+ if (isEq(node, format.block)) {
+ return TRUE;
+ }
+
+ // Check for selector match
+ if (format.selector) {
+ return node.nodeType == 1 && dom.is(node, format.selector);
+ }
+ }
+
+ /**
+ * Compares two string/nodes regardless of their case.
+ *
+ * @private
+ * @param {String/Node} Node or string to compare.
+ * @param {String/Node} Node or string to compare.
+ * @return {boolean} True/false if they match.
+ */
+ function isEq(str1, str2) {
+ str1 = str1 || '';
+ str2 = str2 || '';
+
+ str1 = '' + (str1.nodeName || str1);
+ str2 = '' + (str2.nodeName || str2);
+
+ return str1.toLowerCase() == str2.toLowerCase();
+ }
+
+ /**
+ * Returns the style by name on the specified node. This method modifies the style
+ * contents to make it more easy to match. This will resolve a few browser issues.
+ *
+ * @private
+ * @param {Node} node to get style from.
+ * @param {String} name Style name to get.
+ * @return {String} Style item value.
+ */
+ function getStyle(node, name) {
+ return normalizeStyleValue(dom.getStyle(node, name), name);
+ }
+
+ /**
+ * Normalize style value by name. This method modifies the style contents
+ * to make it more easy to match. This will resolve a few browser issues.
+ *
+ * @private
+ * @param {Node} node to get style from.
+ * @param {String} name Style name to get.
+ * @return {String} Style item value.
+ */
+ function normalizeStyleValue(value, name) {
+ // Force the format to hex
+ if (name == 'color' || name == 'backgroundColor') {
+ value = dom.toHex(value);
+ }
+
+ // Opera will return bold as 700
+ if (name == 'fontWeight' && value == 700) {
+ value = 'bold';
+ }
+
+ // Normalize fontFamily so "'Font name', Font" becomes: "Font name,Font"
+ if (name == 'fontFamily') {
+ value = value.replace(/[\'\"]/g, '').replace(/,\s+/g, ',');
+ }
+
+ return '' + value;
+ }
+
+ /**
+ * Replaces variables in the value. The variable format is %var.
+ *
+ * @private
+ * @param {String} value Value to replace variables in.
+ * @param {Object} vars Name/value array with variables to replace.
+ * @return {String} New value with replaced variables.
+ */
+ function replaceVars(value, vars) {
+ if (typeof(value) != "string") {
+ value = value(vars);
+ } else if (vars) {
+ value = value.replace(/%(\w+)/g, function(str, name) {
+ return vars[name] || str;
+ });
+ }
+
+ return value;
+ }
+
+ function isWhiteSpaceNode(node) {
+ return node && node.nodeType === 3 && /^([\t \r\n]+|)$/.test(node.nodeValue);
+ }
+
+ function wrap(node, name, attrs) {
+ var wrapper = dom.create(name, attrs);
+
+ node.parentNode.insertBefore(wrapper, node);
+ wrapper.appendChild(node);
+
+ return wrapper;
+ }
+
+ /**
+ * Expands the specified range like object to depending on format.
+ *
+ * For example on block formats it will move the start/end position
+ * to the beginning of the current block.
+ *
+ * @private
+ * @param {Object} rng Range like object.
+ * @param {Array} formats Array with formats to expand by.
+ * @return {Object} Expanded range like object.
+ */
+ function expandRng(rng, format, remove) {
+ var lastIdx, leaf, endPoint,
+ startContainer = rng.startContainer,
+ startOffset = rng.startOffset,
+ endContainer = rng.endContainer,
+ endOffset = rng.endOffset;
+
+ // This function walks up the tree if there is no siblings before/after the node
+ function findParentContainer(start) {
+ var container, parent, sibling, siblingName, root;
+
+ container = parent = start ? startContainer : endContainer;
+ siblingName = start ? 'previousSibling' : 'nextSibling';
+ root = dom.getRoot();
+
+ function isBogusBr(node) {
+ return node.nodeName == "BR" && node.getAttribute('data-mce-bogus') && !node.nextSibling;
+ }
+
+ // If it's a text node and the offset is inside the text
+ if (container.nodeType == 3 && !isWhiteSpaceNode(container)) {
+ if (start ? startOffset > 0 : endOffset < container.nodeValue.length) {
+ return container;
+ }
+ }
+
+ for (;;) {
+ // Stop expanding on block elements
+ if (!format[0].block_expand && isBlock(parent)) {
+ return parent;
+ }
+
+ // Walk left/right
+ for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) {
+ if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling) && !isBogusBr(sibling)) {
+ return parent;
+ }
+ }
+
+ // Check if we can move up are we at root level or body level
+ if (parent.parentNode == root) {
+ container = parent;
+ break;
+ }
+
+ parent = parent.parentNode;
+ }
+
+ return container;
+ }
+
+ // This function walks down the tree to find the leaf at the selection.
+ // The offset is also returned as if node initially a leaf, the offset may be in the middle of the text node.
+ function findLeaf(node, offset) {
+ if (offset === undef) {
+ offset = node.nodeType === 3 ? node.length : node.childNodes.length;
+ }
+
+ while (node && node.hasChildNodes()) {
+ node = node.childNodes[offset];
+ if (node) {
+ offset = node.nodeType === 3 ? node.length : node.childNodes.length;
+ }
+ }
+ return { node: node, offset: offset };
+ }
+
+ // If index based start position then resolve it
+ if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) {
+ lastIdx = startContainer.childNodes.length - 1;
+ startContainer = startContainer.childNodes[startOffset > lastIdx ? lastIdx : startOffset];
+
+ if (startContainer.nodeType == 3) {
+ startOffset = 0;
+ }
+ }
+
+ // If index based end position then resolve it
+ if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) {
+ lastIdx = endContainer.childNodes.length - 1;
+ endContainer = endContainer.childNodes[endOffset > lastIdx ? lastIdx : endOffset - 1];
+
+ if (endContainer.nodeType == 3) {
+ endOffset = endContainer.nodeValue.length;
+ }
+ }
+
+ // Expands the node to the closes contentEditable false element if it exists
+ function findParentContentEditable(node) {
+ var parent = node;
+
+ while (parent) {
+ if (parent.nodeType === 1 && getContentEditable(parent)) {
+ return getContentEditable(parent) === "false" ? parent : node;
+ }
+
+ parent = parent.parentNode;
+ }
+
+ return node;
+ }
+
+ function findWordEndPoint(container, offset, start) {
+ var walker, node, pos, lastTextNode;
+
+ function findSpace(node, offset) {
+ var pos, pos2, str = node.nodeValue;
+
+ if (typeof(offset) == "undefined") {
+ offset = start ? str.length : 0;
+ }
+
+ if (start) {
+ pos = str.lastIndexOf(' ', offset);
+ pos2 = str.lastIndexOf('\u00a0', offset);
+ pos = pos > pos2 ? pos : pos2;
+
+ // Include the space on remove to avoid tag soup
+ if (pos !== -1 && !remove) {
+ pos++;
+ }
+ } else {
+ pos = str.indexOf(' ', offset);
+ pos2 = str.indexOf('\u00a0', offset);
+ pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2;
+ }
+
+ return pos;
+ }
+
+ if (container.nodeType === 3) {
+ pos = findSpace(container, offset);
+
+ if (pos !== -1) {
+ return {container: container, offset: pos};
+ }
+
+ lastTextNode = container;
+ }
+
+ // Walk the nodes inside the block
+ walker = new TreeWalker(container, dom.getParent(container, isBlock) || ed.getBody());
+ while ((node = walker[start ? 'prev' : 'next']())) {
+ if (node.nodeType === 3) {
+ lastTextNode = node;
+ pos = findSpace(node);
+
+ if (pos !== -1) {
+ return {container: node, offset: pos};
+ }
+ } else if (isBlock(node)) {
+ break;
+ }
+ }
+
+ if (lastTextNode) {
+ if (start) {
+ offset = 0;
+ } else {
+ offset = lastTextNode.length;
+ }
+
+ return {container: lastTextNode, offset: offset};
+ }
+ }
+
+ function findSelectorEndPoint(container, sibling_name) {
+ var parents, i, y, curFormat;
+
+ if (container.nodeType == 3 && container.nodeValue.length === 0 && container[sibling_name]) {
+ container = container[sibling_name];
+ }
+
+ parents = getParents(container);
+ for (i = 0; i < parents.length; i++) {
+ for (y = 0; y < format.length; y++) {
+ curFormat = format[y];
+
+ // If collapsed state is set then skip formats that doesn't match that
+ if ("collapsed" in curFormat && curFormat.collapsed !== rng.collapsed) {
+ continue;
+ }
+
+ if (dom.is(parents[i], curFormat.selector)) {
+ return parents[i];
+ }
+ }
+ }
+
+ return container;
+ }
+
+ function findBlockEndPoint(container, sibling_name) {
+ var node, root = dom.getRoot();
+
+ // Expand to block of similar type
+ if (!format[0].wrapper) {
+ node = dom.getParent(container, format[0].block, root);
+ }
+
+ // Expand to first wrappable block element or any block element
+ if (!node) {
+ node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, function(node) {
+ // Fixes #6183 where it would expand to editable parent element in inline mode
+ return node != root && isTextBlock(node);
+ });
+ }
+
+ // Exclude inner lists from wrapping
+ if (node && format[0].wrapper) {
+ node = getParents(node, 'ul,ol').reverse()[0] || node;
+ }
+
+ // Didn't find a block element look for first/last wrappable element
+ if (!node) {
+ node = container;
+
+ while (node[sibling_name] && !isBlock(node[sibling_name])) {
+ node = node[sibling_name];
+
+ // Break on BR but include it will be removed later on
+ // we can't remove it now since we need to check if it can be wrapped
+ if (isEq(node, 'br')) {
+ break;
+ }
+ }
+ }
+
+ return node || container;
+ }
+
+ // Expand to closest contentEditable element
+ startContainer = findParentContentEditable(startContainer);
+ endContainer = findParentContentEditable(endContainer);
+
+ // Exclude bookmark nodes if possible
+ if (isBookmarkNode(startContainer.parentNode) || isBookmarkNode(startContainer)) {
+ startContainer = isBookmarkNode(startContainer) ? startContainer : startContainer.parentNode;
+ startContainer = startContainer.nextSibling || startContainer;
+
+ if (startContainer.nodeType == 3) {
+ startOffset = 0;
+ }
+ }
+
+ if (isBookmarkNode(endContainer.parentNode) || isBookmarkNode(endContainer)) {
+ endContainer = isBookmarkNode(endContainer) ? endContainer : endContainer.parentNode;
+ endContainer = endContainer.previousSibling || endContainer;
+
+ if (endContainer.nodeType == 3) {
+ endOffset = endContainer.length;
+ }
+ }
+
+ if (format[0].inline) {
+ if (rng.collapsed) {
+ // Expand left to closest word boundary
+ endPoint = findWordEndPoint(startContainer, startOffset, true);
+ if (endPoint) {
+ startContainer = endPoint.container;
+ startOffset = endPoint.offset;
+ }
+
+ // Expand right to closest word boundary
+ endPoint = findWordEndPoint(endContainer, endOffset);
+ if (endPoint) {
+ endContainer = endPoint.container;
+ endOffset = endPoint.offset;
+ }
+ }
+
+ // Avoid applying formatting to a trailing space.
+ leaf = findLeaf(endContainer, endOffset);
+ if (leaf.node) {
+ while (leaf.node && leaf.offset === 0 && leaf.node.previousSibling) {
+ leaf = findLeaf(leaf.node.previousSibling);
+ }
+
+ if (leaf.node && leaf.offset > 0 && leaf.node.nodeType === 3 &&
+ leaf.node.nodeValue.charAt(leaf.offset - 1) === ' ') {
+
+ if (leaf.offset > 1) {
+ endContainer = leaf.node;
+ endContainer.splitText(leaf.offset - 1);
+ }
+ }
+ }
+ }
+
+ // Move start/end point up the tree if the leaves are sharp and if we are in different containers
+ // Example * becomes !: !<p><b><i>*text</i><i>text*</i></b></p>!
+ // This will reduce the number of wrapper elements that needs to be created
+ // Move start point up the tree
+ if (format[0].inline || format[0].block_expand) {
+ if (!format[0].inline || (startContainer.nodeType != 3 || startOffset === 0)) {
+ startContainer = findParentContainer(true);
+ }
+
+ if (!format[0].inline || (endContainer.nodeType != 3 || endOffset === endContainer.nodeValue.length)) {
+ endContainer = findParentContainer();
+ }
+ }
+
+ // Expand start/end container to matching selector
+ if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) {
+ // Find new startContainer/endContainer if there is better one
+ startContainer = findSelectorEndPoint(startContainer, 'previousSibling');
+ endContainer = findSelectorEndPoint(endContainer, 'nextSibling');
+ }
+
+ // Expand start/end container to matching block element or text node
+ if (format[0].block || format[0].selector) {
+ // Find new startContainer/endContainer if there is better one
+ startContainer = findBlockEndPoint(startContainer, 'previousSibling');
+ endContainer = findBlockEndPoint(endContainer, 'nextSibling');
+
+ // Non block element then try to expand up the leaf
+ if (format[0].block) {
+ if (!isBlock(startContainer)) {
+ startContainer = findParentContainer(true);
+ }
+
+ if (!isBlock(endContainer)) {
+ endContainer = findParentContainer();
+ }
+ }
+ }
+
+ // Setup index for startContainer
+ if (startContainer.nodeType == 1) {
+ startOffset = nodeIndex(startContainer);
+ startContainer = startContainer.parentNode;
+ }
+
+ // Setup index for endContainer
+ if (endContainer.nodeType == 1) {
+ endOffset = nodeIndex(endContainer) + 1;
+ endContainer = endContainer.parentNode;
+ }
+
+ // Return new range like object
+ return {
+ startContainer: startContainer,
+ startOffset: startOffset,
+ endContainer: endContainer,
+ endOffset: endOffset
+ };
+ }
+
+ /**
+ * Removes the specified format for the specified node. It will also remove the node if it doesn't have
+ * any attributes if the format specifies it to do so.
+ *
+ * @private
+ * @param {Object} format Format object with items to remove from node.
+ * @param {Object} vars Name/value object with variables to apply to format.
+ * @param {Node} node Node to remove the format styles on.
+ * @param {Node} compare_node Optional compare node, if specified the styles will be compared to that node.
+ * @return {Boolean} True/false if the node was removed or not.
+ */
+ function removeFormat(format, vars, node, compare_node) {
+ var i, attrs, stylesModified;
+
+ // Check if node matches format
+ if (!matchName(node, format)) {
+ return FALSE;
+ }
+
+ // Should we compare with format attribs and styles
+ if (format.remove != 'all') {
+ // Remove styles
+ each(format.styles, function(value, name) {
+ value = normalizeStyleValue(replaceVars(value, vars), name);
+
+ // Indexed array
+ if (typeof(name) === 'number') {
+ name = value;
+ compare_node = 0;
+ }
+
+ if (!compare_node || isEq(getStyle(compare_node, name), value)) {
+ dom.setStyle(node, name, '');
+ }
+
+ stylesModified = 1;
+ });
+
+ // Remove style attribute if it's empty
+ if (stylesModified && dom.getAttrib(node, 'style') === '') {
+ node.removeAttribute('style');
+ node.removeAttribute('data-mce-style');
+ }
+
+ // Remove attributes
+ each(format.attributes, function(value, name) {
+ var valueOut;
+
+ value = replaceVars(value, vars);
+
+ // Indexed array
+ if (typeof(name) === 'number') {
+ name = value;
+ compare_node = 0;
+ }
+
+ if (!compare_node || isEq(dom.getAttrib(compare_node, name), value)) {
+ // Keep internal classes
+ if (name == 'class') {
+ value = dom.getAttrib(node, name);
+ if (value) {
+ // Build new class value where everything is removed except the internal prefixed classes
+ valueOut = '';
+ each(value.split(/\s+/), function(cls) {
+ if (/mce\w+/.test(cls)) {
+ valueOut += (valueOut ? ' ' : '') + cls;
+ }
+ });
+
+ // We got some internal classes left
+ if (valueOut) {
+ dom.setAttrib(node, name, valueOut);
+ return;
+ }
+ }
+ }
+
+ // IE6 has a bug where the attribute doesn't get removed correctly
+ if (name == "class") {
+ node.removeAttribute('className');
+ }
+
+ // Remove mce prefixed attributes
+ if (MCE_ATTR_RE.test(name)) {
+ node.removeAttribute('data-mce-' + name);
+ }
+
+ node.removeAttribute(name);
+ }
+ });
+
+ // Remove classes
+ each(format.classes, function(value) {
+ value = replaceVars(value, vars);
+
+ if (!compare_node || dom.hasClass(compare_node, value)) {
+ dom.removeClass(node, value);
+ }
+ });
+
+ // Check for non internal attributes
+ attrs = dom.getAttribs(node);
+ for (i = 0; i < attrs.length; i++) {
+ if (attrs[i].nodeName.indexOf('_') !== 0) {
+ return FALSE;
+ }
+ }
+ }
+
+ // Remove the inline child if it's empty for example <b> or <span>
+ if (format.remove != 'none') {
+ removeNode(node, format);
+ return TRUE;
+ }
+ }
+
+ /**
+ * Removes the node and wrap it's children in paragraphs before doing so or
+ * appends BR elements to the beginning/end of the block element if forcedRootBlocks is disabled.
+ *
+ * If the div in the node below gets removed:
+ * text<div>text</div>text
+ *
+ * Output becomes:
+ * text<div><br />text<br /></div>text
+ *
+ * So when the div is removed the result is:
+ * text<br />text<br />text
+ *
+ * @private
+ * @param {Node} node Node to remove + apply BR/P elements to.
+ * @param {Object} format Format rule.
+ * @return {Node} Input node.
+ */
+ function removeNode(node, format) {
+ var parentNode = node.parentNode, rootBlockElm;
+
+ function find(node, next, inc) {
+ node = getNonWhiteSpaceSibling(node, next, inc);
+
+ return !node || (node.nodeName == 'BR' || isBlock(node));
+ }
+
+ if (format.block) {
+ if (!forcedRootBlock) {
+ // Append BR elements if needed before we remove the block
+ if (isBlock(node) && !isBlock(parentNode)) {
+ if (!find(node, FALSE) && !find(node.firstChild, TRUE, 1)) {
+ node.insertBefore(dom.create('br'), node.firstChild);
+ }
+
+ if (!find(node, TRUE) && !find(node.lastChild, FALSE, 1)) {
+ node.appendChild(dom.create('br'));
+ }
+ }
+ } else {
+ // Wrap the block in a forcedRootBlock if we are at the root of document
+ if (parentNode == dom.getRoot()) {
+ if (!format.list_block || !isEq(node, format.list_block)) {
+ each(grep(node.childNodes), function(node) {
+ if (isValid(forcedRootBlock, node.nodeName.toLowerCase())) {
+ if (!rootBlockElm) {
+ rootBlockElm = wrap(node, forcedRootBlock);
+ dom.setAttribs(rootBlockElm, ed.settings.forced_root_block_attrs);
+ } else {
+ rootBlockElm.appendChild(node);
+ }
+ } else {
+ rootBlockElm = 0;
+ }
+ });
+ }
+ }
+ }
+ }
+
+ // Never remove nodes that isn't the specified inline element if a selector is specified too
+ if (format.selector && format.inline && !isEq(format.inline, node)) {
+ return;
+ }
+
+ dom.remove(node, 1);
+ }
+
+ /**
+ * Returns the next/previous non whitespace node.
+ *
+ * @private
+ * @param {Node} node Node to start at.
+ * @param {boolean} next (Optional) Include next or previous node defaults to previous.
+ * @param {boolean} inc (Optional) Include the current node in checking. Defaults to false.
+ * @return {Node} Next or previous node or undefined if it wasn't found.
+ */
+ function getNonWhiteSpaceSibling(node, next, inc) {
+ if (node) {
+ next = next ? 'nextSibling' : 'previousSibling';
+
+ for (node = inc ? node : node[next]; node; node = node[next]) {
+ if (node.nodeType == 1 || !isWhiteSpaceNode(node)) {
+ return node;
+ }
+ }
+ }
+ }
+
+ /**
+ * Checks if the specified node is a bookmark node or not.
+ *
+ * @private
+ * @param {Node} node Node to check if it's a bookmark node or not.
+ * @return {Boolean} true/false if the node is a bookmark node.
+ */
+ function isBookmarkNode(node) {
+ return node && node.nodeType == 1 && node.getAttribute('data-mce-type') == 'bookmark';
+ }
+
+ /**
+ * Merges the next/previous sibling element if they match.
+ *
+ * @private
+ * @param {Node} prev Previous node to compare/merge.
+ * @param {Node} next Next node to compare/merge.
+ * @return {Node} Next node if we didn't merge and prev node if we did.
+ */
+ function mergeSiblings(prev, next) {
+ var sibling, tmpSibling;
+
+ /**
+ * Compares two nodes and checks if it's attributes and styles matches.
+ * This doesn't compare classes as items since their order is significant.
+ *
+ * @private
+ * @param {Node} node1 First node to compare with.
+ * @param {Node} node2 Second node to compare with.
+ * @return {boolean} True/false if the nodes are the same or not.
+ */
+ function compareElements(node1, node2) {
+ // Not the same name
+ if (node1.nodeName != node2.nodeName) {
+ return FALSE;
+ }
+
+ /**
+ * Returns all the nodes attributes excluding internal ones, styles and classes.
+ *
+ * @private
+ * @param {Node} node Node to get attributes from.
+ * @return {Object} Name/value object with attributes and attribute values.
+ */
+ function getAttribs(node) {
+ var attribs = {};
+
+ each(dom.getAttribs(node), function(attr) {
+ var name = attr.nodeName.toLowerCase();
+
+ // Don't compare internal attributes or style
+ if (name.indexOf('_') !== 0 && name !== 'style') {
+ attribs[name] = dom.getAttrib(node, name);
+ }
+ });
+
+ return attribs;
+ }
+
+ /**
+ * Compares two objects checks if it's key + value exists in the other one.
+ *
+ * @private
+ * @param {Object} obj1 First object to compare.
+ * @param {Object} obj2 Second object to compare.
+ * @return {boolean} True/false if the objects matches or not.
+ */
+ function compareObjects(obj1, obj2) {
+ var value, name;
+
+ for (name in obj1) {
+ // Obj1 has item obj2 doesn't have
+ if (obj1.hasOwnProperty(name)) {
+ value = obj2[name];
+
+ // Obj2 doesn't have obj1 item
+ if (value === undef) {
+ return FALSE;
+ }
+
+ // Obj2 item has a different value
+ if (obj1[name] != value) {
+ return FALSE;
+ }
+
+ // Delete similar value
+ delete obj2[name];
+ }
+ }
+
+ // Check if obj 2 has something obj 1 doesn't have
+ for (name in obj2) {
+ // Obj2 has item obj1 doesn't have
+ if (obj2.hasOwnProperty(name)) {
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+ }
+
+ // Attribs are not the same
+ if (!compareObjects(getAttribs(node1), getAttribs(node2))) {
+ return FALSE;
+ }
+
+ // Styles are not the same
+ if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) {
+ return FALSE;
+ }
+
+ return TRUE;
+ }
+
+ function findElementSibling(node, sibling_name) {
+ for (sibling = node; sibling; sibling = sibling[sibling_name]) {
+ if (sibling.nodeType == 3 && sibling.nodeValue.length !== 0) {
+ return node;
+ }
+
+ if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) {
+ return sibling;
+ }
+ }
+
+ return node;
+ }
+
+ // Check if next/prev exists and that they are elements
+ if (prev && next) {
+ // If previous sibling is empty then jump over it
+ prev = findElementSibling(prev, 'previousSibling');
+ next = findElementSibling(next, 'nextSibling');
+
+ // Compare next and previous nodes
+ if (compareElements(prev, next)) {
+ // Append nodes between
+ for (sibling = prev.nextSibling; sibling && sibling != next;) {
+ tmpSibling = sibling;
+ sibling = sibling.nextSibling;
+ prev.appendChild(tmpSibling);
+ }
+
+ // Remove next node
+ dom.remove(next);
+
+ // Move children into prev node
+ each(grep(next.childNodes), function(node) {
+ prev.appendChild(node);
+ });
+
+ return prev;
+ }
+ }
+
+ return next;
+ }
+
+ function getContainer(rng, start) {
+ var container, offset, lastIdx;
+
+ container = rng[start ? 'startContainer' : 'endContainer'];
+ offset = rng[start ? 'startOffset' : 'endOffset'];
+
+ if (container.nodeType == 1) {
+ lastIdx = container.childNodes.length - 1;
+
+ if (!start && offset) {
+ offset--;
+ }
+
+ container = container.childNodes[offset > lastIdx ? lastIdx : offset];
+ }
+
+ // If start text node is excluded then walk to the next node
+ if (container.nodeType === 3 && start && offset >= container.nodeValue.length) {
+ container = new TreeWalker(container, ed.getBody()).next() || container;
+ }
+
+ // If end text node is excluded then walk to the previous node
+ if (container.nodeType === 3 && !start && offset === 0) {
+ container = new TreeWalker(container, ed.getBody()).prev() || container;
+ }
+
+ return container;
+ }
+
+ function performCaretAction(type, name, vars) {
+ var caretContainerId = '_mce_caret', debug = ed.settings.caret_debug;
+
+ // Creates a caret container bogus element
+ function createCaretContainer(fill) {
+ var caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''});
+
+ if (fill) {
+ caretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR));
+ }
+
+ return caretContainer;
+ }
+
+ function isCaretContainerEmpty(node, nodes) {
+ while (node) {
+ if ((node.nodeType === 3 && node.nodeValue !== INVISIBLE_CHAR) || node.childNodes.length > 1) {
+ return false;
+ }
+
+ // Collect nodes
+ if (nodes && node.nodeType === 1) {
+ nodes.push(node);
+ }
+
+ node = node.firstChild;
+ }
+
+ return true;
+ }
+
+ // Returns any parent caret container element
+ function getParentCaretContainer(node) {
+ while (node) {
+ if (node.id === caretContainerId) {
+ return node;
+ }
+
+ node = node.parentNode;
+ }
+ }
+
+ // Finds the first text node in the specified node
+ function findFirstTextNode(node) {
+ var walker;
+
+ if (node) {
+ walker = new TreeWalker(node, node);
+
+ for (node = walker.current(); node; node = walker.next()) {
+ if (node.nodeType === 3) {
+ return node;
+ }
+ }
+ }
+ }
+
+ // Removes the caret container for the specified node or all on the current document
+ function removeCaretContainer(node, move_caret) {
+ var child, rng;
+
+ if (!node) {
+ node = getParentCaretContainer(selection.getStart());
+
+ if (!node) {
+ while ((node = dom.get(caretContainerId))) {
+ removeCaretContainer(node, false);
+ }
+ }
+ } else {
+ rng = selection.getRng(true);
+
+ if (isCaretContainerEmpty(node)) {
+ if (move_caret !== false) {
+ rng.setStartBefore(node);
+ rng.setEndBefore(node);
+ }
+
+ dom.remove(node);
+ } else {
+ child = findFirstTextNode(node);
+
+ if (child.nodeValue.charAt(0) === INVISIBLE_CHAR) {
+ child = child.deleteData(0, 1);
+ }
+
+ dom.remove(node, 1);
+ }
+
+ selection.setRng(rng);
+ }
+ }
+
+ // Applies formatting to the caret postion
+ function applyCaretFormat() {
+ var rng, caretContainer, textNode, offset, bookmark, container, text;
+
+ rng = selection.getRng(true);
+ offset = rng.startOffset;
+ container = rng.startContainer;
+ text = container.nodeValue;
+
+ caretContainer = getParentCaretContainer(selection.getStart());
+ if (caretContainer) {
+ textNode = findFirstTextNode(caretContainer);
+ }
+
+ // Expand to word is caret is in the middle of a text node and the char before/after is a alpha numeric character
+ if (text && offset > 0 && offset < text.length && /\w/.test(text.charAt(offset)) && /\w/.test(text.charAt(offset - 1))) {
+ // Get bookmark of caret position
+ bookmark = selection.getBookmark();
+
+ // Collapse bookmark range (WebKit)
+ rng.collapse(true);
+
+ // Expand the range to the closest word and split it at those points
+ rng = expandRng(rng, get(name));
+ rng = rangeUtils.split(rng);
+
+ // Apply the format to the range
+ apply(name, vars, rng);
+
+ // Move selection back to caret position
+ selection.moveToBookmark(bookmark);
+ } else {
+ if (!caretContainer || textNode.nodeValue !== INVISIBLE_CHAR) {
+ caretContainer = createCaretContainer(true);
+ textNode = caretContainer.firstChild;
+
+ rng.insertNode(caretContainer);
+ offset = 1;
+
+ apply(name, vars, caretContainer);
+ } else {
+ apply(name, vars, caretContainer);
+ }
+
+ // Move selection to text node
+ selection.setCursorLocation(textNode, offset);
+ }
+ }
+
+ function removeCaretFormat() {
+ var rng = selection.getRng(true), container, offset, bookmark,
+ hasContentAfter, node, formatNode, parents = [], i, caretContainer;
+
+ container = rng.startContainer;
+ offset = rng.startOffset;
+ node = container;
+
+ if (container.nodeType == 3) {
+ if (offset != container.nodeValue.length || container.nodeValue === INVISIBLE_CHAR) {
+ hasContentAfter = true;
+ }
+
+ node = node.parentNode;
+ }
+
+ while (node) {
+ if (matchNode(node, name, vars)) {
+ formatNode = node;
+ break;
+ }
+
+ if (node.nextSibling) {
+ hasContentAfter = true;
+ }
+
+ parents.push(node);
+ node = node.parentNode;
+ }
+
+ // Node doesn't have the specified format
+ if (!formatNode) {
+ return;
+ }
+
+ // Is there contents after the caret then remove the format on the element
+ if (hasContentAfter) {
+ // Get bookmark of caret position
+ bookmark = selection.getBookmark();
+
+ // Collapse bookmark range (WebKit)
+ rng.collapse(true);
+
+ // Expand the range to the closest word and split it at those points
+ rng = expandRng(rng, get(name), true);
+ rng = rangeUtils.split(rng);
+
+ // Remove the format from the range
+ remove(name, vars, rng);
+
+ // Move selection back to caret position
+ selection.moveToBookmark(bookmark);
+ } else {
+ caretContainer = createCaretContainer();
+
+ node = caretContainer;
+ for (i = parents.length - 1; i >= 0; i--) {
+ node.appendChild(dom.clone(parents[i], false));
+ node = node.firstChild;
+ }
+
+ // Insert invisible character into inner most format element
+ node.appendChild(dom.doc.createTextNode(INVISIBLE_CHAR));
+ node = node.firstChild;
+
+ var block = dom.getParent(formatNode, isTextBlock);
+
+ if (block && dom.isEmpty(block)) {
+ // Replace formatNode with caretContainer when removing format from empty block like <p><b>|</b></p>
+ formatNode.parentNode.replaceChild(caretContainer, formatNode);
+ } else {
+ // Insert caret container after the formated node
+ dom.insertAfter(caretContainer, formatNode);
+ }
+
+ // Move selection to text node
+ selection.setCursorLocation(node, 1);
+
+ // If the formatNode is empty, we can remove it safely.
+ if (dom.isEmpty(formatNode)) {
+ dom.remove(formatNode);
+ }
+ }
+ }
+
+ // Checks if the parent caret container node isn't empty if that is the case it
+ // will remove the bogus state on all children that isn't empty
+ function unmarkBogusCaretParents() {
+ var caretContainer;
+
+ caretContainer = getParentCaretContainer(selection.getStart());
+ if (caretContainer && !dom.isEmpty(caretContainer)) {
+ walk(caretContainer, function(node) {
+ if (node.nodeType == 1 && node.id !== caretContainerId && !dom.isEmpty(node)) {
+ dom.setAttrib(node, 'data-mce-bogus', null);
+ }
+ }, 'childNodes');
+ }
+ }
+
+ // Only bind the caret events once
+ if (!ed._hasCaretEvents) {
+ // Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements
+ markCaretContainersBogus = function() {
+ var nodes = [], i;
+
+ if (isCaretContainerEmpty(getParentCaretContainer(selection.getStart()), nodes)) {
+ // Mark children
+ i = nodes.length;
+ while (i--) {
+ dom.setAttrib(nodes[i], 'data-mce-bogus', '1');
+ }
+ }
+ };
+
+ disableCaretContainer = function(e) {
+ var keyCode = e.keyCode;
+
+ removeCaretContainer();
+
+ // Remove caret container on keydown and it's a backspace, enter or left/right arrow keys
+ if (keyCode == 8 || keyCode == 37 || keyCode == 39) {
+ removeCaretContainer(getParentCaretContainer(selection.getStart()));
+ }
+
+ unmarkBogusCaretParents();
+ };
+
+ // Remove bogus state if they got filled by contents using editor.selection.setContent
+ ed.on('SetContent', function(e) {
+ if (e.selection) {
+ unmarkBogusCaretParents();
+ }
+ });
+ ed._hasCaretEvents = true;
+ }
+
+ // Do apply or remove caret format
+ if (type == "apply") {
+ applyCaretFormat();
+ } else {
+ removeCaretFormat();
+ }
+ }
+
+ /**
+ * Moves the start to the first suitable text node.
+ */
+ function moveStart(rng) {
+ var container = rng.startContainer,
+ offset = rng.startOffset, isAtEndOfText,
+ walker, node, nodes, tmpNode;
+
+ // Convert text node into index if possible
+ if (container.nodeType == 3 && offset >= container.nodeValue.length) {
+ // Get the parent container location and walk from there
+ offset = nodeIndex(container);
+ container = container.parentNode;
+ isAtEndOfText = true;
+ }
+
+ // Move startContainer/startOffset in to a suitable node
+ if (container.nodeType == 1) {
+ nodes = container.childNodes;
+ container = nodes[Math.min(offset, nodes.length - 1)];
+ walker = new TreeWalker(container, dom.getParent(container, dom.isBlock));
+
+ // If offset is at end of the parent node walk to the next one
+ if (offset > nodes.length - 1 || isAtEndOfText) {
+ walker.next();
+ }
+
+ for (node = walker.current(); node; node = walker.next()) {
+ if (node.nodeType == 3 && !isWhiteSpaceNode(node)) {
+ // IE has a "neat" feature where it moves the start node into the closest element
+ // we can avoid this by inserting an element before it and then remove it after we set the selection
+ tmpNode = dom.create('a', null, INVISIBLE_CHAR);
+ node.parentNode.insertBefore(tmpNode, node);
+
+ // Set selection and remove tmpNode
+ rng.setStart(node, 0);
+ selection.setRng(rng);
+ dom.remove(tmpNode);
+
+ return;
+ }
+ }
+ }
+ }
+ };
+});
+
+// Included from: js/tinymce/classes/UndoManager.js
+
+/**
+ * UndoManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles the undo/redo history levels for the editor. Since the build in undo/redo has major drawbacks a custom one was needed.
+ *
+ * @class tinymce.UndoManager
+ */
+define("tinymce/UndoManager", [
+ "tinymce/Env",
+ "tinymce/util/Tools"
+], function(Env, Tools) {
+ var trim = Tools.trim, trimContentRegExp;
+
+ trimContentRegExp = new RegExp([
+ '<span[^>]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\\/span>', // Trim bogus spans like caret containers
+ '<div[^>]+data-mce-bogus[^>]+><\\/div>', // Trim bogus divs like resize handles
+ '\\s?data-mce-selected="[^"]+"' // Trim temporaty data-mce prefixed attributes like data-mce-selected
+ ].join('|'), 'gi');
+
+ return function(editor) {
+ var self, index = 0, data = [], beforeBookmark, isFirstTypedCharacter, lock;
+
+ // Returns a trimmed version of the current editor contents
+ function getContent() {
+ return trim(editor.getContent({format: 'raw', no_events: 1}).replace(trimContentRegExp, ''));
+ }
+
+ function addNonTypingUndoLevel() {
+ self.typing = false;
+ self.add();
+ }
+
+ // Add initial undo level when the editor is initialized
+ editor.on('init', function() {
+ self.add();
+ });
+
+ // Get position before an execCommand is processed
+ editor.on('BeforeExecCommand', function(e) {
+ var cmd = e.command;
+
+ if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint') {
+ self.beforeChange();
+ }
+ });
+
+ // Add undo level after an execCommand call was made
+ editor.on('ExecCommand', function(e) {
+ var cmd = e.command;
+
+ if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint') {
+ self.add();
+ }
+ });
+
+ editor.on('ObjectResizeStart', function() {
+ self.beforeChange();
+ });
+
+ editor.on('SaveContent ObjectResized', addNonTypingUndoLevel);
+ editor.dom.bind(editor.dom.getRoot(), 'dragend', addNonTypingUndoLevel);
+ editor.dom.bind(editor.getBody(), 'focusout', function() {
+ if (!editor.removed && self.typing) {
+ addNonTypingUndoLevel();
+ }
+ });
+
+ editor.on('KeyUp', function(e) {
+ var keyCode = e.keyCode;
+
+ if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45 || keyCode == 13 || e.ctrlKey) {
+ addNonTypingUndoLevel();
+ editor.nodeChanged();
+ }
+
+ if (keyCode == 46 || keyCode == 8 || (Env.mac && (keyCode == 91 || keyCode == 93))) {
+ editor.nodeChanged();
+ }
+
+ // Fire a TypingUndo event on the first character entered
+ if (isFirstTypedCharacter && self.typing) {
+ // Make the it dirty if the content was changed after typing the first character
+ if (!editor.isDirty()) {
+ editor.isNotDirty = !data[0] || getContent() == data[0].content;
+
+ // Fire initial change event
+ if (!editor.isNotDirty) {
+ editor.fire('change', {level: data[0], lastLevel: null});
+ }
+ }
+
+ editor.fire('TypingUndo');
+ isFirstTypedCharacter = false;
+ editor.nodeChanged();
+ }
+ });
+
+ editor.on('KeyDown', function(e) {
+ var keyCode = e.keyCode;
+
+ // Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter
+ if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45) {
+ if (self.typing) {
+ addNonTypingUndoLevel();
+ }
+
+ return;
+ }
+
+ // If key isn't shift,ctrl,alt,capslock,metakey
+ if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !self.typing) {
+ self.beforeChange();
+ self.typing = true;
+ self.add();
+ isFirstTypedCharacter = true;
+ }
+ });
+
+ editor.on('MouseDown', function() {
+ if (self.typing) {
+ addNonTypingUndoLevel();
+ }
+ });
+
+ // Add keyboard shortcuts for undo/redo keys
+ editor.addShortcut('ctrl+z', '', 'Undo');
+ editor.addShortcut('ctrl+y,ctrl+shift+z', '', 'Redo');
+
+ editor.on('AddUndo Undo Redo ClearUndos MouseUp', function(e) {
+ if (!e.isDefaultPrevented()) {
+ editor.nodeChanged();
+ }
+ });
+
+ self = {
+ // Explose for debugging reasons
+ data: data,
+
+ /**
+ * State if the user is currently typing or not. This will add a typing operation into one undo
+ * level instead of one new level for each keystroke.
+ *
+ * @field {Boolean} typing
+ */
+ typing: false,
+
+ /**
+ * Stores away a bookmark to be used when performing an undo action so that the selection is before
+ * the change has been made.
+ *
+ * @method beforeChange
+ */
+ beforeChange: function() {
+ if (!lock) {
+ beforeBookmark = editor.selection.getBookmark(2, true);
+ }
+ },
+
+ /**
+ * Adds a new undo level/snapshot to the undo list.
+ *
+ * @method add
+ * @param {Object} l Optional undo level object to add.
+ * @return {Object} Undo level that got added or null it a level wasn't needed.
+ */
+ add: function(level) {
+ var i, settings = editor.settings, lastLevel;
+
+ level = level || {};
+ level.content = getContent();
+
+ if (lock || editor.fire('BeforeAddUndo', {level: level}).isDefaultPrevented()) {
+ return null;
+ }
+
+ // Add undo level if needed
+ lastLevel = data[index];
+ if (lastLevel && lastLevel.content == level.content) {
+ return null;
+ }
+
+ // Set before bookmark on previous level
+ if (data[index]) {
+ data[index].beforeBookmark = beforeBookmark;
+ }
+
+ // Time to compress
+ if (settings.custom_undo_redo_levels) {
+ if (data.length > settings.custom_undo_redo_levels) {
+ for (i = 0; i < data.length - 1; i++) {
+ data[i] = data[i + 1];
+ }
+
+ data.length--;
+ index = data.length;
+ }
+ }
+
+ // Get a non intrusive normalized bookmark
+ level.bookmark = editor.selection.getBookmark(2, true);
+
+ // Crop array if needed
+ if (index < data.length - 1) {
+ data.length = index + 1;
+ }
+
+ data.push(level);
+ index = data.length - 1;
+
+ var args = {level: level, lastLevel: lastLevel};
+
+ editor.fire('AddUndo', args);
+
+ if (index > 0) {
+ editor.fire('change', args);
+ editor.isNotDirty = false;
+ }
+
+ return level;
+ },
+
+ /**
+ * Undoes the last action.
+ *
+ * @method undo
+ * @return {Object} Undo level or null if no undo was performed.
+ */
+ undo: function() {
+ var level;
+
+ if (self.typing) {
+ self.add();
+ self.typing = false;
+ }
+
+ if (index > 0) {
+ level = data[--index];
+
+ // Undo to first index then set dirty state to false
+ if (index === 0) {
+ editor.isNotDirty = true;
+ }
+
+ editor.setContent(level.content, {format: 'raw'});
+ editor.selection.moveToBookmark(level.beforeBookmark);
+
+ editor.fire('undo', {level: level});
+ }
+
+ return level;
+ },
+
+ /**
+ * Redoes the last action.
+ *
+ * @method redo
+ * @return {Object} Redo level or null if no redo was performed.
+ */
+ redo: function() {
+ var level;
+
+ if (index < data.length - 1) {
+ level = data[++index];
+
+ editor.setContent(level.content, {format: 'raw'});
+ editor.selection.moveToBookmark(level.bookmark);
+
+ editor.fire('redo', {level: level});
+ }
+
+ return level;
+ },
+
+ /**
+ * Removes all undo levels.
+ *
+ * @method clear
+ */
+ clear: function() {
+ data = [];
+ index = 0;
+ self.typing = false;
+ editor.fire('ClearUndos');
+ },
+
+ /**
+ * Returns true/false if the undo manager has any undo levels.
+ *
+ * @method hasUndo
+ * @return {Boolean} true/false if the undo manager has any undo levels.
+ */
+ hasUndo: function() {
+ // Has undo levels or typing and content isn't the same as the initial level
+ return index > 0 || (self.typing && data[0] && getContent() != data[0].content);
+ },
+
+ /**
+ * Returns true/false if the undo manager has any redo levels.
+ *
+ * @method hasRedo
+ * @return {Boolean} true/false if the undo manager has any redo levels.
+ */
+ hasRedo: function() {
+ return index < data.length - 1 && !this.typing;
+ },
+
+ /**
+ * Executes the specified function in an undo transation. The selection
+ * before the modification will be stored to the undo stack and if the DOM changes
+ * it will add a new undo level. Any methods within the transation that adds undo levels will
+ * be ignored. So a transation can include calls to execCommand or editor.insertContent.
+ *
+ * @method transact
+ * @param {function} callback Function to execute dom manipulation logic in.
+ */
+ transact: function(callback) {
+ self.beforeChange();
+
+ lock = true;
+ callback();
+ lock = false;
+
+ self.add();
+ }
+ };
+
+ return self;
+ };
+});
+
+// Included from: js/tinymce/classes/EnterKey.js
+
+/**
+ * EnterKey.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Contains logic for handling the enter key to split/generate block elements.
+ */
+define("tinymce/EnterKey", [
+ "tinymce/dom/TreeWalker",
+ "tinymce/Env"
+], function(TreeWalker, Env) {
+ var isIE = Env.ie && Env.ie < 11;
+
+ return function(editor) {
+ var dom = editor.dom, selection = editor.selection, settings = editor.settings;
+ var undoManager = editor.undoManager, schema = editor.schema, nonEmptyElementsMap = schema.getNonEmptyElements();
+
+ function handleEnterKey(evt) {
+ var rng = selection.getRng(true), tmpRng, editableRoot, container, offset, parentBlock, documentMode, shiftKey,
+ newBlock, fragment, containerBlock, parentBlockName, containerBlockName, newBlockName, isAfterLastNodeInContainer;
+
+ // Returns true if the block can be split into two blocks or not
+ function canSplitBlock(node) {
+ return node &&
+ dom.isBlock(node) &&
+ !/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) &&
+ !/^(fixed|absolute)/i.test(node.style.position) &&
+ dom.getContentEditable(node) !== "true";
+ }
+
+ // Renders empty block on IE
+ function renderBlockOnIE(block) {
+ var oldRng;
+
+ if (dom.isBlock(block)) {
+ oldRng = selection.getRng();
+ block.appendChild(dom.create('span', null, '\u00a0'));
+ selection.select(block);
+ block.lastChild.outerHTML = '';
+ selection.setRng(oldRng);
+ }
+ }
+
+ // Remove the first empty inline element of the block so this: <p><b><em></em></b>x</p> becomes this: <p>x</p>
+ function trimInlineElementsOnLeftSideOfBlock(block) {
+ var node = block, firstChilds = [], i;
+
+ // Find inner most first child ex: <p><i><b>*</b></i></p>
+ while ((node = node.firstChild)) {
+ if (dom.isBlock(node)) {
+ return;
+ }
+
+ if (node.nodeType == 1 && !nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
+ firstChilds.push(node);
+ }
+ }
+
+ i = firstChilds.length;
+ while (i--) {
+ node = firstChilds[i];
+ if (!node.hasChildNodes() || (node.firstChild == node.lastChild && node.firstChild.nodeValue === '')) {
+ dom.remove(node);
+ } else {
+ // Remove <a> </a> see #5381
+ if (node.nodeName == "A" && (node.innerText || node.textContent) === ' ') {
+ dom.remove(node);
+ }
+ }
+ }
+ }
+
+ // Moves the caret to a suitable position within the root for example in the first non
+ // pure whitespace text node or before an image
+ function moveToCaretPosition(root) {
+ var walker, node, rng, lastNode = root, tempElm;
+
+ function firstNonWhiteSpaceNodeSibling(node) {
+ while (node) {
+ if (node.nodeType == 1 || (node.nodeType == 3 && node.data && /[\r\n\s]/.test(node.data))) {
+ return node;
+ }
+
+ node = node.nextSibling;
+ }
+ }
+
+ // Old IE versions doesn't properly render blocks with br elements in them
+ // For example <p><br></p> wont be rendered correctly in a contentEditable area
+ // until you remove the br producing <p></p>
+ if (Env.ie && Env.ie < 9 && parentBlock && parentBlock.firstChild) {
+ if (parentBlock.firstChild == parentBlock.lastChild && parentBlock.firstChild.tagName == 'BR') {
+ dom.remove(parentBlock.firstChild);
+ }
+ }
+
+ if (root.nodeName == 'LI') {
+ var firstChild = firstNonWhiteSpaceNodeSibling(root.firstChild);
+
+ if (firstChild && /^(UL|OL)$/.test(firstChild.nodeName)) {
+ root.insertBefore(dom.doc.createTextNode('\u00a0'), root.firstChild);
+ }
+ }
+
+ rng = dom.createRng();
+
+ if (root.hasChildNodes()) {
+ walker = new TreeWalker(root, root);
+
+ while ((node = walker.current())) {
+ if (node.nodeType == 3) {
+ rng.setStart(node, 0);
+ rng.setEnd(node, 0);
+ break;
+ }
+
+ if (nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
+ rng.setStartBefore(node);
+ rng.setEndBefore(node);
+ break;
+ }
+
+ lastNode = node;
+ node = walker.next();
+ }
+
+ if (!node) {
+ rng.setStart(lastNode, 0);
+ rng.setEnd(lastNode, 0);
+ }
+ } else {
+ if (root.nodeName == 'BR') {
+ if (root.nextSibling && dom.isBlock(root.nextSibling)) {
+ // Trick on older IE versions to render the caret before the BR between two lists
+ if (!documentMode || documentMode < 9) {
+ tempElm = dom.create('br');
+ root.parentNode.insertBefore(tempElm, root);
+ }
+
+ rng.setStartBefore(root);
+ rng.setEndBefore(root);
+ } else {
+ rng.setStartAfter(root);
+ rng.setEndAfter(root);
+ }
+ } else {
+ rng.setStart(root, 0);
+ rng.setEnd(root, 0);
+ }
+ }
+
+ selection.setRng(rng);
+
+ // Remove tempElm created for old IE:s
+ dom.remove(tempElm);
+ selection.scrollIntoView(root);
+ }
+
+ function setForcedBlockAttrs(node) {
+ var forcedRootBlockName = settings.forced_root_block;
+
+ if (forcedRootBlockName && forcedRootBlockName.toLowerCase() === node.tagName.toLowerCase()) {
+ dom.setAttribs(node, settings.forced_root_block_attrs);
+ }
+ }
+
+ // Creates a new block element by cloning the current one or creating a new one if the name is specified
+ // This function will also copy any text formatting from the parent block and add it to the new one
+ function createNewBlock(name) {
+ var node = container, block, clonedNode, caretNode;
+
+ if (name || parentBlockName == "TABLE") {
+ block = dom.create(name || newBlockName);
+ setForcedBlockAttrs(block);
+ } else {
+ block = parentBlock.cloneNode(false);
+ }
+
+ caretNode = block;
+
+ // Clone any parent styles
+ if (settings.keep_styles !== false) {
+ do {
+ if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(node.nodeName)) {
+ // Never clone a caret containers
+ if (node.id == '_mce_caret') {
+ continue;
+ }
+
+ clonedNode = node.cloneNode(false);
+ dom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique
+
+ if (block.hasChildNodes()) {
+ clonedNode.appendChild(block.firstChild);
+ block.appendChild(clonedNode);
+ } else {
+ caretNode = clonedNode;
+ block.appendChild(clonedNode);
+ }
+ }
+ } while ((node = node.parentNode));
+ }
+
+ // BR is needed in empty blocks on non IE browsers
+ if (!isIE) {
+ caretNode.innerHTML = '<br data-mce-bogus="1">';
+ }
+
+ return block;
+ }
+
+ // Returns true/false if the caret is at the start/end of the parent block element
+ function isCaretAtStartOrEndOfBlock(start) {
+ var walker, node, name;
+
+ // Caret is in the middle of a text node like "a|b"
+ if (container.nodeType == 3 && (start ? offset > 0 : offset < container.nodeValue.length)) {
+ return false;
+ }
+
+ // If after the last element in block node edge case for #5091
+ if (container.parentNode == parentBlock && isAfterLastNodeInContainer && !start) {
+ return true;
+ }
+
+ // If the caret if before the first element in parentBlock
+ if (start && container.nodeType == 1 && container == parentBlock.firstChild) {
+ return true;
+ }
+
+ // Caret can be before/after a table
+ if (container.nodeName === "TABLE" || (container.previousSibling && container.previousSibling.nodeName == "TABLE")) {
+ return (isAfterLastNodeInContainer && !start) || (!isAfterLastNodeInContainer && start);
+ }
+
+ // Walk the DOM and look for text nodes or non empty elements
+ walker = new TreeWalker(container, parentBlock);
+
+ // If caret is in beginning or end of a text block then jump to the next/previous node
+ if (container.nodeType == 3) {
+ if (start && offset === 0) {
+ walker.prev();
+ } else if (!start && offset == container.nodeValue.length) {
+ walker.next();
+ }
+ }
+
+ while ((node = walker.current())) {
+ if (node.nodeType === 1) {
+ // Ignore bogus elements
+ if (!node.getAttribute('data-mce-bogus')) {
+ // Keep empty elements like <img /> <input /> but not trailing br:s like <p>text|<br></p>
+ name = node.nodeName.toLowerCase();
+ if (nonEmptyElementsMap[name] && name !== 'br') {
+ return false;
+ }
+ }
+ } else if (node.nodeType === 3 && !/^[ \t\r\n]*$/.test(node.nodeValue)) {
+ return false;
+ }
+
+ if (start) {
+ walker.prev();
+ } else {
+ walker.next();
+ }
+ }
+
+ return true;
+ }
+
+ // Wraps any text nodes or inline elements in the specified forced root block name
+ function wrapSelfAndSiblingsInDefaultBlock(container, offset) {
+ var newBlock, parentBlock, startNode, node, next, rootBlockName, blockName = newBlockName || 'P';
+
+ // Not in a block element or in a table cell or caption
+ parentBlock = dom.getParent(container, dom.isBlock);
+ rootBlockName = editor.getBody().nodeName.toLowerCase();
+ if (!parentBlock || !canSplitBlock(parentBlock)) {
+ parentBlock = parentBlock || editableRoot;
+
+ if (!parentBlock.hasChildNodes()) {
+ newBlock = dom.create(blockName);
+ setForcedBlockAttrs(newBlock);
+ parentBlock.appendChild(newBlock);
+ rng.setStart(newBlock, 0);
+ rng.setEnd(newBlock, 0);
+ return newBlock;
+ }
+
+ // Find parent that is the first child of parentBlock
+ node = container;
+ while (node.parentNode != parentBlock) {
+ node = node.parentNode;
+ }
+
+ // Loop left to find start node start wrapping at
+ while (node && !dom.isBlock(node)) {
+ startNode = node;
+ node = node.previousSibling;
+ }
+
+ if (startNode && schema.isValidChild(rootBlockName, blockName.toLowerCase())) {
+ newBlock = dom.create(blockName);
+ setForcedBlockAttrs(newBlock);
+ startNode.parentNode.insertBefore(newBlock, startNode);
+
+ // Start wrapping until we hit a block
+ node = startNode;
+ while (node && !dom.isBlock(node)) {
+ next = node.nextSibling;
+ newBlock.appendChild(node);
+ node = next;
+ }
+
+ // Restore range to it's past location
+ rng.setStart(container, offset);
+ rng.setEnd(container, offset);
+ }
+ }
+
+ return container;
+ }
+
+ // Inserts a block or br before/after or in the middle of a split list of the LI is empty
+ function handleEmptyListItem() {
+ function isFirstOrLastLi(first) {
+ var node = containerBlock[first ? 'firstChild' : 'lastChild'];
+
+ // Find first/last element since there might be whitespace there
+ while (node) {
+ if (node.nodeType == 1) {
+ break;
+ }
+
+ node = node[first ? 'nextSibling' : 'previousSibling'];
+ }
+
+ return node === parentBlock;
+ }
+
+ function getContainerBlock() {
+ var containerBlockParent = containerBlock.parentNode;
+
+ if (containerBlockParent.nodeName == 'LI') {
+ return containerBlockParent;
+ }
+
+ return containerBlock;
+ }
+
+ // Check if we are in an nested list
+ var containerBlockParentName = containerBlock.parentNode.nodeName;
+ if (/^(OL|UL|LI)$/.test(containerBlockParentName)) {
+ newBlockName = 'LI';
+ }
+
+ newBlock = newBlockName ? createNewBlock(newBlockName) : dom.create('BR');
+
+ if (isFirstOrLastLi(true) && isFirstOrLastLi()) {
+ if (containerBlockParentName == 'LI') {
+ // Nested list is inside a LI
+ dom.insertAfter(newBlock, getContainerBlock());
+ } else {
+ // Is first and last list item then replace the OL/UL with a text block
+ dom.replace(newBlock, containerBlock);
+ }
+ } else if (isFirstOrLastLi(true)) {
+ if (containerBlockParentName == 'LI') {
+ // List nested in an LI then move the list to a new sibling LI
+ dom.insertAfter(newBlock, getContainerBlock());
+ newBlock.appendChild(dom.doc.createTextNode(' ')); // Needed for IE so the caret can be placed
+ newBlock.appendChild(containerBlock);
+ } else {
+ // First LI in list then remove LI and add text block before list
+ containerBlock.parentNode.insertBefore(newBlock, containerBlock);
+ }
+ } else if (isFirstOrLastLi()) {
+ // Last LI in list then remove LI and add text block after list
+ dom.insertAfter(newBlock, getContainerBlock());
+ renderBlockOnIE(newBlock);
+ } else {
+ // Middle LI in list the split the list and insert a text block in the middle
+ // Extract after fragment and insert it after the current block
+ containerBlock = getContainerBlock();
+ tmpRng = rng.cloneRange();
+ tmpRng.setStartAfter(parentBlock);
+ tmpRng.setEndAfter(containerBlock);
+ fragment = tmpRng.extractContents();
+
+ if (newBlockName == 'LI' && fragment.firstChild.nodeName == 'LI') {
+ newBlock = fragment.firstChild;
+ dom.insertAfter(fragment, containerBlock);
+ } else {
+ dom.insertAfter(fragment, containerBlock);
+ dom.insertAfter(newBlock, containerBlock);
+ }
+ }
+
+ dom.remove(parentBlock);
+ moveToCaretPosition(newBlock);
+ undoManager.add();
+ }
+
+ // Walks the parent block to the right and look for BR elements
+ function hasRightSideContent() {
+ var walker = new TreeWalker(container, parentBlock), node;
+
+ while ((node = walker.next())) {
+ if (nonEmptyElementsMap[node.nodeName.toLowerCase()] || node.length > 0) {
+ return true;
+ }
+ }
+ }
+
+ // Inserts a BR element if the forced_root_block option is set to false or empty string
+ function insertBr() {
+ var brElm, extraBr, marker;
+
+ if (container && container.nodeType == 3 && offset >= container.nodeValue.length) {
+ // Insert extra BR element at the end block elements
+ if (!isIE && !hasRightSideContent()) {
+ brElm = dom.create('br');
+ rng.insertNode(brElm);
+ rng.setStartAfter(brElm);
+ rng.setEndAfter(brElm);
+ extraBr = true;
+ }
+ }
+
+ brElm = dom.create('br');
+ rng.insertNode(brElm);
+
+ // Rendering modes below IE8 doesn't display BR elements in PRE unless we have a \n before it
+ if (isIE && parentBlockName == 'PRE' && (!documentMode || documentMode < 8)) {
+ brElm.parentNode.insertBefore(dom.doc.createTextNode('\r'), brElm);
+ }
+
+ // Insert temp marker and scroll to that
+ marker = dom.create('span', {}, ' ');
+ brElm.parentNode.insertBefore(marker, brElm);
+ selection.scrollIntoView(marker);
+ dom.remove(marker);
+
+ if (!extraBr) {
+ rng.setStartAfter(brElm);
+ rng.setEndAfter(brElm);
+ } else {
+ rng.setStartBefore(brElm);
+ rng.setEndBefore(brElm);
+ }
+
+ selection.setRng(rng);
+ undoManager.add();
+ }
+
+ // Trims any linebreaks at the beginning of node user for example when pressing enter in a PRE element
+ function trimLeadingLineBreaks(node) {
+ do {
+ if (node.nodeType === 3) {
+ node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, '');
+ }
+
+ node = node.firstChild;
+ } while (node);
+ }
+
+ function getEditableRoot(node) {
+ var root = dom.getRoot(), parent, editableRoot;
+
+ // Get all parents until we hit a non editable parent or the root
+ parent = node;
+ while (parent !== root && dom.getContentEditable(parent) !== "false") {
+ if (dom.getContentEditable(parent) === "true") {
+ editableRoot = parent;
+ }
+
+ parent = parent.parentNode;
+ }
+
+ return parent !== root ? editableRoot : root;
+ }
+
+ // Adds a BR at the end of blocks that only contains an IMG or INPUT since
+ // these might be floated and then they won't expand the block
+ function addBrToBlockIfNeeded(block) {
+ var lastChild;
+
+ // IE will render the blocks correctly other browsers needs a BR
+ if (!isIE) {
+ block.normalize(); // Remove empty text nodes that got left behind by the extract
+
+ // Check if the block is empty or contains a floated last child
+ lastChild = block.lastChild;
+ if (!lastChild || (/^(left|right)$/gi.test(dom.getStyle(lastChild, 'float', true)))) {
+ dom.add(block, 'br');
+ }
+ }
+ }
+
+ // Delete any selected contents
+ if (!rng.collapsed) {
+ editor.execCommand('Delete');
+ return;
+ }
+
+ // Event is blocked by some other handler for example the lists plugin
+ if (evt.isDefaultPrevented()) {
+ return;
+ }
+
+ // Setup range items and newBlockName
+ container = rng.startContainer;
+ offset = rng.startOffset;
+ newBlockName = (settings.force_p_newlines ? 'p' : '') || settings.forced_root_block;
+ newBlockName = newBlockName ? newBlockName.toUpperCase() : '';
+ documentMode = dom.doc.documentMode;
+ shiftKey = evt.shiftKey;
+
+ // Resolve node index
+ if (container.nodeType == 1 && container.hasChildNodes()) {
+ isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
+ container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
+ if (isAfterLastNodeInContainer && container.nodeType == 3) {
+ offset = container.nodeValue.length;
+ } else {
+ offset = 0;
+ }
+ }
+
+ // Get editable root node normaly the body element but sometimes a div or span
+ editableRoot = getEditableRoot(container);
+
+ // If there is no editable root then enter is done inside a contentEditable false element
+ if (!editableRoot) {
+ return;
+ }
+
+ undoManager.beforeChange();
+
+ // If editable root isn't block nor the root of the editor
+ if (!dom.isBlock(editableRoot) && editableRoot != dom.getRoot()) {
+ if (!newBlockName || shiftKey) {
+ insertBr();
+ }
+
+ return;
+ }
+
+ // Wrap the current node and it's sibling in a default block if it's needed.
+ // for example this <td>text|<b>text2</b></td> will become this <td><p>text|<b>text2</p></b></td>
+ // This won't happen if root blocks are disabled or the shiftKey is pressed
+ if ((newBlockName && !shiftKey) || (!newBlockName && shiftKey)) {
+ container = wrapSelfAndSiblingsInDefaultBlock(container, offset);
+ }
+
+ // Find parent block and setup empty block paddings
+ parentBlock = dom.getParent(container, dom.isBlock);
+ containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null;
+
+ // Setup block names
+ parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
+ containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
+
+ // Enter inside block contained within a LI then split or insert before/after LI
+ if (containerBlockName == 'LI' && !evt.ctrlKey) {
+ parentBlock = containerBlock;
+ parentBlockName = containerBlockName;
+ }
+
+ // Handle enter in LI
+ if (parentBlockName == 'LI') {
+ if (!newBlockName && shiftKey) {
+ insertBr();
+ return;
+ }
+
+ // Handle enter inside an empty list item
+ if (dom.isEmpty(parentBlock)) {
+ handleEmptyListItem();
+ return;
+ }
+ }
+
+ // Don't split PRE tags but insert a BR instead easier when writing code samples etc
+ if (parentBlockName == 'PRE' && settings.br_in_pre !== false) {
+ if (!shiftKey) {
+ insertBr();
+ return;
+ }
+ } else {
+ // If no root block is configured then insert a BR by default or if the shiftKey is pressed
+ if ((!newBlockName && !shiftKey && parentBlockName != 'LI') || (newBlockName && shiftKey)) {
+ insertBr();
+ return;
+ }
+ }
+
+ // If parent block is root then never insert new blocks
+ if (newBlockName && parentBlock === editor.getBody()) {
+ return;
+ }
+
+ // Default block name if it's not configured
+ newBlockName = newBlockName || 'P';
+
+ // Insert new block before/after the parent block depending on caret location
+ if (isCaretAtStartOrEndOfBlock()) {
+ // If the caret is at the end of a header we produce a P tag after it similar to Word unless we are in a hgroup
+ if (/^(H[1-6]|PRE|FIGURE)$/.test(parentBlockName) && containerBlockName != 'HGROUP') {
+ newBlock = createNewBlock(newBlockName);
+ } else {
+ newBlock = createNewBlock();
+ }
+
+ // Split the current container block element if enter is pressed inside an empty inner block element
+ if (settings.end_container_on_empty_block && canSplitBlock(containerBlock) && dom.isEmpty(parentBlock)) {
+ // Split container block for example a BLOCKQUOTE at the current blockParent location for example a P
+ newBlock = dom.split(containerBlock, parentBlock);
+ } else {
+ dom.insertAfter(newBlock, parentBlock);
+ }
+
+ moveToCaretPosition(newBlock);
+ } else if (isCaretAtStartOrEndOfBlock(true)) {
+ // Insert new block before
+ newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock);
+ renderBlockOnIE(newBlock);
+ moveToCaretPosition(parentBlock);
+ } else {
+ // Extract after fragment and insert it after the current block
+ tmpRng = rng.cloneRange();
+ tmpRng.setEndAfter(parentBlock);
+ fragment = tmpRng.extractContents();
+ trimLeadingLineBreaks(fragment);
+ newBlock = fragment.firstChild;
+ dom.insertAfter(fragment, parentBlock);
+ trimInlineElementsOnLeftSideOfBlock(newBlock);
+ addBrToBlockIfNeeded(parentBlock);
+ moveToCaretPosition(newBlock);
+ }
+
+ dom.setAttrib(newBlock, 'id', ''); // Remove ID since it needs to be document unique
+
+ // Allow custom handling of new blocks
+ editor.fire('NewBlock', { newBlock: newBlock });
+
+ undoManager.add();
+ }
+
+ editor.on('keydown', function(evt) {
+ if (evt.keyCode == 13) {
+ if (handleEnterKey(evt) !== false) {
+ evt.preventDefault();
+ }
+ }
+ });
+ };
+});
+
+// Included from: js/tinymce/classes/ForceBlocks.js
+
+/**
+ * ForceBlocks.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/ForceBlocks", [], function() {
+ return function(editor) {
+ var settings = editor.settings, dom = editor.dom, selection = editor.selection;
+ var schema = editor.schema, blockElements = schema.getBlockElements();
+
+ function addRootBlocks() {
+ var node = selection.getStart(), rootNode = editor.getBody(), rng;
+ var startContainer, startOffset, endContainer, endOffset, rootBlockNode;
+ var tempNode, offset = -0xFFFFFF, wrapped, restoreSelection;
+ var tmpRng, rootNodeName, forcedRootBlock;
+
+ forcedRootBlock = settings.forced_root_block;
+
+ if (!node || node.nodeType !== 1 || !forcedRootBlock) {
+ return;
+ }
+
+ // Check if node is wrapped in block
+ while (node && node != rootNode) {
+ if (blockElements[node.nodeName]) {
+ return;
+ }
+
+ node = node.parentNode;
+ }
+
+ // Get current selection
+ rng = selection.getRng();
+ if (rng.setStart) {
+ startContainer = rng.startContainer;
+ startOffset = rng.startOffset;
+ endContainer = rng.endContainer;
+ endOffset = rng.endOffset;
+
+ try {
+ restoreSelection = editor.getDoc().activeElement === rootNode;
+ } catch (ex) {
+ // IE throws unspecified error here sometimes
+ }
+ } else {
+ // Force control range into text range
+ if (rng.item) {
+ node = rng.item(0);
+ rng = editor.getDoc().body.createTextRange();
+ rng.moveToElementText(node);
+ }
+
+ restoreSelection = rng.parentElement().ownerDocument === editor.getDoc();
+ tmpRng = rng.duplicate();
+ tmpRng.collapse(true);
+ startOffset = tmpRng.move('character', offset) * -1;
+
+ if (!tmpRng.collapsed) {
+ tmpRng = rng.duplicate();
+ tmpRng.collapse(false);
+ endOffset = (tmpRng.move('character', offset) * -1) - startOffset;
+ }
+ }
+
+ // Wrap non block elements and text nodes
+ node = rootNode.firstChild;
+ rootNodeName = rootNode.nodeName.toLowerCase();
+ while (node) {
+ // TODO: Break this up, too complex
+ if (((node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName]))) &&
+ schema.isValidChild(rootNodeName, forcedRootBlock.toLowerCase())) {
+ // Remove empty text nodes
+ if (node.nodeType === 3 && node.nodeValue.length === 0) {
+ tempNode = node;
+ node = node.nextSibling;
+ dom.remove(tempNode);
+ continue;
+ }
+
+ if (!rootBlockNode) {
+ rootBlockNode = dom.create(forcedRootBlock, editor.settings.forced_root_block_attrs);
+ node.parentNode.insertBefore(rootBlockNode, node);
+ wrapped = true;
+ }
+
+ tempNode = node;
+ node = node.nextSibling;
+ rootBlockNode.appendChild(tempNode);
+ } else {
+ rootBlockNode = null;
+ node = node.nextSibling;
+ }
+ }
+
+ if (wrapped && restoreSelection) {
+ if (rng.setStart) {
+ rng.setStart(startContainer, startOffset);
+ rng.setEnd(endContainer, endOffset);
+ selection.setRng(rng);
+ } else {
+ // Only select if the previous selection was inside the document to prevent auto focus in quirks mode
+ try {
+ rng = editor.getDoc().body.createTextRange();
+ rng.moveToElementText(rootNode);
+ rng.collapse(true);
+ rng.moveStart('character', startOffset);
+
+ if (endOffset > 0) {
+ rng.moveEnd('character', endOffset);
+ }
+
+ rng.select();
+ } catch (ex) {
+ // Ignore
+ }
+ }
+
+ editor.nodeChanged();
+ }
+ }
+
+ // Force root blocks
+ if (settings.forced_root_block) {
+ editor.on('NodeChange', addRootBlocks);
+ }
+ };
+});
+
+// Included from: js/tinymce/classes/EditorCommands.js
+
+/**
+ * EditorCommands.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class enables you to add custom editor commands and it contains
+ * overrides for native browser commands to address various bugs and issues.
+ *
+ * @class tinymce.EditorCommands
+ */
+define("tinymce/EditorCommands", [
+ "tinymce/html/Serializer",
+ "tinymce/Env",
+ "tinymce/util/Tools"
+], function(Serializer, Env, Tools) {
+ // Added for compression purposes
+ var each = Tools.each, extend = Tools.extend;
+ var map = Tools.map, inArray = Tools.inArray, explode = Tools.explode;
+ var isGecko = Env.gecko, isIE = Env.ie;
+ var TRUE = true, FALSE = false;
+
+ return function(editor) {
+ var dom = editor.dom,
+ selection = editor.selection,
+ commands = {state: {}, exec: {}, value: {}},
+ settings = editor.settings,
+ formatter = editor.formatter,
+ bookmark;
+
+ /**
+ * Executes the specified command.
+ *
+ * @method execCommand
+ * @param {String} command Command to execute.
+ * @param {Boolean} ui Optional user interface state.
+ * @param {Object} value Optional value for command.
+ * @return {Boolean} true/false if the command was found or not.
+ */
+ function execCommand(command, ui, value) {
+ var func;
+
+ command = command.toLowerCase();
+ if ((func = commands.exec[command])) {
+ func(command, ui, value);
+ return TRUE;
+ }
+
+ return FALSE;
+ }
+
+ /**
+ * Queries the current state for a command for example if the current selection is "bold".
+ *
+ * @method queryCommandState
+ * @param {String} command Command to check the state of.
+ * @return {Boolean/Number} true/false if the selected contents is bold or not, -1 if it's not found.
+ */
+ function queryCommandState(command) {
+ var func;
+
+ command = command.toLowerCase();
+ if ((func = commands.state[command])) {
+ return func(command);
+ }
+
+ return -1;
+ }
+
+ /**
+ * Queries the command value for example the current fontsize.
+ *
+ * @method queryCommandValue
+ * @param {String} command Command to check the value of.
+ * @return {Object} Command value of false if it's not found.
+ */
+ function queryCommandValue(command) {
+ var func;
+
+ command = command.toLowerCase();
+ if ((func = commands.value[command])) {
+ return func(command);
+ }
+
+ return FALSE;
+ }
+
+ /**
+ * Adds commands to the command collection.
+ *
+ * @method addCommands
+ * @param {Object} command_list Name/value collection with commands to add, the names can also be comma separated.
+ * @param {String} type Optional type to add, defaults to exec. Can be value or state as well.
+ */
+ function addCommands(command_list, type) {
+ type = type || 'exec';
+
+ each(command_list, function(callback, command) {
+ each(command.toLowerCase().split(','), function(command) {
+ commands[type][command] = callback;
+ });
+ });
+ }
+
+ // Expose public methods
+ extend(this, {
+ execCommand: execCommand,
+ queryCommandState: queryCommandState,
+ queryCommandValue: queryCommandValue,
+ addCommands: addCommands
+ });
+
+ // Private methods
+
+ function execNativeCommand(command, ui, value) {
+ if (ui === undefined) {
+ ui = FALSE;
+ }
+
+ if (value === undefined) {
+ value = null;
+ }
+
+ return editor.getDoc().execCommand(command, ui, value);
+ }
+
+ function isFormatMatch(name) {
+ return formatter.match(name);
+ }
+
+ function toggleFormat(name, value) {
+ formatter.toggle(name, value ? {value: value} : undefined);
+ editor.nodeChanged();
+ }
+
+ function storeSelection(type) {
+ bookmark = selection.getBookmark(type);
+ }
+
+ function restoreSelection() {
+ selection.moveToBookmark(bookmark);
+ }
+
+ // Add execCommand overrides
+ addCommands({
+ // Ignore these, added for compatibility
+ 'mceResetDesignMode,mceBeginUndoLevel': function() {},
+
+ // Add undo manager logic
+ 'mceEndUndoLevel,mceAddUndoLevel': function() {
+ editor.undoManager.add();
+ },
+
+ 'Cut,Copy,Paste': function(command) {
+ var doc = editor.getDoc(), failed;
+
+ // Try executing the native command
+ try {
+ execNativeCommand(command);
+ } catch (ex) {
+ // Command failed
+ failed = TRUE;
+ }
+
+ // Present alert message about clipboard access not being available
+ if (failed || !doc.queryCommandSupported(command)) {
+ var msg = editor.translate(
+ "Your browser doesn't support direct access to the clipboard. " +
+ "Please use the Ctrl+X/C/V keyboard shortcuts instead."
+ );
+
+ if (Env.mac) {
+ msg = msg.replace(/Ctrl\+/g, '\u2318+');
+ }
+
+ editor.windowManager.alert(msg);
+ }
+ },
+
+ // Override unlink command
+ unlink: function() {
+ if (selection.isCollapsed()) {
+ var elm = selection.getNode();
+ if (elm.tagName == 'A') {
+ editor.dom.remove(elm, true);
+ }
+
+ return;
+ }
+
+ formatter.remove("link");
+ },
+
+ // Override justify commands to use the text formatter engine
+ 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull': function(command) {
+ var align = command.substring(7);
+
+ if (align == 'full') {
+ align = 'justify';
+ }
+
+ // Remove all other alignments first
+ each('left,center,right,justify'.split(','), function(name) {
+ if (align != name) {
+ formatter.remove('align' + name);
+ }
+ });
+
+ toggleFormat('align' + align);
+ execCommand('mceRepaint');
+ },
+
+ // Override list commands to fix WebKit bug
+ 'InsertUnorderedList,InsertOrderedList': function(command) {
+ var listElm, listParent;
+
+ execNativeCommand(command);
+
+ // WebKit produces lists within block elements so we need to split them
+ // we will replace the native list creation logic to custom logic later on
+ // TODO: Remove this when the list creation logic is removed
+ listElm = dom.getParent(selection.getNode(), 'ol,ul');
+ if (listElm) {
+ listParent = listElm.parentNode;
+
+ // If list is within a text block then split that block
+ if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) {
+ storeSelection();
+ dom.split(listParent, listElm);
+ restoreSelection();
+ }
+ }
+ },
+
+ // Override commands to use the text formatter engine
+ 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function(command) {
+ toggleFormat(command);
+ },
+
+ // Override commands to use the text formatter engine
+ 'ForeColor,HiliteColor,FontName': function(command, ui, value) {
+ toggleFormat(command, value);
+ },
+
+ FontSize: function(command, ui, value) {
+ var fontClasses, fontSizes;
+
+ // Convert font size 1-7 to styles
+ if (value >= 1 && value <= 7) {
+ fontSizes = explode(settings.font_size_style_values);
+ fontClasses = explode(settings.font_size_classes);
+
+ if (fontClasses) {
+ value = fontClasses[value - 1] || value;
+ } else {
+ value = fontSizes[value - 1] || value;
+ }
+ }
+
+ toggleFormat(command, value);
+ },
+
+ RemoveFormat: function(command) {
+ formatter.remove(command);
+ },
+
+ mceBlockQuote: function() {
+ toggleFormat('blockquote');
+ },
+
+ FormatBlock: function(command, ui, value) {
+ return toggleFormat(value || 'p');
+ },
+
+ mceCleanup: function() {
+ var bookmark = selection.getBookmark();
+
+ editor.setContent(editor.getContent({cleanup: TRUE}), {cleanup: TRUE});
+
+ selection.moveToBookmark(bookmark);
+ },
+
+ mceRemoveNode: function(command, ui, value) {
+ var node = value || selection.getNode();
+
+ // Make sure that the body node isn't removed
+ if (node != editor.getBody()) {
+ storeSelection();
+ editor.dom.remove(node, TRUE);
+ restoreSelection();
+ }
+ },
+
+ mceSelectNodeDepth: function(command, ui, value) {
+ var counter = 0;
+
+ dom.getParent(selection.getNode(), function(node) {
+ if (node.nodeType == 1 && counter++ == value) {
+ selection.select(node);
+ return FALSE;
+ }
+ }, editor.getBody());
+ },
+
+ mceSelectNode: function(command, ui, value) {
+ selection.select(value);
+ },
+
+ mceInsertContent: function(command, ui, value) {
+ var parser, serializer, parentNode, rootNode, fragment, args;
+ var marker, rng, node, node2, bookmarkHtml;
+
+ function trimOrPaddLeftRight(html) {
+ var rng, container, offset;
+
+ rng = selection.getRng(true);
+ container = rng.startContainer;
+ offset = rng.startOffset;
+
+ function hasSiblingText(siblingName) {
+ return container[siblingName] && container[siblingName].nodeType == 3;
+ }
+
+ if (container.nodeType == 3) {
+ if (offset > 0) {
+ html = html.replace(/^ /, ' ');
+ } else if (!hasSiblingText('previousSibling')) {
+ html = html.replace(/^ /, ' ');
+ }
+
+ if (offset < container.length) {
+ html = html.replace(/ (<br>|)$/, ' ');
+ } else if (!hasSiblingText('nextSibling')) {
+ html = html.replace(/( | )(<br>|)$/, ' ');
+ }
+ }
+
+ return html;
+ }
+
+ // Check for whitespace before/after value
+ if (/^ | $/.test(value)) {
+ value = trimOrPaddLeftRight(value);
+ }
+
+ // Setup parser and serializer
+ parser = editor.parser;
+ serializer = new Serializer({}, editor.schema);
+ bookmarkHtml = '<span id="mce_marker" data-mce-type="bookmark">ÈB;</span>';
+
+ // Run beforeSetContent handlers on the HTML to be inserted
+ args = {content: value, format: 'html', selection: true};
+ editor.fire('BeforeSetContent', args);
+ value = args.content;
+
+ // Add caret at end of contents if it's missing
+ if (value.indexOf('{$caret}') == -1) {
+ value += '{$caret}';
+ }
+
+ // Replace the caret marker with a span bookmark element
+ value = value.replace(/\{\$caret\}/, bookmarkHtml);
+
+ // If selection is at <body>|<p></p> then move it into <body><p>|</p>
+ rng = selection.getRng();
+ var caretElement = rng.startContainer || (rng.parentElement ? rng.parentElement() : null);
+ var body = editor.getBody();
+ if (caretElement === body && selection.isCollapsed()) {
+ if (dom.isBlock(body.firstChild) && dom.isEmpty(body.firstChild)) {
+ rng = dom.createRng();
+ rng.setStart(body.firstChild, 0);
+ rng.setEnd(body.firstChild, 0);
+ selection.setRng(rng);
+ }
+ }
+
+ // Insert node maker where we will insert the new HTML and get it's parent
+ if (!selection.isCollapsed()) {
+ editor.getDoc().execCommand('Delete', false, null);
+ }
+
+ parentNode = selection.getNode();
+
+ // Parse the fragment within the context of the parent node
+ var parserArgs = {context: parentNode.nodeName.toLowerCase()};
+ fragment = parser.parse(value, parserArgs);
+
+ // Move the caret to a more suitable location
+ node = fragment.lastChild;
+ if (node.attr('id') == 'mce_marker') {
+ marker = node;
+
+ for (node = node.prev; node; node = node.walk(true)) {
+ if (node.type == 3 || !dom.isBlock(node.name)) {
+ node.parent.insert(marker, node, node.name === 'br');
+ break;
+ }
+ }
+ }
+
+ // If parser says valid we can insert the contents into that parent
+ if (!parserArgs.invalid) {
+ value = serializer.serialize(fragment);
+
+ // Check if parent is empty or only has one BR element then set the innerHTML of that parent
+ node = parentNode.firstChild;
+ node2 = parentNode.lastChild;
+ if (!node || (node === node2 && node.nodeName === 'BR')) {
+ dom.setHTML(parentNode, value);
+ } else {
+ selection.setContent(value);
+ }
+ } else {
+ // If the fragment was invalid within that context then we need
+ // to parse and process the parent it's inserted into
+
+ // Insert bookmark node and get the parent
+ selection.setContent(bookmarkHtml);
+ parentNode = selection.getNode();
+ rootNode = editor.getBody();
+
+ // Opera will return the document node when selection is in root
+ if (parentNode.nodeType == 9) {
+ parentNode = node = rootNode;
+ } else {
+ node = parentNode;
+ }
+
+ // Find the ancestor just before the root element
+ while (node !== rootNode) {
+ parentNode = node;
+ node = node.parentNode;
+ }
+
+ // Get the outer/inner HTML depending on if we are in the root and parser and serialize that
+ value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode);
+ value = serializer.serialize(
+ parser.parse(
+ // Need to replace by using a function since $ in the contents would otherwise be a problem
+ value.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i, function() {
+ return serializer.serialize(fragment);
+ })
+ )
+ );
+
+ // Set the inner/outer HTML depending on if we are in the root or not
+ if (parentNode == rootNode) {
+ dom.setHTML(rootNode, value);
+ } else {
+ dom.setOuterHTML(parentNode, value);
+ }
+ }
+
+ marker = dom.get('mce_marker');
+ selection.scrollIntoView(marker);
+
+ // Move selection before marker and remove it
+ rng = dom.createRng();
+
+ // If previous sibling is a text node set the selection to the end of that node
+ node = marker.previousSibling;
+ if (node && node.nodeType == 3) {
+ rng.setStart(node, node.nodeValue.length);
+
+ // TODO: Why can't we normalize on IE
+ if (!isIE) {
+ node2 = marker.nextSibling;
+ if (node2 && node2.nodeType == 3) {
+ node.appendData(node2.data);
+ node2.parentNode.removeChild(node2);
+ }
+ }
+ } else {
+ // If the previous sibling isn't a text node or doesn't exist set the selection before the marker node
+ rng.setStartBefore(marker);
+ rng.setEndBefore(marker);
+ }
+
+ // Remove the marker node and set the new range
+ dom.remove(marker);
+ selection.setRng(rng);
+
+ // Dispatch after event and add any visual elements needed
+ editor.fire('SetContent', args);
+ editor.addVisual();
+ },
+
+ mceInsertRawHTML: function(command, ui, value) {
+ selection.setContent('tiny_mce_marker');
+ editor.setContent(
+ editor.getContent().replace(/tiny_mce_marker/g, function() {
+ return value;
+ })
+ );
+ },
+
+ mceToggleFormat: function(command, ui, value) {
+ toggleFormat(value);
+ },
+
+ mceSetContent: function(command, ui, value) {
+ editor.setContent(value);
+ },
+
+ 'Indent,Outdent': function(command) {
+ var intentValue, indentUnit, value;
+
+ // Setup indent level
+ intentValue = settings.indentation;
+ indentUnit = /[a-z%]+$/i.exec(intentValue);
+ intentValue = parseInt(intentValue, 10);
+
+ if (!queryCommandState('InsertUnorderedList') && !queryCommandState('InsertOrderedList')) {
+ // If forced_root_blocks is set to false we don't have a block to indent so lets create a div
+ if (!settings.forced_root_block && !dom.getParent(selection.getNode(), dom.isBlock)) {
+ formatter.apply('div');
+ }
+
+ each(selection.getSelectedBlocks(), function(element) {
+ var indentStyleName;
+
+ if (element.nodeName != "LI") {
+ indentStyleName = dom.getStyle(element, 'direction', true) == 'rtl' ? 'paddingRight' : 'paddingLeft';
+
+ if (command == 'outdent') {
+ value = Math.max(0, parseInt(element.style[indentStyleName] || 0, 10) - intentValue);
+ dom.setStyle(element, indentStyleName, value ? value + indentUnit : '');
+ } else {
+ value = (parseInt(element.style[indentStyleName] || 0, 10) + intentValue) + indentUnit;
+ dom.setStyle(element, indentStyleName, value);
+ }
+ }
+ });
+ } else {
+ execNativeCommand(command);
+ }
+ },
+
+ mceRepaint: function() {
+ if (isGecko) {
+ try {
+ storeSelection(TRUE);
+
+ if (selection.getSel()) {
+ selection.getSel().selectAllChildren(editor.getBody());
+ }
+
+ selection.collapse(TRUE);
+ restoreSelection();
+ } catch (ex) {
+ // Ignore
+ }
+ }
+ },
+
+ InsertHorizontalRule: function() {
+ editor.execCommand('mceInsertContent', false, '<hr />');
+ },
+
+ mceToggleVisualAid: function() {
+ editor.hasVisual = !editor.hasVisual;
+ editor.addVisual();
+ },
+
+ mceReplaceContent: function(command, ui, value) {
+ editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, selection.getContent({format: 'text'})));
+ },
+
+ mceInsertLink: function(command, ui, value) {
+ var anchor;
+
+ if (typeof(value) == 'string') {
+ value = {href: value};
+ }
+
+ anchor = dom.getParent(selection.getNode(), 'a');
+
+ // Spaces are never valid in URLs and it's a very common mistake for people to make so we fix it here.
+ value.href = value.href.replace(' ', '%20');
+
+ // Remove existing links if there could be child links or that the href isn't specified
+ if (!anchor || !value.href) {
+ formatter.remove('link');
+ }
+
+ // Apply new link to selection
+ if (value.href) {
+ formatter.apply('link', value, anchor);
+ }
+ },
+
+ selectAll: function() {
+ var root = dom.getRoot(), rng;
+
+ if (selection.getRng().setStart) {
+ rng = dom.createRng();
+ rng.setStart(root, 0);
+ rng.setEnd(root, root.childNodes.length);
+ selection.setRng(rng);
+ } else {
+ // IE will render it's own root level block elements and sometimes
+ // even put font elements in them when the user starts typing. So we need to
+ // move the selection to a more suitable element from this:
+ // <body>|<p></p></body> to this: <body><p>|</p></body>
+ rng = selection.getRng();
+ if (!rng.item) {
+ rng.moveToElementText(root);
+ rng.select();
+ }
+ }
+ },
+
+ "delete": function() {
+ execNativeCommand("Delete");
+
+ // Check if body is empty after the delete call if so then set the contents
+ // to an empty string and move the caret to any block produced by that operation
+ // this fixes the issue with root blocks not being properly produced after a delete call on IE
+ var body = editor.getBody();
+
+ if (dom.isEmpty(body)) {
+ editor.setContent('');
+
+ if (body.firstChild && dom.isBlock(body.firstChild)) {
+ editor.selection.setCursorLocation(body.firstChild, 0);
+ } else {
+ editor.selection.setCursorLocation(body, 0);
+ }
+ }
+ },
+
+ mceNewDocument: function() {
+ editor.setContent('');
+ }
+ });
+
+ // Add queryCommandState overrides
+ addCommands({
+ // Override justify commands
+ 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull': function(command) {
+ var name = 'align' + command.substring(7);
+ var nodes = selection.isCollapsed() ? [dom.getParent(selection.getNode(), dom.isBlock)] : selection.getSelectedBlocks();
+ var matches = map(nodes, function(node) {
+ return !!formatter.matchNode(node, name);
+ });
+ return inArray(matches, TRUE) !== -1;
+ },
+
+ 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function(command) {
+ return isFormatMatch(command);
+ },
+
+ mceBlockQuote: function() {
+ return isFormatMatch('blockquote');
+ },
+
+ Outdent: function() {
+ var node;
+
+ if (settings.inline_styles) {
+ if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft, 10) > 0) {
+ return TRUE;
+ }
+
+ if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft, 10) > 0) {
+ return TRUE;
+ }
+ }
+
+ return (
+ queryCommandState('InsertUnorderedList') ||
+ queryCommandState('InsertOrderedList') ||
+ (!settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE'))
+ );
+ },
+
+ 'InsertUnorderedList,InsertOrderedList': function(command) {
+ var list = dom.getParent(selection.getNode(), 'ul,ol');
+
+ return list &&
+ (
+ command === 'insertunorderedlist' && list.tagName === 'UL' ||
+ command === 'insertorderedlist' && list.tagName === 'OL'
+ );
+ }
+ }, 'state');
+
+ // Add queryCommandValue overrides
+ addCommands({
+ 'FontSize,FontName': function(command) {
+ var value = 0, parent;
+
+ if ((parent = dom.getParent(selection.getNode(), 'span'))) {
+ if (command == 'fontsize') {
+ value = parent.style.fontSize;
+ } else {
+ value = parent.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase();
+ }
+ }
+
+ return value;
+ }
+ }, 'value');
+
+ // Add undo manager logic
+ addCommands({
+ Undo: function() {
+ editor.undoManager.undo();
+ },
+
+ Redo: function() {
+ editor.undoManager.redo();
+ }
+ });
+ };
+});
+
+// Included from: js/tinymce/classes/util/URI.js
+
+/**
+ * URI.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles parsing, modification and serialization of URI/URL strings.
+ * @class tinymce.util.URI
+ */
+define("tinymce/util/URI", [
+ "tinymce/util/Tools"
+], function(Tools) {
+ var each = Tools.each, trim = Tools.trim;
+
+ /**
+ * Constructs a new URI instance.
+ *
+ * @constructor
+ * @method URI
+ * @param {String} url URI string to parse.
+ * @param {Object} settings Optional settings object.
+ */
+ function URI(url, settings) {
+ var self = this, baseUri, base_url;
+
+ // Trim whitespace
+ url = trim(url);
+
+ // Default settings
+ settings = self.settings = settings || {};
+
+ // Strange app protocol that isn't http/https or local anchor
+ // For example: mailto,skype,tel etc.
+ if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) {
+ self.source = url;
+ return;
+ }
+
+ var isProtocolRelative = url.indexOf('//') === 0;
+
+ // Absolute path with no host, fake host and protocol
+ if (url.indexOf('/') === 0 && !isProtocolRelative) {
+ url = (settings.base_uri ? settings.base_uri.protocol || 'http' : 'http') + '://mce_host' + url;
+ }
+
+ // Relative path http:// or protocol relative //path
+ if (!/^[\w\-]*:?\/\//.test(url)) {
+ base_url = settings.base_uri ? settings.base_uri.path : new URI(location.href).directory;
+ if (settings.base_uri.protocol === "") {
+ url = '//mce_host' + self.toAbsPath(base_url, url);
+ } else {
+ url = ((settings.base_uri && settings.base_uri.protocol) || 'http') + '://mce_host' + self.toAbsPath(base_url, url);
+ }
+ }
+
+ // Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri)
+ url = url.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something
+
+ /*jshint maxlen: 255 */
+ url = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);
+
+ each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], function(v, i) {
+ var part = url[i];
+
+ // Zope 3 workaround, they use @@something
+ if (part) {
+ part = part.replace(/\(mce_at\)/g, '@@');
+ }
+
+ self[v] = part;
+ });
+
+ baseUri = settings.base_uri;
+ if (baseUri) {
+ if (!self.protocol) {
+ self.protocol = baseUri.protocol;
+ }
+
+ if (!self.userInfo) {
+ self.userInfo = baseUri.userInfo;
+ }
+
+ if (!self.port && self.host === 'mce_host') {
+ self.port = baseUri.port;
+ }
+
+ if (!self.host || self.host === 'mce_host') {
+ self.host = baseUri.host;
+ }
+
+ self.source = '';
+ }
+
+ if (isProtocolRelative) {
+ self.protocol = '';
+ }
+
+ //t.path = t.path || '/';
+ }
+
+ URI.prototype = {
+ /**
+ * Sets the internal path part of the URI.
+ *
+ * @method setPath
+ * @param {string} path Path string to set.
+ */
+ setPath: function(path) {
+ var self = this;
+
+ path = /^(.*?)\/?(\w+)?$/.exec(path);
+
+ // Update path parts
+ self.path = path[0];
+ self.directory = path[1];
+ self.file = path[2];
+
+ // Rebuild source
+ self.source = '';
+ self.getURI();
+ },
+
+ /**
+ * Converts the specified URI into a relative URI based on the current URI instance location.
+ *
+ * @method toRelative
+ * @param {String} uri URI to convert into a relative path/URI.
+ * @return {String} Relative URI from the point specified in the current URI instance.
+ * @example
+ * // Converts an absolute URL to an relative URL url will be somedir/somefile.htm
+ * var url = new tinymce.util.URI('http://www.site.com/dir/').toRelative('http://www.site.com/dir/somedir/somefile.htm');
+ */
+ toRelative: function(uri) {
+ var self = this, output;
+
+ if (uri === "./") {
+ return uri;
+ }
+
+ uri = new URI(uri, {base_uri: self});
+
+ // Not on same domain/port or protocol
+ if ((uri.host != 'mce_host' && self.host != uri.host && uri.host) || self.port != uri.port ||
+ (self.protocol != uri.protocol && uri.protocol !== "")) {
+ return uri.getURI();
+ }
+
+ var tu = self.getURI(), uu = uri.getURI();
+
+ // Allow usage of the base_uri when relative_urls = true
+ if (tu == uu || (tu.charAt(tu.length - 1) == "/" && tu.substr(0, tu.length - 1) == uu)) {
+ return tu;
+ }
+
+ output = self.toRelPath(self.path, uri.path);
+
+ // Add query
+ if (uri.query) {
+ output += '?' + uri.query;
+ }
+
+ // Add anchor
+ if (uri.anchor) {
+ output += '#' + uri.anchor;
+ }
+
+ return output;
+ },
+
+ /**
+ * Converts the specified URI into a absolute URI based on the current URI instance location.
+ *
+ * @method toAbsolute
+ * @param {String} uri URI to convert into a relative path/URI.
+ * @param {Boolean} noHost No host and protocol prefix.
+ * @return {String} Absolute URI from the point specified in the current URI instance.
+ * @example
+ * // Converts an relative URL to an absolute URL url will be http://www.site.com/dir/somedir/somefile.htm
+ * var url = new tinymce.util.URI('http://www.site.com/dir/').toAbsolute('somedir/somefile.htm');
+ */
+ toAbsolute: function(uri, noHost) {
+ uri = new URI(uri, {base_uri: this});
+
+ return uri.getURI(this.host == uri.host && this.protocol == uri.protocol ? noHost : 0);
+ },
+
+ /**
+ * Converts a absolute path into a relative path.
+ *
+ * @method toRelPath
+ * @param {String} base Base point to convert the path from.
+ * @param {String} path Absolute path to convert into a relative path.
+ */
+ toRelPath: function(base, path) {
+ var items, breakPoint = 0, out = '', i, l;
+
+ // Split the paths
+ base = base.substring(0, base.lastIndexOf('/'));
+ base = base.split('/');
+ items = path.split('/');
+
+ if (base.length >= items.length) {
+ for (i = 0, l = base.length; i < l; i++) {
+ if (i >= items.length || base[i] != items[i]) {
+ breakPoint = i + 1;
+ break;
+ }
+ }
+ }
+
+ if (base.length < items.length) {
+ for (i = 0, l = items.length; i < l; i++) {
+ if (i >= base.length || base[i] != items[i]) {
+ breakPoint = i + 1;
+ break;
+ }
+ }
+ }
+
+ if (breakPoint === 1) {
+ return path;
+ }
+
+ for (i = 0, l = base.length - (breakPoint - 1); i < l; i++) {
+ out += "../";
+ }
+
+ for (i = breakPoint - 1, l = items.length; i < l; i++) {
+ if (i != breakPoint - 1) {
+ out += "/" + items[i];
+ } else {
+ out += items[i];
+ }
+ }
+
+ return out;
+ },
+
+ /**
+ * Converts a relative path into a absolute path.
+ *
+ * @method toAbsPath
+ * @param {String} base Base point to convert the path from.
+ * @param {String} path Relative path to convert into an absolute path.
+ */
+ toAbsPath: function(base, path) {
+ var i, nb = 0, o = [], tr, outPath;
+
+ // Split paths
+ tr = /\/$/.test(path) ? '/' : '';
+ base = base.split('/');
+ path = path.split('/');
+
+ // Remove empty chunks
+ each(base, function(k) {
+ if (k) {
+ o.push(k);
+ }
+ });
+
+ base = o;
+
+ // Merge relURLParts chunks
+ for (i = path.length - 1, o = []; i >= 0; i--) {
+ // Ignore empty or .
+ if (path[i].length === 0 || path[i] === ".") {
+ continue;
+ }
+
+ // Is parent
+ if (path[i] === '..') {
+ nb++;
+ continue;
+ }
+
+ // Move up
+ if (nb > 0) {
+ nb--;
+ continue;
+ }
+
+ o.push(path[i]);
+ }
+
+ i = base.length - nb;
+
+ // If /a/b/c or /
+ if (i <= 0) {
+ outPath = o.reverse().join('/');
+ } else {
+ outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/');
+ }
+
+ // Add front / if it's needed
+ if (outPath.indexOf('/') !== 0) {
+ outPath = '/' + outPath;
+ }
+
+ // Add traling / if it's needed
+ if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) {
+ outPath += tr;
+ }
+
+ return outPath;
+ },
+
+ /**
+ * Returns the full URI of the internal structure.
+ *
+ * @method getURI
+ * @param {Boolean} noProtoHost Optional no host and protocol part. Defaults to false.
+ */
+ getURI: function(noProtoHost) {
+ var s, self = this;
+
+ // Rebuild source
+ if (!self.source || noProtoHost) {
+ s = '';
+
+ if (!noProtoHost) {
+ if (self.protocol) {
+ s += self.protocol + '://';
+ } else {
+ s += '//';
+ }
+
+ if (self.userInfo) {
+ s += self.userInfo + '@';
+ }
+
+ if (self.host) {
+ s += self.host;
+ }
+
+ if (self.port) {
+ s += ':' + self.port;
+ }
+ }
+
+ if (self.path) {
+ s += self.path;
+ }
+
+ if (self.query) {
+ s += '?' + self.query;
+ }
+
+ if (self.anchor) {
+ s += '#' + self.anchor;
+ }
+
+ self.source = s;
+ }
+
+ return self.source;
+ }
+ };
+
+ return URI;
+});
+
+// Included from: js/tinymce/classes/util/Class.js
+
+/**
+ * Class.js
+ *
+ * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved.
+ */
+
+/**
+ * This utilitiy class is used for easier inheritage.
+ *
+ * Features:
+ * * Exposed super functions: this._super();
+ * * Mixins
+ * * Dummy functions
+ * * Property functions: var value = object.value(); and object.value(newValue);
+ * * Static functions
+ * * Defaults settings
+ */
+define("tinymce/util/Class", [
+ "tinymce/util/Tools"
+], function(Tools) {
+ var each = Tools.each, extend = Tools.extend;
+
+ var extendClass, initializing;
+
+ function Class() {
+ }
+
+ // Provides classical inheritance, based on code made by John Resig
+ Class.extend = extendClass = function(prop) {
+ var Self = this, _super = Self.prototype, prototype, name, member;
+
+ // The dummy class constructor
+ function Class() {
+ var i, mixins, mixin, self;
+
+ // All construction is actually done in the init method
+ if (!initializing) {
+ self = this;
+
+ // Run class constuctor
+ if (self.init) {
+ self.init.apply(self, arguments);
+ }
+
+ // Run mixin constructors
+ mixins = self.Mixins;
+ if (mixins) {
+ i = mixins.length;
+ while (i--) {
+ mixin = mixins[i];
+ if (mixin.init) {
+ mixin.init.apply(self, arguments);
+ }
+ }
+ }
+ }
+ }
+
+ // Dummy function, needs to be extended in order to provide functionality
+ function dummy() {
+ return this;
+ }
+
+ // Creates a overloaded method for the class
+ // this enables you to use this._super(); to call the super function
+ function createMethod(name, fn) {
+ return function(){
+ var self = this, tmp = self._super, ret;
+
+ self._super = _super[name];
+ ret = fn.apply(self, arguments);
+ self._super = tmp;
+
+ return ret;
+ };
+ }
+
+ // Instantiate a base class (but only create the instance,
+ // don't run the init constructor)
+ initializing = true;
+ prototype = new Self();
+ initializing = false;
+
+ // Add mixins
+ if (prop.Mixins) {
+ each(prop.Mixins, function(mixin) {
+ mixin = mixin;
+
+ for (var name in mixin) {
+ if (name !== "init") {
+ prop[name] = mixin[name];
+ }
+ }
+ });
+
+ if (_super.Mixins) {
+ prop.Mixins = _super.Mixins.concat(prop.Mixins);
+ }
+ }
+
+ // Generate dummy methods
+ if (prop.Methods) {
+ each(prop.Methods.split(','), function(name) {
+ prop[name] = dummy;
+ });
+ }
+
+ // Generate property methods
+ if (prop.Properties) {
+ each(prop.Properties.split(','), function(name) {
+ var fieldName = '_' + name;
+
+ prop[name] = function(value) {
+ var self = this, undef;
+
+ // Set value
+ if (value !== undef) {
+ self[fieldName] = value;
+
+ return self;
+ }
+
+ // Get value
+ return self[fieldName];
+ };
+ });
+ }
+
+ // Static functions
+ if (prop.Statics) {
+ each(prop.Statics, function(func, name) {
+ Class[name] = func;
+ });
+ }
+
+ // Default settings
+ if (prop.Defaults && _super.Defaults) {
+ prop.Defaults = extend({}, _super.Defaults, prop.Defaults);
+ }
+
+ // Copy the properties over onto the new prototype
+ for (name in prop) {
+ member = prop[name];
+
+ if (typeof member == "function" && _super[name]) {
+ prototype[name] = createMethod(name, member);
+ } else {
+ prototype[name] = member;
+ }
+ }
+
+ // Populate our constructed prototype object
+ Class.prototype = prototype;
+
+ // Enforce the constructor to be what we expect
+ Class.constructor = Class;
+
+ // And make this class extendible
+ Class.extend = extendClass;
+
+ return Class;
+ };
+
+ return Class;
+});
+
+// Included from: js/tinymce/classes/ui/Selector.js
+
+/**
+ * Selector.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Selector engine, enables you to select controls by using CSS like expressions.
+ * We currently only support basic CSS expressions to reduce the size of the core
+ * and the ones we support should be enough for most cases.
+ *
+ * @example
+ * Supported expressions:
+ * element
+ * element#name
+ * element.class
+ * element[attr]
+ * element[attr*=value]
+ * element[attr~=value]
+ * element[attr!=value]
+ * element[attr^=value]
+ * element[attr$=value]
+ * element:<state>
+ * element:not(<expression>)
+ * element:first
+ * element:last
+ * element:odd
+ * element:even
+ * element element
+ * element > element
+ *
+ * @class tinymce.ui.Selector
+ */
+define("tinymce/ui/Selector", [
+ "tinymce/util/Class"
+], function(Class) {
+ "use strict";
+
+ /**
+ * Produces an array with a unique set of objects. It will not compare the values
+ * but the references of the objects.
+ *
+ * @private
+ * @method unqiue
+ * @param {Array} array Array to make into an array with unique items.
+ * @return {Array} Array with unique items.
+ */
+ function unique(array) {
+ var uniqueItems = [], i = array.length, item;
+
+ while (i--) {
+ item = array[i];
+
+ if (!item.__checked) {
+ uniqueItems.push(item);
+ item.__checked = 1;
+ }
+ }
+
+ i = uniqueItems.length;
+ while (i--) {
+ delete uniqueItems[i].__checked;
+ }
+
+ return uniqueItems;
+ }
+
+ var expression = /^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i;
+
+ /*jshint maxlen:255 */
+ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+ whiteSpace = /^\s*|\s*$/g,
+ Collection;
+
+ var Selector = Class.extend({
+ /**
+ * Constructs a new Selector instance.
+ *
+ * @constructor
+ * @method init
+ * @param {String} selector CSS like selector expression.
+ */
+ init: function(selector) {
+ var match = this.match;
+
+ function compileNameFilter(name) {
+ if (name) {
+ name = name.toLowerCase();
+
+ return function(item) {
+ return name === '*' || item.type === name;
+ };
+ }
+ }
+
+ function compileIdFilter(id) {
+ if (id) {
+ return function(item) {
+ return item._name === id;
+ };
+ }
+ }
+
+ function compileClassesFilter(classes) {
+ if (classes) {
+ classes = classes.split('.');
+
+ return function(item) {
+ var i = classes.length;
+
+ while (i--) {
+ if (!item.hasClass(classes[i])) {
+ return false;
+ }
+ }
+
+ return true;
+ };
+ }
+ }
+
+ function compileAttrFilter(name, cmp, check) {
+ if (name) {
+ return function(item) {
+ var value = item[name] ? item[name]() : '';
+
+ return !cmp ? !!check :
+ cmp === "=" ? value === check :
+ cmp === "*=" ? value.indexOf(check) >= 0 :
+ cmp === "~=" ? (" " + value + " ").indexOf(" " + check + " ") >= 0 :
+ cmp === "!=" ? value != check :
+ cmp === "^=" ? value.indexOf(check) === 0 :
+ cmp === "$=" ? value.substr(value.length - check.length) === check :
+ false;
+ };
+ }
+ }
+
+ function compilePsuedoFilter(name) {
+ var notSelectors;
+
+ if (name) {
+ name = /(?:not\((.+)\))|(.+)/i.exec(name);
+
+ if (!name[1]) {
+ name = name[2];
+
+ return function(item, index, length) {
+ return name === 'first' ? index === 0 :
+ name === 'last' ? index === length - 1 :
+ name === 'even' ? index % 2 === 0 :
+ name === 'odd' ? index % 2 === 1 :
+ item[name] ? item[name]() :
+ false;
+ };
+ } else {
+ // Compile not expression
+ notSelectors = parseChunks(name[1], []);
+
+ return function(item) {
+ return !match(item, notSelectors);
+ };
+ }
+ }
+ }
+
+ function compile(selector, filters, direct) {
+ var parts;
+
+ function add(filter) {
+ if (filter) {
+ filters.push(filter);
+ }
+ }
+
+ // Parse expression into parts
+ parts = expression.exec(selector.replace(whiteSpace, ''));
+
+ add(compileNameFilter(parts[1]));
+ add(compileIdFilter(parts[2]));
+ add(compileClassesFilter(parts[3]));
+ add(compileAttrFilter(parts[4], parts[5], parts[6]));
+ add(compilePsuedoFilter(parts[7]));
+
+ // Mark the filter with psuedo for performance
+ filters.psuedo = !!parts[7];
+ filters.direct = direct;
+
+ return filters;
+ }
+
+ // Parser logic based on Sizzle by John Resig
+ function parseChunks(selector, selectors) {
+ var parts = [], extra, matches, i;
+
+ do {
+ chunker.exec("");
+ matches = chunker.exec(selector);
+
+ if (matches) {
+ selector = matches[3];
+ parts.push(matches[1]);
+
+ if (matches[2]) {
+ extra = matches[3];
+ break;
+ }
+ }
+ } while (matches);
+
+ if (extra) {
+ parseChunks(extra, selectors);
+ }
+
+ selector = [];
+ for (i = 0; i < parts.length; i++) {
+ if (parts[i] != '>') {
+ selector.push(compile(parts[i], [], parts[i - 1] === '>'));
+ }
+ }
+
+ selectors.push(selector);
+
+ return selectors;
+ }
+
+ this._selectors = parseChunks(selector, []);
+ },
+
+ /**
+ * Returns true/false if the selector matches the specified control.
+ *
+ * @method match
+ * @param {tinymce.ui.Control} control Control to match agains the selector.
+ * @param {Array} selectors Optional array of selectors, mostly used internally.
+ * @return {Boolean} true/false state if the control matches or not.
+ */
+ match: function(control, selectors) {
+ var i, l, si, sl, selector, fi, fl, filters, index, length, siblings, count, item;
+
+ selectors = selectors || this._selectors;
+ for (i = 0, l = selectors.length; i < l; i++) {
+ selector = selectors[i];
+ sl = selector.length;
+ item = control;
+ count = 0;
+
+ for (si = sl - 1; si >= 0; si--) {
+ filters = selector[si];
+
+ while (item) {
+ // Find the index and length since a psuedo filter like :first needs it
+ if (filters.psuedo) {
+ siblings = item.parent().items();
+ index = length = siblings.length;
+ while (index--) {
+ if (siblings[index] === item) {
+ break;
+ }
+ }
+ }
+
+ for (fi = 0, fl = filters.length; fi < fl; fi++) {
+ if (!filters[fi](item, index, length)) {
+ fi = fl + 1;
+ break;
+ }
+ }
+
+ if (fi === fl) {
+ count++;
+ break;
+ } else {
+ // If it didn't match the right most expression then
+ // break since it's no point looking at the parents
+ if (si === sl - 1) {
+ break;
+ }
+ }
+
+ item = item.parent();
+ }
+ }
+
+ // If we found all selectors then return true otherwise continue looking
+ if (count === sl) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ /**
+ * Returns a tinymce.ui.Collection with matches of the specified selector inside the specified container.
+ *
+ * @method find
+ * @param {tinymce.ui.Control} container Container to look for items in.
+ * @return {tinymce.ui.Collection} Collection with matched elements.
+ */
+ find: function(container) {
+ var matches = [], i, l, selectors = this._selectors;
+
+ function collect(items, selector, index) {
+ var i, l, fi, fl, item, filters = selector[index];
+
+ for (i = 0, l = items.length; i < l; i++) {
+ item = items[i];
+
+ // Run each filter agains the item
+ for (fi = 0, fl = filters.length; fi < fl; fi++) {
+ if (!filters[fi](item, i, l)) {
+ fi = fl + 1;
+ break;
+ }
+ }
+
+ // All filters matched the item
+ if (fi === fl) {
+ // Matched item is on the last expression like: panel toolbar [button]
+ if (index == selector.length - 1) {
+ matches.push(item);
+ } else {
+ // Collect next expression type
+ if (item.items) {
+ collect(item.items(), selector, index + 1);
+ }
+ }
+ } else if (filters.direct) {
+ return;
+ }
+
+ // Collect child items
+ if (item.items) {
+ collect(item.items(), selector, index);
+ }
+ }
+ }
+
+ if (container.items) {
+ for (i = 0, l = selectors.length; i < l; i++) {
+ collect(container.items(), selectors[i], 0);
+ }
+
+ // Unique the matches if needed
+ if (l > 1) {
+ matches = unique(matches);
+ }
+ }
+
+ // Fix for circular reference
+ if (!Collection) {
+ // TODO: Fix me!
+ Collection = Selector.Collection;
+ }
+
+ return new Collection(matches);
+ }
+ });
+
+ return Selector;
+});
+
+// Included from: js/tinymce/classes/ui/Collection.js
+
+/**
+ * Collection.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Control collection, this class contains control instances and it enables you to
+ * perform actions on all the contained items. This is very similar to how jQuery works.
+ *
+ * @example
+ * someCollection.show().disabled(true);
+ *
+ * @class tinymce.ui.Collection
+ */
+define("tinymce/ui/Collection", [
+ "tinymce/util/Tools",
+ "tinymce/ui/Selector",
+ "tinymce/util/Class"
+], function(Tools, Selector, Class) {
+ "use strict";
+
+ var Collection, proto, push = Array.prototype.push, slice = Array.prototype.slice;
+
+ proto = {
+ /**
+ * Current number of contained control instances.
+ *
+ * @field length
+ * @type Number
+ */
+ length: 0,
+
+ /**
+ * Constructor for the collection.
+ *
+ * @constructor
+ * @method init
+ * @param {Array} items Optional array with items to add.
+ */
+ init: function(items) {
+ if (items) {
+ this.add(items);
+ }
+ },
+
+ /**
+ * Adds new items to the control collection.
+ *
+ * @method add
+ * @param {Array} items Array if items to add to collection.
+ * @return {tinymce.ui.Collection} Current collection instance.
+ */
+ add: function(items) {
+ var self = this;
+
+ // Force single item into array
+ if (!Tools.isArray(items)) {
+ if (items instanceof Collection) {
+ self.add(items.toArray());
+ } else {
+ push.call(self, items);
+ }
+ } else {
+ push.apply(self, items);
+ }
+
+ return self;
+ },
+
+ /**
+ * Sets the contents of the collection. This will remove any existing items
+ * and replace them with the ones specified in the input array.
+ *
+ * @method set
+ * @param {Array} items Array with items to set into the Collection.
+ * @return {tinymce.ui.Collection} Collection instance.
+ */
+ set: function(items) {
+ var self = this, len = self.length, i;
+
+ self.length = 0;
+ self.add(items);
+
+ // Remove old entries
+ for (i = self.length; i < len; i++) {
+ delete self[i];
+ }
+
+ return self;
+ },
+
+ /**
+ * Filters the collection item based on the specified selector expression or selector function.
+ *
+ * @method filter
+ * @param {String} selector Selector expression to filter items by.
+ * @return {tinymce.ui.Collection} Collection containing the filtered items.
+ */
+ filter: function(selector) {
+ var self = this, i, l, matches = [], item, match;
+
+ // Compile string into selector expression
+ if (typeof(selector) === "string") {
+ selector = new Selector(selector);
+
+ match = function(item) {
+ return selector.match(item);
+ };
+ } else {
+ // Use selector as matching function
+ match = selector;
+ }
+
+ for (i = 0, l = self.length; i < l; i++) {
+ item = self[i];
+
+ if (match(item)) {
+ matches.push(item);
+ }
+ }
+
+ return new Collection(matches);
+ },
+
+ /**
+ * Slices the items within the collection.
+ *
+ * @method slice
+ * @param {Number} index Index to slice at.
+ * @param {Number} len Optional length to slice.
+ * @return {tinymce.ui.Collection} Current collection.
+ */
+ slice: function() {
+ return new Collection(slice.apply(this, arguments));
+ },
+
+ /**
+ * Makes the current collection equal to the specified index.
+ *
+ * @method eq
+ * @param {Number} index Index of the item to set the collection to.
+ * @return {tinymce.ui.Collection} Current collection.
+ */
+ eq: function(index) {
+ return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
+ },
+
+ /**
+ * Executes the specified callback on each item in collection.
+ *
+ * @method each
+ * @param {function} callback Callback to execute for each item in collection.
+ * @return {tinymce.ui.Collection} Current collection instance.
+ */
+ each: function(callback) {
+ Tools.each(this, callback);
+
+ return this;
+ },
+
+ /**
+ * Returns an JavaScript array object of the contents inside the collection.
+ *
+ * @method toArray
+ * @return {Array} Array with all items from collection.
+ */
+ toArray: function() {
+ return Tools.toArray(this);
+ },
+
+ /**
+ * Finds the index of the specified control or return -1 if it isn't in the collection.
+ *
+ * @method indexOf
+ * @param {Control} ctrl Control instance to look for.
+ * @return {Number} Index of the specified control or -1.
+ */
+ indexOf: function(ctrl) {
+ var self = this, i = self.length;
+
+ while (i--) {
+ if (self[i] === ctrl) {
+ break;
+ }
+ }
+
+ return i;
+ },
+
+ /**
+ * Returns a new collection of the contents in reverse order.
+ *
+ * @method reverse
+ * @return {tinymce.ui.Collection} Collection instance with reversed items.
+ */
+ reverse: function() {
+ return new Collection(Tools.toArray(this).reverse());
+ },
+
+ /**
+ * Returns true/false if the class exists or not.
+ *
+ * @method hasClass
+ * @param {String} cls Class to check for.
+ * @return {Boolean} true/false state if the class exists or not.
+ */
+ hasClass: function(cls) {
+ return this[0] ? this[0].hasClass(cls) : false;
+ },
+
+ /**
+ * Sets/gets the specific property on the items in the collection. The same as executing control.<property>(<value>);
+ *
+ * @method prop
+ * @param {String} name Property name to get/set.
+ * @param {Object} value Optional object value to set.
+ * @return {tinymce.ui.Collection} Current collection instance or value of the first item on a get operation.
+ */
+ prop: function(name, value) {
+ var self = this, undef, item;
+
+ if (value !== undef) {
+ self.each(function(item) {
+ if (item[name]) {
+ item[name](value);
+ }
+ });
+
+ return self;
+ }
+
+ item = self[0];
+
+ if (item && item[name]) {
+ return item[name]();
+ }
+ },
+
+ /**
+ * Executes the specific function name with optional arguments an all items in collection if it exists.
+ *
+ * @example collection.exec("myMethod", arg1, arg2, arg3);
+ * @method exec
+ * @param {String} name Name of the function to execute.
+ * @param {Object} ... Multiple arguments to pass to each function.
+ * @return {tinymce.ui.Collection} Current collection.
+ */
+ exec: function(name) {
+ var self = this, args = Tools.toArray(arguments).slice(1);
+
+ self.each(function(item) {
+ if (item[name]) {
+ item[name].apply(item, args);
+ }
+ });
+
+ return self;
+ },
+
+ /**
+ * Remove all items from collection and DOM.
+ *
+ * @method remove
+ * @return {tinymce.ui.Collection} Current collection.
+ */
+ remove: function() {
+ var i = this.length;
+
+ while (i--) {
+ this[i].remove();
+ }
+
+ return this;
+ }
+
+ /**
+ * Fires the specified event by name and arguments on the control. This will execute all
+ * bound event handlers.
+ *
+ * @method fire
+ * @param {String} name Name of the event to fire.
+ * @param {Object} args Optional arguments to pass to the event.
+ * @return {tinymce.ui.Collection} Current collection instance.
+ */
+ // fire: function(event, args) {}, -- Generated by code below
+
+ /**
+ * Binds a callback to the specified event. This event can both be
+ * native browser events like "click" or custom ones like PostRender.
+ *
+ * The callback function will have two parameters the first one being the control that received the event
+ * the second one will be the event object either the browsers native event object or a custom JS object.
+ *
+ * @method on
+ * @param {String} name Name of the event to bind. For example "click".
+ * @param {String/function} callback Callback function to execute ones the event occurs.
+ * @return {tinymce.ui.Collection} Current collection instance.
+ */
+ // on: function(name, callback) {}, -- Generated by code below
+
+ /**
+ * Unbinds the specified event and optionally a specific callback. If you omit the name
+ * parameter all event handlers will be removed. If you omit the callback all event handles
+ * by the specified name will be removed.
+ *
+ * @method off
+ * @param {String} name Optional name for the event to unbind.
+ * @param {function} callback Optional callback function to unbind.
+ * @return {tinymce.ui.Collection} Current collection instance.
+ */
+ // off: function(name, callback) {}, -- Generated by code below
+
+ /**
+ * Shows the items in the current collection.
+ *
+ * @method show
+ * @return {tinymce.ui.Collection} Current collection instance.
+ */
+ // show: function() {}, -- Generated by code below
+
+ /**
+ * Hides the items in the current collection.
+ *
+ * @method hide
+ * @return {tinymce.ui.Collection} Current collection instance.
+ */
+ // hide: function() {}, -- Generated by code below
+
+ /**
+ * Sets/gets the text contents of the items in the current collection.
+ *
+ * @method text
+ * @return {tinymce.ui.Collection} Current collection instance or text value of the first item on a get operation.
+ */
+ // text: function(value) {}, -- Generated by code below
+
+ /**
+ * Sets/gets the name contents of the items in the current collection.
+ *
+ * @method name
+ * @return {tinymce.ui.Collection} Current collection instance or name value of the first item on a get operation.
+ */
+ // name: function(value) {}, -- Generated by code below
+
+ /**
+ * Sets/gets the disabled state on the items in the current collection.
+ *
+ * @method disabled
+ * @return {tinymce.ui.Collection} Current collection instance or disabled state of the first item on a get operation.
+ */
+ // disabled: function(state) {}, -- Generated by code below
+
+ /**
+ * Sets/gets the active state on the items in the current collection.
+ *
+ * @method active
+ * @return {tinymce.ui.Collection} Current collection instance or active state of the first item on a get operation.
+ */
+ // active: function(state) {}, -- Generated by code below
+
+ /**
+ * Sets/gets the selected state on the items in the current collection.
+ *
+ * @method selected
+ * @return {tinymce.ui.Collection} Current collection instance or selected state of the first item on a get operation.
+ */
+ // selected: function(state) {}, -- Generated by code below
+
+ /**
+ * Sets/gets the selected state on the items in the current collection.
+ *
+ * @method visible
+ * @return {tinymce.ui.Collection} Current collection instance or visible state of the first item on a get operation.
+ */
+ // visible: function(state) {}, -- Generated by code below
+
+ /**
+ * Adds a class to all items in the collection.
+ *
+ * @method addClass
+ * @param {String} cls Class to add to each item.
+ * @return {tinymce.ui.Collection} Current collection instance.
+ */
+ // addClass: function(cls) {}, -- Generated by code below
+
+ /**
+ * Removes the specified class from all items in collection.
+ *
+ * @method removeClass
+ * @param {String} cls Class to remove from each item.
+ * @return {tinymce.ui.Collection} Current collection instance.
+ */
+ // removeClass: function(cls) {}, -- Generated by code below
+ };
+
+ // Extend tinymce.ui.Collection prototype with some generated control specific methods
+ Tools.each('fire on off show hide addClass removeClass append prepend before after reflow'.split(' '), function(name) {
+ proto[name] = function() {
+ var args = Tools.toArray(arguments);
+
+ this.each(function(ctrl) {
+ if (name in ctrl) {
+ ctrl[name].apply(ctrl, args);
+ }
+ });
+
+ return this;
+ };
+ });
+
+ // Extend tinymce.ui.Collection prototype with some property methods
+ Tools.each('text name disabled active selected checked visible parent value data'.split(' '), function(name) {
+ proto[name] = function(value) {
+ return this.prop(name, value);
+ };
+ });
+
+ // Create class based on the new prototype
+ Collection = Class.extend(proto);
+
+ // Stick Collection into Selector to prevent circual references
+ Selector.Collection = Collection;
+
+ return Collection;
+});
+
+// Included from: js/tinymce/classes/ui/DomUtils.js
+
+/**
+ * DOMUtils.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/ui/DomUtils", [
+ "tinymce/util/Tools",
+ "tinymce/dom/DOMUtils"
+], function(Tools, DOMUtils) {
+ "use strict";
+
+ return {
+ id: function() {
+ return DOMUtils.DOM.uniqueId();
+ },
+
+ createFragment: function(html) {
+ return DOMUtils.DOM.createFragment(html);
+ },
+
+ getWindowSize: function() {
+ return DOMUtils.DOM.getViewPort();
+ },
+
+ getSize: function(elm) {
+ var width, height;
+
+ if (elm.getBoundingClientRect) {
+ var rect = elm.getBoundingClientRect();
+
+ width = Math.max(rect.width || (rect.right - rect.left), elm.offsetWidth);
+ height = Math.max(rect.height || (rect.bottom - rect.bottom), elm.offsetHeight);
+ } else {
+ width = elm.offsetWidth;
+ height = elm.offsetHeight;
+ }
+
+ return {width: width, height: height};
+ },
+
+ getPos: function(elm, root) {
+ return DOMUtils.DOM.getPos(elm, root);
+ },
+
+ getViewPort: function(win) {
+ return DOMUtils.DOM.getViewPort(win);
+ },
+
+ get: function(id) {
+ return document.getElementById(id);
+ },
+
+ addClass : function(elm, cls) {
+ return DOMUtils.DOM.addClass(elm, cls);
+ },
+
+ removeClass : function(elm, cls) {
+ return DOMUtils.DOM.removeClass(elm, cls);
+ },
+
+ hasClass : function(elm, cls) {
+ return DOMUtils.DOM.hasClass(elm, cls);
+ },
+
+ toggleClass: function(elm, cls, state) {
+ return DOMUtils.DOM.toggleClass(elm, cls, state);
+ },
+
+ css: function(elm, name, value) {
+ return DOMUtils.DOM.setStyle(elm, name, value);
+ },
+
+ on: function(target, name, callback, scope) {
+ return DOMUtils.DOM.bind(target, name, callback, scope);
+ },
+
+ off: function(target, name, callback) {
+ return DOMUtils.DOM.unbind(target, name, callback);
+ },
+
+ fire: function(target, name, args) {
+ return DOMUtils.DOM.fire(target, name, args);
+ },
+
+ innerHtml: function(elm, html) {
+ // Workaround for <div> in <p> bug on IE 8 #6178
+ DOMUtils.DOM.setHTML(elm, html);
+ }
+ };
+});
+
+// Included from: js/tinymce/classes/ui/Control.js
+
+/**
+ * Control.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This is the base class for all controls and containers. All UI control instances inherit
+ * from this one as it has the base logic needed by all of them.
+ *
+ * @class tinymce.ui.Control
+ */
+define("tinymce/ui/Control", [
+ "tinymce/util/Class",
+ "tinymce/util/Tools",
+ "tinymce/ui/Collection",
+ "tinymce/ui/DomUtils"
+], function(Class, Tools, Collection, DomUtils) {
+ "use strict";
+
+ var nativeEvents = Tools.makeMap("focusin focusout scroll click dblclick mousedown mouseup mousemove mouseover" +
+ " mouseout mouseenter mouseleave wheel keydown keypress keyup contextmenu", " ");
+
+ var elementIdCache = {};
+ var hasMouseWheelEventSupport = "onmousewheel" in document;
+ var hasWheelEventSupport = false;
+
+ var Control = Class.extend({
+ Statics: {
+ controlIdLookup: {},
+ elementIdCache: elementIdCache
+ },
+
+ isRtl: function() {
+ return Control.rtl;
+ },
+
+ /**
+ * Class/id prefix to use for all controls.
+ *
+ * @final
+ * @field {String} classPrefix
+ */
+ classPrefix: "mce-",
+
+ /**
+ * Constructs a new control instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ * @setting {String} style Style CSS properties to add.
+ * @setting {String} border Border box values example: 1 1 1 1
+ * @setting {String} padding Padding box values example: 1 1 1 1
+ * @setting {String} margin Margin box values example: 1 1 1 1
+ * @setting {Number} minWidth Minimal width for the control.
+ * @setting {Number} minHeight Minimal height for the control.
+ * @setting {String} classes Space separated list of classes to add.
+ * @setting {String} role WAI-ARIA role to use for control.
+ * @setting {Boolean} hidden Is the control hidden by default.
+ * @setting {Boolean} disabled Is the control disabled by default.
+ * @setting {String} name Name of the control instance.
+ */
+ init: function(settings) {
+ var self = this, classes, i;
+
+ self.settings = settings = Tools.extend({}, self.Defaults, settings);
+
+ // Initial states
+ self._id = DomUtils.id();
+ self._text = self._name = '';
+ self._width = self._height = 0;
+ self._aria = {role: settings.role};
+
+ // Setup classes
+ classes = settings.classes;
+ if (classes) {
+ classes = classes.split(' ');
+ classes.map = {};
+ i = classes.length;
+ while (i--) {
+ classes.map[classes[i]] = true;
+ }
+ }
+
+ self._classes = classes || [];
+ self.visible(true);
+
+ // Set some properties
+ Tools.each('title text width height name classes visible disabled active value'.split(' '), function(name) {
+ var value = settings[name], undef;
+
+ if (value !== undef) {
+ self[name](value);
+ } else if (self['_' + name] === undef) {
+ self['_' + name] = false;
+ }
+ });
+
+ self.on('click', function() {
+ if (self.disabled()) {
+ return false;
+ }
+ });
+
+ // TODO: Is this needed duplicate code see above?
+ if (settings.classes) {
+ Tools.each(settings.classes.split(' '), function(cls) {
+ self.addClass(cls);
+ });
+ }
+
+ /**
+ * Name/value object with settings for the current control.
+ *
+ * @field {Object} settings
+ */
+ self.settings = settings;
+
+ self._borderBox = self.parseBox(settings.border);
+ self._paddingBox = self.parseBox(settings.padding);
+ self._marginBox = self.parseBox(settings.margin);
+
+ if (settings.hidden) {
+ self.hide();
+ }
+ },
+
+ // Will generate getter/setter methods for these properties
+ Properties: 'parent,title,text,width,height,disabled,active,name,value',
+
+ // Will generate empty dummy functions for these
+ Methods: 'renderHtml',
+
+ /**
+ * Returns the root element to render controls into.
+ *
+ * @method getContainerElm
+ * @return {Element} HTML DOM element to render into.
+ */
+ getContainerElm: function() {
+ return document.body;
+ },
+
+ /**
+ * Returns a control instance for the current DOM element.
+ *
+ * @method getParentCtrl
+ * @param {Element} elm HTML dom element to get parent control from.
+ * @return {tinymce.ui.Control} Control instance or undefined.
+ */
+ getParentCtrl: function(elm) {
+ var ctrl;
+
+ while (elm) {
+ ctrl = Control.controlIdLookup[elm.id];
+ if (ctrl) {
+ break;
+ }
+
+ elm = elm.parentNode;
+ }
+
+ return ctrl;
+ },
+
+ /**
+ * Parses the specified box value. A box value contains 1-4 properties in clockwise order.
+ *
+ * @method parseBox
+ * @param {String/Number} value Box value "0 1 2 3" or "0" etc.
+ * @return {Object} Object with top/right/bottom/left properties.
+ * @private
+ */
+ parseBox: function(value) {
+ var len, radix = 10;
+
+ if (!value) {
+ return;
+ }
+
+ if (typeof(value) === "number") {
+ value = value || 0;
+
+ return {
+ top: value,
+ left: value,
+ bottom: value,
+ right: value
+ };
+ }
+
+ value = value.split(' ');
+ len = value.length;
+
+ if (len === 1) {
+ value[1] = value[2] = value[3] = value[0];
+ } else if (len === 2) {
+ value[2] = value[0];
+ value[3] = value[1];
+ } else if (len === 3) {
+ value[3] = value[1];
+ }
+
+ return {
+ top: parseInt(value[0], radix) || 0,
+ right: parseInt(value[1], radix) || 0,
+ bottom: parseInt(value[2], radix) || 0,
+ left: parseInt(value[3], radix) || 0
+ };
+ },
+
+ borderBox: function() {
+ return this._borderBox;
+ },
+
+ paddingBox: function() {
+ return this._paddingBox;
+ },
+
+ marginBox: function() {
+ return this._marginBox;
+ },
+
+ measureBox: function(elm, prefix) {
+ function getStyle(name) {
+ var defaultView = document.defaultView;
+
+ if (defaultView) {
+ // Remove camelcase
+ name = name.replace(/[A-Z]/g, function(a) {
+ return '-' + a;
+ });
+
+ return defaultView.getComputedStyle(elm, null).getPropertyValue(name);
+ }
+
+ return elm.currentStyle[name];
+ }
+
+ function getSide(name) {
+ var val = parseFloat(getStyle(name), 10);
+
+ return isNaN(val) ? 0 : val;
+ }
+
+ return {
+ top: getSide(prefix + "TopWidth"),
+ right: getSide(prefix + "RightWidth"),
+ bottom: getSide(prefix + "BottomWidth"),
+ left: getSide(prefix + "LeftWidth")
+ };
+ },
+
+ /**
+ * Initializes the current controls layout rect.
+ * This will be executed by the layout managers to determine the
+ * default minWidth/minHeight etc.
+ *
+ * @method initLayoutRect
+ * @return {Object} Layout rect instance.
+ */
+ initLayoutRect: function() {
+ var self = this, settings = self.settings, borderBox, layoutRect;
+ var elm = self.getEl(), width, height, minWidth, minHeight, autoResize;
+ var startMinWidth, startMinHeight, initialSize;
+
+ // Measure the current element
+ borderBox = self._borderBox = self._borderBox || self.measureBox(elm, 'border');
+ self._paddingBox = self._paddingBox || self.measureBox(elm, 'padding');
+ self._marginBox = self._marginBox || self.measureBox(elm, 'margin');
+ initialSize = DomUtils.getSize(elm);
+
+ // Setup minWidth/minHeight and width/height
+ startMinWidth = settings.minWidth;
+ startMinHeight = settings.minHeight;
+ minWidth = startMinWidth || initialSize.width;
+ minHeight = startMinHeight || initialSize.height;
+ width = settings.width;
+ height = settings.height;
+ autoResize = settings.autoResize;
+ autoResize = typeof(autoResize) != "undefined" ? autoResize : !width && !height;
+
+ width = width || minWidth;
+ height = height || minHeight;
+
+ var deltaW = borderBox.left + borderBox.right;
+ var deltaH = borderBox.top + borderBox.bottom;
+
+ var maxW = settings.maxWidth || 0xFFFF;
+ var maxH = settings.maxHeight || 0xFFFF;
+
+ // Setup initial layout rect
+ self._layoutRect = layoutRect = {
+ x: settings.x || 0,
+ y: settings.y || 0,
+ w: width,
+ h: height,
+ deltaW: deltaW,
+ deltaH: deltaH,
+ contentW: width - deltaW,
+ contentH: height - deltaH,
+ innerW: width - deltaW,
+ innerH: height - deltaH,
+ startMinWidth: startMinWidth || 0,
+ startMinHeight: startMinHeight || 0,
+ minW: Math.min(minWidth, maxW),
+ minH: Math.min(minHeight, maxH),
+ maxW: maxW,
+ maxH: maxH,
+ autoResize: autoResize,
+ scrollW: 0
+ };
+
+ self._lastLayoutRect = {};
+
+ return layoutRect;
+ },
+
+ /**
+ * Getter/setter for the current layout rect.
+ *
+ * @method layoutRect
+ * @param {Object} [newRect] Optional new layout rect.
+ * @return {tinymce.ui.Control/Object} Current control or rect object.
+ */
+ layoutRect: function(newRect) {
+ var self = this, curRect = self._layoutRect, lastLayoutRect, size, deltaWidth, deltaHeight, undef, repaintControls;
+
+ // Initialize default layout rect
+ if (!curRect) {
+ curRect = self.initLayoutRect();
+ }
+
+ // Set new rect values
+ if (newRect) {
+ // Calc deltas between inner and outer sizes
+ deltaWidth = curRect.deltaW;
+ deltaHeight = curRect.deltaH;
+
+ // Set x position
+ if (newRect.x !== undef) {
+ curRect.x = newRect.x;
+ }
+
+ // Set y position
+ if (newRect.y !== undef) {
+ curRect.y = newRect.y;
+ }
+
+ // Set minW
+ if (newRect.minW !== undef) {
+ curRect.minW = newRect.minW;
+ }
+
+ // Set minH
+ if (newRect.minH !== undef) {
+ curRect.minH = newRect.minH;
+ }
+
+ // Set new width and calculate inner width
+ size = newRect.w;
+ if (size !== undef) {
+ size = size < curRect.minW ? curRect.minW : size;
+ size = size > curRect.maxW ? curRect.maxW : size;
+ curRect.w = size;
+ curRect.innerW = size - deltaWidth;
+ }
+
+ // Set new height and calculate inner height
+ size = newRect.h;
+ if (size !== undef) {
+ size = size < curRect.minH ? curRect.minH : size;
+ size = size > curRect.maxH ? curRect.maxH : size;
+ curRect.h = size;
+ curRect.innerH = size - deltaHeight;
+ }
+
+ // Set new inner width and calculate width
+ size = newRect.innerW;
+ if (size !== undef) {
+ size = size < curRect.minW - deltaWidth ? curRect.minW - deltaWidth : size;
+ size = size > curRect.maxW - deltaWidth ? curRect.maxW - deltaWidth : size;
+ curRect.innerW = size;
+ curRect.w = size + deltaWidth;
+ }
+
+ // Set new height and calculate inner height
+ size = newRect.innerH;
+ if (size !== undef) {
+ size = size < curRect.minH - deltaHeight ? curRect.minH - deltaHeight : size;
+ size = size > curRect.maxH - deltaHeight ? curRect.maxH - deltaHeight : size;
+ curRect.innerH = size;
+ curRect.h = size + deltaHeight;
+ }
+
+ // Set new contentW
+ if (newRect.contentW !== undef) {
+ curRect.contentW = newRect.contentW;
+ }
+
+ // Set new contentH
+ if (newRect.contentH !== undef) {
+ curRect.contentH = newRect.contentH;
+ }
+
+ // Compare last layout rect with the current one to see if we need to repaint or not
+ lastLayoutRect = self._lastLayoutRect;
+ if (lastLayoutRect.x !== curRect.x || lastLayoutRect.y !== curRect.y ||
+ lastLayoutRect.w !== curRect.w || lastLayoutRect.h !== curRect.h) {
+ repaintControls = Control.repaintControls;
+
+ if (repaintControls) {
+ if (repaintControls.map && !repaintControls.map[self._id]) {
+ repaintControls.push(self);
+ repaintControls.map[self._id] = true;
+ }
+ }
+
+ lastLayoutRect.x = curRect.x;
+ lastLayoutRect.y = curRect.y;
+ lastLayoutRect.w = curRect.w;
+ lastLayoutRect.h = curRect.h;
+ }
+
+ return self;
+ }
+
+ return curRect;
+ },
+
+ /**
+ * Repaints the control after a layout operation.
+ *
+ * @method repaint
+ */
+ repaint: function() {
+ var self = this, style, bodyStyle, rect, borderBox, borderW = 0, borderH = 0, lastRepaintRect, round;
+
+ // Use Math.round on all values on IE < 9
+ round = !document.createRange ? Math.round : function(value) {
+ return value;
+ };
+
+ style = self.getEl().style;
+ rect = self._layoutRect;
+ lastRepaintRect = self._lastRepaintRect || {};
+
+ borderBox = self._borderBox;
+ borderW = borderBox.left + borderBox.right;
+ borderH = borderBox.top + borderBox.bottom;
+
+ if (rect.x !== lastRepaintRect.x) {
+ style.left = round(rect.x) + 'px';
+ lastRepaintRect.x = rect.x;
+ }
+
+ if (rect.y !== lastRepaintRect.y) {
+ style.top = round(rect.y) + 'px';
+ lastRepaintRect.y = rect.y;
+ }
+
+ if (rect.w !== lastRepaintRect.w) {
+ style.width = round(rect.w - borderW) + 'px';
+ lastRepaintRect.w = rect.w;
+ }
+
+ if (rect.h !== lastRepaintRect.h) {
+ style.height = round(rect.h - borderH) + 'px';
+ lastRepaintRect.h = rect.h;
+ }
+
+ // Update body if needed
+ if (self._hasBody && rect.innerW !== lastRepaintRect.innerW) {
+ bodyStyle = self.getEl('body').style;
+ bodyStyle.width = round(rect.innerW) + 'px';
+ lastRepaintRect.innerW = rect.innerW;
+ }
+
+ if (self._hasBody && rect.innerH !== lastRepaintRect.innerH) {
+ bodyStyle = bodyStyle || self.getEl('body').style;
+ bodyStyle.height = round(rect.innerH) + 'px';
+ lastRepaintRect.innerH = rect.innerH;
+ }
+
+ self._lastRepaintRect = lastRepaintRect;
+ self.fire('repaint', {}, false);
+ },
+
+ /**
+ * Binds a callback to the specified event. This event can both be
+ * native browser events like "click" or custom ones like PostRender.
+ *
+ * The callback function will be passed a DOM event like object that enables yout do stop propagation.
+ *
+ * @method on
+ * @param {String} name Name of the event to bind. For example "click".
+ * @param {String/function} callback Callback function to execute ones the event occurs.
+ * @return {tinymce.ui.Control} Current control object.
+ */
+ on: function(name, callback) {
+ var self = this, bindings, handlers, names, i;
+
+ function resolveCallbackName(name) {
+ var callback, scope;
+
+ return function(e) {
+ if (!callback) {
+ self.parents().each(function(ctrl) {
+ var callbacks = ctrl.settings.callbacks;
+
+ if (callbacks && (callback = callbacks[name])) {
+ scope = ctrl;
+ return false;
+ }
+ });
+ }
+
+ return callback.call(scope, e);
+ };
+ }
+
+ if (callback) {
+ if (typeof(callback) == 'string') {
+ callback = resolveCallbackName(callback);
+ }
+
+ names = name.toLowerCase().split(' ');
+ i = names.length;
+ while (i--) {
+ name = names[i];
+
+ bindings = self._bindings;
+ if (!bindings) {
+ bindings = self._bindings = {};
+ }
+
+ handlers = bindings[name];
+ if (!handlers) {
+ handlers = bindings[name] = [];
+ }
+
+ handlers.push(callback);
+
+ if (nativeEvents[name]) {
+ if (!self._nativeEvents) {
+ self._nativeEvents = {name: true};
+ } else {
+ self._nativeEvents[name] = true;
+ }
+
+ if (self._rendered) {
+ self.bindPendingEvents();
+ }
+ }
+ }
+ }
+
+ return self;
+ },
+
+ /**
+ * Unbinds the specified event and optionally a specific callback. If you omit the name
+ * parameter all event handlers will be removed. If you omit the callback all event handles
+ * by the specified name will be removed.
+ *
+ * @method off
+ * @param {String} [name] Name for the event to unbind.
+ * @param {function} [callback] Callback function to unbind.
+ * @return {mxex.ui.Control} Current control object.
+ */
+ off: function(name, callback) {
+ var self = this, i, bindings = self._bindings, handlers, bindingName, names, hi;
+
+ if (bindings) {
+ if (name) {
+ names = name.toLowerCase().split(' ');
+ i = names.length;
+ while (i--) {
+ name = names[i];
+ handlers = bindings[name];
+
+ // Unbind all handlers
+ if (!name) {
+ for (bindingName in bindings) {
+ bindings[bindingName].length = 0;
+ }
+
+ return self;
+ }
+
+ if (handlers) {
+ // Unbind all by name
+ if (!callback) {
+ handlers.length = 0;
+ } else {
+ // Unbind specific ones
+ hi = handlers.length;
+ while (hi--) {
+ if (handlers[hi] === callback) {
+ handlers.splice(hi, 1);
+ }
+ }
+ }
+ }
+ }
+ } else {
+ self._bindings = [];
+ }
+ }
+
+ return self;
+ },
+
+ /**
+ * Fires the specified event by name and arguments on the control. This will execute all
+ * bound event handlers.
+ *
+ * @method fire
+ * @param {String} name Name of the event to fire.
+ * @param {Object} [args] Arguments to pass to the event.
+ * @param {Boolean} [bubble] Value to control bubbeling. Defaults to true.
+ * @return {Object} Current arguments object.
+ */
+ fire: function(name, args, bubble) {
+ var self = this, i, l, handlers, parentCtrl;
+
+ name = name.toLowerCase();
+
+ // Dummy function that gets replaced on the delegation state functions
+ function returnFalse() {
+ return false;
+ }
+
+ // Dummy function that gets replaced on the delegation state functions
+ function returnTrue() {
+ return true;
+ }
+
+ // Setup empty object if args is omited
+ args = args || {};
+
+ // Stick type into event object
+ if (!args.type) {
+ args.type = name;
+ }
+
+ // Stick control into event
+ if (!args.control) {
+ args.control = self;
+ }
+
+ // Add event delegation methods if they are missing
+ if (!args.preventDefault) {
+ // Add preventDefault method
+ args.preventDefault = function() {
+ args.isDefaultPrevented = returnTrue;
+ };
+
+ // Add stopPropagation
+ args.stopPropagation = function() {
+ args.isPropagationStopped = returnTrue;
+ };
+
+ // Add stopImmediatePropagation
+ args.stopImmediatePropagation = function() {
+ args.isImmediatePropagationStopped = returnTrue;
+ };
+
+ // Add event delegation states
+ args.isDefaultPrevented = returnFalse;
+ args.isPropagationStopped = returnFalse;
+ args.isImmediatePropagationStopped = returnFalse;
+ }
+
+ if (self._bindings) {
+ handlers = self._bindings[name];
+
+ if (handlers) {
+ for (i = 0, l = handlers.length; i < l; i++) {
+ // Execute callback and break if the callback returns a false
+ if (!args.isImmediatePropagationStopped() && handlers[i].call(self, args) === false) {
+ break;
+ }
+ }
+ }
+ }
+
+ // Bubble event up to parent controls
+ if (bubble !== false) {
+ parentCtrl = self.parent();
+ while (parentCtrl && !args.isPropagationStopped()) {
+ parentCtrl.fire(name, args, false);
+ parentCtrl = parentCtrl.parent();
+ }
+ }
+
+ return args;
+ },
+
+ /**
+ * Returns true/false if the specified event has any listeners.
+ *
+ * @method hasEventListeners
+ * @param {String} name Name of the event to check for.
+ * @return {Boolean} True/false state if the event has listeners.
+ */
+ hasEventListeners: function(name) {
+ return name in this._bindings;
+ },
+
+ /**
+ * Returns a control collection with all parent controls.
+ *
+ * @method parents
+ * @param {String} selector Optional selector expression to find parents.
+ * @return {tinymce.ui.Collection} Collection with all parent controls.
+ */
+ parents: function(selector) {
+ var ctrl = this, parents = new Collection();
+
+ // Add each parent to collection
+ for (ctrl = ctrl.parent(); ctrl; ctrl = ctrl.parent()) {
+ parents.add(ctrl);
+ }
+
+ // Filter away everything that doesn't match the selector
+ if (selector) {
+ parents = parents.filter(selector);
+ }
+
+ return parents;
+ },
+
+ /**
+ * Returns the control next to the current control.
+ *
+ * @method next
+ * @return {tinymce.ui.Control} Next control instance.
+ */
+ next: function() {
+ var parentControls = this.parent().items();
+
+ return parentControls[parentControls.indexOf(this) + 1];
+ },
+
+ /**
+ * Returns the control previous to the current control.
+ *
+ * @method prev
+ * @return {tinymce.ui.Control} Previous control instance.
+ */
+ prev: function() {
+ var parentControls = this.parent().items();
+
+ return parentControls[parentControls.indexOf(this) - 1];
+ },
+
+ /**
+ * Find the common ancestor for two control instances.
+ *
+ * @method findCommonAncestor
+ * @param {tinymce.ui.Control} ctrl1 First control.
+ * @param {tinymce.ui.Control} ctrl2 Second control.
+ * @return {tinymce.ui.Control} Ancestor control instance.
+ */
+ findCommonAncestor: function(ctrl1, ctrl2) {
+ var parentCtrl;
+
+ while (ctrl1) {
+ parentCtrl = ctrl2;
+
+ while (parentCtrl && ctrl1 != parentCtrl) {
+ parentCtrl = parentCtrl.parent();
+ }
+
+ if (ctrl1 == parentCtrl) {
+ break;
+ }
+
+ ctrl1 = ctrl1.parent();
+ }
+
+ return ctrl1;
+ },
+
+ /**
+ * Returns true/false if the specific control has the specific class.
+ *
+ * @method hasClass
+ * @param {String} cls Class to check for.
+ * @param {String} [group] Sub element group name.
+ * @return {Boolean} True/false if the control has the specified class.
+ */
+ hasClass: function(cls, group) {
+ var classes = this._classes[group || 'control'];
+
+ cls = this.classPrefix + cls;
+
+ return classes && !!classes.map[cls];
+ },
+
+ /**
+ * Adds the specified class to the control
+ *
+ * @method addClass
+ * @param {String} cls Class to check for.
+ * @param {String} [group] Sub element group name.
+ * @return {tinymce.ui.Control} Current control object.
+ */
+ addClass: function(cls, group) {
+ var self = this, classes, elm;
+
+ cls = this.classPrefix + cls;
+ classes = self._classes[group || 'control'];
+
+ if (!classes) {
+ classes = [];
+ classes.map = {};
+ self._classes[group || 'control'] = classes;
+ }
+
+ if (!classes.map[cls]) {
+ classes.map[cls] = cls;
+ classes.push(cls);
+
+ if (self._rendered) {
+ elm = self.getEl(group);
+
+ if (elm) {
+ elm.className = classes.join(' ');
+ }
+ }
+ }
+
+ return self;
+ },
+
+ /**
+ * Removes the specified class from the control.
+ *
+ * @method removeClass
+ * @param {String} cls Class to remove.
+ * @param {String} [group] Sub element group name.
+ * @return {tinymce.ui.Control} Current control object.
+ */
+ removeClass: function(cls, group) {
+ var self = this, classes, i, elm;
+
+ cls = this.classPrefix + cls;
+ classes = self._classes[group || 'control'];
+ if (classes && classes.map[cls]) {
+ delete classes.map[cls];
+
+ i = classes.length;
+ while (i--) {
+ if (classes[i] === cls) {
+ classes.splice(i, 1);
+ }
+ }
+ }
+
+ if (self._rendered) {
+ elm = self.getEl(group);
+
+ if (elm) {
+ elm.className = classes.join(' ');
+ }
+ }
+
+ return self;
+ },
+
+ /**
+ * Toggles the specified class on the control.
+ *
+ * @method toggleClass
+ * @param {String} cls Class to remove.
+ * @param {Boolean} state True/false state to add/remove class.
+ * @param {String} [group] Sub element group name.
+ * @return {tinymce.ui.Control} Current control object.
+ */
+ toggleClass: function(cls, state, group) {
+ var self = this;
+
+ if (state) {
+ self.addClass(cls, group);
+ } else {
+ self.removeClass(cls, group);
+ }
+
+ return self;
+ },
+
+ /**
+ * Returns the class string for the specified group name.
+ *
+ * @method classes
+ * @param {String} [group] Group to get clases by.
+ * @return {String} Classes for the specified group.
+ */
+ classes: function(group) {
+ var classes = this._classes[group || 'control'];
+
+ return classes ? classes.join(' ') : '';
+ },
+
+ /**
+ * Sets the inner HTML of the control element.
+ *
+ * @method innerHtml
+ * @param {String} html Html string to set as inner html.
+ * @return {tinymce.ui.Control} Current control object.
+ */
+ innerHtml: function(html) {
+ DomUtils.innerHtml(this.getEl(), html);
+ return this;
+ },
+
+ /**
+ * Returns the control DOM element or sub element.
+ *
+ * @method getEl
+ * @param {String} [suffix] Suffix to get element by.
+ * @param {Boolean} [dropCache] True if the cache for the element should be dropped.
+ * @return {Element} HTML DOM element for the current control or it's children.
+ */
+ getEl: function(suffix, dropCache) {
+ var elm, id = suffix ? this._id + '-' + suffix : this._id;
+
+ elm = elementIdCache[id] = (dropCache === true ? null : elementIdCache[id]) || DomUtils.get(id);
+
+ return elm;
+ },
+
+ /**
+ * Sets/gets the visible for the control.
+ *
+ * @method visible
+ * @param {Boolean} state Value to set to control.
+ * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get.
+ */
+ visible: function(state) {
+ var self = this, parentCtrl;
+
+ if (typeof(state) !== "undefined") {
+ if (self._visible !== state) {
+ if (self._rendered) {
+ self.getEl().style.display = state ? '' : 'none';
+ }
+
+ self._visible = state;
+
+ // Parent container needs to reflow
+ parentCtrl = self.parent();
+ if (parentCtrl) {
+ parentCtrl._lastRect = null;
+ }
+
+ self.fire(state ? 'show' : 'hide');
+ }
+
+ return self;
+ }
+
+ return self._visible;
+ },
+
+ /**
+ * Sets the visible state to true.
+ *
+ * @method show
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ show: function() {
+ return this.visible(true);
+ },
+
+ /**
+ * Sets the visible state to false.
+ *
+ * @method hide
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ hide: function() {
+ return this.visible(false);
+ },
+
+ /**
+ * Focuses the current control.
+ *
+ * @method focus
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ focus: function() {
+ try {
+ this.getEl().focus();
+ } catch (ex) {
+ // Ignore IE error
+ }
+
+ return this;
+ },
+
+ /**
+ * Blurs the current control.
+ *
+ * @method blur
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ blur: function() {
+ this.getEl().blur();
+
+ return this;
+ },
+
+ /**
+ * Sets the specified aria property.
+ *
+ * @method aria
+ * @param {String} name Name of the aria property to set.
+ * @param {String} value Value of the aria property.
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ aria: function(name, value) {
+ var self = this, elm = self.getEl();
+
+ if (typeof(value) === "undefined") {
+ return self._aria[name];
+ } else {
+ self._aria[name] = value;
+ }
+
+ if (self._rendered) {
+ if (name == 'label') {
+ elm.setAttribute('aria-labeledby', self._id);
+ }
+
+ elm.setAttribute(name == 'role' ? name : 'aria-' + name, value);
+ }
+
+ return self;
+ },
+
+ /**
+ * Encodes the specified string with HTML entities. It will also
+ * translate the string to different languages.
+ *
+ * @method encode
+ * @param {String/Object/Array} text Text to entity encode.
+ * @param {Boolean} [translate=true] False if the contents shouldn't be translated.
+ * @return {String} Encoded and possible traslated string.
+ */
+ encode: function(text, translate) {
+ if (translate !== false && Control.translate) {
+ text = Control.translate(text);
+ }
+
+ return (text || '').replace(/[&<>"]/g, function(match) {
+ return '&#' + match.charCodeAt(0) + ';';
+ });
+ },
+
+ /**
+ * Adds items before the current control.
+ *
+ * @method before
+ * @param {Array/tinymce.ui.Collection} items Array of items to prepend before this control.
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ before: function(items) {
+ var self = this, parent = self.parent();
+
+ if (parent) {
+ parent.insert(items, parent.items().indexOf(self), true);
+ }
+
+ return self;
+ },
+
+ /**
+ * Adds items after the current control.
+ *
+ * @method after
+ * @param {Array/tinymce.ui.Collection} items Array of items to append after this control.
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ after: function(items) {
+ var self = this, parent = self.parent();
+
+ if (parent) {
+ parent.insert(items, parent.items().indexOf(self));
+ }
+
+ return self;
+ },
+
+ /**
+ * Removes the current control from DOM and from UI collections.
+ *
+ * @method remove
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ remove: function() {
+ var self = this, elm = self.getEl(), parent = self.parent(), newItems, i;
+
+ if (self.items) {
+ var controls = self.items().toArray();
+ i = controls.length;
+ while (i--) {
+ controls[i].remove();
+ }
+ }
+
+ if (parent && parent.items) {
+ newItems = [];
+
+ parent.items().each(function(item) {
+ if (item !== self) {
+ newItems.push(item);
+ }
+ });
+
+ parent.items().set(newItems);
+ parent._lastRect = null;
+ }
+
+ if (self._eventsRoot && self._eventsRoot == self) {
+ DomUtils.off(elm);
+ }
+
+ delete Control.controlIdLookup[self._id];
+ delete elementIdCache[self._id];
+
+ if (elm && elm.parentNode) {
+ var nodes = elm.getElementsByTagName('*');
+
+ i = nodes.length;
+ while (i--) {
+ delete elementIdCache[nodes[i].id];
+ }
+
+ elm.parentNode.removeChild(elm);
+ }
+
+ return self;
+ },
+
+ /**
+ * Renders the control before the specified element.
+ *
+ * @method renderBefore
+ * @param {Element} elm Element to render before.
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ renderBefore: function(elm) {
+ var self = this;
+
+ elm.parentNode.insertBefore(DomUtils.createFragment(self.renderHtml()), elm);
+ self.postRender();
+
+ return self;
+ },
+
+ /**
+ * Renders the control to the specified element.
+ *
+ * @method renderBefore
+ * @param {Element} elm Element to render to.
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ renderTo: function(elm) {
+ var self = this;
+
+ elm = elm || self.getContainerElm();
+ elm.appendChild(DomUtils.createFragment(self.renderHtml()));
+ self.postRender();
+
+ return self;
+ },
+
+ /**
+ * Post render method. Called after the control has been rendered to the target.
+ *
+ * @method postRender
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ postRender: function() {
+ var self = this, settings = self.settings, elm, box, parent, name, parentEventsRoot;
+
+ // Bind on<event> settings
+ for (name in settings) {
+ if (name.indexOf("on") === 0) {
+ self.on(name.substr(2), settings[name]);
+ }
+ }
+
+ if (self._eventsRoot) {
+ for (parent = self.parent(); !parentEventsRoot && parent; parent = parent.parent()) {
+ parentEventsRoot = parent._eventsRoot;
+ }
+
+ if (parentEventsRoot) {
+ for (name in parentEventsRoot._nativeEvents) {
+ self._nativeEvents[name] = true;
+ }
+ }
+ }
+
+ self.bindPendingEvents();
+
+ if (settings.style) {
+ elm = self.getEl();
+ if (elm) {
+ elm.setAttribute('style', settings.style);
+ elm.style.cssText = settings.style;
+ }
+ }
+
+ if (!self._visible) {
+ DomUtils.css(self.getEl(), 'display', 'none');
+ }
+
+ if (self.settings.border) {
+ box = self.borderBox();
+ DomUtils.css(self.getEl(), {
+ 'border-top-width': box.top,
+ 'border-right-width': box.right,
+ 'border-bottom-width': box.bottom,
+ 'border-left-width': box.left
+ });
+ }
+
+ // Add instance to lookup
+ Control.controlIdLookup[self._id] = self;
+
+ for (var key in self._aria) {
+ self.aria(key, self._aria[key]);
+ }
+
+ self.fire('postrender', {}, false);
+ },
+
+ /**
+ * Scrolls the current control into view.
+ *
+ * @method scrollIntoView
+ * @param {String} align Alignment in view top|center|bottom.
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ scrollIntoView: function(align) {
+ function getOffset(elm, rootElm) {
+ var x, y, parent = elm;
+
+ x = y = 0;
+ while (parent && parent != rootElm && parent.nodeType) {
+ x += parent.offsetLeft || 0;
+ y += parent.offsetTop || 0;
+ parent = parent.offsetParent;
+ }
+
+ return {x: x, y: y};
+ }
+
+ var elm = this.getEl(), parentElm = elm.parentNode;
+ var x, y, width, height, parentWidth, parentHeight;
+ var pos = getOffset(elm, parentElm);
+
+ x = pos.x;
+ y = pos.y;
+ width = elm.offsetWidth;
+ height = elm.offsetHeight;
+ parentWidth = parentElm.clientWidth;
+ parentHeight = parentElm.clientHeight;
+
+ if (align == "end") {
+ x -= parentWidth - width;
+ y -= parentHeight - height;
+ } else if (align == "center") {
+ x -= (parentWidth / 2) - (width / 2);
+ y -= (parentHeight / 2) - (height / 2);
+ }
+
+ parentElm.scrollLeft = x;
+ parentElm.scrollTop = y;
+
+ return this;
+ },
+
+ /**
+ * Binds pending DOM events.
+ *
+ * @private
+ */
+ bindPendingEvents: function() {
+ var self = this, i, l, parents, eventRootCtrl, nativeEvents, name;
+
+ function delegate(e) {
+ var control = self.getParentCtrl(e.target);
+
+ if (control) {
+ control.fire(e.type, e);
+ }
+ }
+
+ function mouseLeaveHandler() {
+ var ctrl = eventRootCtrl._lastHoverCtrl;
+
+ if (ctrl) {
+ ctrl.fire("mouseleave", {target: ctrl.getEl()});
+
+ ctrl.parents().each(function(ctrl) {
+ ctrl.fire("mouseleave", {target: ctrl.getEl()});
+ });
+
+ eventRootCtrl._lastHoverCtrl = null;
+ }
+ }
+
+ function mouseEnterHandler(e) {
+ var ctrl = self.getParentCtrl(e.target), lastCtrl = eventRootCtrl._lastHoverCtrl, idx = 0, i, parents, lastParents;
+
+ // Over on a new control
+ if (ctrl !== lastCtrl) {
+ eventRootCtrl._lastHoverCtrl = ctrl;
+
+ parents = ctrl.parents().toArray().reverse();
+ parents.push(ctrl);
+
+ if (lastCtrl) {
+ lastParents = lastCtrl.parents().toArray().reverse();
+ lastParents.push(lastCtrl);
+
+ for (idx = 0; idx < lastParents.length; idx++) {
+ if (parents[idx] !== lastParents[idx]) {
+ break;
+ }
+ }
+
+ for (i = lastParents.length - 1; i >= idx; i--) {
+ lastCtrl = lastParents[i];
+ lastCtrl.fire("mouseleave", {
+ target : lastCtrl.getEl()
+ });
+ }
+ }
+
+ for (i = idx; i < parents.length; i++) {
+ ctrl = parents[i];
+ ctrl.fire("mouseenter", {
+ target : ctrl.getEl()
+ });
+ }
+ }
+ }
+
+ function fixWheelEvent(e) {
+ e.preventDefault();
+
+ if (e.type == "mousewheel") {
+ e.deltaY = - 1/40 * e.wheelDelta;
+
+ if (e.wheelDeltaX) {
+ e.deltaX = -1/40 * e.wheelDeltaX;
+ }
+ } else {
+ e.deltaX = 0;
+ e.deltaY = e.detail;
+ }
+
+ e = self.fire("wheel", e);
+ }
+
+ self._rendered = true;
+
+ nativeEvents = self._nativeEvents;
+ if (nativeEvents) {
+ // Find event root element if it exists
+ parents = self.parents().toArray();
+ parents.unshift(self);
+ for (i = 0, l = parents.length; !eventRootCtrl && i < l; i++) {
+ eventRootCtrl = parents[i]._eventsRoot;
+ }
+
+ // Event root wasn't found the use the root control
+ if (!eventRootCtrl) {
+ eventRootCtrl = parents[parents.length - 1] || self;
+ }
+
+ // Set the eventsRoot property on children that didn't have it
+ self._eventsRoot = eventRootCtrl;
+ for (l = i, i = 0; i < l; i++) {
+ parents[i]._eventsRoot = eventRootCtrl;
+ }
+
+ // Bind native event delegates
+ for (name in nativeEvents) {
+ if (!nativeEvents) {
+ return false;
+ }
+
+ if (name === "wheel" && !hasWheelEventSupport) {
+ if (hasMouseWheelEventSupport) {
+ DomUtils.on(self.getEl(), "mousewheel", fixWheelEvent);
+ } else {
+ DomUtils.on(self.getEl(), "DOMMouseScroll", fixWheelEvent);
+ }
+
+ continue;
+ }
+
+ // Special treatment for mousenter/mouseleave since these doesn't bubble
+ if (name === "mouseenter" || name === "mouseleave") {
+ // Fake mousenter/mouseleave
+ if (!eventRootCtrl._hasMouseEnter) {
+ DomUtils.on(eventRootCtrl.getEl(), "mouseleave", mouseLeaveHandler);
+ DomUtils.on(eventRootCtrl.getEl(), "mouseover", mouseEnterHandler);
+ eventRootCtrl._hasMouseEnter = 1;
+ }
+ } else if (!eventRootCtrl[name]) {
+ DomUtils.on(eventRootCtrl.getEl(), name, delegate);
+ eventRootCtrl[name] = true;
+ }
+
+ // Remove the event once it's bound
+ nativeEvents[name] = false;
+ }
+ }
+ },
+
+ /**
+ * Reflows the current control and it's parents.
+ * This should be used after you for example append children to the current control so
+ * that the layout managers know that they need to reposition everything.
+ *
+ * @example
+ * container.append({type: 'button', text: 'My button'}).reflow();
+ *
+ * @method reflow
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ reflow: function() {
+ this.repaint();
+
+ return this;
+ }
+
+ /**
+ * Sets/gets the parent container for the control.
+ *
+ * @method parent
+ * @param {tinymce.ui.Container} parent Optional parent to set.
+ * @return {tinymce.ui.Control} Parent control or the current control on a set action.
+ */
+ // parent: function(parent) {} -- Generated
+
+ /**
+ * Sets/gets the text for the control.
+ *
+ * @method text
+ * @param {String} value Value to set to control.
+ * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get.
+ */
+ // text: function(value) {} -- Generated
+
+ /**
+ * Sets/gets the width for the control.
+ *
+ * @method width
+ * @param {Number} value Value to set to control.
+ * @return {Number/tinymce.ui.Control} Current control on a set operation or current value on a get.
+ */
+ // width: function(value) {} -- Generated
+
+ /**
+ * Sets/gets the height for the control.
+ *
+ * @method height
+ * @param {Number} value Value to set to control.
+ * @return {Number/tinymce.ui.Control} Current control on a set operation or current value on a get.
+ */
+ // height: function(value) {} -- Generated
+
+ /**
+ * Sets/gets the disabled state on the control.
+ *
+ * @method disabled
+ * @param {Boolean} state Value to set to control.
+ * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get.
+ */
+ // disabled: function(state) {} -- Generated
+
+ /**
+ * Sets/gets the active for the control.
+ *
+ * @method active
+ * @param {Boolean} state Value to set to control.
+ * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get.
+ */
+ // active: function(state) {} -- Generated
+
+ /**
+ * Sets/gets the name for the control.
+ *
+ * @method name
+ * @param {String} value Value to set to control.
+ * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get.
+ */
+ // name: function(value) {} -- Generated
+
+ /**
+ * Sets/gets the title for the control.
+ *
+ * @method title
+ * @param {String} value Value to set to control.
+ * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get.
+ */
+ // title: function(value) {} -- Generated
+ });
+
+ return Control;
+});
+
+// Included from: js/tinymce/classes/ui/Factory.js
+
+/**
+ * Factory.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+/**
+ * This class is a factory for control instances. This enables you
+ * to create instances of controls without having to require the UI controls directly.
+ *
+ * It also allow you to override or add new control types.
+ *
+ * @class tinymce.ui.Factory
+ */
+define("tinymce/ui/Factory", [], function() {
+ "use strict";
+
+ var types = {}, namespaceInit;
+
+ return {
+ /**
+ * Adds a new control instance type to the factory.
+ *
+ * @method add
+ * @param {String} type Type name for example "button".
+ * @param {function} typeClass Class type function.
+ */
+ add: function(type, typeClass) {
+ types[type.toLowerCase()] = typeClass;
+ },
+
+ /**
+ * Returns true/false if the specified type exists or not.
+ *
+ * @method has
+ * @param {String} type Type to look for.
+ * @return {Boolean} true/false if the control by name exists.
+ */
+ has: function(type) {
+ return !!types[type.toLowerCase()];
+ },
+
+ /**
+ * Creates a new control instance based on the settings provided. The instance created will be
+ * based on the specified type property it can also create whole structures of components out of
+ * the specified JSON object.
+ *
+ * @example
+ * tinymce.ui.Factory.create({
+ * type: 'button',
+ * text: 'Hello world!'
+ * });
+ *
+ * @method create
+ * @param {Object/String} settings Name/Value object with items used to create the type.
+ * @return {tinymce.ui.Control} Control instance based on the specified type.
+ */
+ create: function(type, settings) {
+ var ControlType, name, namespace;
+
+ // Build type lookup
+ if (!namespaceInit) {
+ namespace = tinymce.ui;
+
+ for (name in namespace) {
+ types[name.toLowerCase()] = namespace[name];
+ }
+
+ namespaceInit = true;
+ }
+
+ // If string is specified then use it as the type
+ if (typeof(type) == 'string') {
+ settings = settings || {};
+ settings.type = type;
+ } else {
+ settings = type;
+ type = settings.type;
+ }
+
+ // Find control type
+ type = type.toLowerCase();
+ ControlType = types[type];
+
+ // #if debug
+
+ if (!ControlType) {
+ throw new Error("Could not find control by type: " + type);
+ }
+
+ // #endif
+
+ ControlType = new ControlType(settings);
+ ControlType.type = type; // Set the type on the instance, this will be used by the Selector engine
+
+ return ControlType;
+ }
+ };
+});
+
+// Included from: js/tinymce/classes/ui/Container.js
+
+/**
+ * Container.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Container control. This is extended by all controls that can have
+ * children such as panels etc. You can also use this class directly as an
+ * generic container instance. The container doesn't have any specific role or style.
+ *
+ * @-x-less Container.less
+ * @class tinymce.ui.Container
+ * @extends tinymce.ui.Control
+ */
+define("tinymce/ui/Container", [
+ "tinymce/ui/Control",
+ "tinymce/ui/Collection",
+ "tinymce/ui/Selector",
+ "tinymce/ui/Factory",
+ "tinymce/util/Tools",
+ "tinymce/ui/DomUtils"
+], function(Control, Collection, Selector, Factory, Tools, DomUtils) {
+ "use strict";
+
+ var selectorCache = {};
+
+ return Control.extend({
+ layout: '',
+ innerClass: 'container-inner',
+
+ /**
+ * Constructs a new control instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ * @setting {Array} items Items to add to container in JSON format or control instances.
+ * @setting {String} layout Layout manager by name to use.
+ * @setting {Object} defaults Default settings to apply to all items.
+ */
+ init: function(settings) {
+ var self = this;
+
+ self._super(settings);
+ settings = self.settings;
+ self._fixed = settings.fixed;
+ self._items = new Collection();
+
+ if (self.isRtl()) {
+ self.addClass('rtl');
+ }
+
+ self.addClass('container');
+ self.addClass('container-body', 'body');
+
+ if (settings.containerCls) {
+ self.addClass(settings.containerCls);
+ }
+
+ self._layout = Factory.create((settings.layout || self.layout) + 'layout');
+
+ if (self.settings.items) {
+ self.add(self.settings.items);
+ }
+
+ // TODO: Fix this!
+ self._hasBody = true;
+ },
+
+ /**
+ * Returns a collection of child items that the container currently have.
+ *
+ * @method items
+ * @return {tinymce.ui.Collection} Control collection direct child controls.
+ */
+ items: function() {
+ return this._items;
+ },
+
+ /**
+ * Find child controls by selector.
+ *
+ * @method find
+ * @param {String} selector Selector CSS pattern to find children by.
+ * @return {tinymce.ui.Collection} Control collection with child controls.
+ */
+ find: function(selector) {
+ selector = selectorCache[selector] = selectorCache[selector] || new Selector(selector);
+
+ return selector.find(this);
+ },
+
+ /**
+ * Adds one or many items to the current container. This will create instances of
+ * the object representations if needed.
+ *
+ * @method add
+ * @param {Array/Object/tinymce.ui.Control} items Array or item that will be added to the container.
+ * @return {tinymce.ui.Collection} Current collection control.
+ */
+ add: function(items) {
+ var self = this;
+
+ self.items().add(self.create(items)).parent(self);
+
+ return self;
+ },
+
+ /**
+ * Focuses the current container instance. This will look
+ * for the first control in the container and focus that.
+ *
+ * @method focus
+ * @return {tinymce.ui.Collection} Current instance.
+ */
+ focus: function() {
+ var self = this;
+
+ if (self.keyNav) {
+ self.keyNav.focusFirst();
+ } else {
+ self._super();
+ }
+
+ return self;
+ },
+
+ /**
+ * Replaces the specified child control with a new control.
+ *
+ * @method replace
+ * @param {tinymce.ui.Control} oldItem Old item to be replaced.
+ * @param {tinymce.ui.Control} newItem New item to be inserted.
+ */
+ replace: function(oldItem, newItem) {
+ var ctrlElm, items = this.items(), i = items.length;
+
+ // Replace the item in collection
+ while (i--) {
+ if (items[i] === oldItem) {
+ items[i] = newItem;
+ break;
+ }
+ }
+
+ if (i >= 0) {
+ // Remove new item from DOM
+ ctrlElm = newItem.getEl();
+ if (ctrlElm) {
+ ctrlElm.parentNode.removeChild(ctrlElm);
+ }
+
+ // Remove old item from DOM
+ ctrlElm = oldItem.getEl();
+ if (ctrlElm) {
+ ctrlElm.parentNode.removeChild(ctrlElm);
+ }
+ }
+
+ // Adopt the item
+ newItem.parent(this);
+ },
+
+ /**
+ * Creates the specified items. If any of the items is plain JSON style objects
+ * it will convert these into real tinymce.ui.Control instances.
+ *
+ * @method create
+ * @param {Array} items Array of items to convert into control instances.
+ * @return {Array} Array with control instances.
+ */
+ create: function(items) {
+ var self = this, settings, ctrlItems = [];
+
+ // Non array structure, then force it into an array
+ if (!Tools.isArray(items)) {
+ items = [items];
+ }
+
+ // Add default type to each child control
+ Tools.each(items, function(item) {
+ if (item) {
+ // Construct item if needed
+ if (!(item instanceof Control)) {
+ // Name only then convert it to an object
+ if (typeof(item) == "string") {
+ item = {type: item};
+ }
+
+ // Create control instance based on input settings and default settings
+ settings = Tools.extend({}, self.settings.defaults, item);
+ item.type = settings.type = settings.type || item.type || self.settings.defaultType ||
+ (settings.defaults ? settings.defaults.type : null);
+ item = Factory.create(settings);
+ }
+
+ ctrlItems.push(item);
+ }
+ });
+
+ return ctrlItems;
+ },
+
+ /**
+ * Renders new control instances.
+ *
+ * @private
+ */
+ renderNew: function() {
+ var self = this;
+
+ // Render any new items
+ self.items().each(function(ctrl, index) {
+ var containerElm, fragment;
+
+ ctrl.parent(self);
+
+ if (!ctrl._rendered) {
+ containerElm = self.getEl('body');
+ fragment = DomUtils.createFragment(ctrl.renderHtml());
+
+ // Insert or append the item
+ if (containerElm.hasChildNodes() && index <= containerElm.childNodes.length - 1) {
+ containerElm.insertBefore(fragment, containerElm.childNodes[index]);
+ } else {
+ containerElm.appendChild(fragment);
+ }
+
+ ctrl.postRender();
+ }
+ });
+
+ self._layout.applyClasses(self);
+ self._lastRect = null;
+
+ return self;
+ },
+
+ /**
+ * Appends new instances to the current container.
+ *
+ * @method append
+ * @param {Array/tinymce.ui.Collection} items Array if controls to append.
+ * @return {tinymce.ui.Container} Current container instance.
+ */
+ append: function(items) {
+ return this.add(items).renderNew();
+ },
+
+ /**
+ * Prepends new instances to the current container.
+ *
+ * @method prepend
+ * @param {Array/tinymce.ui.Collection} items Array if controls to prepend.
+ * @return {tinymce.ui.Container} Current container instance.
+ */
+ prepend: function(items) {
+ var self = this;
+
+ self.items().set(self.create(items).concat(self.items().toArray()));
+
+ return self.renderNew();
+ },
+
+ /**
+ * Inserts an control at a specific index.
+ *
+ * @method insert
+ * @param {Array/tinymce.ui.Collection} items Array if controls to insert.
+ * @param {Number} index Index to insert controls at.
+ * @param {Boolean} [before=false] Inserts controls before the index.
+ */
+ insert: function(items, index, before) {
+ var self = this, curItems, beforeItems, afterItems;
+
+ items = self.create(items);
+ curItems = self.items();
+
+ if (!before && index < curItems.length - 1) {
+ index += 1;
+ }
+
+ if (index >= 0 && index < curItems.length) {
+ beforeItems = curItems.slice(0, index).toArray();
+ afterItems = curItems.slice(index).toArray();
+ curItems.set(beforeItems.concat(items, afterItems));
+ }
+
+ return self.renderNew();
+ },
+
+ /**
+ * Populates the form fields from the specified JSON data object.
+ *
+ * Control items in the form that matches the data will have it's value set.
+ *
+ * @method fromJSON
+ * @param {Object} data JSON data object to set control values by.
+ * @return {tinymce.ui.Container} Current form instance.
+ */
+ fromJSON: function(data) {
+ var self = this;
+
+ for (var name in data) {
+ self.find('#' + name).value(data[name]);
+ }
+
+ return self;
+ },
+
+ /**
+ * Serializes the form into a JSON object by getting all items
+ * that has a name and a value.
+ *
+ * @method toJSON
+ * @return {Object} JSON object with form data.
+ */
+ toJSON: function() {
+ var self = this, data = {};
+
+ self.find('*').each(function(ctrl) {
+ var name = ctrl.name(), value = ctrl.value();
+
+ if (name && typeof(value) != "undefined") {
+ data[name] = value;
+ }
+ });
+
+ return data;
+ },
+
+ preRender: function() {
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, layout = self._layout;
+
+ self.preRender();
+ layout.preRender(self);
+
+ return (
+ '<div id="' + self._id + '" class="' + self.classes() + '" role="' + this.settings.role + '">' +
+ '<div id="' + self._id + '-body" class="' + self.classes('body') + '">'+
+ (self.settings.html || '') + layout.renderHtml(self) +
+ '</div>' +
+ '</div>'
+ );
+ },
+
+ /**
+ * Post render method. Called after the control has been rendered to the target.
+ *
+ * @method postRender
+ * @return {tinymce.ui.Container} Current combobox instance.
+ */
+ postRender: function() {
+ var self = this, box;
+
+ self.items().exec('postRender');
+ self._super();
+
+ self._layout.postRender(self);
+ self._rendered = true;
+
+ if (self.settings.style) {
+ DomUtils.css(self.getEl(), self.settings.style);
+ }
+
+ if (self.settings.border) {
+ box = self.borderBox();
+ DomUtils.css(self.getEl(), {
+ 'border-top-width': box.top,
+ 'border-right-width': box.right,
+ 'border-bottom-width': box.bottom,
+ 'border-left-width': box.left
+ });
+ }
+
+ return self;
+ },
+
+ /**
+ * Initializes the current controls layout rect.
+ * This will be executed by the layout managers to determine the
+ * default minWidth/minHeight etc.
+ *
+ * @method initLayoutRect
+ * @return {Object} Layout rect instance.
+ */
+ initLayoutRect: function() {
+ var self = this, layoutRect = self._super();
+
+ // Recalc container size by asking layout manager
+ self._layout.recalc(self);
+
+ return layoutRect;
+ },
+
+ /**
+ * Recalculates the positions of the controls in the current container.
+ * This is invoked by the reflow method and shouldn't be called directly.
+ *
+ * @method recalc
+ */
+ recalc: function() {
+ var self = this, rect = self._layoutRect, lastRect = self._lastRect;
+
+ if (!lastRect || lastRect.w != rect.w || lastRect.h != rect.h) {
+ self._layout.recalc(self);
+ rect = self.layoutRect();
+ self._lastRect = {x: rect.x, y: rect.y, w: rect.w, h: rect.h};
+ return true;
+ }
+ },
+
+ /**
+ * Reflows the current container and it's children and possible parents.
+ * This should be used after you for example append children to the current control so
+ * that the layout managers know that they need to reposition everything.
+ *
+ * @example
+ * container.append({type: 'button', text: 'My button'}).reflow();
+ *
+ * @method reflow
+ * @return {tinymce.ui.Container} Current container instance.
+ */
+ reflow: function() {
+ var i, items;
+
+ if (this.visible()) {
+ Control.repaintControls = [];
+ Control.repaintControls.map = {};
+
+ items = this.recalc();
+ i = Control.repaintControls.length;
+
+ while (i--) {
+ Control.repaintControls[i].repaint();
+ }
+
+ // TODO: Fix me!
+ if (this.settings.layout !== "flow" && this.settings.layout !== "stack") {
+ this.repaint();
+ }
+
+ Control.repaintControls = [];
+ }
+
+ return this;
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/DragHelper.js
+
+/**
+ * DragHelper.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Drag/drop helper class.
+ *
+ * @example
+ * var dragHelper = new tinymce.ui.DragHelper('mydiv', {
+ * start: function(evt) {
+ * },
+ *
+ * drag: function(evt) {
+ * },
+ *
+ * end: function(evt) {
+ * }
+ * });
+ *
+ * @class tinymce.ui.DragHelper
+ */
+define("tinymce/ui/DragHelper", [
+ "tinymce/ui/DomUtils"
+], function(DomUtils) {
+ "use strict";
+
+ function getDocumentSize() {
+ var doc = document, documentElement, body, scrollWidth, clientWidth;
+ var offsetWidth, scrollHeight, clientHeight, offsetHeight, max = Math.max;
+
+ documentElement = doc.documentElement;
+ body = doc.body;
+
+ scrollWidth = max(documentElement.scrollWidth, body.scrollWidth);
+ clientWidth = max(documentElement.clientWidth, body.clientWidth);
+ offsetWidth = max(documentElement.offsetWidth, body.offsetWidth);
+
+ scrollHeight = max(documentElement.scrollHeight, body.scrollHeight);
+ clientHeight = max(documentElement.clientHeight, body.clientHeight);
+ offsetHeight = max(documentElement.offsetHeight, body.offsetHeight);
+
+ return {
+ width: scrollWidth < offsetWidth ? clientWidth : scrollWidth,
+ height: scrollHeight < offsetHeight ? clientHeight : scrollHeight
+ };
+ }
+
+ return function(id, settings) {
+ var eventOverlayElm, doc = document, downButton, start, stop, drag, startX, startY;
+
+ settings = settings || {};
+
+ function getHandleElm() {
+ return doc.getElementById(settings.handle || id);
+ }
+
+ start = function(e) {
+ var docSize = getDocumentSize(), handleElm, cursor;
+
+ e.preventDefault();
+ downButton = e.button;
+ handleElm = getHandleElm();
+ startX = e.screenX;
+ startY = e.screenY;
+
+ // Grab cursor from handle
+ if (window.getComputedStyle) {
+ cursor = window.getComputedStyle(handleElm, null).getPropertyValue("cursor");
+ } else {
+ cursor = handleElm.runtimeStyle.cursor;
+ }
+
+ // Create event overlay and add it to document
+ eventOverlayElm = doc.createElement('div');
+ DomUtils.css(eventOverlayElm, {
+ position: "absolute",
+ top: 0, left: 0,
+ width: docSize.width,
+ height: docSize.height,
+ zIndex: 0x7FFFFFFF,
+ opacity: 0.0001,
+ background: 'red',
+ cursor: cursor
+ });
+
+ doc.body.appendChild(eventOverlayElm);
+
+ // Bind mouse events
+ DomUtils.on(doc, 'mousemove', drag);
+ DomUtils.on(doc, 'mouseup', stop);
+
+ // Begin drag
+ settings.start(e);
+ };
+
+ drag = function(e) {
+ if (e.button !== downButton) {
+ return stop(e);
+ }
+
+ e.deltaX = e.screenX - startX;
+ e.deltaY = e.screenY - startY;
+
+ e.preventDefault();
+ settings.drag(e);
+ };
+
+ stop = function(e) {
+ DomUtils.off(doc, 'mousemove', drag);
+ DomUtils.off(doc, 'mouseup', stop);
+
+ eventOverlayElm.parentNode.removeChild(eventOverlayElm);
+
+ if (settings.stop) {
+ settings.stop(e);
+ }
+ };
+
+ /**
+ * Destroys the drag/drop helper instance.
+ *
+ * @method destroy
+ */
+ this.destroy = function() {
+ DomUtils.off(getHandleElm());
+ };
+
+ DomUtils.on(getHandleElm(), 'mousedown', start);
+ };
+});
+
+// Included from: js/tinymce/classes/ui/Scrollable.js
+
+/**
+ * Scrollable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This mixin makes controls scrollable using custom scrollbars.
+ *
+ * @-x-less Scrollable.less
+ * @mixin tinymce.ui.Scrollable
+ */
+define("tinymce/ui/Scrollable", [
+ "tinymce/ui/DomUtils",
+ "tinymce/ui/DragHelper"
+], function(DomUtils, DragHelper) {
+ "use strict";
+
+ return {
+ init: function() {
+ var self = this;
+ self.on('repaint', self.renderScroll);
+ },
+
+ renderScroll: function() {
+ var self = this, margin = 2;
+
+ function repaintScroll() {
+ var hasScrollH, hasScrollV, bodyElm;
+
+ function repaintAxis(axisName, posName, sizeName, contentSizeName, hasScroll, ax) {
+ var containerElm, scrollBarElm, scrollThumbElm;
+ var containerSize, scrollSize, ratio, rect;
+ var posNameLower, sizeNameLower;
+
+ scrollBarElm = self.getEl('scroll' + axisName);
+ if (scrollBarElm) {
+ posNameLower = posName.toLowerCase();
+ sizeNameLower = sizeName.toLowerCase();
+
+ if (self.getEl('absend')) {
+ DomUtils.css(self.getEl('absend'), posNameLower, self.layoutRect()[contentSizeName] - 1);
+ }
+
+ if (!hasScroll) {
+ DomUtils.css(scrollBarElm, 'display', 'none');
+ return;
+ }
+
+ DomUtils.css(scrollBarElm, 'display', 'block');
+ containerElm = self.getEl('body');
+ scrollThumbElm = self.getEl('scroll' + axisName + "t");
+ containerSize = containerElm["client" + sizeName] - (margin * 2);
+ containerSize -= hasScrollH && hasScrollV ? scrollBarElm["client" + ax] : 0;
+ scrollSize = containerElm["scroll" + sizeName];
+ ratio = containerSize / scrollSize;
+
+ rect = {};
+ rect[posNameLower] = containerElm["offset" + posName] + margin;
+ rect[sizeNameLower] = containerSize;
+ DomUtils.css(scrollBarElm, rect);
+
+ rect = {};
+ rect[posNameLower] = containerElm["scroll" + posName] * ratio;
+ rect[sizeNameLower] = containerSize * ratio;
+ DomUtils.css(scrollThumbElm, rect);
+ }
+ }
+
+ bodyElm = self.getEl('body');
+ hasScrollH = bodyElm.scrollWidth > bodyElm.clientWidth;
+ hasScrollV = bodyElm.scrollHeight > bodyElm.clientHeight;
+
+ repaintAxis("h", "Left", "Width", "contentW", hasScrollH, "Height");
+ repaintAxis("v", "Top", "Height", "contentH", hasScrollV, "Width");
+ }
+
+ function addScroll() {
+ function addScrollAxis(axisName, posName, sizeName, deltaPosName, ax) {
+ var scrollStart, axisId = self._id + '-scroll' + axisName, prefix = self.classPrefix;
+
+ self.getEl().appendChild(DomUtils.createFragment(
+ '<div id="' + axisId + '" class="' + prefix + 'scrollbar ' + prefix + 'scrollbar-' + axisName + '">' +
+ '<div id="' + axisId + 't" class="' + prefix + 'scrollbar-thumb"></div>' +
+ '</div>'
+ ));
+
+ self.draghelper = new DragHelper(axisId + 't', {
+ start: function() {
+ scrollStart = self.getEl('body')["scroll" + posName];
+ DomUtils.addClass(DomUtils.get(axisId), prefix + 'active');
+ },
+
+ drag: function(e) {
+ var ratio, hasScrollH, hasScrollV, containerSize, layoutRect = self.layoutRect();
+
+ hasScrollH = layoutRect.contentW > layoutRect.innerW;
+ hasScrollV = layoutRect.contentH > layoutRect.innerH;
+ containerSize = self.getEl('body')["client" + sizeName] - (margin * 2);
+ containerSize -= hasScrollH && hasScrollV ? self.getEl('scroll' + axisName)["client" + ax] : 0;
+
+ ratio = containerSize / self.getEl('body')["scroll" + sizeName];
+ self.getEl('body')["scroll" + posName] = scrollStart + (e["delta" + deltaPosName] / ratio);
+ },
+
+ stop: function() {
+ DomUtils.removeClass(DomUtils.get(axisId), prefix + 'active');
+ }
+ });
+/*
+ self.on('click', function(e) {
+ if (e.target.id == self._id + '-scrollv') {
+
+ }
+ });*/
+ }
+
+ self.addClass('scroll');
+
+ addScrollAxis("v", "Top", "Height", "Y", "Width");
+ addScrollAxis("h", "Left", "Width", "X", "Height");
+ }
+
+ if (self.settings.autoScroll) {
+ if (!self._hasScroll) {
+ self._hasScroll = true;
+ addScroll();
+
+ self.on('wheel', function(e) {
+ var bodyEl = self.getEl('body');
+
+ bodyEl.scrollLeft += (e.deltaX || 0) * 10;
+ bodyEl.scrollTop += e.deltaY * 10;
+
+ repaintScroll();
+ });
+
+ DomUtils.on(self.getEl('body'), "scroll", repaintScroll);
+ }
+
+ repaintScroll();
+ }
+ }
+ };
+});
+
+// Included from: js/tinymce/classes/ui/Panel.js
+
+/**
+ * Panel.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new panel.
+ *
+ * @-x-less Panel.less
+ * @class tinymce.ui.Panel
+ * @extends tinymce.ui.Container
+ * @mixes tinymce.ui.Scrollable
+ */
+define("tinymce/ui/Panel", [
+ "tinymce/ui/Container",
+ "tinymce/ui/Scrollable"
+], function(Container, Scrollable) {
+ "use strict";
+
+ return Container.extend({
+ Defaults: {
+ layout: 'fit',
+ containerCls: 'panel'
+ },
+
+ Mixins: [Scrollable],
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, layout = self._layout, innerHtml = self.settings.html;
+
+ self.preRender();
+ layout.preRender(self);
+
+ if (typeof(innerHtml) == "undefined") {
+ innerHtml = (
+ '<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+ layout.renderHtml(self) +
+ '</div>'
+ );
+ } else {
+ if (typeof(innerHtml) == 'function') {
+ innerHtml = innerHtml.call(self);
+ }
+
+ self._hasBody = false;
+ }
+
+ return (
+ '<div id="' + self._id + '" class="' + self.classes() + '" hideFocus="1" tabIndex="-1">' +
+ (self._preBodyHtml || '') +
+ innerHtml +
+ '</div>'
+ );
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/Movable.js
+
+/**
+ * Movable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Movable mixin. Makes controls movable absolute and relative to other elements.
+ *
+ * @mixin tinymce.ui.Movable
+ */
+define("tinymce/ui/Movable", [
+ "tinymce/ui/DomUtils"
+], function(DomUtils) {
+ "use strict";
+
+ function calculateRelativePosition(ctrl, targetElm, rel) {
+ var ctrlElm, pos, x, y, selfW, selfH, targetW, targetH, viewport, size;
+
+ viewport = DomUtils.getViewPort();
+
+ // Get pos of target
+ pos = DomUtils.getPos(targetElm);
+ x = pos.x;
+ y = pos.y;
+
+ if (ctrl._fixed) {
+ x -= viewport.x;
+ y -= viewport.y;
+ }
+
+ // Get size of self
+ ctrlElm = ctrl.getEl();
+ size = DomUtils.getSize(ctrlElm);
+ selfW = size.width;
+ selfH = size.height;
+
+ // Get size of target
+ size = DomUtils.getSize(targetElm);
+ targetW = size.width;
+ targetH = size.height;
+
+ // Parse align string
+ rel = (rel || '').split('');
+
+ // Target corners
+ if (rel[0] === 'b') {
+ y += targetH;
+ }
+
+ if (rel[1] === 'r') {
+ x += targetW;
+ }
+
+ if (rel[0] === 'c') {
+ y += Math.round(targetH / 2);
+ }
+
+ if (rel[1] === 'c') {
+ x += Math.round(targetW / 2);
+ }
+
+ // Self corners
+ if (rel[3] === 'b') {
+ y -= selfH;
+ }
+
+ if (rel[4] === 'r') {
+ x -= selfW;
+ }
+
+ if (rel[3] === 'c') {
+ y -= Math.round(selfH / 2);
+ }
+
+ if (rel[4] === 'c') {
+ x -= Math.round(selfW / 2);
+ }
+
+ return {
+ x: x,
+ y: y,
+ w: selfW,
+ h: selfH
+ };
+ }
+
+ return {
+ /**
+ * Tests various positions to get the most suitable one.
+ *
+ * @method testMoveRel
+ * @param {DOMElement} elm Element to position against.
+ * @param {Array} rels Array with relative positions.
+ * @return {String} Best suitable relative position.
+ */
+ testMoveRel: function(elm, rels) {
+ var viewPortRect = DomUtils.getViewPort();
+
+ for (var i = 0; i < rels.length; i++) {
+ var pos = calculateRelativePosition(this, elm, rels[i]);
+
+ if (this._fixed) {
+ if (pos.x > 0 && pos.x + pos.w < viewPortRect.w && pos.y > 0 && pos.y + pos.h < viewPortRect.h) {
+ return rels[i];
+ }
+ } else {
+ if (pos.x > viewPortRect.x && pos.x + pos.w < viewPortRect.w + viewPortRect.x &&
+ pos.y > viewPortRect.y && pos.y + pos.h < viewPortRect.h + viewPortRect.y) {
+ return rels[i];
+ }
+ }
+ }
+
+ return rels[0];
+ },
+
+ /**
+ * Move relative to the specified element.
+ *
+ * @method moveRel
+ * @param {Element} elm Element to move relative to.
+ * @param {String} rel Relative mode. For example: br-tl.
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ moveRel: function(elm, rel) {
+ if (typeof(rel) != 'string') {
+ rel = this.testMoveRel(elm, rel);
+ }
+
+ var pos = calculateRelativePosition(this, elm, rel);
+ return this.moveTo(pos.x, pos.y);
+ },
+
+ /**
+ * Move by a relative x, y values.
+ *
+ * @method moveBy
+ * @param {Number} dx Relative x position.
+ * @param {Number} dy Relative y position.
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ moveBy: function(dx, dy) {
+ var self = this, rect = self.layoutRect();
+
+ self.moveTo(rect.x + dx, rect.y + dy);
+
+ return self;
+ },
+
+ /**
+ * Move to absolute position.
+ *
+ * @method moveTo
+ * @param {Number} x Absolute x position.
+ * @param {Number} y Absolute y position.
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ moveTo: function(x, y) {
+ var self = this;
+
+ // TODO: Move this to some global class
+ function contrain(value, max, size) {
+ if (value < 0) {
+ return 0;
+ }
+
+ if (value + size > max) {
+ value = max - size;
+ return value < 0 ? 0 : value;
+ }
+
+ return value;
+ }
+
+ if (self.settings.constrainToViewport) {
+ var viewPortRect = DomUtils.getViewPort(window);
+ var layoutRect = self.layoutRect();
+
+ x = contrain(x, viewPortRect.w + viewPortRect.x, layoutRect.w);
+ y = contrain(y, viewPortRect.h + viewPortRect.y, layoutRect.h);
+ }
+
+ if (self._rendered) {
+ self.layoutRect({x: x, y: y}).repaint();
+ } else {
+ self.settings.x = x;
+ self.settings.y = y;
+ }
+
+ self.fire('move', {x: x, y: y});
+
+ return self;
+ }
+ };
+});
+
+// Included from: js/tinymce/classes/ui/Resizable.js
+
+/**
+ * Resizable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Resizable mixin. Enables controls to be resized.
+ *
+ * @mixin tinymce.ui.Resizable
+ */
+define("tinymce/ui/Resizable", [
+ "tinymce/ui/DomUtils"
+], function(DomUtils) {
+ "use strict";
+
+ return {
+ /**
+ * Resizes the control to contents.
+ *
+ * @method resizeToContent
+ */
+ resizeToContent: function() {
+ this._layoutRect.autoResize = true;
+ this._lastRect = null;
+ this.reflow();
+ },
+
+ /**
+ * Resizes the control to a specific width/height.
+ *
+ * @method resizeTo
+ * @param {Number} w Control width.
+ * @param {Number} h Control height.
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ resizeTo: function(w, h) {
+ // TODO: Fix hack
+ if (w <= 1 || h <= 1) {
+ var rect = DomUtils.getWindowSize();
+
+ w = w <= 1 ? w * rect.w : w;
+ h = h <= 1 ? h * rect.h : h;
+ }
+
+ this._layoutRect.autoResize = false;
+ return this.layoutRect({minW: w, minH: h, w: w, h: h}).reflow();
+ },
+
+ /**
+ * Resizes the control to a specific relative width/height.
+ *
+ * @method resizeBy
+ * @param {Number} dw Relative control width.
+ * @param {Number} dh Relative control height.
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ resizeBy: function(dw, dh) {
+ var self = this, rect = self.layoutRect();
+
+ return self.resizeTo(rect.w + dw, rect.h + dh);
+ }
+ };
+});
+
+// Included from: js/tinymce/classes/ui/FloatPanel.js
+
+/**
+ * FloatPanel.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a floating panel.
+ *
+ * @-x-less FloatPanel.less
+ * @class tinymce.ui.FloatPanel
+ * @extends tinymce.ui.Panel
+ * @mixes tinymce.ui.Movable
+ * @mixes tinymce.ui.Resizable
+ */
+define("tinymce/ui/FloatPanel", [
+ "tinymce/ui/Panel",
+ "tinymce/ui/Movable",
+ "tinymce/ui/Resizable",
+ "tinymce/ui/DomUtils"
+], function(Panel, Movable, Resizable, DomUtils) {
+ "use strict";
+
+ var documentClickHandler, documentScrollHandler, visiblePanels = [];
+ var zOrder = [], hasModal;
+
+ var FloatPanel = Panel.extend({
+ Mixins: [Movable, Resizable],
+
+ /**
+ * Constructs a new control instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ * @setting {Boolean} autohide Automatically hide the panel.
+ */
+ init: function(settings) {
+ var self = this;
+
+ function reorder() {
+ var i, zIndex = FloatPanel.zIndex || 0xFFFF, topModal;
+
+ if (zOrder.length) {
+ for (i = 0; i < zOrder.length; i++) {
+ if (zOrder[i].modal) {
+ zIndex++;
+ topModal = zOrder[i];
+ }
+
+ zOrder[i].getEl().style.zIndex = zIndex;
+ zOrder[i].zIndex = zIndex;
+ zIndex++;
+ }
+ }
+
+ var modalBlockEl = document.getElementById(self.classPrefix + 'modal-block');
+
+ if (topModal) {
+ DomUtils.css(modalBlockEl, 'z-index', topModal.zIndex - 1);
+ } else if (modalBlockEl) {
+ modalBlockEl.parentNode.removeChild(modalBlockEl);
+ hasModal = false;
+ }
+
+ FloatPanel.currentZIndex = zIndex;
+ }
+
+ function isChildOf(ctrl, parent) {
+ while (ctrl) {
+ if (ctrl == parent) {
+ return true;
+ }
+
+ ctrl = ctrl.parent();
+ }
+ }
+
+ /**
+ * Repositions the panel to the top of page if the panel is outside of the visual viewport. It will
+ * also reposition all child panels of the current panel.
+ */
+ function repositionPanel(panel) {
+ var scrollY = DomUtils.getViewPort().y;
+
+ function toggleFixedChildPanels(fixed, deltaY) {
+ var parent;
+
+ for (var i = 0; i < visiblePanels.length; i++) {
+ if (visiblePanels[i] != panel) {
+ parent = visiblePanels[i].parent();
+
+ while (parent && (parent = parent.parent())) {
+ if (parent == panel) {
+ visiblePanels[i].fixed(fixed).moveBy(0, deltaY).repaint();
+ }
+ }
+ }
+ }
+ }
+
+ if (panel.settings.autofix) {
+ if (!panel._fixed) {
+ panel._autoFixY = panel.layoutRect().y;
+
+ if (panel._autoFixY < scrollY) {
+ panel.fixed(true).layoutRect({y: 0}).repaint();
+ toggleFixedChildPanels(true, scrollY - panel._autoFixY);
+ }
+ } else {
+ if (panel._autoFixY > scrollY) {
+ panel.fixed(false).layoutRect({y: panel._autoFixY}).repaint();
+ toggleFixedChildPanels(false, panel._autoFixY - scrollY);
+ }
+ }
+ }
+ }
+
+ self._super(settings);
+ self._eventsRoot = self;
+
+ self.addClass('floatpanel');
+
+ // Hide floatpanes on click out side the root button
+ if (settings.autohide) {
+ if (!documentClickHandler) {
+ documentClickHandler = function(e) {
+ var i, clickCtrl = self.getParentCtrl(e.target);
+
+ // Hide any float panel when a click is out side that float panel and the
+ // float panels direct parent for example a click on a menu button
+ i = visiblePanels.length;
+ while (i--) {
+ var panel = visiblePanels[i];
+
+ if (panel.settings.autohide) {
+ if (clickCtrl) {
+ if (isChildOf(clickCtrl, panel) || panel.parent() === clickCtrl) {
+ continue;
+ }
+ }
+
+ e = panel.fire('autohide', {target: e.target});
+ if (!e.isDefaultPrevented()) {
+ panel.hide();
+ }
+ }
+ }
+ };
+
+ DomUtils.on(document, 'click', documentClickHandler);
+ }
+
+ visiblePanels.push(self);
+ }
+
+ if (settings.autofix) {
+ if (!documentScrollHandler) {
+ documentScrollHandler = function() {
+ var i;
+
+ i = visiblePanels.length;
+ while (i--) {
+ repositionPanel(visiblePanels[i]);
+ }
+ };
+
+ DomUtils.on(window, 'scroll', documentScrollHandler);
+ }
+
+ self.on('move', function() {
+ repositionPanel(this);
+ });
+ }
+
+ self.on('postrender show', function(e) {
+ if (e.control == self) {
+ var modalBlockEl, prefix = self.classPrefix;
+
+ if (self.modal && !hasModal) {
+ modalBlockEl = DomUtils.createFragment('<div id="' + prefix + 'modal-block" class="' +
+ prefix + 'reset ' + prefix + 'fade"></div>');
+ modalBlockEl = modalBlockEl.firstChild;
+
+ self.getContainerElm().appendChild(modalBlockEl);
+
+ setTimeout(function() {
+ DomUtils.addClass(modalBlockEl, prefix + 'in');
+ DomUtils.addClass(self.getEl(), prefix + 'in');
+ }, 0);
+
+ hasModal = true;
+ }
+
+ zOrder.push(self);
+ reorder();
+ }
+ });
+
+ self.on('close hide', function(e) {
+ if (e.control == self) {
+ var i = zOrder.length;
+
+ while (i--) {
+ if (zOrder[i] === self) {
+ zOrder.splice(i, 1);
+ }
+ }
+
+ reorder();
+ }
+ });
+
+ self.on('show', function() {
+ self.parents().each(function(ctrl) {
+ if (ctrl._fixed) {
+ self.fixed(true);
+ return false;
+ }
+ });
+ });
+
+ if (settings.popover) {
+ self._preBodyHtml = '<div class="' + self.classPrefix + 'arrow"></div>';
+ self.addClass('popover').addClass('bottom').addClass(self.isRtl() ? 'end' : 'start');
+ }
+ },
+
+ fixed: function(state) {
+ var self = this;
+
+ if (self._fixed != state) {
+ if (self._rendered) {
+ var viewport = DomUtils.getViewPort();
+
+ if (state) {
+ self.layoutRect().y -= viewport.y;
+ } else {
+ self.layoutRect().y += viewport.y;
+ }
+ }
+
+ self.toggleClass('fixed', state);
+ self._fixed = state;
+ }
+
+ return self;
+ },
+
+ /**
+ * Shows the current float panel.
+ *
+ * @method show
+ * @return {tinymce.ui.FloatPanel} Current floatpanel instance.
+ */
+ show: function() {
+ var self = this, i, state = self._super();
+
+ i = visiblePanels.length;
+ while (i--) {
+ if (visiblePanels[i] === self) {
+ break;
+ }
+ }
+
+ if (i === -1) {
+ visiblePanels.push(self);
+ }
+
+ return state;
+ },
+
+ /**
+ * Hides the current float panel.
+ *
+ * @method hide
+ * @return {tinymce.ui.FloatPanel} Current floatpanel instance.
+ */
+ hide: function() {
+ removeVisiblePanel(this);
+ return this._super();
+ },
+
+ /**
+ * Hides all visible the float panels.
+ *
+ * @method hideAll
+ */
+ hideAll: function() {
+ FloatPanel.hideAll();
+ },
+
+ /**
+ * Closes the float panel. This will remove the float panel from page and fire the close event.
+ *
+ * @method close
+ */
+ close: function() {
+ var self = this;
+
+ self.fire('close');
+
+ return self.remove();
+ },
+
+ /**
+ * Removes the float panel from page.
+ *
+ * @method remove
+ */
+ remove: function() {
+ removeVisiblePanel(this);
+ this._super();
+ }
+ });
+
+ /**
+ * Hides all visible the float panels.
+ *
+ * @static
+ * @method hideAll
+ */
+ FloatPanel.hideAll = function() {
+ var i = visiblePanels.length;
+
+ while (i--) {
+ var panel = visiblePanels[i];
+
+ if (panel.settings.autohide) {
+ panel.fire('cancel', {}, false);
+ panel.hide();
+ visiblePanels.splice(i, 1);
+ }
+ }
+ };
+
+ function removeVisiblePanel(panel) {
+ var i;
+
+ i = visiblePanels.length;
+ while (i--) {
+ if (visiblePanels[i] === panel) {
+ visiblePanels.splice(i, 1);
+ }
+ }
+
+ i = zOrder.length;
+ while (i--) {
+ if (zOrder[i] === panel) {
+ zOrder.splice(i, 1);
+ }
+ }
+ }
+
+ return FloatPanel;
+});
+
+// Included from: js/tinymce/classes/ui/KeyboardNavigation.js
+
+/**
+ * KeyboardNavigation.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles keyboard navigation of controls and elements.
+ *
+ * @class tinymce.ui.KeyboardNavigation
+ */
+define("tinymce/ui/KeyboardNavigation", [
+ "tinymce/ui/DomUtils"
+], function(DomUtils) {
+ "use strict";
+
+ /**
+ * Create a new KeyboardNavigation instance to handle the focus for a specific element.
+ *
+ * @constructor
+ * @param {Object} settings the settings object to define how keyboard navigation works.
+ *
+ * @setting {tinymce.ui.Control} root the root control navigation focus movement is scoped to this root.
+ * @setting {Array} items an array containing the items to move focus between. Every object in this array must have an
+ * id attribute which maps to the actual DOM element and it must be able to have focus i.e. tabIndex=-1.
+ * @setting {Function} onCancel the callback for when the user presses escape or otherwise indicates canceling.
+ * @setting {Function} onAction (optional) the action handler to call when the user activates an item.
+ * @setting {Boolean} enableLeftRight (optional, default) when true, the up/down arrows move through items.
+ * @setting {Boolean} enableUpDown (optional) when true, the up/down arrows move through items.
+ * Note for both up/down and left/right explicitly set both enableLeftRight and enableUpDown to true.
+ */
+ return function(settings) {
+ var root = settings.root, enableUpDown = settings.enableUpDown !== false;
+ var enableLeftRight = settings.enableLeftRight !== false;
+ var items = settings.items, focussedId;
+
+ /**
+ * Initializes the items array if needed. This will collect items/elements
+ * from the specified root control.
+ */
+ function initItems() {
+ if (!items) {
+ items = [];
+
+ if (root.find) {
+ // Root is a container then get child elements using the UI API
+ root.find('*').each(function(ctrl) {
+ if (ctrl.canFocus) {
+ items.push(ctrl.getEl());
+ }
+ });
+ } else {
+ // Root is a control/widget then get the child elements of that control
+ var elements = root.getEl().getElementsByTagName('*');
+ for (var i = 0; i < elements.length; i++) {
+ if (elements[i].id && elements[i]) {
+ items.push(elements[i]);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns the currently focused element.
+ *
+ * @private
+ * @return {Element} Currently focused element.
+ */
+ function getFocusElement() {
+ return document.getElementById(focussedId);
+ }
+
+ /**
+ * Returns the currently focused elements wai aria role.
+ *
+ * @private
+ * @param {Element} elm Optional element to get role from.
+ * @return {String} Role of specified element.
+ */
+ function getRole(elm) {
+ elm = elm || getFocusElement();
+
+ return elm && elm.getAttribute('role');
+ }
+
+ /**
+ * Returns the role of the parent element.
+ *
+ * @private
+ * @param {Element} elm Optional element to get parent role from.
+ * @return {String} Role of the first parent that has a role.
+ */
+ function getParentRole(elm) {
+ var role, parent = elm || getFocusElement();
+
+ while ((parent = parent.parentNode)) {
+ if ((role = getRole(parent))) {
+ return role;
+ }
+ }
+ }
+
+ /**
+ * Returns an wai aria property by name.
+ *
+ * @private
+ * @param {String} name Name of the aria property to get for example "disabled".
+ * @return {String} Aria property value.
+ */
+ function getAriaProp(name) {
+ var elm = document.getElementById(focussedId);
+
+ if (elm) {
+ return elm.getAttribute('aria-' + name);
+ }
+ }
+
+ /**
+ * Executes the onAction event callback. This is when the user presses enter/space.
+ *
+ * @private
+ */
+ function action() {
+ var focusElm = getFocusElement();
+
+ if (focusElm && (focusElm.nodeName == "TEXTAREA" || focusElm.type == "text")) {
+ return;
+ }
+
+ if (settings.onAction) {
+ settings.onAction(focussedId);
+ } else {
+ DomUtils.fire(getFocusElement(), 'click', {keyboard: true});
+ }
+
+ return true;
+ }
+
+ /**
+ * Cancels the current navigation. The same as pressing the Esc key.
+ *
+ * @method cancel
+ */
+ function cancel() {
+ var focusElm;
+
+ if (settings.onCancel) {
+ if ((focusElm = getFocusElement())) {
+ focusElm.blur();
+ }
+
+ settings.onCancel();
+ } else {
+ settings.root.fire('cancel');
+ }
+ }
+
+ /**
+ * Moves the focus to the next or previous item. It will wrap to start/end if it can't move.
+ *
+ * @method moveFocus
+ * @param {Number} dir Direction for move -1 or 1.
+ */
+ function moveFocus(dir) {
+ var idx = -1, focusElm, i;
+ var visibleItems = [];
+
+ function isVisible(elm) {
+ var rootElm = root ? root.getEl() : document.body;
+
+ while (elm && elm != rootElm) {
+ if (elm.style.display == 'none') {
+ return false;
+ }
+
+ elm = elm.parentNode;
+ }
+
+ return true;
+ }
+
+ initItems();
+
+ // TODO: Optimize this, will be slow on lots of items
+ i = visibleItems.length;
+ for (i = 0; i < items.length; i++) {
+ if (isVisible(items[i])) {
+ visibleItems.push(items[i]);
+ }
+ }
+
+ i = visibleItems.length;
+ while (i--) {
+ if (visibleItems[i].id === focussedId) {
+ idx = i;
+ break;
+ }
+ }
+
+ idx += dir;
+ if (idx < 0) {
+ idx = visibleItems.length - 1;
+ } else if (idx >= visibleItems.length) {
+ idx = 0;
+ }
+
+ focusElm = visibleItems[idx];
+ focusElm.focus();
+ focussedId = focusElm.id;
+
+ if (settings.actOnFocus) {
+ action();
+ }
+ }
+
+ /**
+ * Moves focus to the first item or the last focused item if root is a toolbar.
+ *
+ * @method focusFirst
+ * @return {[type]} [description]
+ */
+ function focusFirst() {
+ var i, rootRole;
+
+ rootRole = getRole(settings.root.getEl());
+ initItems();
+
+ i = items.length;
+ while (i--) {
+ if (rootRole == 'toolbar' && items[i].id === focussedId) {
+ items[i].focus();
+ return;
+ }
+ }
+
+ items[0].focus();
+ }
+
+ // Handle accessible keys
+ root.on('keydown', function(e) {
+ var DOM_VK_LEFT = 37, DOM_VK_RIGHT = 39, DOM_VK_UP = 38, DOM_VK_DOWN = 40;
+ var DOM_VK_ESCAPE = 27, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_SPACE = 32, DOM_VK_TAB = 9;
+ var preventDefault;
+
+ switch (e.keyCode) {
+ case DOM_VK_LEFT:
+ if (enableLeftRight) {
+ if (settings.leftAction) {
+ settings.leftAction();
+ } else {
+ moveFocus(-1);
+ }
+
+ preventDefault = true;
+ }
+ break;
+
+ case DOM_VK_RIGHT:
+ if (enableLeftRight) {
+ if (getRole() == 'menuitem' && getParentRole() == 'menu') {
+ if (getAriaProp('haspopup')) {
+ action();
+ }
+ } else {
+ moveFocus(1);
+ }
+
+ preventDefault = true;
+ }
+ break;
+
+ case DOM_VK_UP:
+ if (enableUpDown) {
+ moveFocus(-1);
+ preventDefault = true;
+ }
+ break;
+
+ case DOM_VK_DOWN:
+ if (enableUpDown) {
+ if (getRole() == 'menuitem' && getParentRole() == 'menubar') {
+ action();
+ } else if (getRole() == 'button' && getAriaProp('haspopup')) {
+ action();
+ } else {
+ moveFocus(1);
+ }
+
+ preventDefault = true;
+ }
+ break;
+
+ case DOM_VK_TAB:
+ preventDefault = true;
+
+ if (e.shiftKey) {
+ moveFocus(-1);
+ } else {
+ moveFocus(1);
+ }
+ break;
+
+ case DOM_VK_ESCAPE:
+ preventDefault = true;
+ cancel();
+ break;
+
+ case DOM_VK_ENTER:
+ case DOM_VK_RETURN:
+ case DOM_VK_SPACE:
+ preventDefault = action();
+ break;
+ }
+
+ if (preventDefault) {
+ e.stopPropagation();
+ e.preventDefault();
+ }
+ });
+
+ // Init on focus in
+ root.on('focusin', function(e) {
+ initItems();
+ focussedId = e.target.id;
+ });
+
+ return {
+ moveFocus: moveFocus,
+ focusFirst: focusFirst,
+ cancel: cancel
+ };
+ };
+});
+
+// Included from: js/tinymce/classes/ui/Window.js
+
+/**
+ * Window.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new window.
+ *
+ * @-x-less Window.less
+ * @class tinymce.ui.Window
+ * @extends tinymce.ui.FloatPanel
+ */
+define("tinymce/ui/Window", [
+ "tinymce/ui/FloatPanel",
+ "tinymce/ui/Panel",
+ "tinymce/ui/DomUtils",
+ "tinymce/ui/KeyboardNavigation",
+ "tinymce/ui/DragHelper"
+], function(FloatPanel, Panel, DomUtils, KeyboardNavigation, DragHelper) {
+ "use strict";
+
+ var Window = FloatPanel.extend({
+ modal: true,
+
+ Defaults: {
+ border: 1,
+ layout: 'flex',
+ containerCls: 'panel',
+ role: 'dialog',
+ callbacks: {
+ submit: function() {
+ this.fire('submit', {data: this.toJSON()});
+ },
+
+ close: function() {
+ this.close();
+ }
+ }
+ },
+
+ /**
+ * Constructs a instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ */
+ init: function(settings) {
+ var self = this;
+
+ self._super(settings);
+
+ if (self.isRtl()) {
+ self.addClass('rtl');
+ }
+
+ self.addClass('window');
+ self._fixed = true;
+
+ // Create statusbar
+ if (settings.buttons) {
+ self.statusbar = new Panel({
+ layout: 'flex',
+ border: '1 0 0 0',
+ spacing: 3,
+ padding: 10,
+ align: 'center',
+ pack: self.isRtl() ? 'start' : 'end',
+ defaults: {
+ type: 'button'
+ },
+ items: settings.buttons
+ });
+
+ self.statusbar.addClass('foot');
+ self.statusbar.parent(self);
+ }
+
+ self.on('click', function(e) {
+ if (e.target.className.indexOf(self.classPrefix + 'close') != -1) {
+ self.close();
+ }
+ });
+
+ self.aria('label', settings.title);
+ self._fullscreen = false;
+ },
+
+ /**
+ * Recalculates the positions of the controls in the current container.
+ * This is invoked by the reflow method and shouldn't be called directly.
+ *
+ * @method recalc
+ */
+ recalc: function() {
+ var self = this, statusbar = self.statusbar, layoutRect, width, x, needsRecalc;
+
+ if (self._fullscreen) {
+ self.layoutRect(DomUtils.getWindowSize());
+ self.layoutRect().contentH = self.layoutRect().innerH;
+ }
+
+ self._super();
+
+ layoutRect = self.layoutRect();
+
+ // Resize window based on title width
+ if (self.settings.title && !self._fullscreen) {
+ width = layoutRect.headerW;
+ if (width > layoutRect.w) {
+ x = layoutRect.x - Math.max(0, width / 2);
+ self.layoutRect({w: width, x: x});
+ needsRecalc = true;
+ }
+ }
+
+ // Resize window based on statusbar width
+ if (statusbar) {
+ statusbar.layoutRect({w: self.layoutRect().innerW}).recalc();
+
+ width = statusbar.layoutRect().minW + layoutRect.deltaW;
+ if (width > layoutRect.w) {
+ x = layoutRect.x - Math.max(0, width - layoutRect.w);
+ self.layoutRect({w: width, x: x});
+ needsRecalc = true;
+ }
+ }
+
+ // Recalc body and disable auto resize
+ if (needsRecalc) {
+ self.recalc();
+ }
+ },
+
+ /**
+ * Initializes the current controls layout rect.
+ * This will be executed by the layout managers to determine the
+ * default minWidth/minHeight etc.
+ *
+ * @method initLayoutRect
+ * @return {Object} Layout rect instance.
+ */
+ initLayoutRect: function() {
+ var self = this, layoutRect = self._super(), deltaH = 0, headEl;
+
+ // Reserve vertical space for title
+ if (self.settings.title && !self._fullscreen) {
+ headEl = self.getEl('head');
+
+ var size = DomUtils.getSize(headEl);
+
+ layoutRect.headerW = size.width;
+ layoutRect.headerH = size.height;
+
+ deltaH += layoutRect.headerH;
+ }
+
+ // Reserve vertical space for statusbar
+ if (self.statusbar) {
+ deltaH += self.statusbar.layoutRect().h;
+ }
+
+ layoutRect.deltaH += deltaH;
+ layoutRect.minH += deltaH;
+ //layoutRect.innerH -= deltaH;
+ layoutRect.h += deltaH;
+
+ var rect = DomUtils.getWindowSize();
+
+ layoutRect.x = Math.max(0, rect.w / 2 - layoutRect.w / 2);
+ layoutRect.y = Math.max(0, rect.h / 2 - layoutRect.h / 2);
+
+ return layoutRect;
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, layout = self._layout, id = self._id, prefix = self.classPrefix;
+ var settings = self.settings, headerHtml = '', footerHtml = '', html = settings.html;
+
+ self.preRender();
+ layout.preRender(self);
+
+ if (settings.title) {
+ headerHtml = (
+ '<div id="' + id + '-head" class="' + prefix + 'window-head">' +
+ '<div class="' + prefix + 'title">' + self.encode(settings.title) + '</div>' +
+ '<button type="button" class="' + prefix + 'close" aria-hidden="true">×</button>' +
+ '<div id="' + id + '-dragh" class="' + prefix + 'dragh"></div>' +
+ '</div>'
+ );
+ }
+
+ if (settings.url) {
+ html = '<iframe src="' + settings.url + '" tabindex="-1"></iframe>';
+ }
+
+ if (typeof(html) == "undefined") {
+ html = layout.renderHtml(self);
+ }
+
+ if (self.statusbar) {
+ footerHtml = self.statusbar.renderHtml();
+ }
+
+ return (
+ '<div id="' + id + '" class="' + self.classes() + '" hideFocus="1" tabIndex="-1">' +
+ headerHtml +
+ '<div id="' + id + '-body" class="' + self.classes('body') + '">' +
+ html +
+ '</div>' +
+ footerHtml +
+ '</div>'
+ );
+ },
+
+ /**
+ * Switches the window fullscreen mode.
+ *
+ * @method fullscreen
+ * @param {Boolean} state True/false state.
+ * @return {tinymce.ui.Window} Current window instance.
+ */
+ fullscreen: function(state) {
+ var self = this, documentElement = document.documentElement, slowRendering, prefix = self.classPrefix, layoutRect;
+
+ if (state != self._fullscreen) {
+ DomUtils.on(window, 'resize', function() {
+ var time;
+
+ if (self._fullscreen) {
+ // Time the layout time if it's to slow use a timeout to not hog the CPU
+ if (!slowRendering) {
+ time = new Date().getTime();
+
+ var rect = DomUtils.getWindowSize();
+ self.moveTo(0, 0).resizeTo(rect.w, rect.h);
+
+ if ((new Date().getTime()) - time > 50) {
+ slowRendering = true;
+ }
+ } else {
+ if (!self._timer) {
+ self._timer = setTimeout(function() {
+ var rect = DomUtils.getWindowSize();
+ self.moveTo(0, 0).resizeTo(rect.w, rect.h);
+
+ self._timer = 0;
+ }, 50);
+ }
+ }
+ }
+ });
+
+ layoutRect = self.layoutRect();
+ self._fullscreen = state;
+
+ if (!state) {
+ self._borderBox = self.parseBox(self.settings.border);
+ self.getEl('head').style.display = '';
+ layoutRect.deltaH += layoutRect.headerH;
+ DomUtils.removeClass(documentElement, prefix + 'fullscreen');
+ DomUtils.removeClass(document.body, prefix + 'fullscreen');
+ self.removeClass('fullscreen');
+ self.moveTo(self._initial.x, self._initial.y).resizeTo(self._initial.w, self._initial.h);
+ } else {
+ self._initial = {x: layoutRect.x, y: layoutRect.y, w: layoutRect.w, h: layoutRect.h};
+
+ self._borderBox = self.parseBox('0');
+ self.getEl('head').style.display = 'none';
+ layoutRect.deltaH -= layoutRect.headerH + 2;
+ DomUtils.addClass(documentElement, prefix + 'fullscreen');
+ DomUtils.addClass(document.body, prefix + 'fullscreen');
+ self.addClass('fullscreen');
+
+ var rect = DomUtils.getWindowSize();
+ self.moveTo(0, 0).resizeTo(rect.w, rect.h);
+ }
+ }
+
+ return self.reflow();
+ },
+
+ /**
+ * Called after the control has been rendered.
+ *
+ * @method postRender
+ */
+ postRender: function() {
+ var self = this, items = [], focusCtrl, autoFocusFound, startPos;
+
+ setTimeout(function() {
+ self.addClass('in');
+ }, 0);
+
+ self.keyboardNavigation = new KeyboardNavigation({
+ root: self,
+ enableLeftRight: false,
+ enableUpDown: false,
+ items: items,
+ onCancel: function() {
+ self.close();
+ }
+ });
+
+ self.find('*').each(function(ctrl) {
+ if (ctrl.canFocus) {
+ autoFocusFound = autoFocusFound || ctrl.settings.autofocus;
+ focusCtrl = focusCtrl || ctrl;
+
+ // TODO: Figure out a better way
+ if (ctrl.type == 'filepicker') {
+ items.push(ctrl.getEl('inp'));
+
+ if (ctrl.getEl('open')) {
+ items.push(ctrl.getEl('open'));
+ }
+ } else {
+ items.push(ctrl.getEl());
+ }
+ }
+ });
+
+ if (self.statusbar) {
+ self.statusbar.find('*').each(function(ctrl) {
+ if (ctrl.canFocus) {
+ autoFocusFound = autoFocusFound || ctrl.settings.autofocus;
+ focusCtrl = focusCtrl || ctrl;
+ items.push(ctrl.getEl());
+ }
+ });
+ }
+
+ self._super();
+
+ if (self.statusbar) {
+ self.statusbar.postRender();
+ }
+
+ if (!autoFocusFound && focusCtrl) {
+ focusCtrl.focus();
+ }
+
+ this.dragHelper = new DragHelper(self._id + '-dragh', {
+ start: function() {
+ startPos = {
+ x: self.layoutRect().x,
+ y: self.layoutRect().y
+ };
+ },
+
+ drag: function(e) {
+ self.moveTo(startPos.x + e.deltaX, startPos.y + e.deltaY);
+ }
+ });
+
+ self.on('submit', function(e) {
+ if (!e.isDefaultPrevented()) {
+ self.close();
+ }
+ });
+ },
+
+ /**
+ * Fires a submit event with the serialized form.
+ *
+ * @method submit
+ * @return {Object} Event arguments object.
+ */
+ submit: function() {
+ return this.fire('submit', {data: this.toJSON()});
+ },
+
+ /**
+ * Removes the current control from DOM and from UI collections.
+ *
+ * @method remove
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ remove: function() {
+ var self = this, prefix = self.classPrefix;
+
+ self.dragHelper.destroy();
+ self._super();
+
+ if (self.statusbar) {
+ this.statusbar.remove();
+ }
+
+ if (self._fullscreen) {
+ DomUtils.removeClass(document.documentElement, prefix + 'fullscreen');
+ DomUtils.removeClass(document.body, prefix + 'fullscreen');
+ }
+ }
+ });
+
+ return Window;
+});
+
+// Included from: js/tinymce/classes/ui/MessageBox.js
+
+/**
+ * MessageBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to create MessageBoxes like alerts/confirms etc.
+ *
+ * @class tinymce.ui.Window
+ * @extends tinymce.ui.FloatPanel
+ */
+define("tinymce/ui/MessageBox", [
+ "tinymce/ui/Window"
+], function(Window) {
+ "use strict";
+
+ var MessageBox = Window.extend({
+ /**
+ * Constructs a instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ */
+ init: function(settings) {
+ settings = {
+ border: 1,
+ padding: 20,
+ layout: 'flex',
+ pack: "center",
+ align: "center",
+ containerCls: 'panel',
+ autoScroll: true,
+ buttons: {type: "button", text: "Ok", action: "ok"},
+ items: {
+ type: "label",
+ multiline: true,
+ maxWidth: 500,
+ maxHeight: 200
+ }
+ };
+
+ this._super(settings);
+ },
+
+ Statics: {
+ /**
+ * Ok buttons constant.
+ *
+ * @static
+ * @final
+ * @field {Number} OK
+ */
+ OK: 1,
+
+ /**
+ * Ok/cancel buttons constant.
+ *
+ * @static
+ * @final
+ * @field {Number} OK_CANCEL
+ */
+ OK_CANCEL: 2,
+
+ /**
+ * yes/no buttons constant.
+ *
+ * @static
+ * @final
+ * @field {Number} YES_NO
+ */
+ YES_NO: 3,
+
+ /**
+ * yes/no/cancel buttons constant.
+ *
+ * @static
+ * @final
+ * @field {Number} YES_NO_CANCEL
+ */
+ YES_NO_CANCEL: 4,
+
+ /**
+ * Constructs a new message box and renders it to the body element.
+ *
+ * @static
+ * @method msgBox
+ * @param {Object} settings Name/value object with settings.
+ */
+ msgBox: function(settings) {
+ var buttons, callback = settings.callback || function() {};
+
+ switch (settings.buttons) {
+ case MessageBox.OK_CANCEL:
+ buttons = [
+ {type: "button", text: "Ok", subtype: "primary", onClick: function(e) {
+ e.control.parents()[1].close();
+ callback(true);
+ }},
+
+ {type: "button", text: "Cancel", onClick: function(e) {
+ e.control.parents()[1].close();
+ callback(false);
+ }}
+ ];
+ break;
+
+ case MessageBox.YES_NO:
+ buttons = [
+ {type: "button", text: "Ok", subtype: "primary", onClick: function(e) {
+ e.control.parents()[1].close();
+ callback(true);
+ }}
+ ];
+ break;
+
+ case MessageBox.YES_NO_CANCEL:
+ buttons = [
+ {type: "button", text: "Ok", subtype: "primary", onClick: function(e) {
+ e.control.parents()[1].close();
+ }}
+ ];
+ break;
+
+ default:
+ buttons = [
+ {type: "button", text: "Ok", subtype: "primary", onClick: function(e) {
+ e.control.parents()[1].close();
+ callback(true);
+ }}
+ ];
+ break;
+ }
+
+ return new Window({
+ padding: 20,
+ x: settings.x,
+ y: settings.y,
+ minWidth: 300,
+ minHeight: 100,
+ layout: "flex",
+ pack: "center",
+ align: "center",
+ buttons: buttons,
+ title: settings.title,
+ items: {
+ type: "label",
+ multiline: true,
+ maxWidth: 500,
+ maxHeight: 200,
+ text: settings.text
+ },
+ onClose: settings.onClose
+ }).renderTo(document.body).reflow();
+ },
+
+ /**
+ * Creates a new alert dialog.
+ *
+ * @method alert
+ * @param {Object} settings Settings for the alert dialog.
+ * @param {function} [callback] Callback to execute when the user makes a choice.
+ */
+ alert: function(settings, callback) {
+ if (typeof(settings) == "string") {
+ settings = {text: settings};
+ }
+
+ settings.callback = callback;
+ return MessageBox.msgBox(settings);
+ },
+
+ /**
+ * Creates a new confirm dialog.
+ *
+ * @method confirm
+ * @param {Object} settings Settings for the confirm dialog.
+ * @param {function} [callback] Callback to execute when the user makes a choice.
+ */
+ confirm: function(settings, callback) {
+ if (typeof(settings) == "string") {
+ settings = {text: settings};
+ }
+
+ settings.callback = callback;
+ settings.buttons = MessageBox.OK_CANCEL;
+
+ return MessageBox.msgBox(settings);
+ }
+ }
+ });
+
+ return MessageBox;
+});
+
+// Included from: js/tinymce/classes/WindowManager.js
+
+/**
+ * WindowManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class handles the creation of native windows and dialogs. This class can be extended to provide for example inline dialogs.
+ *
+ * @class tinymce.WindowManager
+ * @example
+ * // Opens a new dialog with the file.htm file and the size 320x240
+ * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog.
+ * tinymce.activeEditor.windowManager.open({
+ * url: 'file.htm',
+ * width: 320,
+ * height: 240
+ * }, {
+ * custom_param: 1
+ * });
+ *
+ * // Displays an alert box using the active editors window manager instance
+ * tinymce.activeEditor.windowManager.alert('Hello world!');
+ *
+ * // Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm
+ * tinymce.activeEditor.windowManager.confirm("Do you want to do something", function(s) {
+ * if (s)
+ * tinymce.activeEditor.windowManager.alert("Ok");
+ * else
+ * tinymce.activeEditor.windowManager.alert("Cancel");
+ * });
+ */
+define("tinymce/WindowManager", [
+ "tinymce/ui/Window",
+ "tinymce/ui/MessageBox"
+], function(Window, MessageBox) {
+ return function(editor) {
+ var self = this, windows = [];
+
+ function getTopMostWindow() {
+ if (windows.length) {
+ return windows[windows.length - 1];
+ }
+ }
+
+ self.windows = windows;
+
+ /**
+ * Opens a new window.
+ *
+ * @method open
+ * @param {Object} args Optional name/value settings collection contains things like width/height/url etc.
+ * @option {String} title Window title.
+ * @option {String} file URL of the file to open in the window.
+ * @option {Number} width Width in pixels.
+ * @option {Number} height Height in pixels.
+ * @option {Boolean} resizable Specifies whether the popup window is resizable or not.
+ * @option {Boolean} maximizable Specifies whether the popup window has a "maximize" button and can get maximized or not.
+ * @option {String/bool} scrollbars Specifies whether the popup window can have scrollbars if required (i.e. content
+ * larger than the popup size specified).
+ */
+ self.open = function(args, params) {
+ var win;
+
+ editor.editorManager.activeEditor = editor;
+
+ args.title = args.title || ' ';
+
+ // Handle URL
+ args.url = args.url || args.file; // Legacy
+ if (args.url) {
+ args.width = parseInt(args.width || 320, 10);
+ args.height = parseInt(args.height || 240, 10);
+ }
+
+ // Handle body
+ if (args.body) {
+ args.items = {
+ defaults: args.defaults,
+ type: args.bodyType || 'form',
+ items: args.body
+ };
+ }
+
+ if (!args.url && !args.buttons) {
+ args.buttons = [
+ {text: 'Ok', subtype: 'primary', onclick: function() {
+ win.find('form')[0].submit();
+ win.close();
+ }},
+
+ {text: 'Cancel', onclick: function() {
+ win.close();
+ }}
+ ];
+ }
+
+ win = new Window(args);
+ windows.push(win);
+
+ win.on('close', function() {
+ var i = windows.length;
+
+ while (i--) {
+ if (windows[i] === win) {
+ windows.splice(i, 1);
+ }
+ }
+
+ editor.focus();
+ });
+
+ // Handle data
+ if (args.data) {
+ win.on('postRender', function() {
+ this.find('*').each(function(ctrl) {
+ var name = ctrl.name();
+
+ if (name in args.data) {
+ ctrl.value(args.data[name]);
+ }
+ });
+ });
+ }
+
+ // store args and parameters
+ win.features = args || {};
+ win.params = params || {};
+
+ // Takes a snapshot in the FocusManager of the selection before focus is lost to dialog
+ editor.nodeChanged();
+
+ return win.renderTo(document.body).reflow();
+ };
+
+ /**
+ * Creates a alert dialog. Please don't use the blocking behavior of this
+ * native version use the callback method instead then it can be extended.
+ *
+ * @method alert
+ * @param {String} message Text to display in the new alert dialog.
+ * @param {function} callback Callback function to be executed after the user has selected ok.
+ * @param {Object} scope Optional scope to execute the callback in.
+ * @example
+ * // Displays an alert box using the active editors window manager instance
+ * tinymce.activeEditor.windowManager.alert('Hello world!');
+ */
+ self.alert = function(message, callback, scope) {
+ MessageBox.alert(message, function() {
+ if (callback) {
+ callback.call(scope || this);
+ }
+ });
+ };
+
+ /**
+ * Creates a confirm dialog. Please don't use the blocking behavior of this
+ * native version use the callback method instead then it can be extended.
+ *
+ * @method confirm
+ * @param {String} messageText to display in the new confirm dialog.
+ * @param {function} callback Callback function to be executed after the user has selected ok or cancel.
+ * @param {Object} scope Optional scope to execute the callback in.
+ * @example
+ * // Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm
+ * tinymce.activeEditor.windowManager.confirm("Do you want to do something", function(s) {
+ * if (s)
+ * tinymce.activeEditor.windowManager.alert("Ok");
+ * else
+ * tinymce.activeEditor.windowManager.alert("Cancel");
+ * });
+ */
+ self.confirm = function(message, callback, scope) {
+ MessageBox.confirm(message, function(state) {
+ callback.call(scope || this, state);
+ });
+ };
+
+ /**
+ * Closes the top most window.
+ *
+ * @method close
+ */
+ self.close = function() {
+ if (getTopMostWindow()) {
+ getTopMostWindow().close();
+ }
+ };
+
+ /**
+ * Returns the params of the last window open call. This can be used in iframe based
+ * dialog to get params passed from the tinymce plugin.
+ *
+ * @example
+ * var dialogArguments = top.tinymce.activeEditor.windowManager.getParams();
+ *
+ * @method getParams
+ * @return {Object} Name/value object with parameters passed from windowManager.open call.
+ */
+ self.getParams = function() {
+ return getTopMostWindow() ? getTopMostWindow().params : null;
+ };
+
+ /**
+ * Sets the params of the last opened window.
+ *
+ * @method setParams
+ * @param {Object} params Params object to set for the last opened window.
+ */
+ self.setParams = function(params) {
+ if (getTopMostWindow()) {
+ getTopMostWindow().params = params;
+ }
+ };
+ };
+});
+
+// Included from: js/tinymce/classes/util/Quirks.js
+
+/**
+ * Quirks.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ *
+ * @ignore-file
+ */
+
+/**
+ * This file includes fixes for various browser quirks it's made to make it easy to add/remove browser specific fixes.
+ *
+ * @class tinymce.util.Quirks
+ */
+define("tinymce/util/Quirks", [
+ "tinymce/util/VK",
+ "tinymce/dom/RangeUtils",
+ "tinymce/html/Node",
+ "tinymce/html/Entities",
+ "tinymce/Env",
+ "tinymce/util/Tools"
+], function(VK, RangeUtils, Node, Entities, Env, Tools) {
+ return function(editor) {
+ var each = Tools.each;
+ var BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection,
+ settings = editor.settings, parser = editor.parser, serializer = editor.serializer;
+ var isGecko = Env.gecko, isIE = Env.ie, isWebKit = Env.webkit;
+
+ /**
+ * Executes a command with a specific state this can be to enable/disable browser editing features.
+ */
+ function setEditorCommandState(cmd, state) {
+ try {
+ editor.getDoc().execCommand(cmd, false, state);
+ } catch (ex) {
+ // Ignore
+ }
+ }
+
+ /**
+ * Returns current IE document mode.
+ */
+ function getDocumentMode() {
+ var documentMode = editor.getDoc().documentMode;
+
+ return documentMode ? documentMode : 6;
+ }
+
+ /**
+ * Returns true/false if the event is prevented or not.
+ *
+ * @private
+ * @param {Event} e Event object.
+ * @return {Boolean} true/false if the event is prevented or not.
+ */
+ function isDefaultPrevented(e) {
+ return e.isDefaultPrevented();
+ }
+
+ /**
+ * Fixes a WebKit bug when deleting contents using backspace or delete key.
+ * WebKit will produce a span element if you delete across two block elements.
+ *
+ * Example:
+ * <h1>a</h1><p>|b</p>
+ *
+ * Will produce this on backspace:
+ * <h1>a<span style="<all runtime styles>">b</span></p>
+ *
+ * This fixes the backspace to produce:
+ * <h1>a|b</p>
+ *
+ * See bug: https://bugs.webkit.org/show_bug.cgi?id=45784
+ *
+ * This fixes the following delete scenarios:
+ * 1. Delete by pressing backspace key.
+ * 2. Delete by pressing delete key.
+ * 3. Delete by pressing backspace key with ctrl/cmd (Word delete).
+ * 4. Delete by pressing delete key with ctrl/cmd (Word delete).
+ * 5. Delete by drag/dropping contents inside the editor.
+ * 6. Delete by using Cut Ctrl+X/Cmd+X.
+ * 7. Delete by selecting contents and writing a character.'
+ *
+ * This code is a ugly hack since writing full custom delete logic for just this bug
+ * fix seemed like a huge task. I hope we can remove this before the year 2030.
+ */
+ function cleanupStylesWhenDeleting() {
+ var doc = editor.getDoc();
+
+ if (!window.MutationObserver) {
+ return;
+ }
+
+ function customDelete(isForward) {
+ var mutationObserver = new MutationObserver(function() {});
+
+ Tools.each(editor.getBody().getElementsByTagName('*'), function(elm) {
+ // Mark existing spans
+ if (elm.tagName == 'SPAN') {
+ elm.setAttribute('mce-data-marked', 1);
+ }
+
+ // Make sure all elements has a data-mce-style attribute
+ if (!elm.hasAttribute('data-mce-style') && elm.hasAttribute('style')) {
+ editor.dom.setAttrib(elm, 'style', elm.getAttribute('style'));
+ }
+ });
+
+ // Observe added nodes and style attribute changes
+ mutationObserver.observe(editor.getDoc(), {
+ childList: true,
+ attributes: true,
+ subtree: true,
+ attributeFilter: ['style']
+ });
+
+ editor.getDoc().execCommand(isForward ? 'ForwardDelete' : 'Delete', false, null);
+
+ var rng = editor.selection.getRng();
+ var caretElement = rng.startContainer.parentNode;
+
+ Tools.each(mutationObserver.takeRecords(), function(record) {
+ // Restore style attribute to previous value
+ if (record.attributeName == "style") {
+ var oldValue = record.target.getAttribute('data-mce-style');
+
+ if (oldValue) {
+ record.target.setAttribute("style", oldValue);
+ } else {
+ record.target.removeAttribute("style");
+ }
+ }
+
+ // Remove all spans that isn't maked and retain selection
+ Tools.each(record.addedNodes, function(node) {
+ if (node.nodeName == "SPAN" && !node.getAttribute('mce-data-marked')) {
+ var offset, container;
+
+ if (node == caretElement) {
+ offset = rng.startOffset;
+ container = node.firstChild;
+ }
+
+ dom.remove(node, true);
+
+ if (container) {
+ rng.setStart(container, offset);
+ rng.setEnd(container, offset);
+ editor.selection.setRng(rng);
+ }
+ }
+ });
+ });
+
+ mutationObserver.disconnect();
+
+ // Remove any left over marks
+ Tools.each(editor.dom.select('span[mce-data-marked]'), function(span) {
+ span.removeAttribute('mce-data-marked');
+ });
+ }
+
+ editor.on('keydown', function(e) {
+ var isForward = e.keyCode == DELETE, isMeta = VK.metaKeyPressed(e);
+
+ if (!isDefaultPrevented(e) && (isForward || e.keyCode == BACKSPACE)) {
+ var rng = editor.selection.getRng(), container = rng.startContainer, offset = rng.startOffset;
+
+ // Ignore non meta delete in the where there is text before/after the caret
+ if (!isMeta && rng.collapsed && container.nodeType == 3) {
+ if (isForward ? offset < container.data.length : offset > 0) {
+ return;
+ }
+ }
+
+ e.preventDefault();
+
+ if (isMeta) {
+ editor.selection.getSel().modify("extend", isForward ? "forward" : "backward", "word");
+ }
+
+ customDelete(isForward);
+ }
+ });
+
+ editor.on('keypress', function(e) {
+ if (!isDefaultPrevented(e) && !selection.isCollapsed() && e.charCode) {
+ e.preventDefault();
+ customDelete(true);
+ editor.selection.setContent(String.fromCharCode(e.charCode));
+ }
+ });
+
+ editor.addCommand('Delete', function() {
+ customDelete();
+ });
+
+ editor.addCommand('ForwardDelete', function() {
+ customDelete(true);
+ });
+
+ editor.on('dragstart', function(e) {
+ e.dataTransfer.setData('mce-internal', editor.selection.getContent());
+ });
+
+ editor.on('drop', function(e) {
+ if (!isDefaultPrevented(e)) {
+ var internalContent = e.dataTransfer.getData('mce-internal');
+
+ if (internalContent && doc.caretRangeFromPoint) {
+ e.preventDefault();
+ customDelete();
+ editor.selection.setRng(doc.caretRangeFromPoint(e.x, e.y));
+ editor.insertContent(internalContent);
+ }
+ }
+ });
+
+ editor.on('cut', function(e) {
+ if (!isDefaultPrevented(e) && e.clipboardData) {
+ e.preventDefault();
+ e.clipboardData.clearData();
+ e.clipboardData.setData('text/html', editor.selection.getContent());
+ e.clipboardData.setData('text/plain', editor.selection.getContent({format: 'text'}));
+ customDelete(true);
+ }
+ });
+ }
+
+ /**
+ * Makes sure that the editor body becomes empty when backspace or delete is pressed in empty editors.
+ *
+ * For example:
+ * <p><b>|</b></p>
+ *
+ * Or:
+ * <h1>|</h1>
+ *
+ * Or:
+ * [<h1></h1>]
+ */
+ function emptyEditorWhenDeleting() {
+ function serializeRng(rng) {
+ var body = dom.create("body");
+ var contents = rng.cloneContents();
+ body.appendChild(contents);
+ return selection.serializer.serialize(body, {format: 'html'});
+ }
+
+ function allContentsSelected(rng) {
+ if (!rng.setStart) {
+ if (rng.item) {
+ return false;
+ }
+
+ var bodyRng = rng.duplicate();
+ bodyRng.moveToElementText(editor.getBody());
+ return RangeUtils.compareRanges(rng, bodyRng);
+ }
+
+ var selection = serializeRng(rng);
+
+ var allRng = dom.createRng();
+ allRng.selectNode(editor.getBody());
+
+ var allSelection = serializeRng(allRng);
+ return selection === allSelection;
+ }
+
+ editor.on('keydown', function(e) {
+ var keyCode = e.keyCode, isCollapsed, body;
+
+ // Empty the editor if it's needed for example backspace at <p><b>|</b></p>
+ if (!isDefaultPrevented(e) && (keyCode == DELETE || keyCode == BACKSPACE)) {
+ isCollapsed = editor.selection.isCollapsed();
+ body = editor.getBody();
+
+ // Selection is collapsed but the editor isn't empty
+ if (isCollapsed && !dom.isEmpty(body)) {
+ return;
+ }
+
+ // Selection isn't collapsed but not all the contents is selected
+ if (!isCollapsed && !allContentsSelected(editor.selection.getRng())) {
+ return;
+ }
+
+ // Manually empty the editor
+ e.preventDefault();
+ editor.setContent('');
+
+ if (body.firstChild && dom.isBlock(body.firstChild)) {
+ editor.selection.setCursorLocation(body.firstChild, 0);
+ } else {
+ editor.selection.setCursorLocation(body, 0);
+ }
+
+ editor.nodeChanged();
+ }
+ });
+ }
+
+ /**
+ * WebKit doesn't select all the nodes in the body when you press Ctrl+A.
+ * IE selects more than the contents <body>[<p>a</p>]</body> instead of <body><p>[a]</p]</body> see bug #6438
+ * This selects the whole body so that backspace/delete logic will delete everything
+ */
+ function selectAll() {
+ editor.on('keydown', function(e) {
+ if (!isDefaultPrevented(e) && e.keyCode == 65 && VK.metaKeyPressed(e)) {
+ e.preventDefault();
+ editor.execCommand('SelectAll');
+ }
+ });
+ }
+
+ /**
+ * WebKit has a weird issue where it some times fails to properly convert keypresses to input method keystrokes.
+ * The IME on Mac doesn't initialize when it doesn't fire a proper focus event.
+ *
+ * This seems to happen when the user manages to click the documentElement element then the window doesn't get proper focus until
+ * you enter a character into the editor.
+ *
+ * It also happens when the first focus in made to the body.
+ *
+ * See: https://bugs.webkit.org/show_bug.cgi?id=83566
+ */
+ function inputMethodFocus() {
+ if (!editor.settings.content_editable) {
+ // Case 1 IME doesn't initialize if you focus the document
+ dom.bind(editor.getDoc(), 'focusin', function() {
+ selection.setRng(selection.getRng());
+ });
+
+ // Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event
+ dom.bind(editor.getDoc(), 'mousedown', function(e) {
+ if (e.target == editor.getDoc().documentElement) {
+ editor.getWin().focus();
+ selection.setRng(selection.getRng());
+ }
+ });
+ }
+ }
+
+ /**
+ * Backspacing in FireFox/IE from a paragraph into a horizontal rule results in a floating text node because the
+ * browser just deletes the paragraph - the browser fails to merge the text node with a horizontal rule so it is
+ * left there. TinyMCE sees a floating text node and wraps it in a paragraph on the key up event (ForceBlocks.js
+ * addRootBlocks), meaning the action does nothing. With this code, FireFox/IE matche the behaviour of other
+ * browsers.
+ *
+ * It also fixes a bug on Firefox where it's impossible to delete HR elements.
+ */
+ function removeHrOnBackspace() {
+ editor.on('keydown', function(e) {
+ if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
+ if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
+ var node = selection.getNode();
+ var previousSibling = node.previousSibling;
+
+ if (node.nodeName == 'HR') {
+ dom.remove(node);
+ e.preventDefault();
+ return;
+ }
+
+ if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "hr") {
+ dom.remove(previousSibling);
+ e.preventDefault();
+ }
+ }
+ }
+ });
+ }
+
+ /**
+ * Firefox 3.x has an issue where the body element won't get proper focus if you click out
+ * side it's rectangle.
+ */
+ function focusBody() {
+ // Fix for a focus bug in FF 3.x where the body element
+ // wouldn't get proper focus if the user clicked on the HTML element
+ if (!window.Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4
+ editor.on('mousedown', function(e) {
+ if (!isDefaultPrevented(e) && e.target.nodeName === "HTML") {
+ var body = editor.getBody();
+
+ // Blur the body it's focused but not correctly focused
+ body.blur();
+
+ // Refocus the body after a little while
+ setTimeout(function() {
+ body.focus();
+ }, 0);
+ }
+ });
+ }
+ }
+
+ /**
+ * WebKit has a bug where it isn't possible to select image, hr or anchor elements
+ * by clicking on them so we need to fake that.
+ */
+ function selectControlElements() {
+ editor.on('click', function(e) {
+ e = e.target;
+
+ // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250
+ // WebKit can't even do simple things like selecting an image
+ // Needs tobe the setBaseAndExtend or it will fail to select floated images
+ if (/^(IMG|HR)$/.test(e.nodeName)) {
+ selection.getSel().setBaseAndExtent(e, 0, e, 1);
+ }
+
+ if (e.nodeName == 'A' && dom.hasClass(e, 'mce-item-anchor')) {
+ selection.select(e);
+ }
+
+ editor.nodeChanged();
+ });
+ }
+
+ /**
+ * Fixes a Gecko bug where the style attribute gets added to the wrong element when deleting between two block elements.
+ *
+ * Fixes do backspace/delete on this:
+ * <p>bla[ck</p><p style="color:red">r]ed</p>
+ *
+ * Would become:
+ * <p>bla|ed</p>
+ *
+ * Instead of:
+ * <p style="color:red">bla|ed</p>
+ */
+ function removeStylesWhenDeletingAcrossBlockElements() {
+ function getAttributeApplyFunction() {
+ var template = dom.getAttribs(selection.getStart().cloneNode(false));
+
+ return function() {
+ var target = selection.getStart();
+
+ if (target !== editor.getBody()) {
+ dom.setAttrib(target, "style", null);
+
+ each(template, function(attr) {
+ target.setAttributeNode(attr.cloneNode(true));
+ });
+ }
+ };
+ }
+
+ function isSelectionAcrossElements() {
+ return !selection.isCollapsed() &&
+ dom.getParent(selection.getStart(), dom.isBlock) != dom.getParent(selection.getEnd(), dom.isBlock);
+ }
+
+ editor.on('keypress', function(e) {
+ var applyAttributes;
+
+ if (!isDefaultPrevented(e) && (e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) {
+ applyAttributes = getAttributeApplyFunction();
+ editor.getDoc().execCommand('delete', false, null);
+ applyAttributes();
+ e.preventDefault();
+ return false;
+ }
+ });
+
+ dom.bind(editor.getDoc(), 'cut', function(e) {
+ var applyAttributes;
+
+ if (!isDefaultPrevented(e) && isSelectionAcrossElements()) {
+ applyAttributes = getAttributeApplyFunction();
+
+ setTimeout(function() {
+ applyAttributes();
+ }, 0);
+ }
+ });
+ }
+
+ /**
+ * Fire a nodeChanged when the selection is changed on WebKit this fixes selection issues on iOS5. It only fires the nodeChange
+ * event every 50ms since it would other wise update the UI when you type and it hogs the CPU.
+ */
+ function selectionChangeNodeChanged() {
+ var lastRng, selectionTimer;
+
+ editor.on('selectionchange', function() {
+ if (selectionTimer) {
+ clearTimeout(selectionTimer);
+ selectionTimer = 0;
+ }
+
+ selectionTimer = window.setTimeout(function() {
+ var rng = selection.getRng();
+
+ // Compare the ranges to see if it was a real change or not
+ if (!lastRng || !RangeUtils.compareRanges(rng, lastRng)) {
+ editor.nodeChanged();
+ lastRng = rng;
+ }
+ }, 50);
+ });
+ }
+
+ /**
+ * Screen readers on IE needs to have the role application set on the body.
+ */
+ function ensureBodyHasRoleApplication() {
+ document.body.setAttribute("role", "application");
+ }
+
+ /**
+ * Backspacing into a table behaves differently depending upon browser type.
+ * Therefore, disable Backspace when cursor immediately follows a table.
+ */
+ function disableBackspaceIntoATable() {
+ editor.on('keydown', function(e) {
+ if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
+ if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
+ var previousSibling = selection.getNode().previousSibling;
+ if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "table") {
+ e.preventDefault();
+ return false;
+ }
+ }
+ }
+ });
+ }
+
+ /**
+ * Old IE versions can't properly render BR elements in PRE tags white in contentEditable mode. So this
+ * logic adds a \n before the BR so that it will get rendered.
+ */
+ function addNewLinesBeforeBrInPre() {
+ // IE8+ rendering mode does the right thing with BR in PRE
+ if (getDocumentMode() > 7) {
+ return;
+ }
+
+ // Enable display: none in area and add a specific class that hides all BR elements in PRE to
+ // avoid the caret from getting stuck at the BR elements while pressing the right arrow key
+ setEditorCommandState('RespectVisibilityInDesign', true);
+ editor.contentStyles.push('.mceHideBrInPre pre br {display: none}');
+ dom.addClass(editor.getBody(), 'mceHideBrInPre');
+
+ // Adds a \n before all BR elements in PRE to get them visual
+ parser.addNodeFilter('pre', function(nodes) {
+ var i = nodes.length, brNodes, j, brElm, sibling;
+
+ while (i--) {
+ brNodes = nodes[i].getAll('br');
+ j = brNodes.length;
+ while (j--) {
+ brElm = brNodes[j];
+
+ // Add \n before BR in PRE elements on older IE:s so the new lines get rendered
+ sibling = brElm.prev;
+ if (sibling && sibling.type === 3 && sibling.value.charAt(sibling.value - 1) != '\n') {
+ sibling.value += '\n';
+ } else {
+ brElm.parent.insert(new Node('#text', 3), brElm, true).value = '\n';
+ }
+ }
+ }
+ });
+
+ // Removes any \n before BR elements in PRE since other browsers and in contentEditable=false mode they will be visible
+ serializer.addNodeFilter('pre', function(nodes) {
+ var i = nodes.length, brNodes, j, brElm, sibling;
+
+ while (i--) {
+ brNodes = nodes[i].getAll('br');
+ j = brNodes.length;
+ while (j--) {
+ brElm = brNodes[j];
+ sibling = brElm.prev;
+ if (sibling && sibling.type == 3) {
+ sibling.value = sibling.value.replace(/\r?\n$/, '');
+ }
+ }
+ }
+ });
+ }
+
+ /**
+ * Moves style width/height to attribute width/height when the user resizes an image on IE.
+ */
+ function removePreSerializedStylesWhenSelectingControls() {
+ dom.bind(editor.getBody(), 'mouseup', function() {
+ var value, node = selection.getNode();
+
+ // Moved styles to attributes on IMG eements
+ if (node.nodeName == 'IMG') {
+ // Convert style width to width attribute
+ if ((value = dom.getStyle(node, 'width'))) {
+ dom.setAttrib(node, 'width', value.replace(/[^0-9%]+/g, ''));
+ dom.setStyle(node, 'width', '');
+ }
+
+ // Convert style height to height attribute
+ if ((value = dom.getStyle(node, 'height'))) {
+ dom.setAttrib(node, 'height', value.replace(/[^0-9%]+/g, ''));
+ dom.setStyle(node, 'height', '');
+ }
+ }
+ });
+ }
+
+ /**
+ * Removes a blockquote when backspace is pressed at the beginning of it.
+ *
+ * For example:
+ * <blockquote><p>|x</p></blockquote>
+ *
+ * Becomes:
+ * <p>|x</p>
+ */
+ function removeBlockQuoteOnBackSpace() {
+ // Add block quote deletion handler
+ editor.on('keydown', function(e) {
+ var rng, container, offset, root, parent;
+
+ if (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {
+ return;
+ }
+
+ rng = selection.getRng();
+ container = rng.startContainer;
+ offset = rng.startOffset;
+ root = dom.getRoot();
+ parent = container;
+
+ if (!rng.collapsed || offset !== 0) {
+ return;
+ }
+
+ while (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {
+ parent = parent.parentNode;
+ }
+
+ // Is the cursor at the beginning of a blockquote?
+ if (parent.tagName === 'BLOCKQUOTE') {
+ // Remove the blockquote
+ editor.formatter.toggle('blockquote', null, parent);
+
+ // Move the caret to the beginning of container
+ rng = dom.createRng();
+ rng.setStart(container, 0);
+ rng.setEnd(container, 0);
+ selection.setRng(rng);
+ }
+ });
+ }
+
+ /**
+ * Sets various Gecko editing options on mouse down and before a execCommand to disable inline table editing that is broken etc.
+ */
+ function setGeckoEditingOptions() {
+ function setOpts() {
+ editor._refreshContentEditable();
+
+ setEditorCommandState("StyleWithCSS", false);
+ setEditorCommandState("enableInlineTableEditing", false);
+
+ if (!settings.object_resizing) {
+ setEditorCommandState("enableObjectResizing", false);
+ }
+ }
+
+ if (!settings.readonly) {
+ editor.on('BeforeExecCommand MouseDown', setOpts);
+ }
+ }
+
+ /**
+ * Fixes a gecko link bug, when a link is placed at the end of block elements there is
+ * no way to move the caret behind the link. This fix adds a bogus br element after the link.
+ *
+ * For example this:
+ * <p><b><a href="#">x</a></b></p>
+ *
+ * Becomes this:
+ * <p><b><a href="#">x</a></b><br></p>
+ */
+ function addBrAfterLastLinks() {
+ function fixLinks() {
+ each(dom.select('a'), function(node) {
+ var parentNode = node.parentNode, root = dom.getRoot();
+
+ if (parentNode.lastChild === node) {
+ while (parentNode && !dom.isBlock(parentNode)) {
+ if (parentNode.parentNode.lastChild !== parentNode || parentNode === root) {
+ return;
+ }
+
+ parentNode = parentNode.parentNode;
+ }
+
+ dom.add(parentNode, 'br', {'data-mce-bogus': 1});
+ }
+ });
+ }
+
+ editor.on('SetContent ExecCommand', function(e) {
+ if (e.type == "setcontent" || e.command === 'mceInsertLink') {
+ fixLinks();
+ }
+ });
+ }
+
+ /**
+ * WebKit will produce DIV elements here and there by default. But since TinyMCE uses paragraphs by
+ * default we want to change that behavior.
+ */
+ function setDefaultBlockType() {
+ if (settings.forced_root_block) {
+ editor.on('init', function() {
+ setEditorCommandState('DefaultParagraphSeparator', settings.forced_root_block);
+ });
+ }
+ }
+
+ /**
+ * Removes ghost selections from images/tables on Gecko.
+ */
+ function removeGhostSelection() {
+ editor.on('Undo Redo SetContent', function(e) {
+ if (!e.initial) {
+ editor.execCommand('mceRepaint');
+ }
+ });
+ }
+
+ /**
+ * Deletes the selected image on IE instead of navigating to previous page.
+ */
+ function deleteControlItemOnBackSpace() {
+ editor.on('keydown', function(e) {
+ var rng;
+
+ if (!isDefaultPrevented(e) && e.keyCode == BACKSPACE) {
+ rng = editor.getDoc().selection.createRange();
+ if (rng && rng.item) {
+ e.preventDefault();
+ editor.undoManager.beforeChange();
+ dom.remove(rng.item(0));
+ editor.undoManager.add();
+ }
+ }
+ });
+ }
+
+ /**
+ * IE10 doesn't properly render block elements with the right height until you add contents to them.
+ * This fixes that by adding a padding-right to all empty text block elements.
+ * See: https://connect.microsoft.com/IE/feedback/details/743881
+ */
+ function renderEmptyBlocksFix() {
+ var emptyBlocksCSS;
+
+ // IE10+
+ if (getDocumentMode() >= 10) {
+ emptyBlocksCSS = '';
+ each('p div h1 h2 h3 h4 h5 h6'.split(' '), function(name, i) {
+ emptyBlocksCSS += (i > 0 ? ',' : '') + name + ':empty';
+ });
+
+ editor.contentStyles.push(emptyBlocksCSS + '{padding-right: 1px !important}');
+ }
+ }
+
+ /**
+ * Old IE versions can't retain contents within noscript elements so this logic will store the contents
+ * as a attribute and the insert that value as it's raw text when the DOM is serialized.
+ */
+ function keepNoScriptContents() {
+ if (getDocumentMode() < 9) {
+ parser.addNodeFilter('noscript', function(nodes) {
+ var i = nodes.length, node, textNode;
+
+ while (i--) {
+ node = nodes[i];
+ textNode = node.firstChild;
+
+ if (textNode) {
+ node.attr('data-mce-innertext', textNode.value);
+ }
+ }
+ });
+
+ serializer.addNodeFilter('noscript', function(nodes) {
+ var i = nodes.length, node, textNode, value;
+
+ while (i--) {
+ node = nodes[i];
+ textNode = nodes[i].firstChild;
+
+ if (textNode) {
+ textNode.value = Entities.decode(textNode.value);
+ } else {
+ // Old IE can't retain noscript value so an attribute is used to store it
+ value = node.attributes.map['data-mce-innertext'];
+ if (value) {
+ node.attr('data-mce-innertext', null);
+ textNode = new Node('#text', 3);
+ textNode.value = value;
+ textNode.raw = true;
+ node.append(textNode);
+ }
+ }
+ }
+ });
+ }
+ }
+
+ /**
+ * IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode.
+ */
+ function fixCaretSelectionOfDocumentElementOnIe() {
+ var doc = dom.doc, body = doc.body, started, startRng, htmlElm;
+
+ // Return range from point or null if it failed
+ function rngFromPoint(x, y) {
+ var rng = body.createTextRange();
+
+ try {
+ rng.moveToPoint(x, y);
+ } catch (ex) {
+ // IE sometimes throws and exception, so lets just ignore it
+ rng = null;
+ }
+
+ return rng;
+ }
+
+ // Fires while the selection is changing
+ function selectionChange(e) {
+ var pointRng;
+
+ // Check if the button is down or not
+ if (e.button) {
+ // Create range from mouse position
+ pointRng = rngFromPoint(e.x, e.y);
+
+ if (pointRng) {
+ // Check if pointRange is before/after selection then change the endPoint
+ if (pointRng.compareEndPoints('StartToStart', startRng) > 0) {
+ pointRng.setEndPoint('StartToStart', startRng);
+ } else {
+ pointRng.setEndPoint('EndToEnd', startRng);
+ }
+
+ pointRng.select();
+ }
+ } else {
+ endSelection();
+ }
+ }
+
+ // Removes listeners
+ function endSelection() {
+ var rng = doc.selection.createRange();
+
+ // If the range is collapsed then use the last start range
+ if (startRng && !rng.item && rng.compareEndPoints('StartToEnd', rng) === 0) {
+ startRng.select();
+ }
+
+ dom.unbind(doc, 'mouseup', endSelection);
+ dom.unbind(doc, 'mousemove', selectionChange);
+ startRng = started = 0;
+ }
+
+ // Make HTML element unselectable since we are going to handle selection by hand
+ doc.documentElement.unselectable = true;
+
+ // Detect when user selects outside BODY
+ dom.bind(doc, 'mousedown contextmenu', function(e) {
+ if (e.target.nodeName === 'HTML') {
+ if (started) {
+ endSelection();
+ }
+
+ // Detect vertical scrollbar, since IE will fire a mousedown on the scrollbar and have target set as HTML
+ htmlElm = doc.documentElement;
+ if (htmlElm.scrollHeight > htmlElm.clientHeight) {
+ return;
+ }
+
+ started = 1;
+ // Setup start position
+ startRng = rngFromPoint(e.x, e.y);
+ if (startRng) {
+ // Listen for selection change events
+ dom.bind(doc, 'mouseup', endSelection);
+ dom.bind(doc, 'mousemove', selectionChange);
+
+ dom.win.focus();
+ startRng.select();
+ }
+ }
+ });
+ }
+
+ /**
+ * Fixes selection issues on Gecko where the caret can be placed between two inline elements like <b>a</b>|<b>b</b>
+ * this fix will lean the caret right into the closest inline element.
+ */
+ function normalizeSelection() {
+ // Normalize selection for example <b>a</b><i>|a</i> becomes <b>a|</b><i>a</i> except for Ctrl+A since it selects everything
+ editor.on('keyup focusin', function(e) {
+ if (e.keyCode != 65 || !VK.metaKeyPressed(e)) {
+ selection.normalize();
+ }
+ });
+ }
+
+ /**
+ * Forces Gecko to render a broken image icon if it fails to load an image.
+ */
+ function showBrokenImageIcon() {
+ editor.contentStyles.push(
+ 'img:-moz-broken {' +
+ '-moz-force-broken-image-icon:1;' +
+ 'min-width:24px;' +
+ 'min-height:24px' +
+ '}'
+ );
+ }
+
+ /**
+ * iOS has a bug where it's impossible to type if the document has a touchstart event
+ * bound and the user touches the document while having the on screen keyboard visible.
+ *
+ * The touch event moves the focus to the parent document while having the caret inside the iframe
+ * this fix moves the focus back into the iframe document.
+ */
+ function restoreFocusOnKeyDown() {
+ if (!editor.inline) {
+ editor.on('keydown', function() {
+ if (document.activeElement == document.body) {
+ editor.getWin().focus();
+ }
+ });
+ }
+ }
+
+ /**
+ * IE 11 has an annoying issue where you can't move focus into the editor
+ * by clicking on the white area HTML element. We used to be able to to fix this with
+ * the fixCaretSelectionOfDocumentElementOnIe fix. But since M$ removed the selection
+ * object it's not possible anymore. So we need to hack in a ungly CSS to force the
+ * body to be at least 150px. If the user clicks the HTML element out side this 150px region
+ * we simply move the focus into the first paragraph. Not ideal since you loose the
+ * positioning of the caret but goot enough for most cases.
+ */
+ function bodyHeight() {
+ if (!editor.inline) {
+ editor.contentStyles.push('body {min-height: 150px}');
+ editor.on('click', function(e) {
+ if (e.target.nodeName == 'HTML') {
+ editor.execCommand('SelectAll');
+ editor.selection.collapse(true);
+ editor.nodeChanged();
+ }
+ });
+ }
+ }
+
+ /**
+ * Firefox on Mac OS will move the browser back to the previous page if you press CMD+Left arrow.
+ * You might then loose all your work so we need to block that behavior and replace it with our own.
+ */
+ function blockCmdArrowNavigation() {
+ if (Env.mac) {
+ editor.on('keydown', function(e) {
+ if (VK.metaKeyPressed(e) && (e.keyCode == 37 || e.keyCode == 39)) {
+ e.preventDefault();
+ editor.selection.getSel().modify('move', e.keyCode == 37 ? 'backward' : 'forward', 'word');
+ }
+ });
+ }
+ }
+
+ // All browsers
+ disableBackspaceIntoATable();
+ removeBlockQuoteOnBackSpace();
+ emptyEditorWhenDeleting();
+ normalizeSelection();
+
+ // WebKit
+ if (isWebKit) {
+ cleanupStylesWhenDeleting();
+ inputMethodFocus();
+ selectControlElements();
+ setDefaultBlockType();
+
+ // iOS
+ if (Env.iOS) {
+ selectionChangeNodeChanged();
+ restoreFocusOnKeyDown();
+ bodyHeight();
+ } else {
+ selectAll();
+ }
+ }
+
+ // IE
+ if (isIE && Env.ie < 11) {
+ removeHrOnBackspace();
+ ensureBodyHasRoleApplication();
+ addNewLinesBeforeBrInPre();
+ removePreSerializedStylesWhenSelectingControls();
+ deleteControlItemOnBackSpace();
+ renderEmptyBlocksFix();
+ keepNoScriptContents();
+ fixCaretSelectionOfDocumentElementOnIe();
+ }
+
+ if (Env.ie >= 11) {
+ bodyHeight();
+ }
+
+ if (Env.ie) {
+ selectAll();
+ }
+
+ // Gecko
+ if (isGecko) {
+ removeHrOnBackspace();
+ focusBody();
+ removeStylesWhenDeletingAcrossBlockElements();
+ setGeckoEditingOptions();
+ addBrAfterLastLinks();
+ removeGhostSelection();
+ showBrokenImageIcon();
+ blockCmdArrowNavigation();
+ }
+ };
+});
+
+// Included from: js/tinymce/classes/util/Observable.js
+
+/**
+ * Observable.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This mixin will add event binding logic to classes.
+ *
+ * @mixin tinymce.util.Observable
+ */
+define("tinymce/util/Observable", [
+ "tinymce/util/Tools"
+], function(Tools) {
+ var bindingsName = "__bindings";
+ var nativeEvents = Tools.makeMap(
+ "focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange" +
+ " mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragstart dragend dragover draggesture dragdrop drop drag", ' '
+ );
+
+ function returnFalse() {
+ return false;
+ }
+
+ function returnTrue() {
+ return true;
+ }
+
+ return {
+ /**
+ * Fires the specified event by name.
+ *
+ * @method fire
+ * @param {String} name Name of the event to fire.
+ * @param {tinymce.Event/Object?} args Event arguments.
+ * @param {Boolean?} bubble True/false if the event is to be bubbled.
+ * @return {tinymce.Event} Event instance passed in converted into tinymce.Event instance.
+ * @example
+ * instance.fire('event', {...});
+ */
+ fire: function(name, args, bubble) {
+ var self = this, handlers, i, l, callback, parent;
+
+ name = name.toLowerCase();
+ args = args || {};
+ args.type = name;
+
+ // Setup target is there isn't one
+ if (!args.target) {
+ args.target = self;
+ }
+
+ // Add event delegation methods if they are missing
+ if (!args.preventDefault) {
+ // Add preventDefault method
+ args.preventDefault = function() {
+ args.isDefaultPrevented = returnTrue;
+ };
+
+ // Add stopPropagation
+ args.stopPropagation = function() {
+ args.isPropagationStopped = returnTrue;
+ };
+
+ // Add stopImmediatePropagation
+ args.stopImmediatePropagation = function() {
+ args.isImmediatePropagationStopped = returnTrue;
+ };
+
+ // Add event delegation states
+ args.isDefaultPrevented = returnFalse;
+ args.isPropagationStopped = returnFalse;
+ args.isImmediatePropagationStopped = returnFalse;
+ }
+
+ //console.log(name, args);
+
+ if (self[bindingsName]) {
+ handlers = self[bindingsName][name];
+
+ if (handlers) {
+ for (i = 0, l = handlers.length; i < l; i++) {
+ handlers[i] = callback = handlers[i];
+
+ // Stop immediate propagation if needed
+ if (args.isImmediatePropagationStopped()) {
+ break;
+ }
+
+ // If callback returns false then prevent default and stop all propagation
+ if (callback.call(self, args) === false) {
+ args.preventDefault();
+ return args;
+ }
+ }
+ }
+ }
+
+ // Bubble event up to parents
+ if (bubble !== false && self.parent) {
+ parent = self.parent();
+ while (parent && !args.isPropagationStopped()) {
+ parent.fire(name, args, false);
+ parent = parent.parent();
+ }
+ }
+
+ return args;
+ },
+
+ /**
+ * Binds an event listener to a specific event by name.
+ *
+ * @method on
+ * @param {String} name Event name or space separated list of events to bind.
+ * @param {callback} callback Callback to be executed when the event occurs.
+ * @return {Object} Current class instance.
+ * @example
+ * instance.on('event', function(e) {
+ * // Callback logic
+ * });
+ */
+ on: function(name, callback) {
+ var self = this, bindings, handlers, names, i;
+
+ if (callback === false) {
+ callback = function() {
+ return false;
+ };
+ }
+
+ if (callback) {
+ names = name.toLowerCase().split(' ');
+ i = names.length;
+ while (i--) {
+ name = names[i];
+
+ bindings = self[bindingsName];
+ if (!bindings) {
+ bindings = self[bindingsName] = {};
+ }
+
+ handlers = bindings[name];
+ if (!handlers) {
+ handlers = bindings[name] = [];
+ if (self.bindNative && nativeEvents[name]) {
+ self.bindNative(name);
+ }
+ }
+
+ handlers.push(callback);
+ }
+ }
+
+ return self;
+ },
+
+ /**
+ * Unbinds an event listener to a specific event by name.
+ *
+ * @method off
+ * @param {String?} name Name of the event to unbind.
+ * @param {callback?} callback Callback to unbind.
+ * @return {Object} Current class instance.
+ * @example
+ * // Unbind specific callback
+ * instance.off('event', handler);
+ *
+ * // Unbind all listeners by name
+ * instance.off('event');
+ *
+ * // Unbind all events
+ * instance.off();
+ */
+ off: function(name, callback) {
+ var self = this, i, bindings = self[bindingsName], handlers, bindingName, names, hi;
+
+ if (bindings) {
+ if (name) {
+ names = name.toLowerCase().split(' ');
+ i = names.length;
+ while (i--) {
+ name = names[i];
+ handlers = bindings[name];
+
+ // Unbind all handlers
+ if (!name) {
+ for (bindingName in bindings) {
+ bindings[name].length = 0;
+ }
+
+ return self;
+ }
+
+ if (handlers) {
+ // Unbind all by name
+ if (!callback) {
+ handlers.length = 0;
+ } else {
+ // Unbind specific ones
+ hi = handlers.length;
+ while (hi--) {
+ if (handlers[hi] === callback) {
+ handlers.splice(hi, 1);
+ }
+ }
+ }
+
+ if (!handlers.length && self.unbindNative && nativeEvents[name]) {
+ self.unbindNative(name);
+ delete bindings[name];
+ }
+ }
+ }
+ } else {
+ if (self.unbindNative) {
+ for (name in bindings) {
+ self.unbindNative(name);
+ }
+ }
+
+ self[bindingsName] = [];
+ }
+ }
+
+ return self;
+ },
+
+ hasEventListeners: function(name) {
+ var bindings = this[bindingsName];
+
+ name = name.toLowerCase();
+
+ return !(!bindings || !bindings[name] || bindings[name].length === 0);
+ }
+ };
+});
+
+// Included from: js/tinymce/classes/Shortcuts.js
+
+/**
+ * Shortcuts.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Contains all logic for handling of keyboard shortcuts.
+ */
+define("tinymce/Shortcuts", [
+ "tinymce/util/Tools",
+ "tinymce/Env"
+], function(Tools, Env) {
+ var each = Tools.each, explode = Tools.explode;
+
+ var keyCodeLookup = {
+ "f9": 120,
+ "f10": 121,
+ "f11": 122
+ };
+
+ return function(editor) {
+ var self = this, shortcuts = {};
+
+ editor.on('keyup keypress keydown', function(e) {
+ if (e.altKey || e.ctrlKey || e.metaKey) {
+ each(shortcuts, function(shortcut) {
+ var ctrlKey = Env.mac ? e.metaKey : e.ctrlKey;
+
+ if (shortcut.ctrl != ctrlKey || shortcut.alt != e.altKey || shortcut.shift != e.shiftKey) {
+ return;
+ }
+
+ if (e.keyCode == shortcut.keyCode || (e.charCode && e.charCode == shortcut.charCode)) {
+ e.preventDefault();
+
+ if (e.type == "keydown") {
+ shortcut.func.call(shortcut.scope);
+ }
+
+ return true;
+ }
+ });
+ }
+ });
+
+ /**
+ * Adds a keyboard shortcut for some command or function.
+ *
+ * @method addShortcut
+ * @param {String} pattern Shortcut pattern. Like for example: ctrl+alt+o.
+ * @param {String} desc Text description for the command.
+ * @param {String/Function} cmdFunc Command name string or function to execute when the key is pressed.
+ * @param {Object} sc Optional scope to execute the function in.
+ * @return {Boolean} true/false state if the shortcut was added or not.
+ */
+ self.add = function(pattern, desc, cmdFunc, scope) {
+ var cmd;
+
+ cmd = cmdFunc;
+
+ if (typeof(cmdFunc) === 'string') {
+ cmdFunc = function() {
+ editor.execCommand(cmd, false, null);
+ };
+ } else if (Tools.isArray(cmd)) {
+ cmdFunc = function() {
+ editor.execCommand(cmd[0], cmd[1], cmd[2]);
+ };
+ }
+
+ each(explode(pattern.toLowerCase()), function(pattern) {
+ var shortcut = {
+ func: cmdFunc,
+ scope: scope || editor,
+ desc: editor.translate(desc),
+ alt: false,
+ ctrl: false,
+ shift: false
+ };
+
+ each(explode(pattern, '+'), function(value) {
+ switch (value) {
+ case 'alt':
+ case 'ctrl':
+ case 'shift':
+ shortcut[value] = true;
+ break;
+
+ default:
+ shortcut.charCode = value.charCodeAt(0);
+ shortcut.keyCode = keyCodeLookup[value] || value.toUpperCase().charCodeAt(0);
+ }
+ });
+
+ shortcuts[
+ (shortcut.ctrl ? 'ctrl' : '') + ',' +
+ (shortcut.alt ? 'alt' : '') + ',' +
+ (shortcut.shift ? 'shift' : '') + ',' +
+ shortcut.keyCode
+ ] = shortcut;
+ });
+
+ return true;
+ };
+ };
+});
+
+// Included from: js/tinymce/classes/Editor.js
+
+/**
+ * Editor.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint scripturl:true */
+
+/**
+ * Include the base event class documentation.
+ *
+ * @include ../../../tools/docs/tinymce.Event.js
+ */
+
+/**
+ * This class contains the core logic for a TinyMCE editor.
+ *
+ * @class tinymce.Editor
+ * @mixes tinymce.util.Observable
+ * @example
+ * // Add a class to all paragraphs in the editor.
+ * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass');
+ *
+ * // Gets the current editors selection as text
+ * tinymce.activeEditor.selection.getContent({format: 'text'});
+ *
+ * // Creates a new editor instance
+ * var ed = new tinymce.Editor('textareaid', {
+ * some_setting: 1
+ * }, tinymce.EditorManager);
+ *
+ * // Select each item the user clicks on
+ * ed.on('click', function(e) {
+ * ed.selection.select(e.target);
+ * });
+ *
+ * ed.render();
+ */
+define("tinymce/Editor", [
+ "tinymce/dom/DOMUtils",
+ "tinymce/AddOnManager",
+ "tinymce/html/Node",
+ "tinymce/dom/Serializer",
+ "tinymce/html/Serializer",
+ "tinymce/dom/Selection",
+ "tinymce/Formatter",
+ "tinymce/UndoManager",
+ "tinymce/EnterKey",
+ "tinymce/ForceBlocks",
+ "tinymce/EditorCommands",
+ "tinymce/util/URI",
+ "tinymce/dom/ScriptLoader",
+ "tinymce/dom/EventUtils",
+ "tinymce/WindowManager",
+ "tinymce/html/Schema",
+ "tinymce/html/DomParser",
+ "tinymce/util/Quirks",
+ "tinymce/Env",
+ "tinymce/util/Tools",
+ "tinymce/util/Observable",
+ "tinymce/Shortcuts"
+], function(
+ DOMUtils, AddOnManager, Node, DomSerializer, Serializer,
+ Selection, Formatter, UndoManager, EnterKey, ForceBlocks, EditorCommands,
+ URI, ScriptLoader, EventUtils, WindowManager,
+ Schema, DomParser, Quirks, Env, Tools, Observable, Shortcuts
+) {
+ // Shorten these names
+ var DOM = DOMUtils.DOM, ThemeManager = AddOnManager.ThemeManager, PluginManager = AddOnManager.PluginManager;
+ var extend = Tools.extend, each = Tools.each, explode = Tools.explode;
+ var inArray = Tools.inArray, trim = Tools.trim, resolve = Tools.resolve;
+ var Event = EventUtils.Event;
+ var isGecko = Env.gecko, ie = Env.ie;
+
+ function getEventTarget(editor, eventName) {
+ if (eventName == 'selectionchange' || eventName == 'drop') {
+ return editor.getDoc();
+ }
+
+ // Need to bind mousedown/mouseup etc to document not body in iframe mode
+ // Since the user might click on the HTML element not the BODY
+ if (!editor.inline && /^mouse|click|contextmenu/.test(eventName)) {
+ return editor.getDoc();
+ }
+
+ return editor.getBody();
+ }
+
+ /**
+ * Include documentation for all the events.
+ *
+ * @include ../../../tools/docs/tinymce.Editor.js
+ */
+
+ /**
+ * Constructs a editor instance by id.
+ *
+ * @constructor
+ * @method Editor
+ * @param {String} id Unique id for the editor.
+ * @param {Object} settings Settings for the editor.
+ * @param {tinymce.EditorManager} editorManager EditorManager instance.
+ * @author Moxiecode
+ */
+ function Editor(id, settings, editorManager) {
+ var self = this, documentBaseUrl, baseUri;
+
+ documentBaseUrl = self.documentBaseUrl = editorManager.documentBaseURL;
+ baseUri = editorManager.baseURI;
+
+ /**
+ * Name/value collection with editor settings.
+ *
+ * @property settings
+ * @type Object
+ * @example
+ * // Get the value of the theme setting
+ * tinymce.activeEditor.windowManager.alert("You are using the " + tinymce.activeEditor.settings.theme + " theme");
+ */
+ self.settings = settings = extend({
+ id: id,
+ theme: 'modern',
+ delta_width: 0,
+ delta_height: 0,
+ popup_css: '',
+ plugins: '',
+ document_base_url: documentBaseUrl,
+ add_form_submit_trigger: true,
+ submit_patch: true,
+ add_unload_trigger: true,
+ convert_urls: true,
+ relative_urls: true,
+ remove_script_host: true,
+ object_resizing: true,
+ doctype: '<!DOCTYPE html>',
+ visual: true,
+ font_size_style_values: 'xx-small,x-small,small,medium,large,x-large,xx-large',
+
+ // See: http://www.w3.org/TR/CSS2/fonts.html#propdef-font-size
+ font_size_legacy_values: 'xx-small,small,medium,large,x-large,xx-large,300%',
+ forced_root_block: 'p',
+ hidden_input: true,
+ padd_empty_editor: true,
+ render_ui: true,
+ indentation: '30px',
+ inline_styles: true,
+ convert_fonts_to_spans: true,
+ indent: 'simple',
+ indent_before: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,' +
+ 'tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist',
+ indent_after: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,' +
+ 'tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist',
+ validate: true,
+ entity_encoding: 'named',
+ url_converter: self.convertURL,
+ url_converter_scope: self,
+ ie7_compat: true
+ }, settings);
+
+ AddOnManager.language = settings.language || 'en';
+ AddOnManager.languageLoad = settings.language_load;
+
+ AddOnManager.baseURL = editorManager.baseURL;
+
+ /**
+ * Editor instance id, normally the same as the div/textarea that was replaced.
+ *
+ * @property id
+ * @type String
+ */
+ self.id = settings.id = id;
+
+ /**
+ * State to force the editor to return false on a isDirty call.
+ *
+ * @property isNotDirty
+ * @type Boolean
+ * @example
+ * function ajaxSave() {
+ * var ed = tinymce.get('elm1');
+ *
+ * // Save contents using some XHR call
+ * alert(ed.getContent());
+ *
+ * ed.isNotDirty = true; // Force not dirty state
+ * }
+ */
+ self.isNotDirty = true;
+
+ /**
+ * Name/Value object containting plugin instances.
+ *
+ * @property plugins
+ * @type Object
+ * @example
+ * // Execute a method inside a plugin directly
+ * tinymce.activeEditor.plugins.someplugin.someMethod();
+ */
+ self.plugins = {};
+
+ /**
+ * URI object to document configured for the TinyMCE instance.
+ *
+ * @property documentBaseURI
+ * @type tinymce.util.URI
+ * @example
+ * // Get relative URL from the location of document_base_url
+ * tinymce.activeEditor.documentBaseURI.toRelative('/somedir/somefile.htm');
+ *
+ * // Get absolute URL from the location of document_base_url
+ * tinymce.activeEditor.documentBaseURI.toAbsolute('somefile.htm');
+ */
+ self.documentBaseURI = new URI(settings.document_base_url || documentBaseUrl, {
+ base_uri: baseUri
+ });
+
+ /**
+ * URI object to current document that holds the TinyMCE editor instance.
+ *
+ * @property baseURI
+ * @type tinymce.util.URI
+ * @example
+ * // Get relative URL from the location of the API
+ * tinymce.activeEditor.baseURI.toRelative('/somedir/somefile.htm');
+ *
+ * // Get absolute URL from the location of the API
+ * tinymce.activeEditor.baseURI.toAbsolute('somefile.htm');
+ */
+ self.baseURI = baseUri;
+
+ /**
+ * Array with CSS files to load into the iframe.
+ *
+ * @property contentCSS
+ * @type Array
+ */
+ self.contentCSS = [];
+
+ /**
+ * Array of CSS styles to add to head of document when the editor loads.
+ *
+ * @property contentStyles
+ * @type Array
+ */
+ self.contentStyles = [];
+
+ // Creates all events like onClick, onSetContent etc see Editor.Events.js for the actual logic
+ self.shortcuts = new Shortcuts(self);
+
+ // Internal command handler objects
+ self.execCommands = {};
+ self.queryStateCommands = {};
+ self.queryValueCommands = {};
+ self.loadedCSS = {};
+
+ self.suffix = editorManager.suffix;
+ self.editorManager = editorManager;
+ self.inline = settings.inline;
+
+ // Call setup
+ self.execCallback('setup', self);
+ editorManager.fire('SetupEditor', self);
+ }
+
+ Editor.prototype = {
+ /**
+ * Renderes the editor/adds it to the page.
+ *
+ * @method render
+ */
+ render: function() {
+ var self = this, settings = self.settings, id = self.id, suffix = self.suffix;
+
+ function readyHandler() {
+ DOM.unbind(window, 'ready', readyHandler);
+ self.render();
+ }
+
+ // Page is not loaded yet, wait for it
+ if (!Event.domLoaded) {
+ DOM.bind(window, 'ready', readyHandler);
+ return;
+ }
+
+ // Element not found, then skip initialization
+ if (!self.getElement()) {
+ return;
+ }
+
+ // No editable support old iOS versions etc
+ if (!Env.contentEditable) {
+ return;
+ }
+
+ // Hide target element early to prevent content flashing
+ if (!settings.inline) {
+ self.orgVisibility = self.getElement().style.visibility;
+ self.getElement().style.visibility = 'hidden';
+ } else {
+ self.inline = true;
+ }
+
+ var form = self.getElement().form || DOM.getParent(id, 'form');
+ if (form) {
+ self.formElement = form;
+
+ // Add hidden input for non input elements inside form elements
+ if (settings.hidden_input && !/TEXTAREA|INPUT/i.test(self.getElement().nodeName)) {
+ DOM.insertAfter(DOM.create('input', {type: 'hidden', name: id}), id);
+ self.hasHiddenInput = true;
+ }
+
+ // Pass submit/reset from form to editor instance
+ self.formEventDelegate = function(e) {
+ self.fire(e.type, e);
+ };
+
+ DOM.bind(form, 'submit reset', self.formEventDelegate);
+
+ // Reset contents in editor when the form is reset
+ self.on('reset', function() {
+ self.setContent(self.startContent, {format: 'raw'});
+ });
+
+ // Check page uses id="submit" or name="submit" for it's submit button
+ if (settings.submit_patch && !form.submit.nodeType && !form.submit.length && !form._mceOldSubmit) {
+ form._mceOldSubmit = form.submit;
+ form.submit = function() {
+ self.editorManager.triggerSave();
+ self.isNotDirty = true;
+
+ return form._mceOldSubmit(form);
+ };
+ }
+ }
+
+ /**
+ * Window manager reference, use this to open new windows and dialogs.
+ *
+ * @property windowManager
+ * @type tinymce.WindowManager
+ * @example
+ * // Shows an alert message
+ * tinymce.activeEditor.windowManager.alert('Hello world!');
+ *
+ * // Opens a new dialog with the file.htm file and the size 320x240
+ * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog.
+ * tinymce.activeEditor.windowManager.open({
+ * url: 'file.htm',
+ * width: 320,
+ * height: 240
+ * }, {
+ * custom_param: 1
+ * });
+ */
+ self.windowManager = new WindowManager(self);
+
+ if (settings.encoding == 'xml') {
+ self.on('GetContent', function(e) {
+ if (e.save) {
+ e.content = DOM.encode(e.content);
+ }
+ });
+ }
+
+ if (settings.add_form_submit_trigger) {
+ self.on('submit', function() {
+ if (self.initialized) {
+ self.save();
+ }
+ });
+ }
+
+ if (settings.add_unload_trigger) {
+ self._beforeUnload = function() {
+ if (self.initialized && !self.destroyed && !self.isHidden()) {
+ self.save({format: 'raw', no_events: true, set_dirty: false});
+ }
+ };
+
+ self.editorManager.on('BeforeUnload', self._beforeUnload);
+ }
+
+ // Load scripts
+ function loadScripts() {
+ var scriptLoader = ScriptLoader.ScriptLoader;
+
+ if (settings.language && settings.language != 'en') {
+ settings.language_url = self.editorManager.baseURL + '/langs/' + settings.language + '.js';
+ }
+
+ if (settings.language_url) {
+ scriptLoader.add(settings.language_url);
+ }
+
+ if (settings.theme && typeof settings.theme != "function" &&
+ settings.theme.charAt(0) != '-' && !ThemeManager.urls[settings.theme]) {
+ var themeUrl = settings.theme_url;
+
+ if (themeUrl) {
+ themeUrl = self.documentBaseURI.toAbsolute(themeUrl);
+ } else {
+ themeUrl = 'themes/' + settings.theme + '/theme' + suffix + '.js';
+ }
+
+ ThemeManager.load(settings.theme, themeUrl);
+ }
+
+ if (Tools.isArray(settings.plugins)) {
+ settings.plugins = settings.plugins.join(' ');
+ }
+
+ each(settings.external_plugins, function(url, name) {
+ PluginManager.load(name, url);
+ settings.plugins += ' ' + name;
+ });
+
+ each(settings.plugins.split(/[ ,]/), function(plugin) {
+ plugin = trim(plugin);
+
+ if (plugin && !PluginManager.urls[plugin]) {
+ if (plugin.charAt(0) == '-') {
+ plugin = plugin.substr(1, plugin.length);
+
+ var dependencies = PluginManager.dependencies(plugin);
+
+ each(dependencies, function(dep) {
+ var defaultSettings = {
+ prefix:'plugins/',
+ resource: dep,
+ suffix:'/plugin' + suffix + '.js'
+ };
+
+ dep = PluginManager.createUrl(defaultSettings, dep);
+ PluginManager.load(dep.resource, dep);
+ });
+ } else {
+ PluginManager.load(plugin, {
+ prefix: 'plugins/',
+ resource: plugin,
+ suffix: '/plugin' + suffix + '.js'
+ });
+ }
+ }
+ });
+
+ scriptLoader.loadQueue(function() {
+ if (!self.removed) {
+ self.init();
+ }
+ });
+ }
+
+ loadScripts();
+ },
+
+ /**
+ * Initializes the editor this will be called automatically when
+ * all plugins/themes and language packs are loaded by the rendered method.
+ * This method will setup the iframe and create the theme and plugin instances.
+ *
+ * @method init
+ */
+ init: function() {
+ var self = this, settings = self.settings, elm = self.getElement();
+ var w, h, minHeight, n, o, url, bodyId, bodyClass, re, i, initializedPlugins = [];
+
+ self.rtl = this.editorManager.i18n.rtl;
+ self.editorManager.add(self);
+
+ settings.aria_label = settings.aria_label || DOM.getAttrib(elm, 'aria-label', self.getLang('aria.rich_text_area'));
+
+ /**
+ * Reference to the theme instance that was used to generate the UI.
+ *
+ * @property theme
+ * @type tinymce.Theme
+ * @example
+ * // Executes a method on the theme directly
+ * tinymce.activeEditor.theme.someMethod();
+ */
+ if (settings.theme) {
+ if (typeof settings.theme != "function") {
+ settings.theme = settings.theme.replace(/-/, '');
+ o = ThemeManager.get(settings.theme);
+ self.theme = new o(self, ThemeManager.urls[settings.theme]);
+
+ if (self.theme.init) {
+ self.theme.init(self, ThemeManager.urls[settings.theme] || self.documentBaseUrl.replace(/\/$/, ''));
+ }
+ } else {
+ self.theme = settings.theme;
+ }
+ }
+
+ function initPlugin(plugin) {
+ var constr = PluginManager.get(plugin), url, pluginInstance;
+
+ url = PluginManager.urls[plugin] || self.documentBaseUrl.replace(/\/$/, '');
+ plugin = trim(plugin);
+ if (constr && inArray(initializedPlugins, plugin) === -1) {
+ each(PluginManager.dependencies(plugin), function(dep){
+ initPlugin(dep);
+ });
+
+ pluginInstance = new constr(self, url);
+
+ self.plugins[plugin] = pluginInstance;
+
+ if (pluginInstance.init) {
+ pluginInstance.init(self, url);
+ initializedPlugins.push(plugin);
+ }
+ }
+ }
+
+ // Create all plugins
+ each(settings.plugins.replace(/\-/g, '').split(/[ ,]/), initPlugin);
+
+ // Measure box
+ if (settings.render_ui && self.theme) {
+ self.orgDisplay = elm.style.display;
+
+ if (typeof settings.theme != "function") {
+ w = settings.width || elm.style.width || elm.offsetWidth;
+ h = settings.height || elm.style.height || elm.offsetHeight;
+ minHeight = settings.min_height || 100;
+ re = /^[0-9\.]+(|px)$/i;
+
+ if (re.test('' + w)) {
+ w = Math.max(parseInt(w, 10) + (o.deltaWidth || 0), 100);
+ }
+
+ if (re.test('' + h)) {
+ h = Math.max(parseInt(h, 10) + (o.deltaHeight || 0), minHeight);
+ }
+
+ // Render UI
+ o = self.theme.renderUI({
+ targetNode: elm,
+ width: w,
+ height: h,
+ deltaWidth: settings.delta_width,
+ deltaHeight: settings.delta_height
+ });
+
+ // Resize editor
+ if (!settings.content_editable) {
+ DOM.setStyles(o.sizeContainer || o.editorContainer, {
+ wi2dth: w,
+ // TODO: Fix this
+ h2eight: h
+ });
+
+ h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : '');
+ if (h < minHeight) {
+ h = minHeight;
+ }
+ }
+ } else {
+ o = settings.theme(self, elm);
+
+ // Convert element type to id:s
+ if (o.editorContainer.nodeType) {
+ o.editorContainer = o.editorContainer.id = o.editorContainer.id || self.id + "_parent";
+ }
+
+ // Convert element type to id:s
+ if (o.iframeContainer.nodeType) {
+ o.iframeContainer = o.iframeContainer.id = o.iframeContainer.id || self.id + "_iframecontainer";
+ }
+
+ // Use specified iframe height or the targets offsetHeight
+ h = o.iframeHeight || elm.offsetHeight;
+ }
+
+ self.editorContainer = o.editorContainer;
+ }
+
+ // Load specified content CSS last
+ if (settings.content_css) {
+ each(explode(settings.content_css), function(u) {
+ self.contentCSS.push(self.documentBaseURI.toAbsolute(u));
+ });
+ }
+
+ // Load specified content CSS last
+ if (settings.content_style) {
+ self.contentStyles.push(settings.content_style);
+ }
+
+ // Content editable mode ends here
+ if (settings.content_editable) {
+ elm = n = o = null; // Fix IE leak
+ return self.initContentBody();
+ }
+
+ self.iframeHTML = settings.doctype + '<html><head>';
+
+ // We only need to override paths if we have to
+ // IE has a bug where it remove site absolute urls to relative ones if this is specified
+ if (settings.document_base_url != self.documentBaseUrl) {
+ self.iframeHTML += '<base href="' + self.documentBaseURI.getURI() + '" />';
+ }
+
+ // IE8 doesn't support carets behind images setting ie7_compat would force IE8+ to run in IE7 compat mode.
+ if (!Env.caretAfter && settings.ie7_compat) {
+ self.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=7" />';
+ }
+
+ self.iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
+
+ // Load the CSS by injecting them into the HTML this will reduce "flicker"
+ for (i = 0; i < self.contentCSS.length; i++) {
+ var cssUrl = self.contentCSS[i];
+ self.iframeHTML += '<link type="text/css" rel="stylesheet" href="' + cssUrl + '" />';
+ self.loadedCSS[cssUrl] = true;
+ }
+
+ bodyId = settings.body_id || 'tinymce';
+ if (bodyId.indexOf('=') != -1) {
+ bodyId = self.getParam('body_id', '', 'hash');
+ bodyId = bodyId[self.id] || bodyId;
+ }
+
+ bodyClass = settings.body_class || '';
+ if (bodyClass.indexOf('=') != -1) {
+ bodyClass = self.getParam('body_class', '', 'hash');
+ bodyClass = bodyClass[self.id] || '';
+ }
+
+ self.iframeHTML += '</head><body id="' + bodyId + '" class="mce-content-body ' + bodyClass + '" ' +
+ 'onload="window.parent.tinymce.get(\'' + self.id + '\').fire(\'load\');"><br></body></html>';
+
+ var domainRelaxUrl = 'javascript:(function(){'+
+ 'document.open();document.domain="' + document.domain + '";' +
+ 'var ed = window.parent.tinymce.get("' + self.id + '");document.write(ed.iframeHTML);' +
+ 'document.close();ed.initContentBody(true);})()';
+
+ // Domain relaxing is required since the user has messed around with document.domain
+ if (document.domain != location.hostname) {
+ url = domainRelaxUrl;
+ }
+
+ // Create iframe
+ // TODO: ACC add the appropriate description on this.
+ n = DOM.add(o.iframeContainer, 'iframe', {
+ id: self.id + "_ifr",
+ src: url || 'javascript:""', // Workaround for HTTPS warning in IE6/7
+ frameBorder: '0',
+ allowTransparency: "true",
+ title: self.editorManager.translate(
+ "Rich Text Area. Press ALT-F9 for menu. " +
+ "Press ALT-F10 for toolbar. Press ALT-0 for help"
+ ),
+ style: {
+ width: '100%',
+ height: h,
+ display: 'block' // Important for Gecko to render the iframe correctly
+ }
+ });
+
+ // Try accessing the document this will fail on IE when document.domain is set to the same as location.hostname
+ // Then we have to force domain relaxing using the domainRelaxUrl approach very ugly!!
+ if (ie) {
+ try {
+ self.getDoc();
+ } catch (e) {
+ n.src = url = domainRelaxUrl;
+ }
+ }
+
+ self.contentAreaContainer = o.iframeContainer;
+
+ if (o.editorContainer) {
+ DOM.get(o.editorContainer).style.display = self.orgDisplay;
+ }
+
+ DOM.get(self.id).style.display = 'none';
+ DOM.setAttrib(self.id, 'aria-hidden', true);
+
+ if (!url) {
+ self.initContentBody();
+ }
+
+ elm = n = o = null; // Cleanup
+ },
+
+ /**
+ * This method get called by the init method ones the iframe is loaded.
+ * It will fill the iframe with contents, setups DOM and selection objects for the iframe.
+ *
+ * @method initContentBody
+ * @private
+ */
+ initContentBody: function(skipWrite) {
+ var self = this, settings = self.settings, targetElm = DOM.get(self.id), doc = self.getDoc(), body, contentCssText;
+
+ // Restore visibility on target element
+ if (!settings.inline) {
+ self.getElement().style.visibility = self.orgVisibility;
+ }
+
+ // Setup iframe body
+ if (!skipWrite && !settings.content_editable) {
+ doc.open();
+ doc.write(self.iframeHTML);
+ doc.close();
+ }
+
+ if (settings.content_editable) {
+ self.on('remove', function() {
+ var body = this.getBody();
+
+ DOM.removeClass(body, 'mce-content-body');
+ DOM.removeClass(body, 'mce-edit-focus');
+ DOM.setAttrib(body, 'tabIndex', null);
+ DOM.setAttrib(body, 'contentEditable', null);
+ });
+
+ DOM.addClass(targetElm, 'mce-content-body');
+ targetElm.tabIndex = -1;
+ self.contentDocument = doc = settings.content_document || document;
+ self.contentWindow = settings.content_window || window;
+ self.bodyElement = targetElm;
+
+ // Prevent leak in IE
+ settings.content_document = settings.content_window = null;
+
+ // TODO: Fix this
+ settings.root_name = targetElm.nodeName.toLowerCase();
+ }
+
+ // It will not steal focus while setting contentEditable
+ body = self.getBody();
+ body.disabled = true;
+
+ if (!settings.readonly) {
+ if (self.inline && DOM.getStyle(body, 'position', true) == 'static') {
+ body.style.position = 'relative';
+ }
+
+ body.contentEditable = self.getParam('content_editable_state', true);
+ }
+
+ body.disabled = false;
+
+ /**
+ * Schema instance, enables you to validate elements and it's children.
+ *
+ * @property schema
+ * @type tinymce.html.Schema
+ */
+ self.schema = new Schema(settings);
+
+ /**
+ * DOM instance for the editor.
+ *
+ * @property dom
+ * @type tinymce.dom.DOMUtils
+ * @example
+ * // Adds a class to all paragraphs within the editor
+ * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass');
+ */
+ self.dom = new DOMUtils(doc, {
+ keep_values: true,
+ url_converter: self.convertURL,
+ url_converter_scope: self,
+ hex_colors: settings.force_hex_style_colors,
+ class_filter: settings.class_filter,
+ update_styles: true,
+ root_element: settings.content_editable ? self.id : null,
+ collect: settings.content_editable,
+ schema: self.schema,
+ onSetAttrib: function(e) {
+ self.fire('SetAttrib', e);
+ }
+ });
+
+ /**
+ * HTML parser will be used when contents is inserted into the editor.
+ *
+ * @property parser
+ * @type tinymce.html.DomParser
+ */
+ self.parser = new DomParser(settings, self.schema);
+
+ // Convert src and href into data-mce-src, data-mce-href and data-mce-style
+ self.parser.addAttributeFilter('src,href,style', function(nodes, name) {
+ var i = nodes.length, node, dom = self.dom, value, internalName;
+
+ while (i--) {
+ node = nodes[i];
+ value = node.attr(name);
+ internalName = 'data-mce-' + name;
+
+ // Add internal attribute if we need to we don't on a refresh of the document
+ if (!node.attributes.map[internalName]) {
+ if (name === "style") {
+ node.attr(internalName, dom.serializeStyle(dom.parseStyle(value), node.name));
+ } else {
+ node.attr(internalName, self.convertURL(value, name, node.name));
+ }
+ }
+ }
+ });
+
+ // Keep scripts from executing
+ self.parser.addNodeFilter('script', function(nodes) {
+ var i = nodes.length, node;
+
+ while (i--) {
+ node = nodes[i];
+ node.attr('type', 'mce-' + (node.attr('type') || 'text/javascript'));
+ }
+ });
+
+ self.parser.addNodeFilter('#cdata', function(nodes) {
+ var i = nodes.length, node;
+
+ while (i--) {
+ node = nodes[i];
+ node.type = 8;
+ node.name = '#comment';
+ node.value = '[CDATA[' + node.value + ']]';
+ }
+ });
+
+ self.parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function(nodes) {
+ var i = nodes.length, node, nonEmptyElements = self.schema.getNonEmptyElements();
+
+ while (i--) {
+ node = nodes[i];
+
+ if (node.isEmpty(nonEmptyElements)) {
+ node.empty().append(new Node('br', 1)).shortEnded = true;
+ }
+ }
+ });
+
+ /**
+ * DOM serializer for the editor. Will be used when contents is extracted from the editor.
+ *
+ * @property serializer
+ * @type tinymce.dom.Serializer
+ * @example
+ * // Serializes the first paragraph in the editor into a string
+ * tinymce.activeEditor.serializer.serialize(tinymce.activeEditor.dom.select('p')[0]);
+ */
+ self.serializer = new DomSerializer(settings, self);
+
+ /**
+ * Selection instance for the editor.
+ *
+ * @property selection
+ * @type tinymce.dom.Selection
+ * @example
+ * // Sets some contents to the current selection in the editor
+ * tinymce.activeEditor.selection.setContent('Some contents');
+ *
+ * // Gets the current selection
+ * alert(tinymce.activeEditor.selection.getContent());
+ *
+ * // Selects the first paragraph found
+ * tinymce.activeEditor.selection.select(tinymce.activeEditor.dom.select('p')[0]);
+ */
+ self.selection = new Selection(self.dom, self.getWin(), self.serializer, self);
+
+ /**
+ * Formatter instance.
+ *
+ * @property formatter
+ * @type tinymce.Formatter
+ */
+ self.formatter = new Formatter(self);
+
+ /**
+ * Undo manager instance, responsible for handling undo levels.
+ *
+ * @property undoManager
+ * @type tinymce.UndoManager
+ * @example
+ * // Undoes the last modification to the editor
+ * tinymce.activeEditor.undoManager.undo();
+ */
+ self.undoManager = new UndoManager(self);
+
+ self.forceBlocks = new ForceBlocks(self);
+ self.enterKey = new EnterKey(self);
+ self.editorCommands = new EditorCommands(self);
+
+ self.fire('PreInit');
+
+ if (!settings.browser_spellcheck && !settings.gecko_spellcheck) {
+ doc.body.spellcheck = false; // Gecko
+ DOM.setAttrib(body, "spellcheck", "false");
+ }
+
+ self.fire('PostRender');
+
+ self.quirks = Quirks(self);
+
+ if (settings.directionality) {
+ body.dir = settings.directionality;
+ }
+
+ if (settings.nowrap) {
+ body.style.whiteSpace = "nowrap";
+ }
+
+ if (settings.protect) {
+ self.on('BeforeSetContent', function(e) {
+ each(settings.protect, function(pattern) {
+ e.content = e.content.replace(pattern, function(str) {
+ return '<!--mce:protected ' + escape(str) + '-->';
+ });
+ });
+ });
+ }
+
+ self.on('SetContent', function() {
+ self.addVisual(self.getBody());
+ });
+
+ // Remove empty contents
+ if (settings.padd_empty_editor) {
+ self.on('PostProcess', function(e) {
+ e.content = e.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/, '');
+ });
+ }
+
+ self.load({initial: true, format: 'html'});
+ self.startContent = self.getContent({format: 'raw'});
+
+ /**
+ * Is set to true after the editor instance has been initialized
+ *
+ * @property initialized
+ * @type Boolean
+ * @example
+ * function isEditorInitialized(editor) {
+ * return editor && editor.initialized;
+ * }
+ */
+ self.initialized = true;
+
+ each(self._pendingNativeEvents, function(name) {
+ self.dom.bind(getEventTarget(self, name), name, function(e) {
+ self.fire(e.type, e);
+ });
+ });
+
+ self.fire('init');
+ self.focus(true);
+ self.nodeChanged({initial: true});
+ self.execCallback('init_instance_callback', self);
+
+ // Add editor specific CSS styles
+ if (self.contentStyles.length > 0) {
+ contentCssText = '';
+
+ each(self.contentStyles, function(style) {
+ contentCssText += style + "\r\n";
+ });
+
+ self.dom.addStyle(contentCssText);
+ }
+
+ // Load specified content CSS last
+ each(self.contentCSS, function(cssUrl) {
+ if (!self.loadedCSS[cssUrl]) {
+ self.dom.loadCSS(cssUrl);
+ self.loadedCSS[cssUrl] = true;
+ }
+ });
+
+ // Handle auto focus
+ if (settings.auto_focus) {
+ setTimeout(function () {
+ var ed = self.editorManager.get(settings.auto_focus);
+
+ ed.selection.select(ed.getBody(), 1);
+ ed.selection.collapse(1);
+ ed.getBody().focus();
+ ed.getWin().focus();
+ }, 100);
+ }
+
+ // Clean up references for IE
+ targetElm = doc = body = null;
+ },
+
+ /**
+ * Focuses/activates the editor. This will set this editor as the activeEditor in the tinymce collection
+ * it will also place DOM focus inside the editor.
+ *
+ * @method focus
+ * @param {Boolean} skip_focus Skip DOM focus. Just set is as the active editor.
+ */
+ focus: function(skip_focus) {
+ var oed, self = this, selection = self.selection, contentEditable = self.settings.content_editable, rng;
+ var controlElm, doc = self.getDoc(), body;
+
+ if (!skip_focus) {
+ // Get selected control element
+ rng = selection.getRng();
+ if (rng.item) {
+ controlElm = rng.item(0);
+ }
+
+ self._refreshContentEditable();
+
+ // Focus the window iframe
+ if (!contentEditable) {
+ // WebKit needs this call to fire focusin event properly see #5948
+ // But Opera pre Blink engine will produce an empty selection so skip Opera
+ if (!Env.opera) {
+ self.getBody().focus();
+ }
+
+ self.getWin().focus();
+ }
+
+ // Focus the body as well since it's contentEditable
+ if (isGecko || contentEditable) {
+ body = self.getBody();
+
+ // Check for setActive since it doesn't scroll to the element
+ if (body.setActive && Env.ie < 11) {
+ body.setActive();
+ } else {
+ body.focus();
+ }
+
+ if (contentEditable) {
+ selection.normalize();
+ }
+ }
+
+ // Restore selected control element
+ // This is needed when for example an image is selected within a
+ // layer a call to focus will then remove the control selection
+ if (controlElm && controlElm.ownerDocument == doc) {
+ rng = doc.body.createControlRange();
+ rng.addElement(controlElm);
+ rng.select();
+ }
+ }
+
+ if (self.editorManager.activeEditor != self) {
+ if ((oed = self.editorManager.activeEditor)) {
+ oed.fire('deactivate', {relatedTarget: self});
+ }
+
+ self.fire('activate', {relatedTarget: oed});
+ }
+
+ self.editorManager.activeEditor = self;
+ },
+
+ /**
+ * Executes a legacy callback. This method is useful to call old 2.x option callbacks.
+ * There new event model is a better way to add callback so this method might be removed in the future.
+ *
+ * @method execCallback
+ * @param {String} name Name of the callback to execute.
+ * @return {Object} Return value passed from callback function.
+ */
+ execCallback: function(name) {
+ var self = this, callback = self.settings[name], scope;
+
+ if (!callback) {
+ return;
+ }
+
+ // Look through lookup
+ if (self.callbackLookup && (scope = self.callbackLookup[name])) {
+ callback = scope.func;
+ scope = scope.scope;
+ }
+
+ if (typeof(callback) === 'string') {
+ scope = callback.replace(/\.\w+$/, '');
+ scope = scope ? resolve(scope) : 0;
+ callback = resolve(callback);
+ self.callbackLookup = self.callbackLookup || {};
+ self.callbackLookup[name] = {func: callback, scope: scope};
+ }
+
+ return callback.apply(scope || self, Array.prototype.slice.call(arguments, 1));
+ },
+
+ /**
+ * Translates the specified string by replacing variables with language pack items it will also check if there is
+ * a key mathcin the input.
+ *
+ * @method translate
+ * @param {String} text String to translate by the language pack data.
+ * @return {String} Translated string.
+ */
+ translate: function(text) {
+ var lang = this.settings.language || 'en', i18n = this.editorManager.i18n;
+
+ if (!text) {
+ return '';
+ }
+
+ return i18n.data[lang + '.' + text] || text.replace(/\{\#([^\}]+)\}/g, function(a, b) {
+ return i18n.data[lang + '.' + b] || '{#' + b + '}';
+ });
+ },
+
+ /**
+ * Returns a language pack item by name/key.
+ *
+ * @method getLang
+ * @param {String} name Name/key to get from the language pack.
+ * @param {String} defaultVal Optional default value to retrive.
+ */
+ getLang: function(name, defaultVal) {
+ return (
+ this.editorManager.i18n.data[(this.settings.language || 'en') + '.' + name] ||
+ (defaultVal !== undefined ? defaultVal : '{#' + name + '}')
+ );
+ },
+
+ /**
+ * Returns a configuration parameter by name.
+ *
+ * @method getParam
+ * @param {String} name Configruation parameter to retrive.
+ * @param {String} defaultVal Optional default value to return.
+ * @param {String} type Optional type parameter.
+ * @return {String} Configuration parameter value or default value.
+ * @example
+ * // Returns a specific config value from the currently active editor
+ * var someval = tinymce.activeEditor.getParam('myvalue');
+ *
+ * // Returns a specific config value from a specific editor instance by id
+ * var someval2 = tinymce.get('my_editor').getParam('myvalue');
+ */
+ getParam: function(name, defaultVal, type) {
+ var value = name in this.settings ? this.settings[name] : defaultVal, output;
+
+ if (type === 'hash') {
+ output = {};
+
+ if (typeof(value) === 'string') {
+ each(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(','), function(value) {
+ value = value.split('=');
+
+ if (value.length > 1) {
+ output[trim(value[0])] = trim(value[1]);
+ } else {
+ output[trim(value[0])] = trim(value);
+ }
+ });
+ } else {
+ output = value;
+ }
+
+ return output;
+ }
+
+ return value;
+ },
+
+ /**
+ * Distpaches out a onNodeChange event to all observers. This method should be called when you
+ * need to update the UI states or element path etc.
+ *
+ * @method nodeChanged
+ */
+ nodeChanged: function() {
+ var self = this, selection = self.selection, node, parents, root;
+
+ // Fix for bug #1896577 it seems that this can not be fired while the editor is loading
+ if (self.initialized && !self.settings.disable_nodechange) {
+ // Get start node
+ root = self.getBody();
+ node = selection.getStart() || root;
+ node = ie && node.ownerDocument != self.getDoc() ? self.getBody() : node; // Fix for IE initial state
+
+ // Edge case for <p>|<img></p>
+ if (node.nodeName == 'IMG' && selection.isCollapsed()) {
+ node = node.parentNode;
+ }
+
+ // Get parents and add them to object
+ parents = [];
+ self.dom.getParent(node, function(node) {
+ if (node === root) {
+ return true;
+ }
+
+ parents.push(node);
+ });
+
+ self.fire('NodeChange', {element: node, parents: parents});
+ }
+ },
+
+ /**
+ * Adds a button that later gets created by the ControlManager. This is a shorter and easier method
+ * of adding buttons without the need to deal with the ControlManager directly. But it's also less
+ * powerfull if you need more control use the ControlManagers factory methods instead.
+ *
+ * @method addButton
+ * @param {String} name Button name to add.
+ * @param {Object} settings Settings object with title, cmd etc.
+ * @example
+ * // Adds a custom button to the editor that inserts contents when clicked
+ * tinymce.init({
+ * ...
+ *
+ * toolbar: 'example'
+ *
+ * setup: function(ed) {
+ * ed.addButton('example', {
+ * title: 'My title',
+ * image: '../js/tinymce/plugins/example/img/example.gif',
+ * onclick: function() {
+ * ed.insertContent('Hello world!!');
+ * }
+ * });
+ * }
+ * });
+ */
+ addButton: function(name, settings) {
+ var self = this;
+
+ if (settings.cmd) {
+ settings.onclick = function() {
+ self.execCommand(settings.cmd);
+ };
+ }
+
+ if (!settings.text && !settings.icon) {
+ settings.icon = name;
+ }
+
+ self.buttons = self.buttons || {};
+ settings.tooltip = settings.tooltip || settings.title;
+ self.buttons[name] = settings;
+ },
+
+ /**
+ * Adds a menu item to be used in the menus of the modern theme.
+ *
+ * @method addMenuItem
+ * @param {String} name Menu item name to add.
+ * @param {Object} settings Settings object with title, cmd etc.
+ * @example
+ * // Adds a custom menu item to the editor that inserts contents when clicked
+ * // The context option allows you to add the menu item to an existing default menu
+ * tinymce.init({
+ * ...
+ *
+ * setup: function(ed) {
+ * ed.addMenuItem('example', {
+ * title: 'My menu item',
+ * context: 'tools',
+ * onclick: function() {
+ * ed.insertContent('Hello world!!');
+ * }
+ * });
+ * }
+ * });
+ */
+ addMenuItem: function(name, settings) {
+ var self = this;
+
+ if (settings.cmd) {
+ settings.onclick = function() {
+ self.execCommand(settings.cmd);
+ };
+ }
+
+ self.menuItems = self.menuItems || {};
+ self.menuItems[name] = settings;
+ },
+
+ /**
+ * Adds a custom command to the editor, you can also override existing commands with this method.
+ * The command that you add can be executed with execCommand.
+ *
+ * @method addCommand
+ * @param {String} name Command name to add/override.
+ * @param {addCommandCallback} callback Function to execute when the command occurs.
+ * @param {Object} scope Optional scope to execute the function in.
+ * @example
+ * // Adds a custom command that later can be executed using execCommand
+ * tinymce.init({
+ * ...
+ *
+ * setup: function(ed) {
+ * // Register example command
+ * ed.addCommand('mycommand', function(ui, v) {
+ * ed.windowManager.alert('Hello world!! Selection: ' + ed.selection.getContent({format: 'text'}));
+ * });
+ * }
+ * });
+ */
+ addCommand: function(name, callback, scope) {
+ /**
+ * Callback function that gets called when a command is executed.
+ *
+ * @callback addCommandCallback
+ * @param {Boolean} ui Display UI state true/false.
+ * @param {Object} value Optional value for command.
+ * @return {Boolean} True/false state if the command was handled or not.
+ */
+ this.execCommands[name] = {func: callback, scope: scope || this};
+ },
+
+ /**
+ * Adds a custom query state command to the editor, you can also override existing commands with this method.
+ * The command that you add can be executed with queryCommandState function.
+ *
+ * @method addQueryStateHandler
+ * @param {String} name Command name to add/override.
+ * @param {addQueryStateHandlerCallback} callback Function to execute when the command state retrival occurs.
+ * @param {Object} scope Optional scope to execute the function in.
+ */
+ addQueryStateHandler: function(name, callback, scope) {
+ /**
+ * Callback function that gets called when a queryCommandState is executed.
+ *
+ * @callback addQueryStateHandlerCallback
+ * @return {Boolean} True/false state if the command is enabled or not like is it bold.
+ */
+ this.queryStateCommands[name] = {func: callback, scope: scope || this};
+ },
+
+ /**
+ * Adds a custom query value command to the editor, you can also override existing commands with this method.
+ * The command that you add can be executed with queryCommandValue function.
+ *
+ * @method addQueryValueHandler
+ * @param {String} name Command name to add/override.
+ * @param {addQueryValueHandlerCallback} callback Function to execute when the command value retrival occurs.
+ * @param {Object} scope Optional scope to execute the function in.
+ */
+ addQueryValueHandler: function(name, callback, scope) {
+ /**
+ * Callback function that gets called when a queryCommandValue is executed.
+ *
+ * @callback addQueryValueHandlerCallback
+ * @return {Object} Value of the command or undefined.
+ */
+ this.queryValueCommands[name] = {func: callback, scope: scope || this};
+ },
+
+ /**
+ * Adds a keyboard shortcut for some command or function.
+ *
+ * @method addShortcut
+ * @param {String} pattern Shortcut pattern. Like for example: ctrl+alt+o.
+ * @param {String} desc Text description for the command.
+ * @param {String/Function} cmdFunc Command name string or function to execute when the key is pressed.
+ * @param {Object} sc Optional scope to execute the function in.
+ * @return {Boolean} true/false state if the shortcut was added or not.
+ */
+ addShortcut: function(pattern, desc, cmdFunc, scope) {
+ this.shortcuts.add(pattern, desc, cmdFunc, scope);
+ },
+
+ /**
+ * Executes a command on the current instance. These commands can be TinyMCE internal commands prefixed with "mce" or
+ * they can be build in browser commands such as "Bold". A compleate list of browser commands is available on MSDN or Mozilla.org.
+ * This function will dispatch the execCommand function on each plugin, theme or the execcommand_callback option if none of these
+ * return true it will handle the command as a internal browser command.
+ *
+ * @method execCommand
+ * @param {String} cmd Command name to execute, for example mceLink or Bold.
+ * @param {Boolean} ui True/false state if a UI (dialog) should be presented or not.
+ * @param {mixed} value Optional command value, this can be anything.
+ * @param {Object} a Optional arguments object.
+ */
+ execCommand: function(cmd, ui, value, args) {
+ var self = this, state = 0, cmdItem;
+
+ if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(cmd) && (!args || !args.skip_focus)) {
+ self.focus();
+ }
+
+ args = extend({}, args);
+ args = self.fire('BeforeExecCommand', {command: cmd, ui: ui, value: value});
+ if (args.isDefaultPrevented()) {
+ return false;
+ }
+
+ // Registred commands
+ if ((cmdItem = self.execCommands[cmd])) {
+ // Fall through on true
+ if (cmdItem.func.call(cmdItem.scope, ui, value) !== true) {
+ self.fire('ExecCommand', {command: cmd, ui: ui, value: value});
+ return true;
+ }
+ }
+
+ // Plugin commands
+ each(self.plugins, function(p) {
+ if (p.execCommand && p.execCommand(cmd, ui, value)) {
+ self.fire('ExecCommand', {command: cmd, ui: ui, value: value});
+ state = true;
+ return false;
+ }
+ });
+
+ if (state) {
+ return state;
+ }
+
+ // Theme commands
+ if (self.theme && self.theme.execCommand && self.theme.execCommand(cmd, ui, value)) {
+ self.fire('ExecCommand', {command: cmd, ui: ui, value: value});
+ return true;
+ }
+
+ // Editor commands
+ if (self.editorCommands.execCommand(cmd, ui, value)) {
+ self.fire('ExecCommand', {command: cmd, ui: ui, value: value});
+ return true;
+ }
+
+ // Browser commands
+ self.getDoc().execCommand(cmd, ui, value);
+ self.fire('ExecCommand', {command: cmd, ui: ui, value: value});
+ },
+
+ /**
+ * Returns a command specific state, for example if bold is enabled or not.
+ *
+ * @method queryCommandState
+ * @param {string} cmd Command to query state from.
+ * @return {Boolean} Command specific state, for example if bold is enabled or not.
+ */
+ queryCommandState: function(cmd) {
+ var self = this, queryItem, returnVal;
+
+ // Is hidden then return undefined
+ if (self._isHidden()) {
+ return;
+ }
+
+ // Registred commands
+ if ((queryItem = self.queryStateCommands[cmd])) {
+ returnVal = queryItem.func.call(queryItem.scope);
+
+ // Fall though on true
+ if (returnVal !== true) {
+ return returnVal;
+ }
+ }
+
+ // Editor commands
+ returnVal = self.editorCommands.queryCommandState(cmd);
+ if (returnVal !== -1) {
+ return returnVal;
+ }
+
+ // Browser commands
+ try {
+ return self.getDoc().queryCommandState(cmd);
+ } catch (ex) {
+ // Fails sometimes see bug: 1896577
+ }
+ },
+
+ /**
+ * Returns a command specific value, for example the current font size.
+ *
+ * @method queryCommandValue
+ * @param {string} cmd Command to query value from.
+ * @return {Object} Command specific value, for example the current font size.
+ */
+ queryCommandValue: function(cmd) {
+ var self = this, queryItem, returnVal;
+
+ // Is hidden then return undefined
+ if (self._isHidden()) {
+ return;
+ }
+
+ // Registred commands
+ if ((queryItem = self.queryValueCommands[cmd])) {
+ returnVal = queryItem.func.call(queryItem.scope);
+
+ // Fall though on true
+ if (returnVal !== true) {
+ return returnVal;
+ }
+ }
+
+ // Editor commands
+ returnVal = self.editorCommands.queryCommandValue(cmd);
+ if (returnVal !== undefined) {
+ return returnVal;
+ }
+
+ // Browser commands
+ try {
+ return self.getDoc().queryCommandValue(cmd);
+ } catch (ex) {
+ // Fails sometimes see bug: 1896577
+ }
+ },
+
+ /**
+ * Shows the editor and hides any textarea/div that the editor is supposed to replace.
+ *
+ * @method show
+ */
+ show: function() {
+ var self = this;
+
+ DOM.show(self.getContainer());
+ DOM.hide(self.id);
+ self.load();
+ self.fire('show');
+ },
+
+ /**
+ * Hides the editor and shows any textarea/div that the editor is supposed to replace.
+ *
+ * @method hide
+ */
+ hide: function() {
+ var self = this, doc = self.getDoc();
+
+ // Fixed bug where IE has a blinking cursor left from the editor
+ if (ie && doc && !self.inline) {
+ doc.execCommand('SelectAll');
+ }
+
+ // We must save before we hide so Safari doesn't crash
+ self.save();
+
+ // defer the call to hide to prevent an IE9 crash #4921
+ DOM.hide(self.getContainer());
+ DOM.setStyle(self.id, 'display', self.orgDisplay);
+ self.fire('hide');
+ },
+
+ /**
+ * Returns true/false if the editor is hidden or not.
+ *
+ * @method isHidden
+ * @return {Boolean} True/false if the editor is hidden or not.
+ */
+ isHidden: function() {
+ return !DOM.isHidden(this.id);
+ },
+
+ /**
+ * Sets the progress state, this will display a throbber/progess for the editor.
+ * This is ideal for asycronous operations like an AJAX save call.
+ *
+ * @method setProgressState
+ * @param {Boolean} state Boolean state if the progress should be shown or hidden.
+ * @param {Number} time Optional time to wait before the progress gets shown.
+ * @return {Boolean} Same as the input state.
+ * @example
+ * // Show progress for the active editor
+ * tinymce.activeEditor.setProgressState(true);
+ *
+ * // Hide progress for the active editor
+ * tinymce.activeEditor.setProgressState(false);
+ *
+ * // Show progress after 3 seconds
+ * tinymce.activeEditor.setProgressState(true, 3000);
+ */
+ setProgressState: function(state, time) {
+ this.fire('ProgressState', {state: state, time: time});
+ },
+
+ /**
+ * Loads contents from the textarea or div element that got converted into an editor instance.
+ * This method will move the contents from that textarea or div into the editor by using setContent
+ * so all events etc that method has will get dispatched as well.
+ *
+ * @method load
+ * @param {Object} args Optional content object, this gets passed around through the whole load process.
+ * @return {String} HTML string that got set into the editor.
+ */
+ load: function(args) {
+ var self = this, elm = self.getElement(), html;
+
+ if (elm) {
+ args = args || {};
+ args.load = true;
+
+ html = self.setContent(elm.value !== undefined ? elm.value : elm.innerHTML, args);
+ args.element = elm;
+
+ if (!args.no_events) {
+ self.fire('LoadContent', args);
+ }
+
+ args.element = elm = null;
+
+ return html;
+ }
+ },
+
+ /**
+ * Saves the contents from a editor out to the textarea or div element that got converted into an editor instance.
+ * This method will move the HTML contents from the editor into that textarea or div by getContent
+ * so all events etc that method has will get dispatched as well.
+ *
+ * @method save
+ * @param {Object} args Optional content object, this gets passed around through the whole save process.
+ * @return {String} HTML string that got set into the textarea/div.
+ */
+ save: function(args) {
+ var self = this, elm = self.getElement(), html, form;
+
+ if (!elm || !self.initialized) {
+ return;
+ }
+
+ args = args || {};
+ args.save = true;
+
+ args.element = elm;
+ html = args.content = self.getContent(args);
+
+ if (!args.no_events) {
+ self.fire('SaveContent', args);
+ }
+
+ html = args.content;
+
+ if (!/TEXTAREA|INPUT/i.test(elm.nodeName)) {
+ elm.innerHTML = html;
+
+ // Update hidden form element
+ if ((form = DOM.getParent(self.id, 'form'))) {
+ each(form.elements, function(elm) {
+ if (elm.name == self.id) {
+ elm.value = html;
+ return false;
+ }
+ });
+ }
+ } else {
+ elm.value = html;
+ }
+
+ args.element = elm = null;
+
+ if (args.set_dirty !== false) {
+ self.isNotDirty = true;
+ }
+
+ return html;
+ },
+
+ /**
+ * Sets the specified content to the editor instance, this will cleanup the content before it gets set using
+ * the different cleanup rules options.
+ *
+ * @method setContent
+ * @param {String} content Content to set to editor, normally HTML contents but can be other formats as well.
+ * @param {Object} args Optional content object, this gets passed around through the whole set process.
+ * @return {String} HTML string that got set into the editor.
+ * @example
+ * // Sets the HTML contents of the activeEditor editor
+ * tinymce.activeEditor.setContent('<span>some</span> html');
+ *
+ * // Sets the raw contents of the activeEditor editor
+ * tinymce.activeEditor.setContent('<span>some</span> html', {format: 'raw'});
+ *
+ * // Sets the content of a specific editor (my_editor in this example)
+ * tinymce.get('my_editor').setContent(data);
+ *
+ * // Sets the bbcode contents of the activeEditor editor if the bbcode plugin was added
+ * tinymce.activeEditor.setContent('[b]some[/b] html', {format: 'bbcode'});
+ */
+ setContent: function(content, args) {
+ var self = this, body = self.getBody(), forcedRootBlockName;
+
+ // Setup args object
+ args = args || {};
+ args.format = args.format || 'html';
+ args.set = true;
+ args.content = content;
+
+ // Do preprocessing
+ if (!args.no_events) {
+ self.fire('BeforeSetContent', args);
+ }
+
+ content = args.content;
+
+ // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content
+ // It will also be impossible to place the caret in the editor unless there is a BR element present
+ if (content.length === 0 || /^\s+$/.test(content)) {
+ forcedRootBlockName = self.settings.forced_root_block;
+
+ // Check if forcedRootBlock is configured and that the block is a valid child of the body
+ if (forcedRootBlockName && self.schema.isValidChild(body.nodeName.toLowerCase(), forcedRootBlockName.toLowerCase())) {
+ // Padd with bogus BR elements on modern browsers and IE 7 and 8 since they don't render empty P tags properly
+ content = ie && ie < 11 ? '' : '<br data-mce-bogus="1">';
+ content = self.dom.createHTML(forcedRootBlockName, self.settings.forced_root_block_attrs, content);
+ } else if (!ie || ie < 11) {
+ // We need to add a BR when forced_root_block is disabled on non IE browsers to place the caret
+ content = '<br data-mce-bogus="1">';
+ }
+
+ body.innerHTML = content;
+
+ self.fire('SetContent', args);
+ } else {
+ // Parse and serialize the html
+ if (args.format !== 'raw') {
+ content = new Serializer({}, self.schema).serialize(
+ self.parser.parse(content, {isRootContent: true})
+ );
+ }
+
+ // Set the new cleaned contents to the editor
+ args.content = trim(content);
+ self.dom.setHTML(body, args.content);
+
+ // Do post processing
+ if (!args.no_events) {
+ self.fire('SetContent', args);
+ }
+
+ // Don't normalize selection if the focused element isn't the body in
+ // content editable mode since it will steal focus otherwise
+ /*if (!self.settings.content_editable || document.activeElement === self.getBody()) {
+ self.selection.normalize();
+ }*/
+ }
+
+ return args.content;
+ },
+
+ /**
+ * Gets the content from the editor instance, this will cleanup the content before it gets returned using
+ * the different cleanup rules options.
+ *
+ * @method getContent
+ * @param {Object} args Optional content object, this gets passed around through the whole get process.
+ * @return {String} Cleaned content string, normally HTML contents.
+ * @example
+ * // Get the HTML contents of the currently active editor
+ * console.debug(tinymce.activeEditor.getContent());
+ *
+ * // Get the raw contents of the currently active editor
+ * tinymce.activeEditor.getContent({format: 'raw'});
+ *
+ * // Get content of a specific editor:
+ * tinymce.get('content id').getContent()
+ */
+ getContent: function(args) {
+ var self = this, content, body = self.getBody();
+
+ // Setup args object
+ args = args || {};
+ args.format = args.format || 'html';
+ args.get = true;
+ args.getInner = true;
+
+ // Do preprocessing
+ if (!args.no_events) {
+ self.fire('BeforeGetContent', args);
+ }
+
+ // Get raw contents or by default the cleaned contents
+ if (args.format == 'raw') {
+ content = body.innerHTML;
+ } else if (args.format == 'text') {
+ content = body.innerText || body.textContent;
+ } else {
+ content = self.serializer.serialize(body, args);
+ }
+
+ // Trim whitespace in beginning/end of HTML
+ if (args.format != 'text') {
+ args.content = trim(content);
+ } else {
+ args.content = content;
+ }
+
+ // Do post processing
+ if (!args.no_events) {
+ self.fire('GetContent', args);
+ }
+
+ return args.content;
+ },
+
+ /**
+ * Inserts content at caret position.
+ *
+ * @method insertContent
+ * @param {String} content Content to insert.
+ */
+ insertContent: function(content) {
+ this.execCommand('mceInsertContent', false, content);
+ },
+
+ /**
+ * Returns true/false if the editor is dirty or not. It will get dirty if the user has made modifications to the contents.
+ *
+ * @method isDirty
+ * @return {Boolean} True/false if the editor is dirty or not. It will get dirty if the user has made modifications to the contents.
+ * @example
+ * if (tinymce.activeEditor.isDirty())
+ * alert("You must save your contents.");
+ */
+ isDirty: function() {
+ return !this.isNotDirty;
+ },
+
+ /**
+ * Returns the editors container element. The container element wrappes in
+ * all the elements added to the page for the editor. Such as UI, iframe etc.
+ *
+ * @method getContainer
+ * @return {Element} HTML DOM element for the editor container.
+ */
+ getContainer: function() {
+ var self = this;
+
+ if (!self.container) {
+ self.container = DOM.get(self.editorContainer || self.id + '_parent');
+ }
+
+ return self.container;
+ },
+
+ /**
+ * Returns the editors content area container element. The this element is the one who
+ * holds the iframe or the editable element.
+ *
+ * @method getContentAreaContainer
+ * @return {Element} HTML DOM element for the editor area container.
+ */
+ getContentAreaContainer: function() {
+ return this.contentAreaContainer;
+ },
+
+ /**
+ * Returns the target element/textarea that got replaced with a TinyMCE editor instance.
+ *
+ * @method getElement
+ * @return {Element} HTML DOM element for the replaced element.
+ */
+ getElement: function() {
+ return DOM.get(this.settings.content_element || this.id);
+ },
+
+ /**
+ * Returns the iframes window object.
+ *
+ * @method getWin
+ * @return {Window} Iframe DOM window object.
+ */
+ getWin: function() {
+ var self = this, elm;
+
+ if (!self.contentWindow) {
+ elm = DOM.get(self.id + "_ifr");
+
+ if (elm) {
+ self.contentWindow = elm.contentWindow;
+ }
+ }
+
+ return self.contentWindow;
+ },
+
+ /**
+ * Returns the iframes document object.
+ *
+ * @method getDoc
+ * @return {Document} Iframe DOM document object.
+ */
+ getDoc: function() {
+ var self = this, win;
+
+ if (!self.contentDocument) {
+ win = self.getWin();
+
+ if (win) {
+ self.contentDocument = win.document;
+ }
+ }
+
+ return self.contentDocument;
+ },
+
+ /**
+ * Returns the iframes body element.
+ *
+ * @method getBody
+ * @return {Element} Iframe body element.
+ */
+ getBody: function() {
+ return this.bodyElement || this.getDoc().body;
+ },
+
+ /**
+ * URL converter function this gets executed each time a user adds an img, a or
+ * any other element that has a URL in it. This will be called both by the DOM and HTML
+ * manipulation functions.
+ *
+ * @method convertURL
+ * @param {string} url URL to convert.
+ * @param {string} name Attribute name src, href etc.
+ * @param {string/HTMLElement} elm Tag name or HTML DOM element depending on HTML or DOM insert.
+ * @return {string} Converted URL string.
+ */
+ convertURL: function(url, name, elm) {
+ var self = this, settings = self.settings;
+
+ // Use callback instead
+ if (settings.urlconverter_callback) {
+ return self.execCallback('urlconverter_callback', url, elm, true, name);
+ }
+
+ // Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs
+ if (!settings.convert_urls || (elm && elm.nodeName == 'LINK') || url.indexOf('file:') === 0 || url.length === 0) {
+ return url;
+ }
+
+ // Convert to relative
+ if (settings.relative_urls) {
+ return self.documentBaseURI.toRelative(url);
+ }
+
+ // Convert to absolute
+ url = self.documentBaseURI.toAbsolute(url, settings.remove_script_host);
+
+ return url;
+ },
+
+ /**
+ * Adds visual aid for tables, anchors etc so they can be more easily edited inside the editor.
+ *
+ * @method addVisual
+ * @param {Element} elm Optional root element to loop though to find tables etc that needs the visual aid.
+ */
+ addVisual: function(elm) {
+ var self = this, settings = self.settings, dom = self.dom, cls;
+
+ elm = elm || self.getBody();
+
+ if (self.hasVisual === undefined) {
+ self.hasVisual = settings.visual;
+ }
+
+ each(dom.select('table,a', elm), function(elm) {
+ var value;
+
+ switch (elm.nodeName) {
+ case 'TABLE':
+ cls = settings.visual_table_class || 'mce-item-table';
+ value = dom.getAttrib(elm, 'border');
+
+ if (!value || value == '0') {
+ if (self.hasVisual) {
+ dom.addClass(elm, cls);
+ } else {
+ dom.removeClass(elm, cls);
+ }
+ }
+
+ return;
+
+ case 'A':
+ if (!dom.getAttrib(elm, 'href', false)) {
+ value = dom.getAttrib(elm, 'name') || elm.id;
+ cls = 'mce-item-anchor';
+
+ if (value) {
+ if (self.hasVisual) {
+ dom.addClass(elm, cls);
+ } else {
+ dom.removeClass(elm, cls);
+ }
+ }
+ }
+
+ return;
+ }
+ });
+
+ self.fire('VisualAid', {element: elm, hasVisual: self.hasVisual});
+ },
+
+ /**
+ * Removes the editor from the dom and tinymce collection.
+ *
+ * @method remove
+ */
+ remove: function() {
+ var self = this;
+
+ if (!self.removed) {
+ self.removed = 1; // Cancels post remove event execution
+
+ // Remove any hidden input
+ if (self.hasHiddenInput) {
+ DOM.remove(self.getElement().nextSibling);
+ }
+
+ // Fixed bug where IE has a blinking cursor left from the editor
+ var doc = self.getDoc();
+ if (ie && doc && !self.inline) {
+ doc.execCommand('SelectAll');
+ }
+
+ // We must save before we hide so Safari doesn't crash
+ self.save();
+
+ DOM.setStyle(self.id, 'display', self.orgDisplay);
+
+ // Don't clear the window or document if content editable
+ // is enabled since other instances might still be present
+ if (!self.settings.content_editable) {
+ Event.unbind(self.getWin());
+ Event.unbind(self.getDoc());
+ }
+
+ var elm = self.getContainer();
+ Event.unbind(self.getBody());
+ Event.unbind(elm);
+
+ self.fire('remove');
+
+ self.editorManager.remove(self);
+ DOM.remove(elm);
+ self.destroy();
+ }
+ },
+
+ bindNative: function(name) {
+ var self = this;
+
+ if (self.settings.readonly) {
+ return;
+ }
+
+ if (self.initialized) {
+ self.dom.bind(getEventTarget(self, name), name, function(e) {
+ self.fire(name, e);
+ });
+ } else {
+ if (!self._pendingNativeEvents) {
+ self._pendingNativeEvents = [name];
+ } else {
+ self._pendingNativeEvents.push(name);
+ }
+ }
+ },
+
+ unbindNative: function(name) {
+ var self = this;
+
+ if (self.initialized) {
+ self.dom.unbind(name);
+ }
+ },
+
+ /**
+ * Destroys the editor instance by removing all events, element references or other resources
+ * that could leak memory. This method will be called automatically when the page is unloaded
+ * but you can also call it directly if you know what you are doing.
+ *
+ * @method destroy
+ * @param {Boolean} automatic Optional state if the destroy is an automatic destroy or user called one.
+ */
+ destroy: function(automatic) {
+ var self = this, form;
+
+ // One time is enough
+ if (self.destroyed) {
+ return;
+ }
+
+ // If user manually calls destroy and not remove
+ // Users seems to have logic that calls destroy instead of remove
+ if (!automatic && !self.removed) {
+ self.remove();
+ return;
+ }
+
+ // We must unbind on Gecko since it would otherwise produce the pesky "attempt
+ // to run compile-and-go script on a cleared scope" message
+ if (automatic && isGecko) {
+ Event.unbind(self.getDoc());
+ Event.unbind(self.getWin());
+ Event.unbind(self.getBody());
+ }
+
+ if (!automatic) {
+ self.editorManager.off('beforeunload', self._beforeUnload);
+
+ // Manual destroy
+ if (self.theme && self.theme.destroy) {
+ self.theme.destroy();
+ }
+
+ // Destroy controls, selection and dom
+ self.selection.destroy();
+ self.dom.destroy();
+ }
+
+ form = self.formElement;
+ if (form) {
+ if (form._mceOldSubmit) {
+ form.submit = form._mceOldSubmit;
+ form._mceOldSubmit = null;
+ }
+
+ DOM.unbind(form, 'submit reset', self.formEventDelegate);
+ }
+
+ self.contentAreaContainer = self.formElement = self.container = null;
+ self.settings.content_element = self.bodyElement = self.contentDocument = self.contentWindow = null;
+
+ if (self.selection) {
+ self.selection = self.selection.win = self.selection.dom = self.selection.dom.doc = null;
+ }
+
+ self.destroyed = 1;
+ },
+
+ // Internal functions
+
+ _refreshContentEditable: function() {
+ var self = this, body, parent;
+
+ // Check if the editor was hidden and the re-initalize contentEditable mode by removing and adding the body again
+ if (self._isHidden()) {
+ body = self.getBody();
+ parent = body.parentNode;
+
+ parent.removeChild(body);
+ parent.appendChild(body);
+
+ body.focus();
+ }
+ },
+
+ _isHidden: function() {
+ var sel;
+
+ if (!isGecko) {
+ return 0;
+ }
+
+ // Weird, wheres that cursor selection?
+ sel = this.selection.getSel();
+ return (!sel || !sel.rangeCount || sel.rangeCount === 0);
+ }
+ };
+
+ extend(Editor.prototype, Observable);
+
+ return Editor;
+});
+
+// Included from: js/tinymce/classes/util/I18n.js
+
+/**
+ * I18n.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * I18n class that handles translation of TinyMCE UI.
+ * Uses po style with csharp style parameters.
+ *
+ * @class tinymce.util.I18n
+ */
+define("tinymce/util/I18n", [], function() {
+ "use strict";
+
+ var data = {};
+
+ return {
+ /**
+ * Property gets set to true if a RTL language pack was loaded.
+ *
+ * @property rtl
+ * @type {Boolean}
+ */
+ rtl: false,
+
+ /**
+ * Adds translations for a specific language code.
+ *
+ * @method add
+ * @param {String} code Language code like sv_SE.
+ * @param {Array} items Name/value array with English en_US to sv_SE.
+ */
+ add: function(code, items) {
+ for (var name in items) {
+ data[name] = items[name];
+ }
+
+ this.rtl = this.rtl || data._dir === 'rtl';
+ },
+
+ /**
+ * Translates the specified text.
+ *
+ * It has a few formats:
+ * I18n.translate("Text");
+ * I18n.translate(["Text {0}/{1}", 0, 1]);
+ * I18n.translate({raw: "Raw string"});
+ *
+ * @method translate
+ * @param {String/Object/Array} text Text to translate.
+ * @return {String} String that got translated.
+ */
+ translate: function(text) {
+ if (typeof(text) == "undefined") {
+ return text;
+ }
+
+ if (typeof(text) != "string" && text.raw) {
+ return text.raw;
+ }
+
+ if (text.push) {
+ var values = text.slice(1);
+
+ text = (data[text[0]] || text[0]).replace(/\{([^\}]+)\}/g, function(match1, match2) {
+ return values[match2];
+ });
+ }
+
+ return data[text] || text;
+ },
+
+ data: data
+ };
+});
+
+// Included from: js/tinymce/classes/FocusManager.js
+
+/**
+ * FocusManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class manages the focus/blur state of the editor. This class is needed since some
+ * browsers fire false focus/blur states when the selection is moved to a UI dialog or similar.
+ *
+ * This class will fire two events focus and blur on the editor instances that got affected.
+ * It will also handle the restore of selection when the focus is lost and returned.
+ *
+ * @class tinymce.FocusManager
+ */
+define("tinymce/FocusManager", [
+ "tinymce/dom/DOMUtils",
+ "tinymce/Env"
+], function(DOMUtils, Env) {
+ /**
+ * Constructs a new focus manager instance.
+ *
+ * @constructor FocusManager
+ * @param {tinymce.EditorManager} editorManager Editor manager instance to handle focus for.
+ */
+ function FocusManager(editorManager) {
+ function getActiveElement() {
+ try {
+ return document.activeElement;
+ } catch (ex) {
+ // IE sometimes fails to get the activeElement when resizing table
+ // TODO: Investigate this
+ return document.body;
+ }
+ }
+
+ // We can't store a real range on IE 11 since it gets mutated so we need to use a bookmark object
+ // TODO: Move this to a separate range utils class since it's it's logic is present in Selection as well.
+ function createBookmark(rng) {
+ if (rng && rng.startContainer) {
+ return {
+ startContainer: rng.startContainer,
+ startOffset: rng.startOffset,
+ endContainer: rng.endContainer,
+ endOffset: rng.endOffset
+ };
+ }
+
+ return rng;
+ }
+
+ function bookmarkToRng(editor, bookmark) {
+ var rng;
+
+ if (bookmark.startContainer) {
+ rng = editor.getDoc().createRange();
+ rng.setStart(bookmark.startContainer, bookmark.startOffset);
+ rng.setEnd(bookmark.endContainer, bookmark.endOffset);
+ } else {
+ rng = bookmark;
+ }
+
+ return rng;
+ }
+
+ function isUIElement(elm) {
+ return !!DOMUtils.DOM.getParent(elm, FocusManager.isEditorUIElement);
+ }
+
+ function isNodeInBodyOfEditor(node, editor) {
+ var body = editor.getBody();
+
+ while (node) {
+ if (node == body) {
+ return true;
+ }
+
+ node = node.parentNode;
+ }
+ }
+
+ function registerEvents(e) {
+ var editor = e.editor, selectionChangeHandler;
+
+ editor.on('init', function() {
+ // On IE take selection snapshot onbeforedeactivate
+ if ("onbeforedeactivate" in document && Env.ie < 11) {
+ editor.dom.bind(editor.getBody(), 'beforedeactivate', function() {
+ try {
+ editor.lastRng = editor.selection.getRng();
+ } catch (ex) {
+ // IE throws "Unexcpected call to method or property access" some times so lets ignore it
+ }
+
+ editor.selection.lastFocusBookmark = createBookmark(editor.lastRng);
+ });
+ } else if (editor.inline || Env.ie > 10) {
+ // On other browsers take snapshot on nodechange in inline mode since they have Ghost selections for iframes
+ editor.on('nodechange keyup', function() {
+ var node = document.activeElement;
+
+ // IE 11 reports active element as iframe not body of iframe
+ if (node && node.id == editor.id + '_ifr') {
+ node = editor.getBody();
+ }
+
+ if (isNodeInBodyOfEditor(node, editor)) {
+ editor.lastRng = editor.selection.getRng();
+ }
+ });
+
+ // Handles the issue with WebKit not retaining selection within inline document
+ // If the user releases the mouse out side the body while selecting a nodeChange won't
+ // fire and there for the selection snapshot won't be stored
+ // TODO: Optimize this since we only need to bind these on the active editor
+ if (Env.webkit) {
+ selectionChangeHandler = function() {
+ var rng = editor.selection.getRng();
+
+ // Store when it's non collapsed
+ if (!rng.collapsed) {
+ editor.lastRng = rng;
+ }
+ };
+
+ // Bind selection handler
+ DOMUtils.DOM.bind(document, 'selectionchange', selectionChangeHandler);
+
+ editor.on('remove', function() {
+ DOMUtils.DOM.unbind(document, 'selectionchange', selectionChangeHandler);
+ });
+ }
+ }
+ });
+
+ editor.on('setcontent', function() {
+ editor.lastRng = null;
+ });
+
+ // Remove last selection bookmark on mousedown see #6305
+ editor.on('mousedown', function() {
+ editor.selection.lastFocusBookmark = null;
+ });
+
+ editor.on('focusin', function() {
+ var focusedEditor = editorManager.focusedEditor;
+
+ if (editor.selection.lastFocusBookmark) {
+ editor.selection.setRng(bookmarkToRng(editor, editor.selection.lastFocusBookmark));
+ editor.selection.lastFocusBookmark = null;
+ }
+
+ if (focusedEditor != editor) {
+ if (focusedEditor) {
+ focusedEditor.fire('blur', {focusedEditor: editor});
+ }
+
+ editorManager.activeEditor = editor;
+ editorManager.focusedEditor = editor;
+ editor.fire('focus', {blurredEditor: focusedEditor});
+ editor.focus(false);
+ }
+
+ editor.lastRng = null;
+ });
+
+ editor.on('focusout', function() {
+ window.setTimeout(function() {
+ var focusedEditor = editorManager.focusedEditor;
+
+ // Still the same editor the the blur was outside any editor UI
+ if (!isUIElement(getActiveElement()) && focusedEditor == editor) {
+ editor.fire('blur', {focusedEditor: null});
+ editorManager.focusedEditor = null;
+ editor.selection.lastFocusBookmark = null;
+ }
+ }, 0);
+ });
+ }
+
+ // Check if focus is moved to an element outside the active editor by checking if the target node
+ // isn't within the body of the activeEditor nor a UI element such as a dialog child control
+ DOMUtils.DOM.bind(document, 'focusin', function(e) {
+ var activeEditor = editorManager.activeEditor;
+
+ if (activeEditor && e.target.ownerDocument == document) {
+ activeEditor.selection.lastFocusBookmark = createBookmark(activeEditor.lastRng);
+
+ // Fire a blur event if the element isn't a UI element
+ if (!isUIElement(e.target) && editorManager.focusedEditor == activeEditor) {
+ activeEditor.fire('blur', {focusedEditor: null});
+ editorManager.focusedEditor = null;
+ }
+ }
+ });
+
+ editorManager.on('AddEditor', registerEvents);
+ }
+
+ /**
+ * Returns true if the specified element is part of the UI for example an button or text input.
+ *
+ * @method isEditorUIElement
+ * @param {Element} elm Element to check if it's part of the UI or not.
+ * @return {Boolean} True/false state if the element is part of the UI or not.
+ */
+ FocusManager.isEditorUIElement = function(elm) {
+ return elm.className.indexOf('mce-') !== -1;
+ };
+
+ return FocusManager;
+});
+
+// Included from: js/tinymce/classes/EditorManager.js
+
+/**
+ * EditorManager.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class used as a factory for manager for tinymce.Editor instances.
+ *
+ * @example
+ * tinymce.EditorManager.init({});
+ *
+ * @class tinymce.EditorManager
+ * @mixes tinymce.util.Observable
+ * @static
+ */
+define("tinymce/EditorManager", [
+ "tinymce/Editor",
+ "tinymce/dom/DOMUtils",
+ "tinymce/util/URI",
+ "tinymce/Env",
+ "tinymce/util/Tools",
+ "tinymce/util/Observable",
+ "tinymce/util/I18n",
+ "tinymce/FocusManager"
+], function(Editor, DOMUtils, URI, Env, Tools, Observable, I18n, FocusManager) {
+ var DOM = DOMUtils.DOM;
+ var explode = Tools.explode, each = Tools.each, extend = Tools.extend;
+ var instanceCounter = 0, beforeUnloadDelegate;
+
+ var EditorManager = {
+ /**
+ * Major version of TinyMCE build.
+ *
+ * @property majorVersion
+ * @type String
+ */
+ majorVersion : '4',
+
+ /**
+ * Minor version of TinyMCE build.
+ *
+ * @property minorVersion
+ * @type String
+ */
+ minorVersion : '0.12',
+
+ /**
+ * Release date of TinyMCE build.
+ *
+ * @property releaseDate
+ * @type String
+ */
+ releaseDate: '2013-12-18',
+
+ /**
+ * Collection of editor instances.
+ *
+ * @property editors
+ * @type Object
+ * @example
+ * for (edId in tinymce.editors)
+ * tinymce.editors[edId].save();
+ */
+ editors: [],
+
+ /**
+ * Collection of language pack data.
+ *
+ * @property i18n
+ * @type Object
+ */
+ i18n: I18n,
+
+ /**
+ * Currently active editor instance.
+ *
+ * @property activeEditor
+ * @type tinymce.Editor
+ * @example
+ * tinyMCE.activeEditor.selection.getContent();
+ * tinymce.EditorManager.activeEditor.selection.getContent();
+ */
+ activeEditor: null,
+
+ setup: function() {
+ var self = this, baseURL, documentBaseURL, suffix = "", preInit;
+
+ // Get base URL for the current document
+ documentBaseURL = document.location.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
+ if (!/[\/\\]$/.test(documentBaseURL)) {
+ documentBaseURL += '/';
+ }
+
+ // If tinymce is defined and has a base use that or use the old tinyMCEPreInit
+ preInit = window.tinymce || window.tinyMCEPreInit;
+ if (preInit) {
+ baseURL = preInit.base || preInit.baseURL;
+ suffix = preInit.suffix;
+ } else {
+ // Get base where the tinymce script is located
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0; i < scripts.length; i++) {
+ var src = scripts[i].src;
+
+ // Script types supported:
+ // tinymce.js tinymce.min.js tinymce.dev.js
+ // tinymce.jquery.js tinymce.jquery.min.js tinymce.jquery.dev.js
+ // tinymce.full.js tinymce.full.min.js tinymce.full.dev.js
+ if (/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(src)) {
+ if (src.indexOf('.min') != -1) {
+ suffix = '.min';
+ }
+
+ baseURL = src.substring(0, src.lastIndexOf('/'));
+ break;
+ }
+ }
+ }
+
+ /**
+ * Base URL where the root directory if TinyMCE is located.
+ *
+ * @property baseURL
+ * @type String
+ */
+ self.baseURL = new URI(documentBaseURL).toAbsolute(baseURL);
+
+ /**
+ * Document base URL where the current document is located.
+ *
+ * @property documentBaseURL
+ * @type String
+ */
+ self.documentBaseURL = documentBaseURL;
+
+ /**
+ * Absolute baseURI for the installation path of TinyMCE.
+ *
+ * @property baseURI
+ * @type tinymce.util.URI
+ */
+ self.baseURI = new URI(self.baseURL);
+
+ /**
+ * Current suffix to add to each plugin/theme that gets loaded for example ".min".
+ *
+ * @property suffix
+ * @type String
+ */
+ self.suffix = suffix;
+
+ self.focusManager = new FocusManager(self);
+ },
+
+ /**
+ * Initializes a set of editors. This method will create editors based on various settings.
+ *
+ * @method init
+ * @param {Object} settings Settings object to be passed to each editor instance.
+ * @example
+ * // Initializes a editor using the longer method
+ * tinymce.EditorManager.init({
+ * some_settings : 'some value'
+ * });
+ *
+ * // Initializes a editor instance using the shorter version
+ * tinyMCE.init({
+ * some_settings : 'some value'
+ * });
+ */
+ init: function(settings) {
+ var self = this, editors = [], editor;
+
+ function createId(elm) {
+ var id = elm.id;
+
+ // Use element id, or unique name or generate a unique id
+ if (!id) {
+ id = elm.name;
+
+ if (id && !DOM.get(id)) {
+ id = elm.name;
+ } else {
+ // Generate unique name
+ id = DOM.uniqueId();
+ }
+
+ elm.setAttribute('id', id);
+ }
+
+ return id;
+ }
+
+ function execCallback(se, n, s) {
+ var f = se[n];
+
+ if (!f) {
+ return;
+ }
+
+ return f.apply(s || this, Array.prototype.slice.call(arguments, 2));
+ }
+
+ function hasClass(n, c) {
+ return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c);
+ }
+
+ function readyHandler() {
+ var l, co;
+
+ DOM.unbind(window, 'ready', readyHandler);
+
+ execCallback(settings, 'onpageload');
+
+ if (settings.types) {
+ // Process type specific selector
+ each(settings.types, function(type) {
+ each(DOM.select(type.selector), function(elm) {
+ var editor = new Editor(createId(elm), extend({}, settings, type), self);
+ editors.push(editor);
+ editor.render(1);
+ });
+ });
+
+ return;
+ } else if (settings.selector) {
+ // Process global selector
+ each(DOM.select(settings.selector), function(elm) {
+ var editor = new Editor(createId(elm), settings, self);
+ editors.push(editor);
+ editor.render(1);
+ });
+
+ return;
+ }
+
+ // Fallback to old setting
+ switch (settings.mode) {
+ case "exact":
+ l = settings.elements || '';
+
+ if(l.length > 0) {
+ each(explode(l), function(v) {
+ if (DOM.get(v)) {
+ editor = new Editor(v, settings, self);
+ editors.push(editor);
+ editor.render(true);
+ } else {
+ each(document.forms, function(f) {
+ each(f.elements, function(e) {
+ if (e.name === v) {
+ v = 'mce_editor_' + instanceCounter++;
+ DOM.setAttrib(e, 'id', v);
+
+ editor = new Editor(v, settings, self);
+ editors.push(editor);
+ editor.render(1);
+ }
+ });
+ });
+ }
+ });
+ }
+ break;
+
+ case "textareas":
+ case "specific_textareas":
+ each(DOM.select('textarea'), function(elm) {
+ if (settings.editor_deselector && hasClass(elm, settings.editor_deselector)) {
+ return;
+ }
+
+ if (!settings.editor_selector || hasClass(elm, settings.editor_selector)) {
+ editor = new Editor(createId(elm), settings, self);
+ editors.push(editor);
+ editor.render(true);
+ }
+ });
+ break;
+ }
+
+ // Call onInit when all editors are initialized
+ if (settings.oninit) {
+ l = co = 0;
+
+ each(editors, function(ed) {
+ co++;
+
+ if (!ed.initialized) {
+ // Wait for it
+ ed.on('init', function() {
+ l++;
+
+ // All done
+ if (l == co) {
+ execCallback(settings, 'oninit');
+ }
+ });
+ } else {
+ l++;
+ }
+
+ // All done
+ if (l == co) {
+ execCallback(settings, 'oninit');
+ }
+ });
+ }
+ }
+
+ self.settings = settings;
+
+ DOM.bind(window, 'ready', readyHandler);
+ },
+
+ /**
+ * Returns a editor instance by id.
+ *
+ * @method get
+ * @param {String/Number} id Editor instance id or index to return.
+ * @return {tinymce.Editor} Editor instance to return.
+ * @example
+ * // Adds an onclick event to an editor by id (shorter version)
+ * tinymce.get('mytextbox').on('click', function(e) {
+ * ed.windowManager.alert('Hello world!');
+ * });
+ *
+ * // Adds an onclick event to an editor by id (longer version)
+ * tinymce.EditorManager.get('mytextbox').on('click', function(e) {
+ * ed.windowManager.alert('Hello world!');
+ * });
+ */
+ get: function(id) {
+ if (id === undefined) {
+ return this.editors;
+ }
+
+ return this.editors[id];
+ },
+
+ /**
+ * Adds an editor instance to the editor collection. This will also set it as the active editor.
+ *
+ * @method add
+ * @param {tinymce.Editor} editor Editor instance to add to the collection.
+ * @return {tinymce.Editor} The same instance that got passed in.
+ */
+ add: function(editor) {
+ var self = this, editors = self.editors;
+
+ // Add named and index editor instance
+ editors[editor.id] = editor;
+ editors.push(editor);
+
+ self.activeEditor = editor;
+
+ /**
+ * Fires when an editor is added to the EditorManager collection.
+ *
+ * @event AddEditor
+ * @param {Object} e Event arguments.
+ */
+ self.fire('AddEditor', {editor: editor});
+
+ if (!beforeUnloadDelegate) {
+ beforeUnloadDelegate = function() {
+ self.fire('BeforeUnload');
+ };
+
+ DOM.bind(window, 'beforeunload', beforeUnloadDelegate);
+ }
+
+ return editor;
+ },
+
+ /**
+ * Creates an editor instance and adds it to the EditorManager collection.
+ *
+ * @method createEditor
+ * @param {String} id Instance id to use for editor.
+ * @param {Object} settings Editor instance settings.
+ * @return {tinymce.Editor} Editor instance that got created.
+ */
+ createEditor: function(id, settings) {
+ return this.add(new Editor(id, settings, this));
+ },
+
+ /**
+ * Removes a editor or editors form page.
+ *
+ * @example
+ * // Remove all editors bound to divs
+ * tinymce.remove('div');
+ *
+ * // Remove all editors bound to textareas
+ * tinymce.remove('textarea');
+ *
+ * // Remove all editors
+ * tinymce.remove();
+ *
+ * // Remove specific instance by id
+ * tinymce.remove('#id');
+ *
+ * @method remove
+ * @param {tinymce.Editor/String/Object} [selector] CSS selector or editor instance to remove.
+ * @return {tinymce.Editor} The editor that got passed in will be return if it was found otherwise null.
+ */
+ remove: function(selector) {
+ var self = this, i, editors = self.editors, editor, removedFromList;
+
+ // Remove all editors
+ if (!selector) {
+ for (i = editors.length - 1; i >= 0; i--) {
+ self.remove(editors[i]);
+ }
+
+ return;
+ }
+
+ // Remove editors by selector
+ if (typeof(selector) == "string") {
+ selector = selector.selector || selector;
+
+ each(DOM.select(selector), function(elm) {
+ self.remove(editors[elm.id]);
+ });
+
+ return;
+ }
+
+ // Remove specific editor
+ editor = selector;
+
+ // Not in the collection
+ if (!editors[editor.id]) {
+ return null;
+ }
+
+ delete editors[editor.id];
+
+ for (i = 0; i < editors.length; i++) {
+ if (editors[i] == editor) {
+ editors.splice(i, 1);
+ removedFromList = true;
+ break;
+ }
+ }
+
+ // Select another editor since the active one was removed
+ if (self.activeEditor == editor) {
+ self.activeEditor = editors[0];
+ }
+
+ /**
+ * Fires when an editor is removed from EditorManager collection.
+ *
+ * @event RemoveEditor
+ * @param {Object} e Event arguments.
+ */
+ if (removedFromList) {
+ self.fire('RemoveEditor', {editor: editor});
+ }
+
+ if (!editors.length) {
+ DOM.unbind(window, 'beforeunload', beforeUnloadDelegate);
+ }
+
+ editor.remove();
+
+ return editor;
+ },
+
+ /**
+ * Executes a specific command on the currently active editor.
+ *
+ * @method execCommand
+ * @param {String} c Command to perform for example Bold.
+ * @param {Boolean} u Optional boolean state if a UI should be presented for the command or not.
+ * @param {String} v Optional value parameter like for example an URL to a link.
+ * @return {Boolean} true/false if the command was executed or not.
+ */
+ execCommand: function(cmd, ui, value) {
+ var self = this, editor = self.get(value);
+
+ // Manager commands
+ switch (cmd) {
+ case "mceAddEditor":
+ if (!self.get(value)) {
+ new Editor(value, self.settings, self).render();
+ }
+
+ return true;
+
+ case "mceRemoveEditor":
+ if (editor) {
+ editor.remove();
+ }
+
+ return true;
+
+ case 'mceToggleEditor':
+ if (!editor) {
+ self.execCommand('mceAddEditor', 0, value);
+ return true;
+ }
+
+ if (editor.isHidden()) {
+ editor.show();
+ } else {
+ editor.hide();
+ }
+
+ return true;
+ }
+
+ // Run command on active editor
+ if (self.activeEditor) {
+ return self.activeEditor.execCommand(cmd, ui, value);
+ }
+
+ return false;
+ },
+
+ /**
+ * Calls the save method on all editor instances in the collection. This can be useful when a form is to be submitted.
+ *
+ * @method triggerSave
+ * @example
+ * // Saves all contents
+ * tinyMCE.triggerSave();
+ */
+ triggerSave: function() {
+ each(this.editors, function(editor) {
+ editor.save();
+ });
+ },
+
+ /**
+ * Adds a language pack, this gets called by the loaded language files like en.js.
+ *
+ * @method addI18n
+ * @param {String} code Optional language code.
+ * @param {Object} items Name/value object with translations.
+ */
+ addI18n: function(code, items) {
+ I18n.add(code, items);
+ },
+
+ /**
+ * Translates the specified string using the language pack items.
+ *
+ * @method translate
+ * @param {String/Array/Object} text String to translate
+ * @return {String} Translated string.
+ */
+ translate: function(text) {
+ return I18n.translate(text);
+ }
+ };
+
+ extend(EditorManager, Observable);
+
+ EditorManager.setup();
+
+ // Export EditorManager as tinymce/tinymce in global namespace
+ window.tinymce = window.tinyMCE = EditorManager;
+
+ return EditorManager;
+});
+
+// Included from: js/tinymce/classes/LegacyInput.js
+
+/**
+ * LegacyInput.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/LegacyInput", [
+ "tinymce/EditorManager",
+ "tinymce/util/Tools"
+], function(EditorManager, Tools) {
+ var each = Tools.each, explode = Tools.explode;
+
+ EditorManager.on('AddEditor', function(e) {
+ var editor = e.editor;
+
+ editor.on('preInit', function() {
+ var filters, fontSizes, dom, settings = editor.settings;
+
+ function replaceWithSpan(node, styles) {
+ each(styles, function(value, name) {
+ if (value) {
+ dom.setStyle(node, name, value);
+ }
+ });
+
+ dom.rename(node, 'span');
+ }
+
+ function convert(e) {
+ dom = editor.dom;
+
+ if (settings.convert_fonts_to_spans) {
+ each(dom.select('font,u,strike', e.node), function(node) {
+ filters[node.nodeName.toLowerCase()](dom, node);
+ });
+ }
+ }
+
+ if (settings.inline_styles) {
+ fontSizes = explode(settings.font_size_legacy_values);
+
+ filters = {
+ font: function(dom, node) {
+ replaceWithSpan(node, {
+ backgroundColor: node.style.backgroundColor,
+ color: node.color,
+ fontFamily: node.face,
+ fontSize: fontSizes[parseInt(node.size, 10) - 1]
+ });
+ },
+
+ u: function(dom, node) {
+ replaceWithSpan(node, {
+ textDecoration: 'underline'
+ });
+ },
+
+ strike: function(dom, node) {
+ replaceWithSpan(node, {
+ textDecoration: 'line-through'
+ });
+ }
+ };
+
+ editor.on('PreProcess SetContent', convert);
+ }
+ });
+ });
+});
+
+// Included from: js/tinymce/classes/util/XHR.js
+
+/**
+ * XHR.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class enables you to send XMLHTTPRequests cross browser.
+ * @class tinymce.util.XHR
+ * @static
+ * @example
+ * // Sends a low level Ajax request
+ * tinymce.util.XHR.send({
+ * url: 'someurl',
+ * success: function(text) {
+ * console.debug(text);
+ * }
+ * });
+ */
+define("tinymce/util/XHR", [], function() {
+ return {
+ /**
+ * Sends a XMLHTTPRequest.
+ * Consult the Wiki for details on what settings this method takes.
+ *
+ * @method send
+ * @param {Object} settings Object will target URL, callbacks and other info needed to make the request.
+ */
+ send: function(settings) {
+ var xhr, count = 0;
+
+ function ready() {
+ if (!settings.async || xhr.readyState == 4 || count++ > 10000) {
+ if (settings.success && count < 10000 && xhr.status == 200) {
+ settings.success.call(settings.success_scope, '' + xhr.responseText, xhr, settings);
+ } else if (settings.error) {
+ settings.error.call(settings.error_scope, count > 10000 ? 'TIMED_OUT' : 'GENERAL', xhr, settings);
+ }
+
+ xhr = null;
+ } else {
+ setTimeout(ready, 10);
+ }
+ }
+
+ // Default settings
+ settings.scope = settings.scope || this;
+ settings.success_scope = settings.success_scope || settings.scope;
+ settings.error_scope = settings.error_scope || settings.scope;
+ settings.async = settings.async === false ? false : true;
+ settings.data = settings.data || '';
+
+ xhr = new XMLHttpRequest();
+
+ if (xhr) {
+ if (xhr.overrideMimeType) {
+ xhr.overrideMimeType(settings.content_type);
+ }
+
+ xhr.open(settings.type || (settings.data ? 'POST' : 'GET'), settings.url, settings.async);
+
+ if (settings.content_type) {
+ xhr.setRequestHeader('Content-Type', settings.content_type);
+ }
+
+ xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
+
+ xhr.send(settings.data);
+
+ // Syncronous request
+ if (!settings.async) {
+ return ready();
+ }
+
+ // Wait for response, onReadyStateChange can not be used since it leaks memory in IE
+ setTimeout(ready, 10);
+ }
+ }
+ };
+});
+
+// Included from: js/tinymce/classes/util/JSON.js
+
+/**
+ * JSON.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * JSON parser and serializer class.
+ *
+ * @class tinymce.util.JSON
+ * @static
+ * @example
+ * // JSON parse a string into an object
+ * var obj = tinymce.util.JSON.parse(somestring);
+ *
+ * // JSON serialize a object into an string
+ * var str = tinymce.util.JSON.serialize(obj);
+ */
+define("tinymce/util/JSON", [], function() {
+ function serialize(o, quote) {
+ var i, v, t, name;
+
+ quote = quote || '"';
+
+ if (o === null) {
+ return 'null';
+ }
+
+ t = typeof o;
+
+ if (t == 'string') {
+ v = '\bb\tt\nn\ff\rr\""\'\'\\\\';
+
+ return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function(a, b) {
+ // Make sure single quotes never get encoded inside double quotes for JSON compatibility
+ if (quote === '"' && a === "'") {
+ return a;
+ }
+
+ i = v.indexOf(b);
+
+ if (i + 1) {
+ return '\\' + v.charAt(i + 1);
+ }
+
+ a = b.charCodeAt().toString(16);
+
+ return '\\u' + '0000'.substring(a.length) + a;
+ }) + quote;
+ }
+
+ if (t == 'object') {
+ if (o.hasOwnProperty && Object.prototype.toString.call(o) === '[object Array]') {
+ for (i=0, v = '['; i<o.length; i++) {
+ v += (i > 0 ? ',' : '') + serialize(o[i], quote);
+ }
+
+ return v + ']';
+ }
+
+ v = '{';
+
+ for (name in o) {
+ if (o.hasOwnProperty(name)) {
+ v += typeof o[name] != 'function' ? (v.length > 1 ? ',' + quote : quote) + name +
+ quote +':' + serialize(o[name], quote) : '';
+ }
+ }
+
+ return v + '}';
+ }
+
+ return '' + o;
+ }
+
+ return {
+ /**
+ * Serializes the specified object as a JSON string.
+ *
+ * @method serialize
+ * @param {Object} obj Object to serialize as a JSON string.
+ * @param {String} quote Optional quote string defaults to ".
+ * @return {string} JSON string serialized from input.
+ */
+ serialize: serialize,
+
+ /**
+ * Unserializes/parses the specified JSON string into a object.
+ *
+ * @method parse
+ * @param {string} s JSON String to parse into a JavaScript object.
+ * @return {Object} Object from input JSON string or undefined if it failed.
+ */
+ parse: function(text) {
+ try {
+ // Trick uglify JS
+ return window[String.fromCharCode(101) + 'val']('(' + text + ')');
+ } catch (ex) {
+ // Ignore
+ }
+ }
+
+ /**#@-*/
+ };
+});
+
+// Included from: js/tinymce/classes/util/JSONRequest.js
+
+/**
+ * JSONRequest.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class enables you to use JSON-RPC to call backend methods.
+ *
+ * @class tinymce.util.JSONRequest
+ * @example
+ * var json = new tinymce.util.JSONRequest({
+ * url: 'somebackend.php'
+ * });
+ *
+ * // Send RPC call 1
+ * json.send({
+ * method: 'someMethod1',
+ * params: ['a', 'b'],
+ * success: function(result) {
+ * console.dir(result);
+ * }
+ * });
+ *
+ * // Send RPC call 2
+ * json.send({
+ * method: 'someMethod2',
+ * params: ['a', 'b'],
+ * success: function(result) {
+ * console.dir(result);
+ * }
+ * });
+ */
+define("tinymce/util/JSONRequest", [
+ "tinymce/util/JSON",
+ "tinymce/util/XHR",
+ "tinymce/util/Tools"
+], function(JSON, XHR, Tools) {
+ var extend = Tools.extend;
+
+ function JSONRequest(settings) {
+ this.settings = extend({}, settings);
+ this.count = 0;
+ }
+
+ /**
+ * Simple helper function to send a JSON-RPC request without the need to initialize an object.
+ * Consult the Wiki API documentation for more details on what you can pass to this function.
+ *
+ * @method sendRPC
+ * @static
+ * @param {Object} o Call object where there are three field id, method and params this object should also contain callbacks etc.
+ */
+ JSONRequest.sendRPC = function(o) {
+ return new JSONRequest().send(o);
+ };
+
+ JSONRequest.prototype = {
+ /**
+ * Sends a JSON-RPC call. Consult the Wiki API documentation for more details on what you can pass to this function.
+ *
+ * @method send
+ * @param {Object} args Call object where there are three field id, method and params this object should also contain callbacks etc.
+ */
+ send: function(args) {
+ var ecb = args.error, scb = args.success;
+
+ args = extend(this.settings, args);
+
+ args.success = function(c, x) {
+ c = JSON.parse(c);
+
+ if (typeof(c) == 'undefined') {
+ c = {
+ error : 'JSON Parse error.'
+ };
+ }
+
+ if (c.error) {
+ ecb.call(args.error_scope || args.scope, c.error, x);
+ } else {
+ scb.call(args.success_scope || args.scope, c.result);
+ }
+ };
+
+ args.error = function(ty, x) {
+ if (ecb) {
+ ecb.call(args.error_scope || args.scope, ty, x);
+ }
+ };
+
+ args.data = JSON.serialize({
+ id: args.id || 'c' + (this.count++),
+ method: args.method,
+ params: args.params
+ });
+
+ // JSON content type for Ruby on rails. Bug: #1883287
+ args.content_type = 'application/json';
+
+ XHR.send(args);
+ }
+ };
+
+ return JSONRequest;
+});
+
+// Included from: js/tinymce/classes/util/JSONP.js
+
+/**
+ * JSONP.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define("tinymce/util/JSONP", [
+ "tinymce/dom/DOMUtils"
+], function(DOMUtils) {
+ return {
+ callbacks: {},
+ count: 0,
+
+ send: function(settings) {
+ var self = this, dom = DOMUtils.DOM, count = settings.count !== undefined ? settings.count : self.count;
+ var id = 'tinymce_jsonp_' + count;
+
+ self.callbacks[count] = function(json) {
+ dom.remove(id);
+ delete self.callbacks[count];
+
+ settings.callback(json);
+ };
+
+ dom.add(dom.doc.body, 'script', {
+ id: id,
+ src: settings.url,
+ type: 'text/javascript'
+ });
+
+ self.count++;
+ }
+ };
+});
+
+// Included from: js/tinymce/classes/util/LocalStorage.js
+
+/**
+ * LocalStorage.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class will simulate LocalStorage on IE 7 and return the native version on modern browsers.
+ * Storage is done using userData on IE 7 and a special serialization format. The format is designed
+ * to be as small as possible by making sure that the keys and values doesn't need to be encoded. This
+ * makes it possible to store for example HTML data.
+ *
+ * Storage format for userData:
+ * <base 32 key length>,<key string>,<base 32 value length>,<value>,...
+ *
+ * For example this data key1=value1,key2=value2 would be:
+ * 4,key1,6,value1,4,key2,6,value2
+ *
+ * @class tinymce.util.LocalStorage
+ * @static
+ * @version 4.0
+ * @example
+ * tinymce.util.LocalStorage.setItem('key', 'value');
+ * var value = tinymce.util.LocalStorage.getItem('key');
+ */
+define("tinymce/util/LocalStorage", [], function() {
+ var LocalStorage, storageElm, items, keys, userDataKey, hasOldIEDataSupport;
+
+ // Check for native support
+ try {
+ if (window.localStorage) {
+ return localStorage;
+ }
+ } catch (ex) {
+ // Ignore
+ }
+
+ userDataKey = "tinymce";
+ storageElm = document.documentElement;
+ hasOldIEDataSupport = !!storageElm.addBehavior;
+
+ if (hasOldIEDataSupport) {
+ storageElm.addBehavior('#default#userData');
+ }
+
+ /**
+ * Gets the keys names and updates LocalStorage.length property. Since IE7 doesn't have any getters/setters.
+ */
+ function updateKeys() {
+ keys = [];
+
+ for (var key in items) {
+ keys.push(key);
+ }
+
+ LocalStorage.length = keys.length;
+ }
+
+ /**
+ * Loads the userData string and parses it into the items structure.
+ */
+ function load() {
+ var key, data, value, pos = 0;
+
+ items = {};
+
+ // localStorage can be disabled on WebKit/Gecko so make a dummy storage
+ if (!hasOldIEDataSupport) {
+ return;
+ }
+
+ function next(end) {
+ var value, nextPos;
+
+ nextPos = end !== undefined ? pos + end : data.indexOf(',', pos);
+ if (nextPos === -1 || nextPos > data.length) {
+ return null;
+ }
+
+ value = data.substring(pos, nextPos);
+ pos = nextPos + 1;
+
+ return value;
+ }
+
+ storageElm.load(userDataKey);
+ data = storageElm.getAttribute(userDataKey) || '';
+
+ do {
+ var offset = next();
+ if (offset === null) {
+ break;
+ }
+
+ key = next(parseInt(offset, 32) || 0);
+ if (key !== null) {
+ offset = next();
+ if (offset === null) {
+ break;
+ }
+
+ value = next(parseInt(offset, 32) || 0);
+
+ if (key) {
+ items[key] = value;
+ }
+ }
+ } while (key !== null);
+
+ updateKeys();
+ }
+
+ /**
+ * Saves the items structure into a the userData format.
+ */
+ function save() {
+ var value, data = '';
+
+ // localStorage can be disabled on WebKit/Gecko so make a dummy storage
+ if (!hasOldIEDataSupport) {
+ return;
+ }
+
+ for (var key in items) {
+ value = items[key];
+ data += (data ? ',' : '') + key.length.toString(32) + ',' + key + ',' + value.length.toString(32) + ',' + value;
+ }
+
+ storageElm.setAttribute(userDataKey, data);
+
+ try {
+ storageElm.save(userDataKey);
+ } catch (ex) {
+ // Ignore disk full
+ }
+
+ updateKeys();
+ }
+
+ LocalStorage = {
+ /**
+ * Length of the number of items in storage.
+ *
+ * @property length
+ * @type Number
+ * @return {Number} Number of items in storage.
+ */
+ //length:0,
+
+ /**
+ * Returns the key name by index.
+ *
+ * @method key
+ * @param {Number} index Index of key to return.
+ * @return {String} Key value or null if it wasn't found.
+ */
+ key: function(index) {
+ return keys[index];
+ },
+
+ /**
+ * Returns the value if the specified key or null if it wasn't found.
+ *
+ * @method getItem
+ * @param {String} key Key of item to retrive.
+ * @return {String} Value of the specified item or null if it wasn't found.
+ */
+ getItem: function(key) {
+ return key in items ? items[key] : null;
+ },
+
+ /**
+ * Sets the value of the specified item by it's key.
+ *
+ * @method setItem
+ * @param {String} key Key of the item to set.
+ * @param {String} value Value of the item to set.
+ */
+ setItem: function(key, value) {
+ items[key] = "" + value;
+ save();
+ },
+
+ /**
+ * Removes the specified item by key.
+ *
+ * @method removeItem
+ * @param {String} key Key of item to remove.
+ */
+ removeItem: function(key) {
+ delete items[key];
+ save();
+ },
+
+ /**
+ * Removes all items.
+ *
+ * @method clear
+ */
+ clear: function() {
+ items = {};
+ save();
+ }
+ };
+
+ load();
+
+ return LocalStorage;
+});
+
+// Included from: js/tinymce/classes/Compat.js
+
+/**
+ * Compat.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * TinyMCE core class.
+ *
+ * @static
+ * @class tinymce
+ * @borrow-members tinymce.EditorManager
+ * @borrow-members tinymce.util.Tools
+ */
+define("tinymce/Compat", [
+ "tinymce/dom/DOMUtils",
+ "tinymce/dom/EventUtils",
+ "tinymce/dom/ScriptLoader",
+ "tinymce/AddOnManager",
+ "tinymce/util/Tools",
+ "tinymce/Env"
+], function(DOMUtils, EventUtils, ScriptLoader, AddOnManager, Tools, Env) {
+ var tinymce = window.tinymce;
+
+ /**
+ * @property {tinymce.dom.DOMUtils} DOM Global DOM instance.
+ * @property {tinymce.dom.ScriptLoader} ScriptLoader Global ScriptLoader instance.
+ * @property {tinymce.AddOnManager} PluginManager Global PluginManager instance.
+ * @property {tinymce.AddOnManager} ThemeManager Global ThemeManager instance.
+ */
+ tinymce.DOM = DOMUtils.DOM;
+ tinymce.ScriptLoader = ScriptLoader.ScriptLoader;
+ tinymce.PluginManager = AddOnManager.PluginManager;
+ tinymce.ThemeManager = AddOnManager.ThemeManager;
+
+ tinymce.dom = tinymce.dom || {};
+ tinymce.dom.Event = EventUtils.Event;
+
+ Tools.each(Tools, function(func, key) {
+ tinymce[key] = func;
+ });
+
+ Tools.each('isOpera isWebKit isIE isGecko isMac'.split(' '), function(name) {
+ tinymce[name] = Env[name.substr(2).toLowerCase()];
+ });
+
+ return {};
+});
+
+// Describe the different namespaces
+
+/**
+ * Root level namespace this contains classes directly releated to the TinyMCE editor.
+ *
+ * @namespace tinymce
+ */
+
+/**
+ * Contains classes for handling the browsers DOM.
+ *
+ * @namespace tinymce.dom
+ */
+
+/**
+ * Contains html parser and serializer logic.
+ *
+ * @namespace tinymce.html
+ */
+
+/**
+ * Contains the different UI types such as buttons, listboxes etc.
+ *
+ * @namespace tinymce.ui
+ */
+
+/**
+ * Contains various utility classes such as json parser, cookies etc.
+ *
+ * @namespace tinymce.util
+ */
+
+// Included from: js/tinymce/classes/ui/Layout.js
+
+/**
+ * Layout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Base layout manager class.
+ *
+ * @class tinymce.ui.Layout
+ */
+define("tinymce/ui/Layout", [
+ "tinymce/util/Class",
+ "tinymce/util/Tools"
+], function(Class, Tools) {
+ "use strict";
+
+ return Class.extend({
+ Defaults: {
+ firstControlClass: 'first',
+ lastControlClass: 'last'
+ },
+
+ /**
+ * Constructs a layout instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ */
+ init: function(settings) {
+ this.settings = Tools.extend({}, this.Defaults, settings);
+ },
+
+ /**
+ * This method gets invoked before the layout renders the controls.
+ *
+ * @method preRender
+ * @param {tinymce.ui.Container} container Container instance to preRender.
+ */
+ preRender: function(container) {
+ container.addClass(this.settings.containerClass, 'body');
+ },
+
+ /**
+ * Applies layout classes to the container.
+ *
+ * @private
+ */
+ applyClasses: function(container) {
+ var self = this, settings = self.settings, items, firstClass, lastClass;
+
+ items = container.items().filter(':visible');
+ firstClass = settings.firstControlClass;
+ lastClass = settings.lastControlClass;
+
+ items.each(function(item) {
+ item.removeClass(firstClass).removeClass(lastClass);
+
+ if (settings.controlClass) {
+ item.addClass(settings.controlClass);
+ }
+ });
+
+ items.eq(0).addClass(firstClass);
+ items.eq(-1).addClass(lastClass);
+ },
+
+ /**
+ * Renders the specified container and any layout specific HTML.
+ *
+ * @method renderHtml
+ * @param {tinymce.ui.Container} container Container to render HTML for.
+ */
+ renderHtml: function(container) {
+ var self = this, settings = self.settings, items, html = '';
+
+ items = container.items();
+ items.eq(0).addClass(settings.firstControlClass);
+ items.eq(-1).addClass(settings.lastControlClass);
+
+ items.each(function(item) {
+ if (settings.controlClass) {
+ item.addClass(settings.controlClass);
+ }
+
+ html += item.renderHtml();
+ });
+
+ return html;
+ },
+
+ /**
+ * Recalculates the positions of the controls in the specified container.
+ *
+ * @method recalc
+ * @param {tinymce.ui.Container} container Container instance to recalc.
+ */
+ recalc: function() {
+ },
+
+ /**
+ * This method gets invoked after the layout renders the controls.
+ *
+ * @method postRender
+ * @param {tinymce.ui.Container} container Container instance to postRender.
+ */
+ postRender: function() {
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/AbsoluteLayout.js
+
+/**
+ * AbsoluteLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * LayoutManager for absolute positioning. This layout manager is more of
+ * a base class for other layouts but can be created and used directly.
+ *
+ * @-x-less AbsoluteLayout.less
+ * @class tinymce.ui.AbsoluteLayout
+ * @extends tinymce.ui.Layout
+ */
+define("tinymce/ui/AbsoluteLayout", [
+ "tinymce/ui/Layout"
+], function(Layout) {
+ "use strict";
+
+ return Layout.extend({
+ Defaults: {
+ containerClass: 'abs-layout',
+ controlClass: 'abs-layout-item'
+ },
+
+ /**
+ * Recalculates the positions of the controls in the specified container.
+ *
+ * @method recalc
+ * @param {tinymce.ui.Container} container Container instance to recalc.
+ */
+ recalc: function(container) {
+ container.items().filter(':visible').each(function(ctrl) {
+ var settings = ctrl.settings;
+
+ ctrl.layoutRect({
+ x: settings.x,
+ y: settings.y,
+ w: settings.w,
+ h: settings.h
+ });
+
+ if (ctrl.recalc) {
+ ctrl.recalc();
+ }
+ });
+ },
+
+ /**
+ * Renders the specified container and any layout specific HTML.
+ *
+ * @method renderHtml
+ * @param {tinymce.ui.Container} container Container to render HTML for.
+ */
+ renderHtml: function(container) {
+ return '<div id="' + container._id + '-absend" class="' + container.classPrefix + 'abs-end"></div>' + this._super(container);
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/Tooltip.js
+
+/**
+ * Tooltip.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a tooltip instance.
+ *
+ * @-x-less ToolTip.less
+ * @class tinymce.ui.ToolTip
+ * @extends tinymce.ui.Control
+ * @mixes tinymce.ui.Movable
+ */
+define("tinymce/ui/Tooltip", [
+ "tinymce/ui/Control",
+ "tinymce/ui/Movable"
+], function(Control, Movable) {
+ return Control.extend({
+ Mixins: [Movable],
+
+ Defaults: {
+ classes: 'widget tooltip tooltip-n'
+ },
+
+ /**
+ * Sets/gets the current label text.
+ *
+ * @method text
+ * @param {String} [text] New label text.
+ * @return {String|tinymce.ui.Tooltip} Current text or current label instance.
+ */
+ text: function(value) {
+ var self = this;
+
+ if (typeof(value) != "undefined") {
+ self._value = value;
+
+ if (self._rendered) {
+ self.getEl().lastChild.innerHTML = self.encode(value);
+ }
+
+ return self;
+ }
+
+ return self._value;
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, prefix = self.classPrefix;
+
+ return (
+ '<div id="' + self._id + '" class="' + self.classes() + '" role="presentation">' +
+ '<div class="' + prefix + 'tooltip-arrow"></div>' +
+ '<div class="' + prefix + 'tooltip-inner">' + self.encode(self._text) + '</div>' +
+ '</div>'
+ );
+ },
+
+ /**
+ * Repaints the control after a layout operation.
+ *
+ * @method repaint
+ */
+ repaint: function() {
+ var self = this, style, rect;
+
+ style = self.getEl().style;
+ rect = self._layoutRect;
+
+ style.left = rect.x + 'px';
+ style.top = rect.y + 'px';
+ style.zIndex = 0xFFFF + 0xFFFF;
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/Widget.js
+
+/**
+ * Widget.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Widget base class a widget is a control that has a tooltip and some basic states.
+ *
+ * @class tinymce.ui.Widget
+ * @extends tinymce.ui.Control
+ */
+define("tinymce/ui/Widget", [
+ "tinymce/ui/Control",
+ "tinymce/ui/Tooltip"
+], function(Control, Tooltip) {
+ "use strict";
+
+ var tooltip;
+
+ var Widget = Control.extend({
+ /**
+ * Constructs a instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ * @setting {String} tooltip Tooltip text to display when hovering.
+ * @setting {Boolean} autofocus True if the control should be focused when rendered.
+ * @setting {String} text Text to display inside widget.
+ */
+ init: function(settings) {
+ var self = this;
+
+ self._super(settings);
+ self.canFocus = true;
+
+ if (settings.tooltip && Widget.tooltips !== false) {
+ self.on('mouseenter', function(e) {
+ var tooltip = self.tooltip().moveTo(-0xFFFF);
+
+ if (e.control == self) {
+ var rel = tooltip.text(settings.tooltip).show().testMoveRel(self.getEl(), ['bc-tc', 'bc-tl', 'bc-tr']);
+
+ tooltip.toggleClass('tooltip-n', rel == 'bc-tc');
+ tooltip.toggleClass('tooltip-nw', rel == 'bc-tl');
+ tooltip.toggleClass('tooltip-ne', rel == 'bc-tr');
+
+ tooltip.moveRel(self.getEl(), rel);
+ } else {
+ tooltip.hide();
+ }
+ });
+
+ self.on('mouseleave mousedown click', function() {
+ self.tooltip().hide();
+ });
+
+ }
+
+ self.aria('label', settings.tooltip);
+ },
+
+ /**
+ * Returns the current tooltip instance.
+ *
+ * @method tooltip
+ * @return {tinymce.ui.Tooltip} Tooltip instance.
+ */
+ tooltip: function() {
+ var self = this;
+
+ if (!tooltip) {
+ tooltip = new Tooltip({type: 'tooltip'});
+ tooltip.renderTo(self.getContainerElm());
+ }
+
+ return tooltip;
+ },
+
+ /**
+ * Sets/gets the active state of the widget.
+ *
+ * @method active
+ * @param {Boolean} [state] State if the control is active.
+ * @return {Boolean|tinymce.ui.Widget} True/false or current widget instance.
+ */
+ active: function(state) {
+ var self = this, undef;
+
+ if (state !== undef) {
+ self.aria('pressed', state);
+ self.toggleClass('active', state);
+ }
+
+ return self._super(state);
+ },
+
+ /**
+ * Sets/gets the disabled state of the widget.
+ *
+ * @method disabled
+ * @param {Boolean} [state] State if the control is disabled.
+ * @return {Boolean|tinymce.ui.Widget} True/false or current widget instance.
+ */
+ disabled: function(state) {
+ var self = this, undef;
+
+ if (state !== undef) {
+ self.aria('disabled', state);
+ self.toggleClass('disabled', state);
+ }
+
+ return self._super(state);
+ },
+
+ /**
+ * Called after the control has been rendered.
+ *
+ * @method postRender
+ */
+ postRender: function() {
+ var self = this, settings = self.settings;
+
+ self._rendered = true;
+
+ self._super();
+
+ if (!self.parent() && (settings.width || settings.height)) {
+ self.initLayoutRect();
+ self.repaint();
+ }
+
+ if (settings.autofocus) {
+ setTimeout(function() {
+ self.focus();
+ }, 0);
+ }
+ },
+
+ /**
+ * Removes the current control from DOM and from UI collections.
+ *
+ * @method remove
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ remove: function() {
+ this._super();
+
+ if (tooltip) {
+ tooltip.remove();
+ tooltip = null;
+ }
+ }
+ });
+
+ return Widget;
+});
+
+// Included from: js/tinymce/classes/ui/Button.js
+
+/**
+ * Button.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is used to create buttons. You can create them directly or through the Factory.
+ *
+ * @example
+ * // Create and render a button to the body element
+ * tinymce.ui.Factory.create({
+ * type: 'button',
+ * text: 'My button'
+ * }).renderTo(document.body);
+ *
+ * @-x-less Button.less
+ * @class tinymce.ui.Button
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Button", [
+ "tinymce/ui/Widget"
+], function(Widget) {
+ "use strict";
+
+ return Widget.extend({
+ Defaults: {
+ classes: "widget btn",
+ role: "button"
+ },
+
+ /**
+ * Constructs a new button instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ * @setting {String} size Size of the button small|medium|large.
+ * @setting {String} image Image to use for icon.
+ * @setting {String} icon Icon to use for button.
+ */
+ init: function(settings) {
+ var self = this, size;
+
+ self.on('click mousedown', function(e) {
+ e.preventDefault();
+ });
+
+ self._super(settings);
+ size = settings.size;
+
+ if (settings.subtype) {
+ self.addClass(settings.subtype);
+ }
+
+ if (size) {
+ self.addClass('btn-' + size);
+ }
+ },
+
+ /**
+ * Sets/gets the current button icon.
+ *
+ * @method icon
+ * @param {String} [icon] New icon identifier.
+ * @return {String|tinymce.ui.MenuButton} Current icon or current MenuButton instance.
+ */
+ icon: function(icon) {
+ var self = this, prefix = self.classPrefix;
+
+ if (typeof(icon) == 'undefined') {
+ return self.settings.icon;
+ }
+
+ self.settings.icon = icon;
+ icon = icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
+
+ if (self._rendered) {
+ var btnElm = self.getEl().firstChild, iconElm = btnElm.getElementsByTagName('i')[0];
+
+ if (icon) {
+ if (!iconElm || iconElm != btnElm.firstChild) {
+ iconElm = document.createElement('i');
+ btnElm.insertBefore(iconElm, btnElm.firstChild);
+ }
+
+ iconElm.className = icon;
+ } else if (iconElm) {
+ btnElm.removeChild(iconElm);
+ }
+
+ self.text(self._text); // Set text again to fix whitespace between icon + text
+ }
+
+ return self;
+ },
+
+ /**
+ * Repaints the button for example after it's been resizes by a layout engine.
+ *
+ * @method repaint
+ */
+ repaint: function() {
+ var btnStyle = this.getEl().firstChild.style;
+
+ btnStyle.width = btnStyle.height = "100%";
+
+ this._super();
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, id = self._id, prefix = self.classPrefix;
+ var icon = self.settings.icon, image = '';
+
+ if (self.settings.image) {
+ icon = 'none';
+ image = ' style="background-image: url(\'' + self.settings.image + '\')"';
+ }
+
+ icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
+
+ return (
+ '<div id="' + id + '" class="' + self.classes() + '" tabindex="-1">' +
+ '<button role="presentation" type="button" tabindex="-1">' +
+ (icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
+ (self._text ? (icon ? '\u00a0' : '') + self.encode(self._text) : '') +
+ '</button>' +
+ '</div>'
+ );
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/ButtonGroup.js
+
+/**
+ * ButtonGroup.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This control enables you to put multiple buttons into a group. This is
+ * useful when you want to combine similar toolbar buttons into a group.
+ *
+ * @example
+ * // Create and render a buttongroup with two buttons to the body element
+ * tinymce.ui.Factory.create({
+ * type: 'buttongroup',
+ * items: [
+ * {text: 'Button A'},
+ * {text: 'Button B'}
+ * ]
+ * }).renderTo(document.body);
+ *
+ * @-x-less ButtonGroup.less
+ * @class tinymce.ui.ButtonGroup
+ * @extends tinymce.ui.Container
+ */
+define("tinymce/ui/ButtonGroup", [
+ "tinymce/ui/Container"
+], function(Container) {
+ "use strict";
+
+ return Container.extend({
+ Defaults: {
+ defaultType: 'button',
+ role: 'toolbar'
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, layout = self._layout;
+
+ self.addClass('btn-group');
+ self.preRender();
+ layout.preRender(self);
+
+ return (
+ '<div id="' + self._id + '" class="' + self.classes() + '">'+
+ '<div id="' + self._id + '-body">'+
+ (self.settings.html || '') + layout.renderHtml(self) +
+ '</div>' +
+ '</div>'
+ );
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/Checkbox.js
+
+/**
+ * Checkbox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This control creates a custom checkbox.
+ *
+ * @example
+ * // Create and render a checkbox to the body element
+ * tinymce.ui.Factory.create({
+ * type: 'checkbox',
+ * checked: true,
+ * text: 'My checkbox'
+ * }).renderTo(document.body);
+ *
+ * @-x-less Checkbox.less
+ * @class tinymce.ui.Checkbox
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Checkbox", [
+ "tinymce/ui/Widget"
+], function(Widget) {
+ "use strict";
+
+ return Widget.extend({
+ Defaults: {
+ classes: "checkbox",
+ role: "checkbox",
+ checked: false
+ },
+
+ /**
+ * Constructs a new Checkbox instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ * @setting {Boolean} checked True if the checkbox should be checked by default.
+ */
+ init: function(settings) {
+ var self = this;
+
+ self._super(settings);
+
+ self.on('click mousedown', function(e) {
+ e.preventDefault();
+ });
+
+ self.on('click', function(e) {
+ e.preventDefault();
+
+ if (!self.disabled()) {
+ self.checked(!self.checked());
+ }
+ });
+
+ self.checked(self.settings.checked);
+ },
+
+ /**
+ * Getter/setter function for the checked state.
+ *
+ * @method checked
+ * @param {Boolean} [state] State to be set.
+ * @return {Boolean|tinymce.ui.Checkbox} True/false or checkbox if it's a set operation.
+ */
+ checked: function(state) {
+ var self = this;
+
+ if (typeof state != "undefined") {
+ if (state) {
+ self.addClass('checked');
+ } else {
+ self.removeClass('checked');
+ }
+
+ self._checked = state;
+ self.aria('checked', state);
+
+ return self;
+ }
+
+ return self._checked;
+ },
+
+ /**
+ * Getter/setter function for the value state.
+ *
+ * @method value
+ * @param {Boolean} [state] State to be set.
+ * @return {Boolean|tinymce.ui.Checkbox} True/false or checkbox if it's a set operation.
+ */
+ value: function(state) {
+ return this.checked(state);
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, id = self._id, prefix = self.classPrefix;
+
+ return (
+ '<div id="' + id + '" class="' + self.classes() + '" unselectable="on" aria-labeledby="' + id + '-al" tabindex="-1">' +
+ '<i class="' + prefix + 'ico ' + prefix + 'i-checkbox"></i>' +
+ '<span id="' + id +'-al" class="' + prefix + 'label">' + self.encode(self._text) + '</span>' +
+ '</div>'
+ );
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/PanelButton.js
+
+/**
+ * PanelButton.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new panel button.
+ *
+ * @class tinymce.ui.PanelButton
+ * @extends tinymce.ui.Button
+ */
+define("tinymce/ui/PanelButton", [
+ "tinymce/ui/Button",
+ "tinymce/ui/FloatPanel"
+], function(Button, FloatPanel) {
+ "use strict";
+
+ return Button.extend({
+ /**
+ * Shows the panel for the button.
+ *
+ * @method showPanel
+ */
+ showPanel: function() {
+ var self = this, settings = self.settings;
+
+ self.active(true);
+
+ if (!self.panel) {
+ var panelSettings = settings.panel;
+
+ // Wrap panel in grid layout if type if specified
+ // This makes it possible to add forms or other containers directly in the panel option
+ if (panelSettings.type) {
+ panelSettings = {
+ layout: 'grid',
+ items: panelSettings
+ };
+ }
+
+ panelSettings.popover = true;
+ panelSettings.autohide = true;
+
+ self.panel = new FloatPanel(panelSettings).on('hide', function() {
+ self.active(false);
+ }).parent(self).renderTo(self.getContainerElm());
+ self.panel.fire('show');
+ self.panel.reflow();
+ } else {
+ self.panel.show();
+ }
+
+ self.panel.moveRel(self.getEl(), settings.popoverAlign || (self.isRtl() ? ['bc-tr', 'bc-tc'] : ['bc-tl', 'bc-tc']));
+ },
+
+ /**
+ * Hides the panel for the button.
+ *
+ * @method hidePanel
+ */
+ hidePanel: function() {
+ var self = this;
+
+ if (self.panel) {
+ self.panel.hide();
+ }
+ },
+
+ /**
+ * Called after the control has been rendered.
+ *
+ * @method postRender
+ */
+ postRender: function() {
+ var self = this;
+
+ self.on('click', function(e) {
+ if (e.control === self) {
+ if (self.panel && self.panel.visible()) {
+ self.hidePanel();
+ } else {
+ self.showPanel();
+ }
+ }
+ });
+
+ return self._super();
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/ColorButton.js
+
+/**
+ * ColorButton.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a color button control. This is a split button in which the main
+ * button has a visual representation of the currently selected color. When clicked
+ * the caret button displays a color picker, allowing the user to select a new color.
+ *
+ * @-x-less ColorButton.less
+ * @class tinymce.ui.ColorButton
+ * @extends tinymce.ui.PanelButton
+ */
+define("tinymce/ui/ColorButton", [
+ "tinymce/ui/PanelButton",
+ "tinymce/dom/DOMUtils"
+], function(PanelButton, DomUtils) {
+ "use strict";
+
+ var DOM = DomUtils.DOM;
+
+ return PanelButton.extend({
+ /**
+ * Constructs a new ColorButton instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ */
+ init: function(settings) {
+ this._super(settings);
+ this.addClass('colorbutton');
+ },
+
+ /**
+ * Getter/setter for the current color.
+ *
+ * @method color
+ * @param {String} [color] Color to set.
+ * @return {String|tinymce.ui.ColorButton} Current color or current instance.
+ */
+ color: function(color) {
+ if (color) {
+ this._color = color;
+ this.getEl('preview').style.backgroundColor = color;
+ return this;
+ }
+
+ return this._color;
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, id = self._id, prefix = self.classPrefix;
+ var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
+ var image = self.settings.image ? ' style="background-image: url(\'' + self.settings.image + '\')"' : '';
+
+ return (
+ '<div id="' + id + '" class="' + self.classes() + '">' +
+ '<button role="presentation" hidefocus type="button" tabindex="-1">' +
+ (icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
+ '<span id="' + id + '-preview" class="' + prefix + 'preview"></span>' +
+ (self._text ? (icon ? ' ' : '') + (self._text) : '') +
+ '</button>' +
+ '<button type="button" class="' + prefix + 'open" hidefocus tabindex="-1">' +
+ ' <i class="' + prefix + 'caret"></i>' +
+ '</button>' +
+ '</div>'
+ );
+ },
+
+ /**
+ * Called after the control has been rendered.
+ *
+ * @method postRender
+ */
+ postRender: function() {
+ var self = this, onClickHandler = self.settings.onclick;
+
+ self.on('click', function(e) {
+ if (e.control == self && !DOM.getParent(e.target, '.' + self.classPrefix + 'open')) {
+ e.stopImmediatePropagation();
+ onClickHandler.call(self, e);
+ }
+ });
+
+ delete self.settings.onclick;
+
+ return self._super();
+ }
+
+ });
+});
+
+// Included from: js/tinymce/classes/ui/ComboBox.js
+
+/**
+ * ComboBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a combobox control. Select box that you select a value from or
+ * type a value into.
+ *
+ * @-x-less ComboBox.less
+ * @class tinymce.ui.ComboBox
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/ComboBox", [
+ "tinymce/ui/Widget",
+ "tinymce/ui/DomUtils"
+], function(Widget, DomUtils) {
+ "use strict";
+
+ return Widget.extend({
+ /**
+ * Constructs a new control instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ * @setting {String} placeholder Placeholder text to display.
+ */
+ init: function(settings) {
+ var self = this;
+
+ self._super(settings);
+ self.addClass('combobox');
+
+ self.on('click', function(e) {
+ var elm = e.target;
+
+ while (elm) {
+ if (elm.id && elm.id.indexOf('-open') != -1) {
+ self.fire('action');
+ }
+
+ elm = elm.parentNode;
+ }
+ });
+
+ // TODO: Rework this
+ self.on('keydown', function(e) {
+ if (e.target.nodeName == "INPUT" && e.keyCode == 13) {
+ self.parents().reverse().each(function(ctrl) {
+ e.preventDefault();
+ self.fire('change');
+
+ if (ctrl.hasEventListeners('submit') && ctrl.toJSON) {
+ ctrl.fire('submit', {data: ctrl.toJSON()});
+ return false;
+ }
+ });
+ }
+ });
+
+ if (settings.placeholder) {
+ self.addClass('placeholder');
+
+ self.on('focusin', function() {
+ if (!self._hasOnChange) {
+ DomUtils.on(self.getEl('inp'), 'change', function() {
+ self.fire('change');
+ });
+
+ self._hasOnChange = true;
+ }
+
+ if (self.hasClass('placeholder')) {
+ self.getEl('inp').value = '';
+ self.removeClass('placeholder');
+ }
+ });
+
+ self.on('focusout', function() {
+ if (self.value().length === 0) {
+ self.getEl('inp').value = settings.placeholder;
+ self.addClass('placeholder');
+ }
+ });
+ }
+ },
+
+ /**
+ * Getter/setter function for the control value.
+ *
+ * @method value
+ * @param {String} [value] Value to be set.
+ * @return {String|tinymce.ui.ComboBox} Value or self if it's a set operation.
+ */
+ value: function(value) {
+ var self = this;
+
+ if (typeof(value) != "undefined") {
+ self._value = value;
+ self.removeClass('placeholder');
+
+ if (self._rendered) {
+ self.getEl('inp').value = value;
+ }
+
+ return self;
+ }
+
+ if (self._rendered) {
+ value = self.getEl('inp').value;
+
+ if (value != self.settings.placeholder) {
+ return value;
+ }
+
+ return '';
+ }
+
+ return self._value;
+ },
+
+ /**
+ * Getter/setter function for the disabled state.
+ *
+ * @method value
+ * @param {Boolean} [state] State to be set.
+ * @return {Boolean|tinymce.ui.ComboBox} True/false or self if it's a set operation.
+ */
+ disabled: function(state) {
+ var self = this;
+
+ if (self._rendered && typeof(state) != 'undefined') {
+ self.getEl('inp').disabled = state;
+ }
+
+ return self._super(state);
+ },
+
+ /**
+ * Focuses the input area of the control.
+ *
+ * @method focus
+ */
+ focus: function() {
+ this.getEl('inp').focus();
+ },
+
+ /**
+ * Repaints the control after a layout operation.
+ *
+ * @method repaint
+ */
+ repaint: function() {
+ var self = this, elm = self.getEl(), openElm = self.getEl('open'), rect = self.layoutRect();
+ var width, lineHeight;
+
+ if (openElm) {
+ width = rect.w - DomUtils.getSize(openElm).width - 10;
+ } else {
+ width = rect.w - 10;
+ }
+
+ // Detect old IE 7+8 add lineHeight to align caret vertically in the middle
+ var doc = document;
+ if (doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
+ lineHeight = (self.layoutRect().h - 2) + 'px';
+ }
+
+ DomUtils.css(elm.firstChild, {
+ width: width,
+ lineHeight: lineHeight
+ });
+
+ self._super();
+
+ return self;
+ },
+
+ /**
+ * Post render method. Called after the control has been rendered to the target.
+ *
+ * @method postRender
+ * @return {tinymce.ui.ComboBox} Current combobox instance.
+ */
+ postRender: function() {
+ var self = this;
+
+ DomUtils.on(this.getEl('inp'), 'change', function() {
+ self.fire('change');
+ });
+
+ return self._super();
+ },
+
+ remove: function() {
+ DomUtils.off(this.getEl('inp'));
+ this._super();
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix;
+ var value = settings.value || settings.placeholder || '';
+ var icon, text, openBtnHtml = '';
+
+ icon = settings.icon ? prefix + 'ico ' + prefix + 'i-' + settings.icon : '';
+ text = self._text;
+
+ if (icon || text) {
+ openBtnHtml = (
+ '<div id="' + id + '-open" class="' + prefix + 'btn ' + prefix + 'open" tabIndex="-1">' +
+ '<button id="' + id + '-action" type="button" hidefocus tabindex="-1">' +
+ (icon ? '<i class="' + icon + '"></i>' : '<i class="' + prefix + 'caret"></i>') +
+ (text ? (icon ? ' ' : '') + text : '') +
+ '</button>' +
+ '</div>'
+ );
+
+ self.addClass('has-open');
+ }
+
+ return (
+ '<div id="' + id + '" class="' + self.classes() + '">' +
+ '<input id="' + id + '-inp" class="' + prefix + 'textbox ' + prefix + 'placeholder" value="' +
+ value + '" hidefocus="true"' + (self.disabled() ? ' disabled="disabled"' : '') + '>' +
+ openBtnHtml +
+ '</div>'
+ );
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/Path.js
+
+/**
+ * Path.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new path control.
+ *
+ * @-x-less Path.less
+ * @class tinymce.ui.Path
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Path", [
+ "tinymce/ui/Widget",
+ "tinymce/ui/KeyboardNavigation"
+], function(Widget, KeyboardNavigation) {
+ "use strict";
+
+ return Widget.extend({
+ /**
+ * Constructs a instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ * @setting {String} delimiter Delimiter to display between items in path.
+ */
+ init: function(settings) {
+ var self = this;
+
+ if (!settings.delimiter) {
+ settings.delimiter = '\u00BB';
+ }
+
+ self._super(settings);
+ self.addClass('path');
+ self.canFocus = true;
+
+ self.on('click', function(e) {
+ var index, target = e.target;
+
+ if ((index = target.getAttribute('data-index'))) {
+ self.fire('select', {value: self.data()[index], index: index});
+ }
+ });
+ },
+
+ /**
+ * Focuses the current control.
+ *
+ * @method focus
+ * @return {tinymce.ui.Control} Current control instance.
+ */
+ focus: function() {
+ var self = this;
+
+ self.keyNav = new KeyboardNavigation({
+ root: self,
+ enableLeftRight: true
+ });
+
+ self.keyNav.focusFirst();
+
+ return self;
+ },
+
+ /**
+ * Sets/gets the data to be used for the path.
+ *
+ * @method data
+ * @param {Array} data Array with items name is rendered to path.
+ */
+ data: function(data) {
+ var self = this;
+
+ if (typeof(data) !== "undefined") {
+ self._data = data;
+ self.update();
+
+ return self;
+ }
+
+ return self._data;
+ },
+
+ /**
+ * Updated the path.
+ *
+ * @private
+ */
+ update: function() {
+ this.innerHtml(this._getPathHtml());
+ },
+
+ /**
+ * Called after the control has been rendered.
+ *
+ * @method postRender
+ */
+ postRender: function() {
+ var self = this;
+
+ self._super();
+
+ self.data(self.settings.data);
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this;
+
+ return (
+ '<div id="' + self._id + '" class="' + self.classes() + '">' +
+ self._getPathHtml() +
+ '</div>'
+ );
+ },
+
+ _getPathHtml: function() {
+ var self = this, parts = self._data || [], i, l, html = '', prefix = self.classPrefix;
+
+ for (i = 0, l = parts.length; i < l; i++) {
+ html += (
+ (i > 0 ? '<div class="'+ prefix + 'divider" aria-hidden="true"> ' + self.settings.delimiter + ' </div>' : '') +
+ '<div role="button" class="' + prefix + 'path-item' + (i == l - 1 ? ' ' + prefix + 'last' : '') + '" data-index="' +
+ i + '" tabindex="-1" id="' + self._id + '-' + i +'">' + parts[i].name + '</div>'
+ );
+ }
+
+ if (!html) {
+ html = '<div class="' + prefix + 'path-item"> </div>';
+ }
+
+ return html;
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/ElementPath.js
+
+/**
+ * ElementPath.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This control creates an path for the current selections parent elements in TinyMCE.
+ *
+ * @class tinymce.ui.ElementPath
+ * @extends tinymce.ui.Path
+ */
+define("tinymce/ui/ElementPath", [
+ "tinymce/ui/Path",
+ "tinymce/EditorManager"
+], function(Path, EditorManager) {
+ return Path.extend({
+ /**
+ * Post render method. Called after the control has been rendered to the target.
+ *
+ * @method postRender
+ * @return {tinymce.ui.ElementPath} Current combobox instance.
+ */
+ postRender: function() {
+ var self = this, editor = EditorManager.activeEditor;
+
+ function isHidden(elm) {
+ if (elm.nodeType === 1) {
+ if (elm.nodeName == "BR" || !!elm.getAttribute('data-mce-bogus')) {
+ return true;
+ }
+
+ if (elm.getAttribute('data-mce-type') === 'bookmark') {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ self.on('select', function(e) {
+ var parents = [], node, body = editor.getBody();
+
+ editor.focus();
+
+ node = editor.selection.getStart();
+ while (node && node != body) {
+ if (!isHidden(node)) {
+ parents.push(node);
+ }
+
+ node = node.parentNode;
+ }
+
+ editor.selection.select(parents[parents.length - 1 - e.index]);
+ editor.nodeChanged();
+ });
+
+ editor.on('nodeChange', function(e) {
+ var parents = [], selectionParents = e.parents, i = selectionParents.length;
+
+ while (i--) {
+ if (selectionParents[i].nodeType == 1 && !isHidden(selectionParents[i])) {
+ var args = editor.fire('ResolveName', {
+ name: selectionParents[i].nodeName.toLowerCase(),
+ target: selectionParents[i]
+ });
+
+ parents.push({name: args.name});
+ }
+ }
+
+ self.data(parents);
+ });
+
+ return self._super();
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/FormItem.js
+
+/**
+ * FormItem.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class is a container created by the form element with
+ * a label and control item.
+ *
+ * @class tinymce.ui.FormItem
+ * @extends tinymce.ui.Container
+ * @setting {String} label Label to display for the form item.
+ */
+define("tinymce/ui/FormItem", [
+ "tinymce/ui/Container"
+], function(Container) {
+ "use strict";
+
+ return Container.extend({
+ Defaults: {
+ layout: 'flex',
+ align: 'center',
+ defaults: {
+ flex: 1
+ }
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, layout = self._layout, prefix = self.classPrefix;
+
+ self.addClass('formitem');
+ layout.preRender(self);
+
+ return (
+ '<div id="' + self._id + '" class="' + self.classes() + '" hideFocus="1" tabIndex="-1">' +
+ (self.settings.title ? ('<div id="' + self._id + '-title" class="' + prefix + 'title">' +
+ self.settings.title + '</div>') : '') +
+ '<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+ (self.settings.html || '') + layout.renderHtml(self) +
+ '</div>' +
+ '</div>'
+ );
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/Form.js
+
+/**
+ * Form.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a form container. A form container has the ability
+ * to automatically wrap items in tinymce.ui.FormItem instances.
+ *
+ * Each FormItem instance is a container for the label and the item.
+ *
+ * @example
+ * tinymce.ui.Factory.create({
+ * type: 'form',
+ * items: [
+ * {type: 'textbox', label: 'My text box'}
+ * ]
+ * }).renderTo(document.body);
+ *
+ * @class tinymce.ui.Form
+ * @extends tinymce.ui.Container
+ */
+define("tinymce/ui/Form", [
+ "tinymce/ui/Container",
+ "tinymce/ui/FormItem"
+], function(Container, FormItem) {
+ "use strict";
+
+ return Container.extend({
+ Defaults: {
+ containerCls: 'form',
+ layout: 'flex',
+ direction: 'column',
+ align: 'stretch',
+ flex: 1,
+ padding: 20,
+ labelGap: 30,
+ spacing: 10,
+ callbacks: {
+ submit: function() {
+ this.submit();
+ }
+ }
+ },
+
+ /**
+ * This method gets invoked before the control is rendered.
+ *
+ * @method preRender
+ */
+ preRender: function() {
+ var self = this, items = self.items();
+
+ // Wrap any labeled items in FormItems
+ items.each(function(ctrl) {
+ var formItem, label = ctrl.settings.label;
+
+ if (label) {
+ formItem = new FormItem({
+ layout: 'flex',
+ autoResize: "overflow",
+ defaults: {flex: 1},
+ items: [
+ {type: 'label', text: label, flex: 0, forId: ctrl._id}
+ ]
+ });
+
+ formItem.type = 'formitem';
+
+ if (typeof(ctrl.settings.flex) == "undefined") {
+ ctrl.settings.flex = 1;
+ }
+
+ self.replace(ctrl, formItem);
+ formItem.add(ctrl);
+ }
+ });
+ },
+
+ /**
+ * Recalcs label widths.
+ *
+ * @private
+ */
+ recalcLabels: function() {
+ var self = this, maxLabelWidth = 0, labels = [], i, labelGap;
+
+ if (self.settings.labelGapCalc === false) {
+ return;
+ }
+
+ self.items().filter('formitem').each(function(item) {
+ var labelCtrl = item.items()[0], labelWidth = labelCtrl.getEl().clientWidth;
+
+ maxLabelWidth = labelWidth > maxLabelWidth ? labelWidth : maxLabelWidth;
+ labels.push(labelCtrl);
+ });
+
+ labelGap = self.settings.labelGap || 0;
+
+ i = labels.length;
+ while (i--) {
+ labels[i].settings.minWidth = maxLabelWidth + labelGap;
+ }
+ },
+
+ /**
+ * Getter/setter for the visibility state.
+ *
+ * @method visible
+ * @param {Boolean} [state] True/false state to show/hide.
+ * @return {tinymce.ui.Form|Boolean} True/false state or current control.
+ */
+ visible: function(state) {
+ var val = this._super(state);
+
+ if (state === true && this._rendered) {
+ this.recalcLabels();
+ }
+
+ return val;
+ },
+
+ /**
+ * Fires a submit event with the serialized form.
+ *
+ * @method submit
+ * @return {Object} Event arguments object.
+ */
+ submit: function() {
+ return this.fire('submit', {data: this.toJSON()});
+ },
+
+ /**
+ * Post render method. Called after the control has been rendered to the target.
+ *
+ * @method postRender
+ * @return {tinymce.ui.ComboBox} Current combobox instance.
+ */
+ postRender: function() {
+ var self = this;
+
+ self._super();
+ self.recalcLabels();
+ self.fromJSON(self.settings.data);
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/FieldSet.js
+
+/**
+ * FieldSet.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates fieldset containers.
+ *
+ * @-x-less FieldSet.less
+ * @class tinymce.ui.FieldSet
+ * @extends tinymce.ui.Form
+ */
+define("tinymce/ui/FieldSet", [
+ "tinymce/ui/Form"
+], function(Form) {
+ "use strict";
+
+ return Form.extend({
+ Defaults: {
+ containerCls: 'fieldset',
+ layout: 'flex',
+ direction: 'column',
+ align: 'stretch',
+ flex: 1,
+ padding: "25 15 5 15",
+ labelGap: 30,
+ spacing: 10,
+ border: 1
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, layout = self._layout, prefix = self.classPrefix;
+
+ self.preRender();
+ layout.preRender(self);
+
+ return (
+ '<fieldset id="' + self._id + '" class="' + self.classes() + '" hideFocus="1" tabIndex="-1">' +
+ (self.settings.title ? ('<legend id="' + self._id + '-title" class="' + prefix + 'fieldset-title">' +
+ self.settings.title + '</legend>') : '') +
+ '<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+ (self.settings.html || '') + layout.renderHtml(self) +
+ '</div>' +
+ '</fieldset>'
+ );
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/FilePicker.js
+
+/**
+ * FilePicker.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*global tinymce:true */
+
+/**
+ * This class creates a file picker control.
+ *
+ * @class tinymce.ui.FilePicker
+ * @extends tinymce.ui.ComboBox
+ */
+define("tinymce/ui/FilePicker", [
+ "tinymce/ui/ComboBox"
+], function(ComboBox) {
+ "use strict";
+
+ return ComboBox.extend({
+ /**
+ * Constructs a new control instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ */
+ init: function(settings) {
+ var self = this, editor = tinymce.activeEditor, fileBrowserCallback;
+
+ settings.spellcheck = false;
+
+ fileBrowserCallback = editor.settings.file_browser_callback;
+ if (fileBrowserCallback) {
+ settings.icon = 'browse';
+
+ settings.onaction = function() {
+ fileBrowserCallback(
+ self.getEl('inp').id,
+ self.getEl('inp').value,
+ settings.filetype,
+ window
+ );
+ };
+ }
+
+ self._super(settings);
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/FitLayout.js
+
+/**
+ * FitLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager will resize the control to be the size of it's parent container.
+ * In other words width: 100% and height: 100%.
+ *
+ * @-x-less FitLayout.less
+ * @class tinymce.ui.FitLayout
+ * @extends tinymce.ui.AbsoluteLayout
+ */
+define("tinymce/ui/FitLayout", [
+ "tinymce/ui/AbsoluteLayout"
+], function(AbsoluteLayout) {
+ "use strict";
+
+ return AbsoluteLayout.extend({
+ /**
+ * Recalculates the positions of the controls in the specified container.
+ *
+ * @method recalc
+ * @param {tinymce.ui.Container} container Container instance to recalc.
+ */
+ recalc: function(container) {
+ var contLayoutRect = container.layoutRect(), paddingBox = container.paddingBox();
+
+ container.items().filter(':visible').each(function(ctrl) {
+ ctrl.layoutRect({
+ x: paddingBox.left,
+ y: paddingBox.top,
+ w: contLayoutRect.innerW - paddingBox.right - paddingBox.left,
+ h: contLayoutRect.innerH - paddingBox.top - paddingBox.bottom
+ });
+
+ if (ctrl.recalc) {
+ ctrl.recalc();
+ }
+ });
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/FlexLayout.js
+
+/**
+ * FlexLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager works similar to the CSS flex box.
+ *
+ * @setting {String} direction row|row-reverse|column|column-reverse
+ * @setting {Number} flex A positive-number to flex by.
+ * @setting {String} align start|end|center|stretch
+ * @setting {String} pack start|end|justify
+ *
+ * @class tinymce.ui.FlexLayout
+ * @extends tinymce.ui.AbsoluteLayout
+ */
+define("tinymce/ui/FlexLayout", [
+ "tinymce/ui/AbsoluteLayout"
+], function(AbsoluteLayout) {
+ "use strict";
+
+ return AbsoluteLayout.extend({
+ /**
+ * Recalculates the positions of the controls in the specified container.
+ *
+ * @method recalc
+ * @param {tinymce.ui.Container} container Container instance to recalc.
+ */
+ recalc: function(container) {
+ // A ton of variables, needs to be in the same scope for performance
+ var i, l, items, contLayoutRect, contPaddingBox, contSettings, align, pack, spacing, totalFlex, availableSpace, direction;
+ var ctrl, ctrlLayoutRect, ctrlSettings, flex, maxSizeItems = [], size, maxSize, ratio, rect, pos, maxAlignEndPos;
+ var sizeName, minSizeName, posName, maxSizeName, beforeName, innerSizeName, afterName, deltaSizeName, contentSizeName;
+ var alignAxisName, alignInnerSizeName, alignSizeName, alignMinSizeName, alignMaxSizeName, alignBeforeName, alignAfterName;
+ var alignDeltaSizeName, alignContentSizeName;
+ var max = Math.max, min = Math.min;
+
+ // Get container items, properties and settings
+ items = container.items().filter(':visible');
+ contLayoutRect = container.layoutRect();
+ contPaddingBox = container._paddingBox;
+ contSettings = container.settings;
+ direction = container.isRtl() ? (contSettings.direction || 'row-reversed') : contSettings.direction;
+ align = contSettings.align;
+ pack = container.isRtl() ? (contSettings.pack || 'end') : contSettings.pack;
+ spacing = contSettings.spacing || 0;
+
+ if (direction == "row-reversed" || direction == "column-reverse") {
+ items = items.set(items.toArray().reverse());
+ direction = direction.split('-')[0];
+ }
+
+ // Setup axis variable name for row/column direction since the calculations is the same
+ if (direction == "column") {
+ posName = "y";
+ sizeName = "h";
+ minSizeName = "minH";
+ maxSizeName = "maxH";
+ innerSizeName = "innerH";
+ beforeName = 'top';
+ afterName = 'bottom';
+ deltaSizeName = "deltaH";
+ contentSizeName = "contentH";
+
+ alignBeforeName = "left";
+ alignSizeName = "w";
+ alignAxisName = "x";
+ alignInnerSizeName = "innerW";
+ alignMinSizeName = "minW";
+ alignMaxSizeName = "maxW";
+ alignAfterName = "right";
+ alignDeltaSizeName = "deltaW";
+ alignContentSizeName = "contentW";
+ } else {
+ posName = "x";
+ sizeName = "w";
+ minSizeName = "minW";
+ maxSizeName = "maxW";
+ innerSizeName = "innerW";
+ beforeName = 'left';
+ afterName = 'right';
+ deltaSizeName = "deltaW";
+ contentSizeName = "contentW";
+
+ alignBeforeName = "top";
+ alignSizeName = "h";
+ alignAxisName = "y";
+ alignInnerSizeName = "innerH";
+ alignMinSizeName = "minH";
+ alignMaxSizeName = "maxH";
+ alignAfterName = "bottom";
+ alignDeltaSizeName = "deltaH";
+ alignContentSizeName = "contentH";
+ }
+
+ // Figure out total flex, availableSpace and collect any max size elements
+ availableSpace = contLayoutRect[innerSizeName] - contPaddingBox[beforeName] - contPaddingBox[beforeName];
+ maxAlignEndPos = totalFlex = 0;
+ for (i = 0, l = items.length; i < l; i++) {
+ ctrl = items[i];
+ ctrlLayoutRect = ctrl.layoutRect();
+ ctrlSettings = ctrl.settings;
+ flex = ctrlSettings.flex;
+ availableSpace -= (i < l - 1 ? spacing : 0);
+
+ if (flex > 0) {
+ totalFlex += flex;
+
+ // Flexed item has a max size then we need to check if we will hit that size
+ if (ctrlLayoutRect[maxSizeName]) {
+ maxSizeItems.push(ctrl);
+ }
+
+ ctrlLayoutRect.flex = flex;
+ }
+
+ availableSpace -= ctrlLayoutRect[minSizeName];
+
+ // Calculate the align end position to be used to check for overflow/underflow
+ size = contPaddingBox[alignBeforeName] + ctrlLayoutRect[alignMinSizeName] + contPaddingBox[alignAfterName];
+ if (size > maxAlignEndPos) {
+ maxAlignEndPos = size;
+ }
+ }
+
+ // Calculate minW/minH
+ rect = {};
+ if (availableSpace < 0) {
+ rect[minSizeName] = contLayoutRect[minSizeName] - availableSpace + contLayoutRect[deltaSizeName];
+ } else {
+ rect[minSizeName] = contLayoutRect[innerSizeName] - availableSpace + contLayoutRect[deltaSizeName];
+ }
+
+ rect[alignMinSizeName] = maxAlignEndPos + contLayoutRect[alignDeltaSizeName];
+
+ rect[contentSizeName] = contLayoutRect[innerSizeName] - availableSpace;
+ rect[alignContentSizeName] = maxAlignEndPos;
+ rect.minW = min(rect.minW, contLayoutRect.maxW);
+ rect.minH = min(rect.minH, contLayoutRect.maxH);
+ rect.minW = max(rect.minW, contLayoutRect.startMinWidth);
+ rect.minH = max(rect.minH, contLayoutRect.startMinHeight);
+
+ // Resize container container if minSize was changed
+ if (contLayoutRect.autoResize && (rect.minW != contLayoutRect.minW || rect.minH != contLayoutRect.minH)) {
+ rect.w = rect.minW;
+ rect.h = rect.minH;
+
+ container.layoutRect(rect);
+ this.recalc(container);
+
+ // Forced recalc for example if items are hidden/shown
+ if (container._lastRect === null) {
+ var parentCtrl = container.parent();
+ if (parentCtrl) {
+ parentCtrl._lastRect = null;
+ parentCtrl.recalc();
+ }
+ }
+
+ return;
+ }
+
+ // Handle max size elements, check if they will become to wide with current options
+ ratio = availableSpace / totalFlex;
+ for (i = 0, l = maxSizeItems.length; i < l; i++) {
+ ctrl = maxSizeItems[i];
+ ctrlLayoutRect = ctrl.layoutRect();
+ maxSize = ctrlLayoutRect[maxSizeName];
+ size = ctrlLayoutRect[minSizeName] + ctrlLayoutRect.flex * ratio;
+
+ if (size > maxSize) {
+ availableSpace -= (ctrlLayoutRect[maxSizeName] - ctrlLayoutRect[minSizeName]);
+ totalFlex -= ctrlLayoutRect.flex;
+ ctrlLayoutRect.flex = 0;
+ ctrlLayoutRect.maxFlexSize = maxSize;
+ } else {
+ ctrlLayoutRect.maxFlexSize = 0;
+ }
+ }
+
+ // Setup new ratio, target layout rect, start position
+ ratio = availableSpace / totalFlex;
+ pos = contPaddingBox[beforeName];
+ rect = {};
+
+ // Handle pack setting moves the start position to end, center
+ if (totalFlex === 0) {
+ if (pack == "end") {
+ pos = availableSpace + contPaddingBox[beforeName];
+ } else if (pack == "center") {
+ pos = Math.round(
+ (contLayoutRect[innerSizeName] / 2) - ((contLayoutRect[innerSizeName] - availableSpace) / 2)
+ ) + contPaddingBox[beforeName];
+
+ if (pos < 0) {
+ pos = contPaddingBox[beforeName];
+ }
+ } else if (pack == "justify") {
+ pos = contPaddingBox[beforeName];
+ spacing = Math.floor(availableSpace / (items.length - 1));
+ }
+ }
+
+ // Default aligning (start) the other ones needs to be calculated while doing the layout
+ rect[alignAxisName] = contPaddingBox[alignBeforeName];
+
+ // Start laying out controls
+ for (i = 0, l = items.length; i < l; i++) {
+ ctrl = items[i];
+ ctrlLayoutRect = ctrl.layoutRect();
+ size = ctrlLayoutRect.maxFlexSize || ctrlLayoutRect[minSizeName];
+
+ // Align the control on the other axis
+ if (align === "center") {
+ rect[alignAxisName] = Math.round((contLayoutRect[alignInnerSizeName] / 2) - (ctrlLayoutRect[alignSizeName] / 2));
+ } else if (align === "stretch") {
+ rect[alignSizeName] = max(
+ ctrlLayoutRect[alignMinSizeName] || 0,
+ contLayoutRect[alignInnerSizeName] - contPaddingBox[alignBeforeName] - contPaddingBox[alignAfterName]
+ );
+ rect[alignAxisName] = contPaddingBox[alignBeforeName];
+ } else if (align === "end") {
+ rect[alignAxisName] = contLayoutRect[alignInnerSizeName] - ctrlLayoutRect[alignSizeName] - contPaddingBox.top;
+ }
+
+ // Calculate new size based on flex
+ if (ctrlLayoutRect.flex > 0) {
+ size += ctrlLayoutRect.flex * ratio;
+ }
+
+ rect[sizeName] = size;
+ rect[posName] = pos;
+ ctrl.layoutRect(rect);
+
+ // Recalculate containers
+ if (ctrl.recalc) {
+ ctrl.recalc();
+ }
+
+ // Move x/y position
+ pos += size + spacing;
+ }
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/FlowLayout.js
+
+/**
+ * FlowLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager will place the controls by using the browsers native layout.
+ *
+ * @-x-less FlowLayout.less
+ * @class tinymce.ui.FlowLayout
+ * @extends tinymce.ui.Layout
+ */
+define("tinymce/ui/FlowLayout", [
+ "tinymce/ui/Layout"
+], function(Layout) {
+ return Layout.extend({
+ Defaults: {
+ containerClass: 'flow-layout',
+ controlClass: 'flow-layout-item',
+ endClass : 'break'
+ },
+
+ /**
+ * Recalculates the positions of the controls in the specified container.
+ *
+ * @method recalc
+ * @param {tinymce.ui.Container} container Container instance to recalc.
+ */
+ recalc: function(container) {
+ container.items().filter(':visible').each(function(ctrl) {
+ if (ctrl.recalc) {
+ ctrl.recalc();
+ }
+ });
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/FormatControls.js
+
+/**
+ * FormatControls.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Internal class containing all TinyMCE specific control types such as
+ * format listboxes, fontlist boxes, toolbar buttons etc.
+ *
+ * @class tinymce.ui.FormatControls
+ */
+define("tinymce/ui/FormatControls", [
+ "tinymce/ui/Control",
+ "tinymce/ui/Widget",
+ "tinymce/ui/FloatPanel",
+ "tinymce/util/Tools",
+ "tinymce/EditorManager",
+ "tinymce/Env"
+], function(Control, Widget, FloatPanel, Tools, EditorManager, Env) {
+ var each = Tools.each;
+
+ EditorManager.on('AddEditor', function(e) {
+ if (e.editor.rtl) {
+ Control.rtl = true;
+ }
+
+ registerControls(e.editor);
+ });
+
+ Control.translate = function(text) {
+ return EditorManager.translate(text);
+ };
+
+ Widget.tooltips = !Env.iOS;
+
+ function registerControls(editor) {
+ var formatMenu;
+
+ // Generates a preview for a format
+ function getPreviewCss(format) {
+ var name, previewElm, dom = editor.dom;
+ var previewCss = '', parentFontSize, previewStyles;
+
+ previewStyles = editor.settings.preview_styles;
+
+ // No preview forced
+ if (previewStyles === false) {
+ return '';
+ }
+
+ // Default preview
+ if (!previewStyles) {
+ previewStyles = 'font-family font-size font-weight font-style text-decoration ' +
+ 'text-transform color background-color border border-radius';
+ }
+
+ // Removes any variables since these can't be previewed
+ function removeVars(val) {
+ return val.replace(/%(\w+)/g, '');
+ }
+
+ // Create block/inline element to use for preview
+ format = editor.formatter.get(format);
+ if (!format) {
+ return;
+ }
+
+ format = format[0];
+ name = format.block || format.inline || 'span';
+ previewElm = dom.create(name);
+
+ // Add format styles to preview element
+ each(format.styles, function(value, name) {
+ value = removeVars(value);
+
+ if (value) {
+ dom.setStyle(previewElm, name, value);
+ }
+ });
+
+ // Add attributes to preview element
+ each(format.attributes, function(value, name) {
+ value = removeVars(value);
+
+ if (value) {
+ dom.setAttrib(previewElm, name, value);
+ }
+ });
+
+ // Add classes to preview element
+ each(format.classes, function(value) {
+ value = removeVars(value);
+
+ if (!dom.hasClass(previewElm, value)) {
+ dom.addClass(previewElm, value);
+ }
+ });
+
+ editor.fire('PreviewFormats');
+
+ // Add the previewElm outside the visual area
+ dom.setStyles(previewElm, {position: 'absolute', left: -0xFFFF});
+ editor.getBody().appendChild(previewElm);
+
+ // Get parent container font size so we can compute px values out of em/% for older IE:s
+ parentFontSize = dom.getStyle(editor.getBody(), 'fontSize', true);
+ parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0;
+
+ each(previewStyles.split(' '), function(name) {
+ var value = dom.getStyle(previewElm, name, true);
+
+ // If background is transparent then check if the body has a background color we can use
+ if (name == 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) {
+ value = dom.getStyle(editor.getBody(), name, true);
+
+ // Ignore white since it's the default color, not the nicest fix
+ // TODO: Fix this by detecting runtime style
+ if (dom.toHex(value).toLowerCase() == '#ffffff') {
+ return;
+ }
+ }
+
+ if (name == 'color') {
+ // Ignore black since it's the default color, not the nicest fix
+ // TODO: Fix this by detecting runtime style
+ if (dom.toHex(value).toLowerCase() == '#000000') {
+ return;
+ }
+ }
+
+ // Old IE won't calculate the font size so we need to do that manually
+ if (name == 'font-size') {
+ if (/em|%$/.test(value)) {
+ if (parentFontSize === 0) {
+ return;
+ }
+
+ // Convert font size from em/% to px
+ value = parseFloat(value, 10) / (/%$/.test(value) ? 100 : 1);
+ value = (value * parentFontSize) + 'px';
+ }
+ }
+
+ if (name == "border" && value) {
+ previewCss += 'padding:0 2px;';
+ }
+
+ previewCss += name + ':' + value + ';';
+ });
+
+ editor.fire('AfterPreviewFormats');
+
+ //previewCss += 'line-height:normal';
+
+ dom.remove(previewElm);
+
+ return previewCss;
+ }
+
+ function createListBoxChangeHandler(items, formatName) {
+ return function() {
+ var self = this;
+
+ editor.on('nodeChange', function(e) {
+ var formatter = editor.formatter;
+ var value = null;
+
+ each(e.parents, function(node) {
+ each(items, function(item) {
+ if (formatName) {
+ if (formatter.matchNode(node, formatName, {value: item.value})) {
+ value = item.value;
+ }
+ } else {
+ if (formatter.matchNode(node, item.value)) {
+ value = item.value;
+ }
+ }
+
+ if (value) {
+ return false;
+ }
+ });
+
+ if (value) {
+ return false;
+ }
+ });
+
+ self.value(value);
+ });
+ };
+ }
+
+ function createFormats(formats) {
+ formats = formats.split(';');
+
+ var i = formats.length;
+ while (i--) {
+ formats[i] = formats[i].split('=');
+ }
+
+ return formats;
+ }
+
+ function createFormatMenu() {
+ var count = 0, newFormats = [];
+
+ var defaultStyleFormats = [
+ {title: 'Headers', items: [
+ {title: 'Header 1', format: 'h1'},
+ {title: 'Header 2', format: 'h2'},
+ {title: 'Header 3', format: 'h3'},
+ {title: 'Header 4', format: 'h4'},
+ {title: 'Header 5', format: 'h5'},
+ {title: 'Header 6', format: 'h6'}
+ ]},
+
+ {title: 'Inline', items: [
+ {title: 'Bold', icon: 'bold', format: 'bold'},
+ {title: 'Italic', icon: 'italic', format: 'italic'},
+ {title: 'Underline', icon: 'underline', format: 'underline'},
+ {title: 'Strikethrough', icon: 'strikethrough', format: 'strikethrough'},
+ {title: 'Superscript', icon: 'superscript', format: 'superscript'},
+ {title: 'Subscript', icon: 'subscript', format: 'subscript'},
+ {title: 'Code', icon: 'code', format: 'code'}
+ ]},
+
+ {title: 'Blocks', items: [
+ {title: 'Paragraph', format: 'p'},
+ {title: 'Blockquote', format: 'blockquote'},
+ {title: 'Div', format: 'div'},
+ {title: 'Pre', format: 'pre'}
+ ]},
+
+ {title: 'Alignment', items: [
+ {title: 'Left', icon: 'alignleft', format: 'alignleft'},
+ {title: 'Center', icon: 'aligncenter', format: 'aligncenter'},
+ {title: 'Right', icon: 'alignright', format: 'alignright'},
+ {title: 'Justify', icon: 'alignjustify', format: 'alignjustify'}
+ ]}
+ ];
+
+ function createMenu(formats) {
+ var menu = [];
+
+ if (!formats) {
+ return;
+ }
+
+ each(formats, function(format) {
+ var menuItem = {
+ text: format.title,
+ icon: format.icon
+ };
+
+ if (format.items) {
+ menuItem.menu = createMenu(format.items);
+ } else {
+ var formatName = format.format || "custom" + count++;
+
+ if (!format.format) {
+ format.name = formatName;
+ newFormats.push(format);
+ }
+
+ menuItem.format = formatName;
+ }
+
+ menu.push(menuItem);
+ });
+
+ return menu;
+ }
+
+ editor.on('init', function() {
+ each(newFormats, function(format) {
+ editor.formatter.register(format.name, format);
+ });
+ });
+
+ var menu = createMenu(editor.settings.style_formats || defaultStyleFormats);
+
+ menu = {
+ type: 'menu',
+ items: menu,
+ onPostRender: function(e) {
+ editor.fire('renderFormatsMenu', {control: e.control});
+ },
+ itemDefaults: {
+ preview: true,
+
+ textStyle: function() {
+ if (this.settings.format) {
+ return getPreviewCss(this.settings.format);
+ }
+ },
+
+ onPostRender: function() {
+ var self = this, formatName = this.settings.format;
+
+ if (formatName) {
+ self.parent().on('show', function() {
+ self.disabled(!editor.formatter.canApply(formatName));
+ self.active(editor.formatter.match(formatName));
+ });
+ }
+ },
+
+ onclick: function() {
+ if (this.settings.format) {
+ toggleFormat(this.settings.format);
+ }
+ }
+ }
+ };
+
+ return menu;
+ }
+
+ formatMenu = createFormatMenu();
+
+ // Simple format controls <control/format>:<UI text>
+ each({
+ bold: 'Bold',
+ italic: 'Italic',
+ underline: 'Underline',
+ strikethrough: 'Strikethrough',
+ subscript: 'Subscript',
+ superscript: 'Superscript'
+ }, function(text, name) {
+ editor.addButton(name, {
+ tooltip: text,
+ onPostRender: function() {
+ var self = this;
+
+ // TODO: Fix this
+ if (editor.formatter) {
+ editor.formatter.formatChanged(name, function(state) {
+ self.active(state);
+ });
+ } else {
+ editor.on('init', function() {
+ editor.formatter.formatChanged(name, function(state) {
+ self.active(state);
+ });
+ });
+ }
+ },
+ onclick: function() {
+ toggleFormat(name);
+ }
+ });
+ });
+
+ // Simple command controls <control>:[<UI text>,<Command>]
+ each({
+ outdent: ['Decrease indent', 'Outdent'],
+ indent: ['Increase indent', 'Indent'],
+ cut: ['Cut', 'Cut'],
+ copy: ['Copy', 'Copy'],
+ paste: ['Paste', 'Paste'],
+ help: ['Help', 'mceHelp'],
+ selectall: ['Select all', 'SelectAll'],
+ hr: ['Insert horizontal rule', 'InsertHorizontalRule'],
+ removeformat: ['Clear formatting', 'RemoveFormat'],
+ visualaid: ['Visual aids', 'mceToggleVisualAid'],
+ newdocument: ['New document', 'mceNewDocument']
+ }, function(item, name) {
+ editor.addButton(name, {
+ tooltip: item[0],
+ cmd: item[1]
+ });
+ });
+
+ // Simple command controls with format state
+ each({
+ blockquote: ['Toggle blockquote', 'mceBlockQuote'],
+ numlist: ['Numbered list', 'InsertOrderedList'],
+ bullist: ['Bullet list', 'InsertUnorderedList'],
+ subscript: ['Subscript', 'Subscript'],
+ superscript: ['Superscript', 'Superscript'],
+ alignleft: ['Align left', 'JustifyLeft'],
+ aligncenter: ['Align center', 'JustifyCenter'],
+ alignright: ['Align right', 'JustifyRight'],
+ alignjustify: ['Justify', 'JustifyFull']
+ }, function(item, name) {
+ editor.addButton(name, {
+ tooltip: item[0],
+ cmd: item[1],
+ onPostRender: function() {
+ var self = this;
+
+ // TODO: Fix this
+ if (editor.formatter) {
+ editor.formatter.formatChanged(name, function(state) {
+ self.active(state);
+ });
+ } else {
+ editor.on('init', function() {
+ editor.formatter.formatChanged(name, function(state) {
+ self.active(state);
+ });
+ });
+ }
+ }
+ });
+ });
+
+ function hasUndo() {
+ return editor.undoManager ? editor.undoManager.hasUndo() : false;
+ }
+
+ function hasRedo() {
+ return editor.undoManager ? editor.undoManager.hasRedo() : false;
+ }
+
+ function toggleUndoState() {
+ var self = this;
+
+ self.disabled(!hasUndo());
+ editor.on('Undo Redo AddUndo TypingUndo', function() {
+ self.disabled(!hasUndo());
+ });
+ }
+
+ function toggleRedoState() {
+ var self = this;
+
+ self.disabled(!hasRedo());
+ editor.on('Undo Redo AddUndo TypingUndo', function() {
+ self.disabled(!hasRedo());
+ });
+ }
+
+ function toggleVisualAidState() {
+ var self = this;
+
+ editor.on('VisualAid', function(e) {
+ self.active(e.hasVisual);
+ });
+
+ self.active(editor.hasVisual);
+ }
+
+ editor.addButton('undo', {
+ tooltip: 'Undo',
+ onPostRender: toggleUndoState,
+ cmd: 'undo'
+ });
+
+ editor.addButton('redo', {
+ tooltip: 'Redo',
+ onPostRender: toggleRedoState,
+ cmd: 'redo'
+ });
+
+ editor.addMenuItem('newdocument', {
+ text: 'New document',
+ shortcut: 'Ctrl+N',
+ icon: 'newdocument',
+ cmd: 'mceNewDocument'
+ });
+
+ editor.addMenuItem('undo', {
+ text: 'Undo',
+ icon: 'undo',
+ shortcut: 'Ctrl+Z',
+ onPostRender: toggleUndoState,
+ cmd: 'undo'
+ });
+
+ editor.addMenuItem('redo', {
+ text: 'Redo',
+ icon: 'redo',
+ shortcut: 'Ctrl+Y',
+ onPostRender: toggleRedoState,
+ cmd: 'redo'
+ });
+
+ editor.addMenuItem('visualaid', {
+ text: 'Visual aids',
+ selectable: true,
+ onPostRender: toggleVisualAidState,
+ cmd: 'mceToggleVisualAid'
+ });
+
+ each({
+ cut: ['Cut', 'Cut', 'Ctrl+X'],
+ copy: ['Copy', 'Copy', 'Ctrl+C'],
+ paste: ['Paste', 'Paste', 'Ctrl+V'],
+ selectall: ['Select all', 'SelectAll', 'Ctrl+A'],
+ bold: ['Bold', 'Bold', 'Ctrl+B'],
+ italic: ['Italic', 'Italic', 'Ctrl+I'],
+ underline: ['Underline', 'Underline'],
+ strikethrough: ['Strikethrough', 'Strikethrough'],
+ subscript: ['Subscript', 'Subscript'],
+ superscript: ['Superscript', 'Superscript'],
+ removeformat: ['Clear formatting', 'RemoveFormat']
+ }, function(item, name) {
+ editor.addMenuItem(name, {
+ text: item[0],
+ icon: name,
+ shortcut: item[2],
+ cmd: item[1]
+ });
+ });
+
+ editor.on('mousedown', function() {
+ FloatPanel.hideAll();
+ });
+
+ function toggleFormat(fmt) {
+ if (fmt.control) {
+ fmt = fmt.control.value();
+ }
+
+ if (fmt) {
+ editor.execCommand('mceToggleFormat', false, fmt);
+ }
+ }
+
+ editor.addButton('styleselect', {
+ type: 'menubutton',
+ text: 'Formats',
+ menu: formatMenu
+ });
+
+ editor.addButton('formatselect', function() {
+ var items = [], blocks = createFormats(editor.settings.block_formats ||
+ 'Paragraph=p;' +
+ 'Address=address;' +
+ 'Pre=pre;' +
+ 'Header 1=h1;' +
+ 'Header 2=h2;' +
+ 'Header 3=h3;' +
+ 'Header 4=h4;' +
+ 'Header 5=h5;' +
+ 'Header 6=h6'
+ );
+
+ each(blocks, function(block) {
+ items.push({
+ text: block[0],
+ value: block[1],
+ textStyle: function() {
+ return getPreviewCss(block[1]);
+ }
+ });
+ });
+
+ return {
+ type: 'listbox',
+ text: blocks[0][0],
+ values: items,
+ fixedWidth: true,
+ onselect: toggleFormat,
+ onPostRender: createListBoxChangeHandler(items)
+ };
+ });
+
+ editor.addButton('fontselect', function() {
+ var defaultFontsFormats =
+ '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';
+
+ var items = [], fonts = createFormats(editor.settings.font_formats || defaultFontsFormats);
+
+ each(fonts, function(font) {
+ items.push({
+ text: {raw: font[0]},
+ value: font[1],
+ textStyle: font[1].indexOf('dings') == -1 ? 'font-family:' + font[1] : ''
+ });
+ });
+
+ return {
+ type: 'listbox',
+ text: 'Font Family',
+ tooltip: 'Font Family',
+ values: items,
+ fixedWidth: true,
+ onPostRender: createListBoxChangeHandler(items, 'fontname'),
+ onselect: function(e) {
+ if (e.control.settings.value) {
+ editor.execCommand('FontName', false, e.control.settings.value);
+ }
+ }
+ };
+ });
+
+ editor.addButton('fontsizeselect', function() {
+ var items = [], defaultFontsizeFormats = '8pt 10pt 12pt 14pt 18pt 24pt 36pt';
+ var fontsize_formats = editor.settings.fontsize_formats || defaultFontsizeFormats;
+
+ each(fontsize_formats.split(' '), function(item) {
+ items.push({text: item, value: item});
+ });
+
+ return {
+ type: 'listbox',
+ text: 'Font Sizes',
+ tooltip: 'Font Sizes',
+ values: items,
+ fixedWidth: true,
+ onPostRender: createListBoxChangeHandler(items, 'fontsize'),
+ onclick: function(e) {
+ if (e.control.settings.value) {
+ editor.execCommand('FontSize', false, e.control.settings.value);
+ }
+ }
+ };
+ });
+
+ editor.addMenuItem('formats', {
+ text: 'Formats',
+ menu: formatMenu
+ });
+ }
+});
+
+// Included from: js/tinymce/classes/ui/GridLayout.js
+
+/**
+ * GridLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager places controls in a grid.
+ *
+ * @setting {Number} spacing Spacing between controls.
+ * @setting {Number} spacingH Horizontal spacing between controls.
+ * @setting {Number} spacingV Vertical spacing between controls.
+ * @setting {Number} columns Number of columns to use.
+ * @setting {String/Array} alignH start|end|center|stretch or array of values for each column.
+ * @setting {String/Array} alignV start|end|center|stretch or array of values for each column.
+ * @setting {String} pack start|end
+ *
+ * @class tinymce.ui.GridLayout
+ * @extends tinymce.ui.AbsoluteLayout
+ */
+define("tinymce/ui/GridLayout", [
+ "tinymce/ui/AbsoluteLayout"
+], function(AbsoluteLayout) {
+ "use strict";
+
+ return AbsoluteLayout.extend({
+ /**
+ * Recalculates the positions of the controls in the specified container.
+ *
+ * @method recalc
+ * @param {tinymce.ui.Container} container Container instance to recalc.
+ */
+ recalc: function(container) {
+ var settings = container.settings, rows, cols, items, contLayoutRect, width, height, rect,
+ ctrlLayoutRect, ctrl, x, y, posX, posY, ctrlSettings, contPaddingBox, align, spacingH, spacingV, alignH, alignV, maxX, maxY,
+ colWidths = [], rowHeights = [], ctrlMinWidth, ctrlMinHeight, alignX, alignY, availableWidth, availableHeight;
+
+ // Get layout settings
+ settings = container.settings;
+ items = container.items().filter(':visible');
+ contLayoutRect = container.layoutRect();
+ cols = settings.columns || Math.ceil(Math.sqrt(items.length));
+ rows = Math.ceil(items.length / cols);
+ spacingH = settings.spacingH || settings.spacing || 0;
+ spacingV = settings.spacingV || settings.spacing || 0;
+ alignH = settings.alignH || settings.align;
+ alignV = settings.alignV || settings.align;
+ contPaddingBox = container._paddingBox;
+
+ if (alignH && typeof(alignH) == "string") {
+ alignH = [alignH];
+ }
+
+ if (alignV && typeof(alignV) == "string") {
+ alignV = [alignV];
+ }
+
+ // Zero padd columnWidths
+ for (x = 0; x < cols; x++) {
+ colWidths.push(0);
+ }
+
+ // Zero padd rowHeights
+ for (y = 0; y < rows; y++) {
+ rowHeights.push(0);
+ }
+
+ // Calculate columnWidths and rowHeights
+ for (y = 0; y < rows; y++) {
+ for (x = 0; x < cols; x++) {
+ ctrl = items[y * cols + x];
+
+ // Out of bounds
+ if (!ctrl) {
+ break;
+ }
+
+ ctrlLayoutRect = ctrl.layoutRect();
+ ctrlMinWidth = ctrlLayoutRect.minW;
+ ctrlMinHeight = ctrlLayoutRect.minH;
+
+ colWidths[x] = ctrlMinWidth > colWidths[x] ? ctrlMinWidth : colWidths[x];
+ rowHeights[y] = ctrlMinHeight > rowHeights[y] ? ctrlMinHeight : rowHeights[y];
+ }
+ }
+
+ // Calculate maxX
+ availableWidth = contLayoutRect.innerW - contPaddingBox.left - contPaddingBox.right;
+ for (maxX = 0, x = 0; x < cols; x++) {
+ maxX += colWidths[x] + (x > 0 ? spacingH : 0);
+ availableWidth -= (x > 0 ? spacingH : 0) + colWidths[x];
+ }
+
+ // Calculate maxY
+ availableHeight = contLayoutRect.innerH - contPaddingBox.top - contPaddingBox.bottom;
+ for (maxY = 0, y = 0; y < rows; y++) {
+ maxY += rowHeights[y] + (y > 0 ? spacingV : 0);
+ availableHeight -= (y > 0 ? spacingV : 0) + rowHeights[y];
+ }
+
+ maxX += contPaddingBox.left + contPaddingBox.right;
+ maxY += contPaddingBox.top + contPaddingBox.bottom;
+
+ // Calculate minW/minH
+ rect = {};
+ rect.minW = maxX + (contLayoutRect.w - contLayoutRect.innerW);
+ rect.minH = maxY + (contLayoutRect.h - contLayoutRect.innerH);
+
+ rect.contentW = rect.minW - contLayoutRect.deltaW;
+ rect.contentH = rect.minH - contLayoutRect.deltaH;
+ rect.minW = Math.min(rect.minW, contLayoutRect.maxW);
+ rect.minH = Math.min(rect.minH, contLayoutRect.maxH);
+ rect.minW = Math.max(rect.minW, contLayoutRect.startMinWidth);
+ rect.minH = Math.max(rect.minH, contLayoutRect.startMinHeight);
+
+ // Resize container container if minSize was changed
+ if (contLayoutRect.autoResize && (rect.minW != contLayoutRect.minW || rect.minH != contLayoutRect.minH)) {
+ rect.w = rect.minW;
+ rect.h = rect.minH;
+
+ container.layoutRect(rect);
+ this.recalc(container);
+
+ // Forced recalc for example if items are hidden/shown
+ if (container._lastRect === null) {
+ var parentCtrl = container.parent();
+ if (parentCtrl) {
+ parentCtrl._lastRect = null;
+ parentCtrl.recalc();
+ }
+ }
+
+ return;
+ }
+
+ // Update contentW/contentH so absEnd moves correctly
+ if (contLayoutRect.autoResize) {
+ rect = container.layoutRect(rect);
+ rect.contentW = rect.minW - contLayoutRect.deltaW;
+ rect.contentH = rect.minH - contLayoutRect.deltaH;
+ }
+
+ var flexV;
+
+ if (settings.packV == 'start') {
+ flexV = 0;
+ } else {
+ flexV = availableHeight > 0 ? Math.floor(availableHeight / rows) : 0;
+ }
+
+ // Calculate totalFlex
+ var totalFlex = 0;
+ var flexWidths = settings.flexWidths;
+ if (flexWidths) {
+ for (x = 0; x < flexWidths.length; x++) {
+ totalFlex += flexWidths[x];
+ }
+ } else {
+ totalFlex = cols;
+ }
+
+ // Calculate new column widths based on flex values
+ var ratio = availableWidth / totalFlex;
+ for (x = 0; x < cols; x++) {
+ colWidths[x] += flexWidths ? flexWidths[x] * ratio : ratio;
+ }
+
+ // Move/resize controls
+ posY = contPaddingBox.top;
+ for (y = 0; y < rows; y++) {
+ posX = contPaddingBox.left;
+ height = rowHeights[y] + flexV;
+
+ for (x = 0; x < cols; x++) {
+ ctrl = items[y * cols + x];
+
+ // No more controls to render then break
+ if (!ctrl) {
+ break;
+ }
+
+ // Get control settings and calculate x, y
+ ctrlSettings = ctrl.settings;
+ ctrlLayoutRect = ctrl.layoutRect();
+ width = Math.max(colWidths[x], ctrlLayoutRect.startMinWidth);
+ alignX = alignY = 0;
+ ctrlLayoutRect.x = posX;
+ ctrlLayoutRect.y = posY;
+
+ // Align control horizontal
+ align = ctrlSettings.alignH || (alignH ? (alignH[x] || alignH[0]) : null);
+ if (align == "center") {
+ ctrlLayoutRect.x = posX + (width / 2) - (ctrlLayoutRect.w / 2);
+ } else if (align == "right") {
+ ctrlLayoutRect.x = posX + width - ctrlLayoutRect.w;
+ } else if (align == "stretch") {
+ ctrlLayoutRect.w = width;
+ }
+
+ // Align control vertical
+ align = ctrlSettings.alignV || (alignV ? (alignV[x] || alignV[0]) : null);
+ if (align == "center") {
+ ctrlLayoutRect.y = posY + (height / 2) - (ctrlLayoutRect.h / 2);
+ } else if (align == "bottom") {
+ ctrlLayoutRect.y = posY + height - ctrlLayoutRect.h;
+ } else if (align == "stretch") {
+ ctrlLayoutRect.h = height;
+ }
+
+ ctrl.layoutRect(ctrlLayoutRect);
+
+ posX += width + spacingH;
+
+ if (ctrl.recalc) {
+ ctrl.recalc();
+ }
+ }
+
+ posY += height + spacingV;
+ }
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/Iframe.js
+
+/**
+ * Iframe.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/*jshint scripturl:true */
+
+/**
+ * This class creates an iframe.
+ *
+ * @setting {String} url Url to open in the iframe.
+ *
+ * @-x-less Iframe.less
+ * @class tinymce.ui.Iframe
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Iframe", [
+ "tinymce/ui/Widget"
+], function(Widget) {
+ "use strict";
+
+ return Widget.extend({
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this;
+
+ self.addClass('iframe');
+ self.canFocus = false;
+
+ return (
+ '<iframe id="' + self._id + '" class="' + self.classes() + '" tabindex="-1" src="' +
+ (self.settings.url || "javascript:\'\'") + '" frameborder="0"></iframe>'
+ );
+ },
+
+ /**
+ * Setter for the iframe source.
+ *
+ * @method src
+ * @param {String} src Source URL for iframe.
+ */
+ src: function(src) {
+ this.getEl().src = src;
+ },
+
+ /**
+ * Inner HTML for the iframe.
+ *
+ * @method html
+ * @param {String} html HTML string to set as HTML inside the iframe.
+ * @param {function} callback Optional callback to execute when the iframe body is filled with contents.
+ * @return {tinymce.ui.Iframe} Current iframe control.
+ */
+ html: function(html, callback) {
+ var self = this, body = this.getEl().contentWindow.document.body;
+
+ // Wait for iframe to initialize IE 10 takes time
+ if (!body) {
+ setTimeout(function() {
+ self.html(html);
+ }, 0);
+ } else {
+ body.innerHTML = html;
+
+ if (callback) {
+ callback();
+ }
+ }
+
+ return this;
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/Label.js
+
+/**
+ * Label.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class creates a label element. A label is a simple text control
+ * that can be bound to other controls.
+ *
+ * @-x-less Label.less
+ * @class tinymce.ui.Label
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Label", [
+ "tinymce/ui/Widget",
+ "tinymce/ui/DomUtils"
+], function(Widget, DomUtils) {
+ "use strict";
+
+ return Widget.extend({
+ /**
+ * Constructs a instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ * @param {Boolean} multiline Multiline label.
+ */
+ init: function(settings) {
+ var self = this;
+
+ self._super(settings);
+ self.addClass('widget');
+ self.addClass('label');
+ self.canFocus = false;
+
+ if (settings.multiline) {
+ self.addClass('autoscroll');
+ }
+
+ if (settings.strong) {
+ self.addClass('strong');
+ }
+ },
+
+ /**
+ * Initializes the current controls layout rect.
+ * This will be executed by the layout managers to determine the
+ * default minWidth/minHeight etc.
+ *
+ * @method initLayoutRect
+ * @return {Object} Layout rect instance.
+ */
+ initLayoutRect: function() {
+ var self = this, layoutRect = self._super();
+
+ if (self.settings.multiline) {
+ var size = DomUtils.getSize(self.getEl());
+
+ // Check if the text fits within maxW if not then try word wrapping it
+ if (size.width > layoutRect.maxW) {
+ layoutRect.minW = layoutRect.maxW;
+ self.addClass('multiline');
+ }
+
+ self.getEl().style.width = layoutRect.minW + 'px';
+ layoutRect.startMinH = layoutRect.h = layoutRect.minH = Math.min(layoutRect.maxH, DomUtils.getSize(self.getEl()).height);
+ }
+
+ return layoutRect;
+ },
+
+ /**
+ * Repaints the control after a layout operation.
+ *
+ * @method repaint
+ */
+ repaint: function() {
+ var self = this;
+
+ if (!self.settings.multiline) {
+ self.getEl().style.lineHeight = self.layoutRect().h + 'px';
+ }
+
+ return self._super();
+ },
+
+ /**
+ * Sets/gets the current label text.
+ *
+ * @method text
+ * @param {String} [text] New label text.
+ * @return {String|tinymce.ui.Label} Current text or current label instance.
+ */
+ text: function(text) {
+ var self = this;
+
+ if (self._rendered && text) {
+ this.innerHtml(self.encode(text));
+ }
+
+ return self._super(text);
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, forId = self.settings.forId;
+
+ return (
+ '<label id="' + self._id + '" class="' + self.classes() + '"' + (forId ? ' for="' + forId : '') + '">' +
+ self.encode(self._text) +
+ '</label>'
+ );
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/Toolbar.js
+
+/**
+ * Toolbar.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new toolbar.
+ *
+ * @class tinymce.ui.Toolbar
+ * @extends tinymce.ui.Container
+ */
+define("tinymce/ui/Toolbar", [
+ "tinymce/ui/Container",
+ "tinymce/ui/KeyboardNavigation"
+], function(Container, KeyboardNavigation) {
+ "use strict";
+
+ return Container.extend({
+ Defaults: {
+ role: 'toolbar',
+ layout: 'flow'
+ },
+
+ /**
+ * Constructs a instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ */
+ init: function(settings) {
+ var self = this;
+
+ self._super(settings);
+ self.addClass('toolbar');
+ },
+
+ /**
+ * Called after the control has been rendered.
+ *
+ * @method postRender
+ */
+ postRender: function() {
+ var self = this;
+
+ self.items().addClass('toolbar-item');
+
+ self.keyNav = new KeyboardNavigation({
+ root: self,
+ enableLeftRight: true
+ });
+
+ return self._super();
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/MenuBar.js
+
+/**
+ * MenuBar.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new menubar.
+ *
+ * @-x-less MenuBar.less
+ * @class tinymce.ui.MenuBar
+ * @extends tinymce.ui.Container
+ */
+define("tinymce/ui/MenuBar", [
+ "tinymce/ui/Toolbar"
+], function(Toolbar) {
+ "use strict";
+
+ return Toolbar.extend({
+ Defaults: {
+ role: 'menubar',
+ containerCls: 'menubar',
+ defaults: {
+ type: 'menubutton'
+ }
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/MenuButton.js
+
+/**
+ * MenuButton.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new menu button.
+ *
+ * @-x-less MenuButton.less
+ * @class tinymce.ui.MenuButton
+ * @extends tinymce.ui.Button
+ */
+define("tinymce/ui/MenuButton", [
+ "tinymce/ui/Button",
+ "tinymce/ui/Factory",
+ "tinymce/ui/MenuBar"
+], function(Button, Factory, MenuBar) {
+ "use strict";
+
+ // TODO: Maybe add as some global function
+ function isChildOf(node, parent) {
+ while (node) {
+ if (parent === node) {
+ return true;
+ }
+
+ node = node.parentNode;
+ }
+
+ return false;
+ }
+
+ var MenuButton = Button.extend({
+ /**
+ * Constructs a instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ */
+ init: function(settings) {
+ var self = this;
+
+ self._renderOpen = true;
+ self._super(settings);
+
+ self.addClass('menubtn');
+
+ if (settings.fixedWidth) {
+ self.addClass('fixed-width');
+ }
+
+ self.aria('haspopup', true);
+ self.hasPopup = true;
+ },
+
+ /**
+ * Shows the menu for the button.
+ *
+ * @method showMenu
+ */
+ showMenu: function() {
+ var self = this, settings = self.settings, menu;
+
+ if (self.menu && self.menu.visible()) {
+ return self.hideMenu();
+ }
+
+ if (!self.menu) {
+ menu = settings.menu || [];
+
+ // Is menu array then auto constuct menu control
+ if (menu.length) {
+ menu = {
+ type: 'menu',
+ items: menu
+ };
+ } else {
+ menu.type = menu.type || 'menu';
+ }
+
+ self.menu = Factory.create(menu).parent(self).renderTo(self.getContainerElm());
+ self.fire('createmenu');
+ self.menu.reflow();
+ self.menu.on('cancel', function(e) {
+ if (e.control === self.menu) {
+ self.focus();
+ }
+ });
+
+ self.menu.on('show hide', function(e) {
+ if (e.control == self.menu) {
+ self.activeMenu(e.type == 'show');
+ }
+ }).fire('show');
+
+ self.aria('expanded', true);
+ }
+
+ self.menu.show();
+ self.menu.layoutRect({w: self.layoutRect().w});
+ self.menu.moveRel(self.getEl(), self.isRtl() ? ['br-tr', 'tr-br'] : ['bl-tl', 'tl-bl']);
+ },
+
+ /**
+ * Hides the menu for the button.
+ *
+ * @method hideMenu
+ */
+ hideMenu: function() {
+ var self = this;
+
+ if (self.menu) {
+ self.menu.items().each(function(item) {
+ if (item.hideMenu) {
+ item.hideMenu();
+ }
+ });
+
+ self.menu.hide();
+ self.aria('expanded', false);
+ }
+ },
+
+ /**
+ * Sets the active menu state.
+ *
+ * @private
+ */
+ activeMenu: function(state) {
+ this.toggleClass('active', state);
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, id = self._id, prefix = self.classPrefix;
+ var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
+
+ self.aria('role', self.parent() instanceof MenuBar ? 'menuitem' : 'button');
+
+ return (
+ '<div id="' + id + '" class="' + self.classes() + '" tabindex="-1">' +
+ '<button id="' + id + '-open" role="presentation" type="button" tabindex="-1">' +
+ (icon ? '<i class="' + icon + '"></i>' : '') +
+ '<span>' + (self._text ? (icon ? '\u00a0' : '') + self.encode(self._text) : '') + '</span>' +
+ ' <i class="' + prefix + 'caret"></i>' +
+ '</button>' +
+ '</div>'
+ );
+ },
+
+ /**
+ * Gets invoked after the control has been rendered.
+ *
+ * @method postRender
+ */
+ postRender: function() {
+ var self = this;
+
+ self.on('click', function(e) {
+ if (e.control === self && isChildOf(e.target, self.getEl())) {
+ self.showMenu();
+
+ if (e.keyboard) {
+ self.menu.items()[0].focus();
+ }
+ }
+ });
+
+ self.on('mouseenter', function(e) {
+ var overCtrl = e.control, parent = self.parent(), hasVisibleSiblingMenu;
+
+ if (overCtrl && parent && overCtrl instanceof MenuButton && overCtrl.parent() == parent) {
+ parent.items().filter('MenuButton').each(function(ctrl) {
+ if (ctrl.hideMenu && ctrl != overCtrl) {
+ if (ctrl.menu && ctrl.menu.visible()) {
+ hasVisibleSiblingMenu = true;
+ }
+
+ ctrl.hideMenu();
+ }
+ });
+
+ if (hasVisibleSiblingMenu) {
+ overCtrl.focus(); // Fix for: #5887
+ overCtrl.showMenu();
+ }
+ }
+ });
+
+ return self._super();
+ },
+
+ /**
+ * Sets/gets the current button text.
+ *
+ * @method text
+ * @param {String} [text] New button text.
+ * @return {String|tinymce.ui.MenuButton} Current text or current MenuButton instance.
+ */
+ text: function(text) {
+ var self = this, i, children;
+
+ if (self._rendered) {
+ children = self.getEl('open').getElementsByTagName('span');
+ for (i = 0; i < children.length; i++) {
+ children[i].innerHTML = (self.settings.icon && text ? '\u00a0' : '') + self.encode(text);
+ }
+ }
+
+ return this._super(text);
+ },
+
+ /**
+ * Removes the control and it's menus.
+ *
+ * @method remove
+ */
+ remove: function() {
+ this._super();
+
+ if (this.menu) {
+ this.menu.remove();
+ }
+ }
+ });
+
+ return MenuButton;
+});
+
+// Included from: js/tinymce/classes/ui/ListBox.js
+
+/**
+ * ListBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new list box control.
+ *
+ * @-x-less ListBox.less
+ * @class tinymce.ui.ListBox
+ * @extends tinymce.ui.MenuButton
+ */
+define("tinymce/ui/ListBox", [
+ "tinymce/ui/MenuButton"
+], function(MenuButton) {
+ "use strict";
+
+ return MenuButton.extend({
+ /**
+ * Constructs a instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ * @setting {Array} values Array with values to add to list box.
+ */
+ init: function(settings) {
+ var self = this, values, i, selected, selectedText, lastItemCtrl;
+
+ self._values = values = settings.values;
+ if (values) {
+ for (i = 0; i < values.length; i++) {
+ selected = values[i].selected || settings.value === values[i].value;
+
+ if (selected) {
+ selectedText = selectedText || values[i].text;
+ self._value = values[i].value;
+ }
+ }
+
+ settings.menu = values;
+ }
+
+ settings.text = settings.text || selectedText || values[0].text;
+
+ self._super(settings);
+ self.addClass('listbox');
+
+ self.on('select', function(e) {
+ var ctrl = e.control;
+
+ if (lastItemCtrl) {
+ e.lastControl = lastItemCtrl;
+ }
+
+ if (settings.multiple) {
+ ctrl.active(!ctrl.active());
+ } else {
+ self.value(e.control.settings.value);
+ }
+
+ lastItemCtrl = ctrl;
+ });
+ },
+
+ /**
+ * Getter/setter function for the control value.
+ *
+ * @method value
+ * @param {String} [value] Value to be set.
+ * @return {Boolean/tinymce.ui.ListBox} Value or self if it's a set operation.
+ */
+ value: function(value) {
+ var self = this, active, selectedText, menu, i;
+
+ function activateByValue(menu, value) {
+ menu.items().each(function(ctrl) {
+ active = ctrl.value() === value;
+
+ if (active) {
+ selectedText = selectedText || ctrl.text();
+ }
+
+ ctrl.active(active);
+
+ if (ctrl.menu) {
+ activateByValue(ctrl.menu, value);
+ }
+ });
+ }
+
+ if (typeof(value) != "undefined") {
+ if (self.menu) {
+ activateByValue(self.menu, value);
+ } else {
+ menu = self.settings.menu;
+ for (i = 0; i < menu.length; i++) {
+ active = menu[i].value == value;
+
+ if (active) {
+ selectedText = selectedText || menu[i].text;
+ }
+
+ menu[i].active = active;
+ }
+ }
+
+ self.text(selectedText || this.settings.text);
+ }
+
+ return self._super(value);
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/MenuItem.js
+
+/**
+ * MenuItem.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new menu item.
+ *
+ * @-x-less MenuItem.less
+ * @class tinymce.ui.MenuItem
+ * @extends tinymce.ui.Control
+ */
+define("tinymce/ui/MenuItem", [
+ "tinymce/ui/Widget",
+ "tinymce/ui/Factory",
+ "tinymce/Env"
+], function(Widget, Factory, Env) {
+ "use strict";
+
+ return Widget.extend({
+ Defaults: {
+ border: 0,
+ role: 'menuitem'
+ },
+
+ /**
+ * Constructs a instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ * @setting {Boolean} selectable Selectable menu.
+ * @setting {Array} menu Submenu array with items.
+ * @setting {String} shortcut Shortcut to display for menu item. Example: Ctrl+X
+ */
+ init: function(settings) {
+ var self = this;
+
+ self.hasPopup = true;
+
+ self._super(settings);
+
+ settings = self.settings;
+
+ self.addClass('menu-item');
+
+ if (settings.menu) {
+ self.addClass('menu-item-expand');
+ }
+
+ if (settings.preview) {
+ self.addClass('menu-item-preview');
+ }
+
+ if (self._text === '-' || self._text === '|') {
+ self.addClass('menu-item-sep');
+ self.aria('role', 'separator');
+ self.canFocus = false;
+ self._text = '-';
+ }
+
+ if (settings.selectable) {
+ self.aria('role', 'menuitemcheckbox');
+ self.aria('checked', true);
+ self.addClass('menu-item-checkbox');
+ settings.icon = 'selected';
+ }
+
+ if (!settings.preview && !settings.selectable) {
+ self.addClass('menu-item-normal');
+ }
+
+ self.on('mousedown', function(e) {
+ e.preventDefault();
+ });
+
+ self.on('mouseenter click', function(e) {
+ if (e.control === self) {
+ if (!settings.menu && e.type === 'click') {
+ self.parent().hideAll();
+ self.fire('cancel');
+ self.fire('select');
+ } else {
+ self.showMenu();
+
+ if (e.keyboard) {
+ setTimeout(function() {
+ self.menu.items()[0].focus();
+ }, 0);
+ }
+ }
+ }
+ });
+
+ if (settings.menu) {
+ self.aria('haspopup', true);
+ }
+ },
+
+ /**
+ * Returns true/false if the menuitem has sub menu.
+ *
+ * @method hasMenus
+ * @return {Boolean} True/false state if it has submenu.
+ */
+ hasMenus: function() {
+ return !!this.settings.menu;
+ },
+
+ /**
+ * Shows the menu for the menu item.
+ *
+ * @method showMenu
+ */
+ showMenu: function() {
+ var self = this, settings = self.settings, menu, parent = self.parent();
+
+ parent.items().each(function(ctrl) {
+ if (ctrl !== self) {
+ ctrl.hideMenu();
+ }
+ });
+
+ if (settings.menu) {
+ menu = self.menu;
+
+ if (!menu) {
+ menu = settings.menu;
+
+ // Is menu array then auto constuct menu control
+ if (menu.length) {
+ menu = {
+ type: 'menu',
+ items: menu
+ };
+ } else {
+ menu.type = menu.type || 'menu';
+ }
+
+ if (parent.settings.itemDefaults) {
+ menu.itemDefaults = parent.settings.itemDefaults;
+ }
+
+ menu = self.menu = Factory.create(menu).parent(self).renderTo(self.getContainerElm());
+ menu.reflow();
+ menu.fire('show');
+ menu.on('cancel', function() {
+ self.focus();
+ });
+
+ menu.on('hide', function(e) {
+ if (e.control === menu) {
+ self.removeClass('selected');
+ }
+ });
+ } else {
+ menu.show();
+ }
+
+ menu._parentMenu = parent;
+
+ menu.addClass('menu-sub');
+
+ var rel = menu.testMoveRel(
+ self.getEl(),
+ self.isRtl() ? ['tl-tr', 'bl-br', 'tr-tl', 'br-bl'] : ['tr-tl', 'br-bl', 'tl-tr', 'bl-br']
+ );
+
+ menu.moveRel(self.getEl(), rel);
+ menu.rel = rel;
+
+ rel = 'menu-sub-' + rel;
+ menu.removeClass(menu._lastRel);
+ menu.addClass(rel);
+ menu._lastRel = rel;
+
+ self.addClass('selected');
+ self.aria('expanded', true);
+ }
+ },
+
+ /**
+ * Hides the menu for the menu item.
+ *
+ * @method hideMenu
+ */
+ hideMenu: function() {
+ var self = this;
+
+ if (self.menu) {
+ self.menu.items().each(function(item) {
+ if (item.hideMenu) {
+ item.hideMenu();
+ }
+ });
+
+ self.menu.hide();
+ self.aria('expanded', false);
+ }
+
+ return self;
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix, text = self.encode(self._text);
+ var icon = self.settings.icon, image = '', shortcut = settings.shortcut;
+
+ if (icon) {
+ self.parent().addClass('menu-has-icons');
+ }
+
+ if (settings.image) {
+ icon = 'none';
+ image = ' style="background-image: url(\'' + settings.image + '\')"';
+ }
+
+ if (shortcut && Env.mac) {
+ // format shortcut for Mac
+ shortcut = shortcut.replace(/ctrl\+alt\+/i, '⌥⌘'); // ctrl+cmd
+ shortcut = shortcut.replace(/ctrl\+/i, '⌘'); // ctrl symbol
+ shortcut = shortcut.replace(/alt\+/i, '⌥'); // cmd symbol
+ shortcut = shortcut.replace(/shift\+/i, '⇧'); // shift symbol
+ }
+
+ icon = prefix + 'ico ' + prefix + 'i-' + (self.settings.icon || 'none');
+
+ return (
+ '<div id="' + id + '" class="' + self.classes() + '" tabindex="-1">' +
+ (text !== '-' ? '<i class="' + icon + '"' + image + '></i> ' : '') +
+ (text !== '-' ? '<span id="' + id + '-text" class="' + prefix + 'text">' + text + '</span>' : '') +
+ (shortcut ? '<div id="' + id + '-shortcut" class="' + prefix + 'menu-shortcut">' +
+ shortcut + '</div>' : '') +
+ (settings.menu ? '<div class="' + prefix + 'caret"></div>' : '') +
+ '</div>'
+ );
+ },
+
+ /**
+ * Gets invoked after the control has been rendered.
+ *
+ * @method postRender
+ */
+ postRender: function() {
+ var self = this, settings = self.settings;
+
+ var textStyle = settings.textStyle;
+ if (typeof(textStyle) == "function") {
+ textStyle = textStyle.call(this);
+ }
+
+ if (textStyle) {
+ var textElm = self.getEl('text');
+ if (textElm) {
+ textElm.setAttribute('style', textStyle);
+ }
+ }
+
+ return self._super();
+ },
+
+ /**
+ * Removes the control and it's menus.
+ *
+ * @method remove
+ */
+ remove: function() {
+ this._super();
+
+ if (this.menu) {
+ this.menu.remove();
+ }
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/Menu.js
+
+/**
+ * Menu.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new menu.
+ *
+ * @-x-less Menu.less
+ * @class tinymce.ui.Menu
+ * @extends tinymce.ui.FloatPanel
+ */
+define("tinymce/ui/Menu", [
+ "tinymce/ui/FloatPanel",
+ "tinymce/ui/KeyboardNavigation",
+ "tinymce/ui/MenuItem",
+ "tinymce/util/Tools"
+], function(FloatPanel, KeyboardNavigation, MenuItem, Tools) {
+ "use strict";
+
+ var Menu = FloatPanel.extend({
+ Defaults: {
+ defaultType: 'menuitem',
+ border: 1,
+ layout: 'stack',
+ role: 'menu'
+ },
+
+ /**
+ * Constructs a instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ */
+ init: function(settings) {
+ var self = this;
+
+ settings.autohide = true;
+ settings.constrainToViewport = true;
+
+ if (settings.itemDefaults) {
+ var items = settings.items, i = items.length;
+
+ while (i--) {
+ items[i] = Tools.extend({}, settings.itemDefaults, items[i]);
+ }
+ }
+
+ self._super(settings);
+ self.addClass('menu');
+
+ self.keyNav = new KeyboardNavigation({
+ root: self,
+ enableUpDown: true,
+ enableLeftRight: true,
+
+ leftAction: function() {
+ if (self.parent() instanceof MenuItem) {
+ self.keyNav.cancel();
+ }
+ },
+
+ onCancel: function() {
+ self.fire('cancel', {}, false);
+ self.hide();
+ }
+ });
+ },
+
+ /**
+ * Repaints the control after a layout operation.
+ *
+ * @method repaint
+ */
+ repaint: function() {
+ this.toggleClass('menu-align', true);
+
+ this._super();
+
+ this.getEl().style.height = '';
+ this.getEl('body').style.height = '';
+
+ return this;
+ },
+
+ /**
+ * Hides/closes the menu.
+ *
+ * @method cancel
+ */
+ cancel: function() {
+ var self = this;
+
+ self.hideAll();
+ self.fire('cancel');
+ self.fire('select');
+ },
+
+ /**
+ * Hide menu and all sub menus.
+ *
+ * @method hideAll
+ */
+ hideAll: function() {
+ var self = this;
+
+ this.find('menuitem').exec('hideMenu');
+
+ return self._super();
+ },
+
+ /**
+ * Invoked before the menu is rendered.
+ *
+ * @method preRender
+ */
+ preRender: function() {
+ var self = this;
+
+ self.items().each(function(ctrl) {
+ var settings = ctrl.settings;
+
+ if (settings.icon || settings.selectable) {
+ self._hasIcons = true;
+ return false;
+ }
+ });
+
+ return self._super();
+ }
+ });
+
+ return Menu;
+});
+
+// Included from: js/tinymce/classes/ui/Radio.js
+
+/**
+ * Radio.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new radio button.
+ *
+ * @-x-less Radio.less
+ * @class tinymce.ui.Radio
+ * @extends tinymce.ui.Checkbox
+ */
+define("tinymce/ui/Radio", [
+ "tinymce/ui/Checkbox"
+], function(Checkbox) {
+ "use strict";
+
+ return Checkbox.extend({
+ Defaults: {
+ classes: "radio",
+ role: "radio"
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/ResizeHandle.js
+
+/**
+ * ResizeHandle.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Renders a resize handle that fires ResizeStart, Resize and ResizeEnd events.
+ *
+ * @-x-less ResizeHandle.less
+ * @class tinymce.ui.ResizeHandle
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/ResizeHandle", [
+ "tinymce/ui/Widget",
+ "tinymce/ui/DragHelper"
+], function(Widget, DragHelper) {
+ "use strict";
+
+ return Widget.extend({
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, prefix = self.classPrefix;
+
+ self.addClass('resizehandle');
+
+ if (self.settings.direction == "both") {
+ self.addClass('resizehandle-both');
+ }
+
+ self.canFocus = false;
+
+ return (
+ '<div id="' + self._id + '" class="' + self.classes() + '">' +
+ '<i class="' + prefix + 'ico ' + prefix + 'i-resize"></i>' +
+ '</div>'
+ );
+ },
+
+ /**
+ * Called after the control has been rendered.
+ *
+ * @method postRender
+ */
+ postRender: function() {
+ var self = this;
+
+ self._super();
+
+ self.resizeDragHelper = new DragHelper(this._id, {
+ start: function() {
+ self.fire('ResizeStart');
+ },
+
+ drag: function(e) {
+ if (self.settings.direction != "both") {
+ e.deltaX = 0;
+ }
+
+ self.fire('Resize', e);
+ },
+
+ end: function() {
+ self.fire('ResizeEnd');
+ }
+ });
+ },
+
+ remove: function() {
+ if (this.resizeDragHelper) {
+ this.resizeDragHelper.destroy();
+ }
+
+ return this._super();
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/Spacer.js
+
+/**
+ * Spacer.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a spacer. This control is used in flex layouts for example.
+ *
+ * @-x-less Spacer.less
+ * @class tinymce.ui.Spacer
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/Spacer", [
+ "tinymce/ui/Widget"
+], function(Widget) {
+ "use strict";
+
+ return Widget.extend({
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this;
+
+ self.addClass('spacer');
+ self.canFocus = false;
+
+ return '<div id="' + self._id + '" class="' + self.classes() + '"></div>';
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/SplitButton.js
+
+/**
+ * SplitButton.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a split button.
+ *
+ * @-x-less SplitButton.less
+ * @class tinymce.ui.SplitButton
+ * @extends tinymce.ui.Button
+ */
+define("tinymce/ui/SplitButton", [
+ "tinymce/ui/MenuButton",
+ "tinymce/ui/DomUtils"
+], function(MenuButton, DomUtils) {
+ return MenuButton.extend({
+ Defaults: {
+ classes: "widget btn splitbtn",
+ role: "splitbutton"
+ },
+
+ /**
+ * Repaints the control after a layout operation.
+ *
+ * @method repaint
+ */
+ repaint: function() {
+ var self = this, elm = self.getEl(), rect = self.layoutRect(), mainButtonElm, menuButtonElm;
+
+ self._super();
+
+ mainButtonElm = elm.firstChild;
+ menuButtonElm = elm.lastChild;
+
+ DomUtils.css(mainButtonElm, {
+ width: rect.w - DomUtils.getSize(menuButtonElm).width,
+ height: rect.h - 2
+ });
+
+ DomUtils.css(menuButtonElm, {
+ height: rect.h - 2
+ });
+
+ return self;
+ },
+
+ /**
+ * Sets the active menu state.
+ *
+ * @private
+ */
+ activeMenu: function(state) {
+ var self = this;
+
+ DomUtils.toggleClass(self.getEl().lastChild, self.classPrefix + 'active', state);
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, id = self._id, prefix = self.classPrefix;
+ var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
+
+ return (
+ '<div id="' + id + '" class="' + self.classes() + '">' +
+ '<button type="button" hidefocus tabindex="-1">' +
+ (icon ? '<i class="' + icon + '"></i>' : '') +
+ (self._text ? (icon ? ' ' : '') + self._text : '') +
+ '</button>' +
+ '<button type="button" class="' + prefix + 'open" hidefocus tabindex="-1">' +
+ //(icon ? '<i class="' + icon + '"></i>' : '') +
+ (self._menuBtnText ? (icon ? '\u00a0' : '') + self._menuBtnText : '') +
+ ' <i class="' + prefix + 'caret"></i>' +
+ '</button>' +
+ '</div>'
+ );
+ },
+
+ /**
+ * Called after the control has been rendered.
+ *
+ * @method postRender
+ */
+ postRender: function() {
+ var self = this, onClickHandler = self.settings.onclick;
+
+ self.on('click', function(e) {
+ var node = e.target;
+
+ if (e.control == this) {
+ // Find clicks that is on the main button
+ while (node) {
+ if (node.nodeName == 'BUTTON' && node.className.indexOf('open') == -1) {
+ e.stopImmediatePropagation();
+ onClickHandler.call(this, e);
+ return;
+ }
+
+ node = node.parentNode;
+ }
+ }
+ });
+
+ delete self.settings.onclick;
+
+ return self._super();
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/StackLayout.js
+
+/**
+ * StackLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout uses the browsers layout when the items are blocks.
+ *
+ * @-x-less StackLayout.less
+ * @class tinymce.ui.StackLayout
+ * @extends tinymce.ui.FlowLayout
+ */
+define("tinymce/ui/StackLayout", [
+ "tinymce/ui/FlowLayout"
+], function(FlowLayout) {
+ "use strict";
+
+ return FlowLayout.extend({
+ Defaults: {
+ containerClass: 'stack-layout',
+ controlClass: 'stack-layout-item',
+ endClass : 'break'
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/TabPanel.js
+
+/**
+ * TabPanel.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a tab panel control.
+ *
+ * @-x-less TabPanel.less
+ * @class tinymce.ui.TabPanel
+ * @extends tinymce.ui.Panel
+ *
+ * @setting {Number} activeTab Active tab index.
+ */
+define("tinymce/ui/TabPanel", [
+ "tinymce/ui/Panel",
+ "tinymce/ui/DomUtils"
+], function(Panel, DomUtils) {
+ "use strict";
+
+ return Panel.extend({
+ lastIdx: 0,
+
+ Defaults: {
+ layout: 'absolute',
+ defaults: {
+ type: 'panel'
+ }
+ },
+
+ /**
+ * Activates the specified tab by index.
+ *
+ * @method activateTab
+ * @param {Number} idx Index of the tab to activate.
+ */
+ activateTab: function(idx) {
+ if (this.activeTabId) {
+ DomUtils.removeClass(this.getEl(this.activeTabId), this.classPrefix + 'active');
+ }
+
+ this.activeTabId = 't' + idx;
+
+ DomUtils.addClass(this.getEl('t' + idx), this.classPrefix + 'active');
+
+ if (idx != this.lastIdx) {
+ this.items()[this.lastIdx].hide();
+ this.lastIdx = idx;
+ }
+
+ this.items()[idx].show().fire('showtab');
+ this.reflow();
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, layout = self._layout, tabsHtml = '', prefix = self.classPrefix;
+
+ self.preRender();
+ layout.preRender(self);
+
+ self.items().each(function(ctrl, i) {
+ tabsHtml += (
+ '<div id="' + self._id + '-t' + i + '" class="' + prefix + 'tab" unselectable="on">' +
+ self.encode(ctrl.settings.title) +
+ '</div>'
+ );
+ });
+
+ return (
+ '<div id="' + self._id + '" class="' + self.classes() + '" hideFocus="1" tabIndex="-1">' +
+ '<div id="' + self._id + '-head" class="' + prefix + 'tabs">' +
+ tabsHtml +
+ '</div>' +
+ '<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
+ layout.renderHtml(self) +
+ '</div>' +
+ '</div>'
+ );
+ },
+
+ /**
+ * Called after the control has been rendered.
+ *
+ * @method postRender
+ */
+ postRender: function() {
+ var self = this;
+
+ self._super();
+
+ self.settings.activeTab = self.settings.activeTab || 0;
+ self.activateTab(self.settings.activeTab);
+
+ this.on('click', function(e) {
+ var targetParent = e.target.parentNode;
+
+ if (e.target.parentNode.id == self._id + '-head') {
+ var i = targetParent.childNodes.length;
+
+ while (i--) {
+ if (targetParent.childNodes[i] == e.target) {
+ self.activateTab(i);
+ }
+ }
+ }
+ });
+ },
+
+ /**
+ * Initializes the current controls layout rect.
+ * This will be executed by the layout managers to determine the
+ * default minWidth/minHeight etc.
+ *
+ * @method initLayoutRect
+ * @return {Object} Layout rect instance.
+ */
+ initLayoutRect: function() {
+ var self = this, rect, minW, minH;
+
+ minW = DomUtils.getSize(self.getEl('head')).width;
+ minW = minW < 0 ? 0 : minW;
+ minH = 0;
+ self.items().each(function(item, i) {
+ minW = Math.max(minW, item.layoutRect().minW);
+ minH = Math.max(minH, item.layoutRect().minH);
+ if (self.settings.activeTab != i) {
+ item.hide();
+ }
+ });
+
+ self.items().each(function(ctrl) {
+ ctrl.settings.x = 0;
+ ctrl.settings.y = 0;
+ ctrl.settings.w = minW;
+ ctrl.settings.h = minH;
+
+ ctrl.layoutRect({
+ x: 0,
+ y: 0,
+ w: minW,
+ h: minH
+ });
+ });
+
+ var headH = DomUtils.getSize(self.getEl('head')).height;
+
+ self.settings.minWidth = minW;
+ self.settings.minHeight = minH + headH;
+
+ rect = self._super();
+ rect.deltaH += headH;
+ rect.innerH = rect.h - rect.deltaH;
+
+ return rect;
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/TextBox.js
+
+/**
+ * TextBox.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * Creates a new textbox.
+ *
+ * @-x-less TextBox.less
+ * @class tinymce.ui.TextBox
+ * @extends tinymce.ui.Widget
+ */
+define("tinymce/ui/TextBox", [
+ "tinymce/ui/Widget",
+ "tinymce/ui/DomUtils"
+], function(Widget, DomUtils) {
+ "use strict";
+
+ return Widget.extend({
+ /**
+ * Constructs a instance with the specified settings.
+ *
+ * @constructor
+ * @param {Object} settings Name/value object with settings.
+ * @setting {Boolean} multiline True if the textbox is a multiline control.
+ * @setting {Number} maxLength Max length for the textbox.
+ * @setting {Number} size Size of the textbox in characters.
+ */
+ init: function(settings) {
+ var self = this;
+
+ self._super(settings);
+
+ self._value = settings.value || '';
+ self.addClass('textbox');
+
+ if (settings.multiline) {
+ self.addClass('multiline');
+ } else {
+ // TODO: Rework this
+ self.on('keydown', function(e) {
+ if (e.keyCode == 13) {
+ self.parents().reverse().each(function(ctrl) {
+ e.preventDefault();
+
+ if (ctrl.hasEventListeners('submit') && ctrl.toJSON) {
+ ctrl.fire('submit', {data: ctrl.toJSON()});
+ return false;
+ }
+ });
+ }
+ });
+ }
+ },
+
+ /**
+ * Getter/setter function for the disabled state.
+ *
+ * @method value
+ * @param {Boolean} [state] State to be set.
+ * @return {Boolean|tinymce.ui.ComboBox} True/false or self if it's a set operation.
+ */
+ disabled: function(state) {
+ var self = this;
+
+ if (self._rendered && typeof(state) != 'undefined') {
+ self.getEl().disabled = state;
+ }
+
+ return self._super(state);
+ },
+
+ /**
+ * Getter/setter function for the control value.
+ *
+ * @method value
+ * @param {String} [value] Value to be set.
+ * @return {String|tinymce.ui.ComboBox} Value or self if it's a set operation.
+ */
+ value: function(value) {
+ var self = this;
+
+ if (typeof(value) != "undefined") {
+ self._value = value;
+
+ if (self._rendered) {
+ self.getEl().value = value;
+ }
+
+ return self;
+ }
+
+ if (self._rendered) {
+ return self.getEl().value;
+ }
+
+ return self._value;
+ },
+
+ /**
+ * Repaints the control after a layout operation.
+ *
+ * @method repaint
+ */
+ repaint: function() {
+ var self = this, style, rect, borderBox, borderW = 0, borderH = 0, lastRepaintRect;
+
+ style = self.getEl().style;
+ rect = self._layoutRect;
+ lastRepaintRect = self._lastRepaintRect || {};
+
+ // Detect old IE 7+8 add lineHeight to align caret vertically in the middle
+ var doc = document;
+ if (!self.settings.multiline && doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
+ style.lineHeight = (rect.h - borderH) + 'px';
+ }
+
+ borderBox = self._borderBox;
+ borderW = borderBox.left + borderBox.right + 8;
+ borderH = borderBox.top + borderBox.bottom + (self.settings.multiline ? 8 : 0);
+
+ if (rect.x !== lastRepaintRect.x) {
+ style.left = rect.x + 'px';
+ lastRepaintRect.x = rect.x;
+ }
+
+ if (rect.y !== lastRepaintRect.y) {
+ style.top = rect.y + 'px';
+ lastRepaintRect.y = rect.y;
+ }
+
+ if (rect.w !== lastRepaintRect.w) {
+ style.width = (rect.w - borderW) + 'px';
+ lastRepaintRect.w = rect.w;
+ }
+
+ if (rect.h !== lastRepaintRect.h) {
+ style.height = (rect.h - borderH) + 'px';
+ lastRepaintRect.h = rect.h;
+ }
+
+ self._lastRepaintRect = lastRepaintRect;
+ self.fire('repaint', {}, false);
+
+ return self;
+ },
+
+ /**
+ * Renders the control as a HTML string.
+ *
+ * @method renderHtml
+ * @return {String} HTML representing the control.
+ */
+ renderHtml: function() {
+ var self = this, id = self._id, settings = self.settings, value = self.encode(self._value, false), extraAttrs = '';
+
+ if ("spellcheck" in settings) {
+ extraAttrs += ' spellcheck="' + settings.spellcheck + '"';
+ }
+
+ if (settings.maxLength) {
+ extraAttrs += ' maxlength="' + settings.maxLength + '"';
+ }
+
+ if (settings.size) {
+ extraAttrs += ' size="' + settings.size + '"';
+ }
+
+ if (settings.subtype) {
+ extraAttrs += ' type="' + settings.subtype + '"';
+ }
+
+ if (self.disabled()) {
+ extraAttrs += ' disabled="disabled"';
+ }
+
+ if (settings.multiline) {
+ return (
+ '<textarea id="' + id + '" class="' + self.classes() + '" ' +
+ (settings.rows ? ' rows="' + settings.rows + '"' : '') +
+ ' hidefocus="true"' + extraAttrs + '>' + value +
+ '</textarea>'
+ );
+ }
+
+ return '<input id="' + id + '" class="' + self.classes() + '" value="' + value + '" hidefocus="true"' + extraAttrs + '>';
+ },
+
+ /**
+ * Called after the control has been rendered.
+ *
+ * @method postRender
+ */
+ postRender: function() {
+ var self = this;
+
+ DomUtils.on(self.getEl(), 'change', function(e) {
+ self.fire('change', e);
+ });
+
+ return self._super();
+ },
+
+ remove: function() {
+ DomUtils.off(this.getEl());
+ this._super();
+ }
+ });
+});
+
+// Included from: js/tinymce/classes/ui/Throbber.js
+
+/**
+ * Throbber.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This class enables you to display a Throbber for any element.
+ *
+ * @-x-less Throbber.less
+ * @class tinymce.ui.Throbber
+ */
+define("tinymce/ui/Throbber", [
+ "tinymce/ui/DomUtils"
+], function(DomUtils) {
+ "use strict";
+
+ /**
+ * Constructs a new throbber.
+ *
+ * @constructor
+ * @param {Element} elm DOM Html element to display throbber in.
+ */
+ return function(elm) {
+ var self = this, state;
+
+ /**
+ * Shows the throbber.
+ *
+ * @method show
+ * @param {Number} [time] Time to wait before showing.
+ * @return {tinymce.ui.Throbber} Current throbber instance.
+ */
+ self.show = function(time) {
+ self.hide();
+
+ state = true;
+
+ window.setTimeout(function() {
+ if (state) {
+ elm.appendChild(DomUtils.createFragment('<div class="mce-throbber"></div>'));
+ }
+ }, time || 0);
+
+ return self;
+ };
+
+ /**
+ * Hides the throbber.
+ *
+ * @method hide
+ * @return {tinymce.ui.Throbber} Current throbber instance.
+ */
+ self.hide = function() {
+ var child = elm.lastChild;
+
+ if (child && child.className.indexOf('throbber') != -1) {
+ child.parentNode.removeChild(child);
+ }
+
+ state = false;
+
+ return self;
+ };
+ };
+});
+
+expose(["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/TreeWalker","tinymce/util/Tools","tinymce/dom/Range","tinymce/html/Entities","tinymce/Env","tinymce/dom/DOMUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/html/DomParser","tinymce/html/Writer","tinymce/html/Serializer","tinymce/dom/Serializer","tinymce/dom/TridentSelection","tinymce/util/VK","tinymce/dom/ControlSelection","tinymce/dom/Selection","tinymce/dom/RangeUtils","tinymce/Formatter","tinymce/UndoManager","tinymce/EnterKey","tinymce/ForceBlocks","tinymce/EditorCommands","tinymce/util/URI",
"tinymce/util/Class","tinymce/ui/Selector","tinymce/ui/Collection","tinymce/ui/DomUtils","tinymce/ui/Control","tinymce/ui/Factory","tinymce/ui/Container","tinymce/ui/DragHelper","tinymce/ui/Scrollable","tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/FloatPanel","tinymce/ui/KeyboardNavigation","tinymce/ui/Window","tinymce/ui/MessageBox","tinymce/WindowManager","tinymce/util/Quirks","tinymce/util/Observable","tinymce/Shortcuts","tinymce/Editor","tinymce/util/I18n","tinymce/FocusManager","tinymce/EditorManager","tinymce/LegacyInput","tinymce/util/XHR","tinymce/util/JSON","tinymce/util/JSONRequest","tinymce/util/JSONP","tinymce/util/LocalStorage","tinymce/Compa
t","tinymce/ui/Layout","tinymce/ui/AbsoluteLayout","tinymce/ui/Tooltip","tinymce/ui/Widget","tinymce/ui/Button","tinymce/ui/ButtonGroup","tinymce/ui/Checkbox","tinymce/ui/PanelButton","tinymce/ui/ColorButton","tinymce/ui/ComboBox","tinymce/ui/Path","tinymce/ui/ElementPath","tinymce/ui/FormItem","tinymce/ui/Form","tinymce/ui/FieldSet","tinymce/ui/FilePicker","tinymce/ui/FitLayout","tinymce/ui/FlexLayout","tinymce/ui/FlowLayout","tinymce/ui/FormatControls","tinymce/ui/GridLayout","tinymce/ui/Iframe","tinymce/ui/Label","tinymce/ui/Toolbar","tinymce/ui/MenuBar","tinymce/ui/MenuButton","tinymce/ui/ListBox","tinymce/ui/MenuItem","tinymce/ui/Menu","tinymce/ui/Radio","tinymce/ui/ResizeH
andle","tinymce/ui/Spacer","tinymce/ui/SplitButton","tinymce/ui/StackLayout","tinymce/ui/TabPanel","tinymce/ui/TextBox","tinymce/ui/Throbber"]);
+})(this);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcetinymceminjs"></a>
<div class="addfile"><h4>Added: trunk/src/wp-includes/js/tinymce/tinymce.min.js (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/tinymce.min.js (rev 0)
+++ trunk/src/wp-includes/js/tinymce/tinymce.min.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+// 4.0.12 (2013-12-18)
+!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){for(var r=0;r<n.length;r++){for(var i=e,o=n[r],a=o.split(/[.\/]/),l=0;l<a.length-1;++l)i[a[l]]===t&&(i[a[l]]={}),i=i[a[l]];i[a[a.length-1]]=s[o]}}var s={},l="tinymce/dom/EventUtils",c="tinymce/dom/Sizzle",u="tinymce/dom/DomQuery",d="tinymc
e/html/Styles",f="tinymce/dom/TreeWalker",p="tinymce/util/Tools",h="tinymce/dom/Range",m="tinymce/html/Entities",g="tinymce/Env",v="tinymce/dom/DOMUtils",y="tinymce/dom/ScriptLoader",b="tinymce/AddOnManager",C="tinymce/html/Node",x="tinymce/html/Schema",w="tinymce/html/SaxParser",_="tinymce/html/DomParser",N="tinymce/html/Writer",E="tinymce/html/Serializer",k="tinymce/dom/Serializer",S="tinymce/dom/TridentSelection",T="tinymce/util/VK",R="tinymce/dom/ControlSelection",A="tinymce/dom/Selection",B="tinymce/dom/RangeUtils",L="tinymce/Formatter",D="tinymce/UndoManager",H="tinymce/EnterKey",M="tinymce/ForceBlocks",P="tinymce/EditorCommands",O="tinymce/util/URI",I="tinymce/util/Class",F="tinymce/ui/Selector",
z="tinymce/ui/Collection",W="tinymce/ui/DomUtils",V="tinymce/ui/Control",U="tinymce/ui/Factory",q="tinymce/ui/Container",$="tinymce/ui/DragHelper",j="tinymce/ui/Scrollable",K="tinymce/ui/Panel",Y="tinymce/ui/Movable",G="tinymce/ui/Resizable",X="tinymce/ui/FloatPanel",J="tinymce/ui/KeyboardNavigation",Q="tinymce/ui/Window",Z="tinymce/ui/MessageBox",et="tinymce/WindowManager",tt="tinymce/util/Quirks",nt="tinymce/util/Observable",rt="tinymce/Shortcuts",it="tinymce/Editor",ot="tinymce/util/I18n",at="tinymce/FocusManager",st="tinymce/EditorManager",lt="tinymce/LegacyInput",ct="tinymce/util/XHR",ut="tinymce/util/JSON",dt="tinymce/util/JSONRequest",ft="tinymce/util/JSONP",pt="tinymce/util/LocalStorage",ht="tin
ymce/Compat",mt="tinymce/ui/Layout",gt="tinymce/ui/AbsoluteLayout",vt="tinymce/ui/Tooltip",yt="tinymce/ui/Widget",bt="tinymce/ui/Button",Ct="tinymce/ui/ButtonGroup",xt="tinymce/ui/Checkbox",wt="tinymce/ui/PanelButton",_t="tinymce/ui/ColorButton",Nt="tinymce/ui/ComboBox",Et="tinymce/ui/Path",kt="tinymce/ui/ElementPath",St="tinymce/ui/FormItem",Tt="tinymce/ui/Form",Rt="tinymce/ui/FieldSet",At="tinymce/ui/FilePicker",Bt="tinymce/ui/FitLayout",Lt="tinymce/ui/FlexLayout",Dt="tinymce/ui/FlowLayout",Ht="tinymce/ui/FormatControls",Mt="tinymce/ui/GridLayout",Pt="tinymce/ui/Iframe",Ot="tinymce/ui/Label",It="tinymce/ui/Toolbar",Ft="tinymce/ui/MenuBar",zt="tinymce/ui/MenuButton",Wt="tinymce/ui/ListBox",Vt="tinymce/ui/Me
nuItem",Ut="tinymce/ui/Menu",qt="tinymce/ui/Radio",$t="tinymce/ui/ResizeHandle",jt="tinymce/ui/Spacer",Kt="tinymce/ui/SplitButton",Yt="tinymce/ui/StackLayout",Gt="tinymce/ui/TabPanel",Xt="tinymce/ui/TextBox",Jt="tinymce/ui/Throbber";r(l,[],function(){function e(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function t(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function n(e,t){function n(){return!1}function r(){return!0}var i,o=t||{},l;for(i in e)s[i]||(o[i]=e[i]);if(o.target||(o.target=o.srcElement||document),e&&a.test(e.type)&&e.pageX===l&&e.clientX!==l){var c=o.target.ownerDocument||document,u=c.documentElement,d=c.body;o.pageX=e.clientX+(u&&u.scrollLeft||d&&d.scrollLeft||0)-(u&&u.clientLeft||d&am
p;&d.clientLeft||0),o.pageY=e.clientY+(u&&u.scrollTop||d&&d.scrollTop||0)-(u&&u.clientTop||d&&d.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=r,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=r,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=r,o.stopPropagation()},o.isDefaultPrevented||(o.isDefaultPrevented=n,o.isPropagationStopped=n,o.isImmediatePropagationStopped=n),o}function r(n,r,i){function o(){i.domLoaded||(i.domLoaded=!0,r(c))}function a(){"complete"===l.readyState&&(t(l,"readystatechange",a),o())}function s(){try{l.documentElement.doScroll("left")}catch(e){return setTimeout(s,0),void 0}o()}var l=n.document,c={type:"ready"};return i.domLoaded?(r(c),void 0):(l.addEventListener?"complete"===l.readySta
te?o():e(n,"DOMContentLoaded",o):(e(l,"readystatechange",a),l.documentElement.doScroll&&n===n.top&&s()),e(n,"load",o),void 0)}function i(){function i(e,t){var n,r,i,o,a=s[t];if(n=a&&a[e.type])for(r=0,i=n.length;i>r;r++)if(o=n[r],o&&o.func.call(o.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var a=this,s={},l,c,u,d,f;c=o+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},l=1,a.domLoaded=!1,a.events=s,a.bind=function(t,o,p,h){function m(e){i(n(e||_.event),g)}var g,v,y,b,C,x,w,_=window;if(t&&3!==t.nodeType&&8!==t.nodeType){for(t[c]?g=t[c]:(g=l++,t[c]=g,s[g]={}),h=h||t,o=o.split(" "),y=o.length;y--;)b=o[y],x=m,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),a.domLoaded&&"ready&quo
t;===b&&"complete"==t.readyState?p.call(h,n({type:b})):(d||(C=f[b],C&&(x=function(e){var t,r;if(t=e.currentTarget,r=e.relatedTarget,r&&t.contains)r=t.contains(r);else for(;r&&r!==t;)r=r.parentNode;r||(e=n(e||_.event),e.type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,i(e,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(e){e=n(e||_.event),e.type="focus"===e.type?"focusin":"focusout",i(e,g)}),v=s[g][b],v?"ready"===b&&a.domLoaded?p({type:b}):v.push({func:p,scope:h}):(s[g][b]=v=[{func:p,scope:h}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?r(t,x,a):e(t,C||b,x,w)));return t=v=0,p}},a.unbind=function(e,n,r){var i,o,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return a;if(i=e[c]){if(f=s[i],n){for(n=n.split(" "),l=n.length;l--;)if(d
=n[l],o=f[d]){if(r)for(u=o.length;u--;)if(o[u].func===r){var p=o.nativeHandler;o=o.slice(0,u).concat(o.slice(u+1)),o.nativeHandler=p,f[d]=o}r&&0!==o.length||(delete f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture))}}else{for(d in f)o=f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture);f={}}for(d in f)return a;delete s[i];try{delete e[c]}catch(h){e[c]=null}}return a},a.fire=function(e,t,r){var o;if(!e||3===e.nodeType||8===e.nodeType)return a;r=n(null,r),r.type=t,r.target=e;do o=e[c],o&&i(r,o),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow;while(e&&!r.isPropagationStopped());return a},a.clean=function(e){var t,n,r=a.unbind;if(!e||3===e.nodeType||8===e.nodeType)return a;if(e[c]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),n=e.getElementsByTagName("*"),t=n.length;t--;)e=n[t],e[c]&&r(e);return a},a.destroy=function(){s={}},a.cancel=function(e){return e&&(e.preventDefault(),
e.stopImmediatePropagation()),!1}}var o="mce-data-",a=/^(?:mouse|contextmenu)|click/,s={keyLocation:1,layerX:1,layerY:1,returnValue:1};return i.Event=new i,i.Event.bind(window,"ready",function(){}),i}),r(c,[],function(){function e(e){return mt.test(e+"")}function n(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>_.cacheLength&&delete e[t.shift()],e[n]=r,r}}function r(e){return e[I]=!0,e}function i(e){var t=B.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t=null}}function o(e,t,n,r){var i,o,a,s,l,c,f,p,h,m;if((t?t.ownerDocument||t:F)!==B&&A(t),t=t||B,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(D&&!r){if(i=gt.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&O(t,o)&&o.id===a)return
n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&z.getElementsByClassName&&t.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(z.qsa&&!H.test(e)){if(f=!0,p=I,h=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=u(e),(f=t.getAttribute("id"))?p=f.replace(bt,"\\$&"):t.setAttribute("id",p),p="[id='"+p+"'] ",l=c.length;l--;)c[l]=p+d(c[l]);h=ht.test(e)&&t.parentNode||t,m=c.join(",")}if(m)try{return Z.apply(n,h.querySelectorAll(m)),n}catch(g){}finally{f||t.removeAttribute("id")}}}return b(e.replace(lt,"$1"),t,n,r)}function a(e,t){var n=t&&e,r=n&&(~t.sourceIndex||G)-(~e.sourceIndex||G);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type==
=e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e,t){var n,r,i,a,s,l,c,u=q[e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=_.preFilter;s;){(!n||(r=ct.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=ut.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(lt," ")}),s=s.slice(n.length));for(a in _.filter)!(r=pt[a].exec(s))||c[a]&&!(r=c[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?o.error(e):q(e,l).slice(0)}function d(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function f(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=V++;return t.first?function(t,n,o){fo
r(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c,u=W+" "+o;if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i)if(c=t[I]||(t[I]={}),(l=c[r])&&l[0]===u){if((s=l[1])===!0||s===w)return s===!0}else if(l=c[r]=[u],l[1]=e(t,n,a)||w,l[1]===!0)return!0}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function h(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),c&&t.push(s));return a}function m(e,t,n,i,o,a){return i&&!i[I]&&(i=m(i)),o&&!o[I]&&(o=m(o,a)),r(function(r,a,s,l){var c,u,d,f=[],p=[],m=a.length,g=r||y(t||"*",s.nodeType?[s]:s,[]),v=!e||!r&&t?g:h(g,f,e,s,l),b=n?o||(r?e:m||i)?[]:a:v;if(n&&n(v,b,s,l),i)for(c=h(b,p),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[p[u]]=!(v[p[u]]=d));if(r){if(o|
|e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(v[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?tt.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=h(b===a?b.splice(m,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function g(e){for(var t,n,r,i=e.length,o=_.relative[e[0].type],a=o||_.relative[" "],s=o?1:0,l=f(function(e){return e===t},a,!0),c=f(function(e){return tt.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==S)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=_.relative[e[s].type])u=[f(p(u),n)];else{if(n=_.filter[e[s].type].apply(null,e[s].matches),n[I]){for(r=++s;i>r&&!_.relative[e[r].type];r++);return m(s>1&&p(u),s>1&&d(e.slice(0,s-1)).replace(lt,"$1"),n,r>s&&g(e.slice(s,r)),i>r&&g(e=e.slice(r)),i>r&&d(e))}u.push(n)}return p(u)}function v(e,t){var n=0,i=t.length>0,a=e.length>0,s=function(r,s,l,c,u){var d,f,p,m=[],g=0,v="0
",y=r&&[],b=null!=u,C=S,x=r||a&&_.find.TAG("*",u&&s.parentNode||s),N=W+=null==C?1:Math.random()||.1;for(b&&(S=s!==B&&s,w=n);null!=(d=x[v]);v++){if(a&&d){for(f=0;p=e[f++];)if(p(d,s,l)){c.push(d);break}b&&(W=N,w=++n)}i&&((d=!p&&d)&&g--,r&&y.push(d))}if(g+=v,i&&v!==g){for(f=0;p=t[f++];)p(y,m,s,l);if(r){if(g>0)for(;v--;)y[v]||m[v]||(m[v]=J.call(c));m=h(m)}Z.apply(c,m),b&&!r&&m.length>0&&g+t.length>1&&o.uniqueSort(c)}return b&&(W=N,S=C),y};return i?r(s):s}function y(e,t,n){for(var r=0,i=t.length;i>r;r++)o(e,t[r],n);return n}function b(e,t,n,r){var i,o,a,s,l,c=u(e);if(!r&&1===c.length){if(o=c[0]=c[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&9===t.nodeType&&D&&_.relative[o[1].type]){if(t=(_.find.ID(a.matches[0].replace(xt,wt),t)||[])[0],!t)return n;e=e.slice(o.shift().value.l
ength)}for(i=pt.needsContext.test(e)?0:o.length;i--&&(a=o[i],!_.relative[s=a.type]);)if((l=_.find[s])&&(r=l(a.matches[0].replace(xt,wt),ht.test(o[0].type)&&t.parentNode||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return Z.apply(n,r),n;break}}return k(e,c)(r,t,!D,n,ht.test(e)),n}function C(){}var x,w,_,N,E,k,S,T,R,A,B,L,D,H,M,P,O,I="sizzle"+-new Date,F=window.document,z={},W=0,V=0,U=n(),q=n(),$=n(),j=!1,K=function(){return 0},Y=typeof t,G=1<<31,X=[],J=X.pop,Q=X.push,Z=X.push,et=X.slice,tt=X.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},nt="[\\x20\\t\\r\\n\\f]",rt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",it=rt.replace("w","w#"),ot="([*^$|!~]?=)",at="\\["+nt+"*("+rt+")"+nt+"*(?:"+ot+nt+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+it+")|)|)"+nt+"*\\]",st=":("+rt+")(?:\
\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+at.replace(3,8)+")*)|.*)\\)|)",lt=new RegExp("^"+nt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+nt+"+$","g"),ct=new RegExp("^"+nt+"*,"+nt+"*"),ut=new RegExp("^"+nt+"*([\\x20\\t\\r\\n\\f>+~])"+nt+"*"),dt=new RegExp(st),ft=new RegExp("^"+it+"$"),pt={ID:new RegExp("^#("+rt+")"),CLASS:new RegExp("^\\.("+rt+")"),NAME:new RegExp("^\\[name=['\"]?("+rt+")['\"]?\\]"),TAG:new RegExp("^("+rt.replace("w","w*")+")"),ATTR:new RegExp("^"+at),PSEUDO:new RegExp("^"+st),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+nt+"*(even|odd|(([+-]|)(\\d*)n|)"+nt+"*(?:([+-]|)"+nt+"*(\\d+)|))"+nt+"*\\)|)","i"),ne
edsContext:new RegExp("^"+nt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+nt+"*((?:-\\d)?\\d*)"+nt+"*\\)|)(?=[^-]|$)","i")},ht=/[\x20\t\r\n\f]*[+~]/,mt=/^[^{]+\{\s*\[native code/,gt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,vt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,bt=/'|\\/g,Ct=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,xt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,wt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)};try{Z.apply(X=et.call(F.childNodes),F.childNodes),X[F.childNodes.length].nodeType}catch(_t){Z={apply:X.length?function(e,t){Q.apply(e,et.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}E=o.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},A=o.setDocument=function(n){var r=n?n.ownerDocument||n:F;return r!==
B&&9===r.nodeType&&r.documentElement?(B=r,L=r.documentElement,D=!E(r),z.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),z.attributes=i(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),z.getElementsByClassName=i(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),z.getByName=i(function(e){e.id=I+0,e.appendChild(B.createElement("a")).setAttribute("name",I),e.appendChild(B.createElement("i")).setAttribute("name",I),L.appendChild(e);var t=r.getElementsByName&&
r.getElementsByName(I).length===2+r.getElementsByName(I+0).length;return L.removeChild(e),t}),z.sortDetached=i(function(e){return e.compareDocumentPosition&&1&e.compareDocumentPosition(B.createElement("div"))}),_.attrHandle=i(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==Y&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},z.getByName?(_.find.ID=function(e,t){if(typeof t.getElementById!==Y&&D){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},_.filter.ID=function(e){var t=e.replace(xt,wt);return function(e){return e.getAttribute("id")===t}}):(_.find.ID=function(e,n){if(typeof n.getElementById!==Y&&D){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==Y&&r.getAttributeN
ode("id").value===e?[r]:t:[]}},_.filter.ID=function(e){var t=e.replace(xt,wt);return function(e){var n=typeof e.getAttributeNode!==Y&&e.getAttributeNode("id");return n&&n.value===t}}),_.find.TAG=z.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==Y?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},_.find.NAME=z.getByName&&function(e,t){return typeof t.getElementsByName!==Y?t.getElementsByName(name):void 0},_.find.CLASS=z.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==Y&&D?t.getElementsByClassName(e):void 0},M=[],H=[":focus"],(z.qsa=e(r.querySelectorAll))&&(i(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||H.push(&q
uot;\\["+nt+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||H.push(":checked")}),i(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&H.push("[*^$]="+nt+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||H.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),H.push(",.*:")})),(z.matchesSelector=e(P=L.matchesSelector||L.mozMatchesSelector||L.webkitMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){z.disconnectedMatch=P.call(e,"div"),P.call(e,"[s!='']:x"),M.push("!=",st)}),H=new RegExp(H.join("|")),M=M.length&&new RegExp(M.join("|")),O=e(L.contains)||L.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.paren
tNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},K=L.compareDocumentPosition?function(e,t){if(e===t)return j=!0,0;var n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return n?1&n||T&&t.compareDocumentPosition(e)===n?e===r||O(F,e)?-1:t===r||O(F,t)?1:R?tt.call(R,e)-tt.call(R,t):0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(e===t)return j=!0,0;if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===F?-1:c[i]===F?1:0},B):B},o.matches=function(e,t){return o(e,null,null,t)},o.matchesSelector=function(e,t){if((e.ownerDocument||e)!==B&&A(e),t=t.replace(Ct,&
quot;='$1']"),z.matchesSelector&&D&&(!M||!M.test(t))&&!H.test(t))try{var n=P.call(e,t);if(n||z.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return o(t,B,null,[e]).length>0},o.contains=function(e,t){return(e.ownerDocument||e)!==B&&A(e),O(e,t)},o.attr=function(e,t){var n;return(e.ownerDocument||e)!==B&&A(e),D&&(t=t.toLowerCase()),(n=_.attrHandle[t])?n(e):!D||z.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},o.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},o.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!z.detectDuplicates,T=!z.sortDetached,R=!z.sortStable&&e.slice(0),e.sort(K),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return e},N=o.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if(
"string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=N(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=N(t);return n},_=o.selectors={cacheLength:50,createPseudo:r,match:pt,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xt,wt),e[3]=(e[4]||e[5]||"").replace(xt,wt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||o.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&o.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return pt.CHILD.test(e[0])?null:(e[4]?
e[2]=e[4]:n&&dt.test(n)&&(t=u(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(xt,wt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=U[e+" "];return t||(t=new RegExp("(^|"+nt+")"+e+"("+nt+"|$)"))&&U(e,function(e){return t.test(e.className||typeof e.getAttribute!==Y&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=o.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)
>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,p,h,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(u=g[I]||(g[I]={}),c=u[e]||[],p=c[0]===W&&c[1],f=c[0]===W&&c[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(f=p=0)||h.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[W,p,f];break}}else if(y&&(c=(t[I]||(t[I]={}))[e])&&c[0]===W)f=c[1];else for(;(d=++p&&d&&d[m]||(f=p=0
)||h.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[I]||(d[I]={}))[e]=[W,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(e,t){var n,i=_.pseudos[e]||_.setFilters[e.toLowerCase()]||o.error("unsupported pseudo: "+e);return i[I]?i(t):i.length>1?(n=[e,e,"",t],_.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)r=tt.call(e,o[a]),e[r]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(lt,"$1"));return i[I]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(e){return function(t){return o(e,t).length>0}}),contains:r(function(e){return function(t){return(t.textContent||t.innerText||N(t)).indexOf(e)>-1}}),lang:r(function(e){return ft.test(e||"")||o.error("u
nsupported lang: "+e),e=e.replace(xt,wt).toLowerCase(),function(t){var n;do if(n=D?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===L},focus:function(e){return e===B.activeElement&&(!B.hasFocus||B.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeTy
pe)return!1;return!0},parent:function(e){return!_.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return vt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}};for(x in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})_.pseudos[x]=s(x);for(x in{submit:!0,reset:!0})_.pse
udos[x]=l(x);return k=o.compile=function(e,t){var n,r=[],i=[],o=$[e+" "];if(!o){for(t||(t=u(e)),n=t.length;n--;)o=g(t[n]),o[I]?r.push(o):i.push(o);o=$(e,v(i,r))}return o},_.pseudos.nth=_.pseudos.eq,C.prototype=_.filters=_.pseudos,_.setFilters=new C,z.sortStable=I.split("").sort(K).join("")===I,A(),[0,0].sort(K),z.detectDuplicates=j,o}),r(u,[l,c],function(e,n){function r(e){return"undefined"!=typeof e}function i(e){return"string"==typeof e}function o(e){var t,n,r;for(r=g.createElement("div"),t=g.createDocumentFragment(),r.innerHTML=e;n=r.firstChild;)t.appendChild(n);return t}function a(e,t,n){var r;if("string"==typeof t)t=o(t);else if(t.length){for(r=0;r<t.length;r++)a(e,t[r],n);return e}for(r=e.length;r--;)n.call(e[r],t.parentNode?t:t);return e}function s(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")}function l(e,t){var n;for(e=e||[],&quo
t;string"==typeof e&&(e=e.split(" ")),t=t||{},n=e.length;n--;)t[e[n]]={};return t}function c(e,t){return new c.fn.init(e,t)}function u(e){var t=arguments,n,r,i;for(r=1;r<t.length;r++){n=t[r];for(i in n)e[i]=n[i]}return e}function d(e){var t=[],n,r;for(n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function f(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1}function p(e,t){var n,r,i,o,a;if(e)if(n=e.length,n===o){for(r in e)if(e.hasOwnProperty(r)&&(a=e[r],t.call(a,a,r)===!1))break}else for(i=0;n>i&&(a=e[i],t.call(a,a,r)!==!1);i++);return e}function h(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!c(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i}function m(e,t,n,r){for(var i=[];e;e=e[n])r&&e.nodeType!==r||e===t||i.push(e);return i}var g=document,v=Array.prototype.push,y=Array.prototype.slice,b=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\
w\-]*)$)/,C=e.Event,x=l("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"),w=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},_=/^\s*|\s*$/g,N=function(e){return null===e||e===t?"":(""+e).replace(_,"")};return c.fn=c.prototype={constructor:c,selector:"",length:0,init:function(e,t){var n=this,r,a;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(i(e)){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:b.exec(e),!r)return c(t||document).find(e);if(r[1])for(a=o(e).firstChild;a;)this.add(a),a=a.nextSibling;else{if(a=g.getElementById(r[2]),a.id!==r[2])return n.find(e);n.length=1,n[0]=a}}else this.add(e);return n},toArray:function(){return d(this)},add:function(e){var t=this;return w(e)?v.apply(t,e):e instanceof c?t.add(e.toArray()):v.call(t,e),t},attr:function(e,n){var i=this;if(&q
uot;object"==typeof e)p(e,function(e,t){i.attr(t,e)});else{if(!r(n))return i[0]&&1===i[0].nodeType?i[0].getAttribute(e):t;this.each(function(){1===this.nodeType&&this.setAttribute(e,n)})}return i},css:function(e,n){var i=this;if("object"==typeof e)p(e,function(e,t){i.css(t,e)});else{if(e=e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),!r(n))return i[0]?i[0].style[e]:t;"number"!=typeof n||x[e]||(n+="px"),i.each(function(){var t=this.style;"opacity"===e&&this.runtimeStyle&&"undefined"==typeof this.runtimeStyle.opacity&&(t.filter=""===n?"":"alpha(opacity="+100*n+")");try{t[e]=n}catch(r){}})}return i},remove:function(){for(var e=this,t,n=this.length;n--;)t=e[n],C.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var e=this,t,n=this.length;n--;)for(t=e[n];t.firstChild;)t.removeChild(t.firstChild);return
this},html:function(e){var t=this,n;if(r(e)){for(n=t.length;n--;)t[n].innerHTML=e;return t}return t[0]?t[0].innerHTML:""},text:function(e){var t=this,n;if(r(e)){for(n=t.length;n--;)t[n].innerText=t[0].textContent=e;return t}return t[0]?t[0].innerText||t[0].textContent:""},append:function(){return a(this,arguments,function(e){1===this.nodeType&&this.appendChild(e)})},prepend:function(){return a(this,arguments,function(e){1===this.nodeType&&this.insertBefore(e,this.firstChild)})},before:function(){var e=this;return e[0]&&e[0].parentNode?a(e,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)}):e},after:function(){var e=this;return e[0]&&e[0].parentNode?a(e,arguments,function(e){this.parentNode.insertBefore(e,this)}):e},appendTo:function(e){return c(e).append(this),this},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;re
turn-1!==e.indexOf(" ")?p(e.split(" "),function(){n.toggleClass(this,t)}):n.each(function(){var n=this,r;s(n,e)!==t&&(r=n.className,t?n.className+=r?" "+e:e:n.className=N((" "+r+" ").replace(" "+e+" "," ")))}),n},hasClass:function(e){return s(this[0],e)},each:function(e){return p(this,e)},on:function(e,t){return this.each(function(){C.bind(this,e,t)})},off:function(e,t){return this.each(function(){C.unbind(this,e,t)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new c(y.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},replaceWith:function(e){var t=this;return t[0]&&t[0].parentNode.replaceChild(c(e)[0],t[0]),t},wrap:function(e){return e=c(e)[0],this.each(function(){v
ar t=this,n=e.cloneNode(!1);t.parentNode.insertBefore(n,t),n.appendChild(t)})},unwrap:function(){return this.each(function(){for(var e=this,t=e.firstChild,n;t;)n=t,t=t.nextSibling,e.parentNode.insertBefore(n,e)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),c(e)},find:function(e){var t,n,r=[];for(t=0,n=this.length;n>t;t++)c.find(e,this[t],r);return c(r)},push:v,sort:[].sort,splice:[].splice},u(c,{extend:u,toArray:d,inArray:f,isArray:w,each:p,trim:N,makeMap:l,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,isXMLDoc:n.isXML,contains:n.contains,filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?c.find.matchesSelector(t[0],e)?[t[0]]:[]:c.find.matches(e,t)}}),p({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t){return h(e,"parentNode",t)},next:function(e){return m(e,"ne
xtSibling",1)},prev:function(e){return m(e,"previousSibling",1)},nextNodes:function(e){return m(e,"nextSibling")},prevNodes:function(e){return m(e,"previousSibling")},children:function(e){return m(e.firstChild,"nextSibling",1)},contents:function(e){return d(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){c.fn[e]=function(n){var r=this,i;if(r.length>1)throw new Error("DomQuery only supports traverse functions on a single node.");return r[0]&&(i=t(r[0],n)),i=c(i),n&&"parentsUntil"!==e?i.filter(n):i}}),c.fn.filter=function(e){return c.filter(e)},c.fn.is=function(e){return!!e&&this.filter(e).length>0},c.fn.init.prototype=c.fn,c}),r(d,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\
s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d="\ufeff";
+for(e=e||{},u=("\\\" \\' \\; \\: ; : "+d).split(" "),l=0;l<u.length;l++)c[u[l]]=d+l,c[d+l]=u[l];return{toHex:function(e){return e.replace(r,n)},parse:function(t){function s(e,t,n){var r,i,o,a;if(r=m[e+"-top"+t],r&&(i=m[e+"-right"+t],i&&(o=m[e+"-bottom"+t],o&&(a=m[e+"-left"+t])))){var s=[r,i,o,a];for(l=s.length-1;l--&&s[l]===s[l+1];);l>-1&&n||(m[e+t]=-1==l?s[0]:s.join(" "),delete m[e+"-top"+t],delete m[e+"-right"+t],delete m[e+"-bottom"+t],delete m[e+"-left"+t])}}function u(e){var t=m[e],n;if(t){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return m[e]=t[0],!0}}function d(e,t,n,r){u(t)&&u(n)&&u(r)&&(m[e]=m[t]+" "+m[n]+" "+m[r],delete m[t],delete m[n],delete m[r])}function f(e){return b=!0,c[e]}function p(e,t){return b&&(e=e.replace(/\uFEFF[0-9]/g,funct
ion(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function h(t,n,r,i,o,a){return(o=o||a)?(o=p(o),"'"+o.replace(/\'/g,"\\'")+"'"):(n=p(n||r||i),!e.allow_script_urls&&/(java|vb)script:/i.test(n.replace(/[\s\r\n]+/,""))?"":(C&&(n=C.call(x,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"))}var m={},g,v,y,b,C=e.url_converter,x=e.url_converter_scope||this;if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,f)});g=o.exec(t);){if(v=g[1].replace(a,"").toLowerCase(),y=g[2].replace(a,""),v&&y.length>0){if(!e.allow_script_urls&&("behavior"==v||/expression\s*\(/.test(y)))continue;"font-weight"===v&&"700"===y?y="bold":("color"===v||"backgro
und-color"===v)&&(y=y.toLowerCase()),y=y.replace(r,n),y=y.replace(i,h),m[v]=b?p(y,!0):y}o.lastIndex=g.index+g[0].length}s("border","",!0),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border,"none"===m["border-image"]&&delete m["border-image"]}return m},serialize:function(e,n){function r(n){var r,o,a,l;if(r=t.styles[n])for(o=0,a=r.length;a>o;o++)n=r[o],l=e[n],l!==s&&l.length>0&&(i+=(i.length>0?" ":"")+n+": "+l+";")}var i="",o,a;if(n&&t&&t.styles)r("*"),r(n);else for(o in e)a=e[o],a!==s&&a.length>0&&(i+=
(i.length>0?" ":"")+o+": "+a+";");return i}}}}),r(f,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}var r=e;this.current=function(){return r},this.next=function(e){return r=n(r,"firstChild","nextSibling",e)},this.prev=function(e){return r=n(r,"lastChild","previousSibling",e)}}}),r(p,[],function(){function e(e,n){return n?"array"==n&&g(e)?!0:typeof e==n:e!==t}function n(e){var t=[],n,r;for(n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function r(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function i(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.has
OwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function o(e,t){var n=[];return i(e,function(e){n.push(t(e))}),n}function a(e,t){var n=[];return i(e,function(e){(!t||t(e))&&n.push(e)}),n}function s(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,this.onCreate&&this.onCreate(e[2],e[3],o[a]),void 0;t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],o[a]=c?function(){return i[s].apply(this,arguments)}:function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static&q
uot;],function(e,t){o[a][t]=e})}}function l(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function c(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function u(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),i(e,function(e,i){return t.call(r,e,i,n)===!1?!1:(u(e,t,n,r),void 0)}))}function d(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)r=e[n],t[r]||(t[r]={}),t=t[r];return t}function f(e,t){var n,r;for(t=t||window,e=e.split("."),n=0,r=e.length;r>n&&(t=t[e[n]],t);n++);return t}function p(t,n){return!t||e(t,"array")?t:o(t.split(n||","),m)}var h=/^\s*|\s*$/g,m=function(e){return null===e||e===t?"":(""+e).replace(h,"")},g=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{trim:m,isArray:g,is:e,toArray:n,
makeMap:r,each:i,map:o,grep:a,inArray:l,extend:c,create:s,walk:u,createNS:d,resolve:f,explode:p}}),r(h,[p],function(e){function t(n){function r(){return M.createDocumentFragment()}function i(e,t){_(F,e,t)}function o(e,t){_(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(H[U]=H[V],H[q]=H[W]):(H[V]=H[U],H[W]=H[q]),H.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function p(e,t){var n=H[V],r=H[W],i=H[U],o=H[q],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function h(){N(I)}function m(){return N(P)}function g(){return N(O)}function v(e){var t=this[V],r=this[W],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.node
Type?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=H.extractContents();H.insertNode(e),e.appendChild(t),H.selectNode(e)}function b(){return $(new t(n),{startContainer:H[V],startOffset:H[W],endContainer:H[U],endOffset:H[q],collapsed:H.collapsed,commonAncestorContainer:H.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return H[V]==H[U]&&H[W]==H[q]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAnc
estor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function _(e,t,r){var i,o;for(e?(H[V]=t,H[W]=r):(H[U]=t,H[q]=r),i=H[U];i.parentNode;)i=i.parentNode;for(o=H[V];o.parentNode;)o=o.parentNode;o==i?w(H[V],H[W],H[U],H[q])>0&&H.collapse(e):H.collapse(e),H.collapsed=x(),H.commonAncestorContainer=n.findCommonAncestor(H[V],H[U])}function N(e){var t,n=0,r=0,i,o,a,s,l,c;if(H[V]==H[U])return E(e);for(t=H[U],i=t.parentNode;i;t=i,i=i.parentNode){if(i==H[V])return k(t,e);++n}for(t=H[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==H[U])return S(t,e);++r}for(o=r-n,a=H[V];o>0;)a=a.parentNode,o--;for(s=H[U];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function E(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),H[W]==H[q])return t;if(3==H[V].nodeType
){if(n=H[V].nodeValue,i=n.substring(H[W],H[q]),e!=O&&(o=H[V],c=H[W],u=H[q]-H[W],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),H.collapse(F)),e==I)return;return i.length>0&&t.appendChild(M.createTextNode(i)),t}for(o=C(H[V],H[W]),a=H[q]-H[W];o&&a>0;)s=o.nextSibling,l=L(o,e),t&&t.appendChild(l),--a,o=s;return e!=O&&H.collapse(F),t}function k(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-H[W],0>=a)return t!=O&&(H.setEndBefore(e),H.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=L(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=O&&(H.setEndBefore(e),H.collapse(z)),n}function S(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=H[q]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=L(o,t),n&&n.appendChild(l),--a,o=s;return t!=O&&(H.s
etStartAfter(e),H.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u,d;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=e.parentNode,s=j(e),l=j(t),++s,c=l-s,u=e.nextSibling;c>0;)d=u.nextSibling,i=L(u,n),o&&o.appendChild(i),u=d,--c;return i=R(t,n),o&&o.appendChild(i),n!=O&&(H.setStartAfter(e),H.collapse(F)),o}function R(e,t){var n=C(H[U],H[q]-1),r,i,o,a,s,l=n!=H[U];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(H[V],H[W]),r=n!=H[V],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)r
eturn L(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=H[W],a=o.substring(l),s=o.substring(0,l)):(l=H[q],a=o.substring(0,l),s=o.substring(l)),i!=O&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function L(e,t){return t!=I?t==O?n.clone(e,F):e:(e.parentNode.removeChild(e),void 0)}function D(){return n.create("body",null,g()).outerText}var H=this,M=n.doc,P=0,O=1,I=2,F=!0,z=!1,W="startOffset",V="startContainer",U="endContainer",q="endOffset",$=e.extend,j=n.nodeIndex;return $(H,{startContainer:M,startOffset:0,endContainer:M,endOffset:0,collapsed:F,commonAncestorContainer:M,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:p,deleteContents:h,extractContents:m,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:
D}),H}return t.prototype.toString=function(){return this.toStringIE()},t}),r(m,[p],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),o[r]||(i="&"+e[n+1]+";",a[r]=i,a[i]=r);return a}}var r=e.makeMap,i,o,a,s=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&(#x|#)?([\w]+);/g,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2
019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,
Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,he
llip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){retu
rn o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n,r){return n?(r=parseInt(r,2===n.length?16:10),r>65535?(r-=65536,String.fromCharCode(55296+(r>>10),56320+(1023&r))):d[r]||String.fromCharCode(r)):a[e]||i[e]||t
(e)})}};return f}),r(g,[],function(){var e=navigator,t=e.userAgent,n,r,i,o,a,s,l;n=window.opera&&window.opera.buildNumber,r=/WebKit/.test(t),i=!r&&!n&&/MSIE/gi.test(t)&&/Explorer/gi.test(e.appName),i=i&&/MSIE (\w+)\./.exec(t)[1],o=-1==t.indexOf("Trident/")||-1==t.indexOf("rv:")&&-1==e.appName.indexOf("Netscape")?!1:11,i=i||o,a=!r&&!o&&/Gecko/.test(t),s=-1!=t.indexOf("Mac"),l=/(iPad|iPhone)/.test(t);var c=!l||t.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:n,webkit:r,ie:i,gecko:a,mac:s,iOS:l,contentEditable:c,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=i,range:window.getSelection&&"Range"in window,documentMode:i?document.documentMode||7:10}}),r(v,[c,d,l,f,h,m,g,p],function(e,n,r,i,o,a,s,l){function c(e,t){var i=this,o;i.doc=e,i.win=window,i.files={},i.counter=0,i.stdMode=!g||e.docume
ntMode>=8,i.boxModel=!g||"CSS1Compat"==e.compatMode||i.stdMode,i.hasOuterHTML="outerHTML"in e.createElement("a"),this.boundEvents=[],i.settings=t=h({keep_values:!1,hex_colors:1},t),i.schema=t.schema,i.styles=new n({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),i.fixDoc(e),i.events=t.ownEvents?new r(t.proxy):r.Event,o=t.schema?t.schema.getBlockElements():{},i.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!o[e.nodeName]):!!o[e]}}var u=l.each,d=l.is,f=l.grep,p=l.trim,h=l.extend,m=s.webkit,g=s.ie,v=/^([a-z0-9],?)+$/i,y=/^[ \t\r\n]*$/,b=l.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," ");return c.prototype={root:null,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly&
quot;,selected:"selected",value:"value",id:"id",name:"name",type:"type"},fixDoc:function(e){var t=this.settings,n;if(g&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!g||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),u(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.get(e.settings.root_element)||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:funct
ion(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),d(n,"string")&&(a=n,n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e)
,e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.get(r.settings.root_element)||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(v.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}return n.nodeType&&1!=n.nodeType?!1:e.matches(r,n.nodeType?[n]:n).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=d(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProp
erty(i)&&null!==t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"</"+e+">":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return this.run(e,function(e){var n,r=e.parentNode;if(!r)return null;if(t)for(;n=e.firstChild;)!g||3!==n.nodeType||n.nodeValue?r.insertBefore(n,e):e.removeChild(n);return r.removeChild(e)})},setStyle:function(e,t,n){return this.run(e,function(e){var r=this,i,o;if(t)if("string"==typeof t){i=e.style,t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"number"!=typeof n||b[t]||(n+="px"),"opacity"===t&&e.runtimeStyle&&"undefined"==typeof e.runtimeStyle.opacity&&(i.filter=""===n?"
;":"alpha(opacity="+100*n+")"),"float"==t&&(t="cssFloat"in e.style?"cssFloat":"styleFloat");try{i[t]=n}catch(a){}r.settings.update_styles&&e.removeAttribute("data-mce-style")}else for(o in t)r.setStyle(e,o,t[o])})},getStyle:function(e,n,r){if(e=this.get(e)){if(this.doc.defaultView&&r){n=n.replace(/[A-Z]/g,function(e){return"-"+e});try{return this.doc.defaultView.getComputedStyle(e,null).getPropertyValue(n)}catch(i){return null}}return n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=g?"styleFloat":"cssFloat"),e.currentStyle&&r?e.currentStyle[n]:e.style?e.style[n]:t}},setStyles:function(e,t){this.setStyle(e,t)},css:function(e,t,n){this.setStyle(e,t,n)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:f
unction(e,t,n){var r=this;if(e&&t)return this.run(e,function(e){var i=r.settings,o=e.getAttribute(t);if(null!==n)switch(t){case"style":if(!d(n,"string"))return u(n,function(t,n){r.setStyle(e,n,t)}),void 0;i.keep_values&&(n?e.setAttribute("data-mce-style",n,2):e.removeAttribute("data-mce-style",2)),e.style.cssText=n;break;case"class":e.className=n||"";break;case"src":case"href":i.keep_values&&(i.url_converter&&(n=i.url_converter.call(i.url_converter_scope||r,n,t,e)),r.setAttrib(e,"data-mce-"+t,n,2));break;case"shape":e.setAttribute("data-mce-style",n)}d(n)&&null!==n&&0!==n.length?e.setAttribute(t,""+n,2):e.removeAttribute(t,2),o!=n&&i.onSetAttrib&&i.onSetAttrib({attrElm:e,attrName:t,attrValue:n})})},setAttribs:function(e,t){var n=this;return this.run(e,function(e){u(t,function(t,r){n.setAttrib(e,r,t)})}
)},getAttrib:function(e,t,n){var r,i=this,o;if(e=i.get(e),!e||1!==e.nodeType)return n===o?!1:n;if(d(n)||(n=""),/^(src|href|style|coords|shape)$/.test(t)&&(r=e.getAttribute("data-mce-"+t)))return r;if(g&&i.props[t]&&(r=e[i.props[t]],r=r&&r.nodeValue?r.nodeValue:r),r||(r=e.getAttribute(t,2)),/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(t))return e[i.props[t]]===!0&&""===r?t:r?t:"";if("FORM"===e.nodeName&&e.getAttributeNode(t))return e.getAttributeNode(t).nodeValue;if("style"===t&&(r=r||e.style.cssText,r&&(r=i.serializeStyle(i.parseStyle(r),e.nodeName),i.settings.keep_values&&e.setAttribute("data-mce-style",r))),m&&"class"===t&&r&&(r=r.replace(/(apple|webkit)\-[a-z\-]+/gi,"")),g)switch(t){case"rowspan":case"colspan":1===r&am
p;&(r="");break;case"size":("+0"===r||20===r||0===r)&&(r="");break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":0===r&&(r="");break;case"hspace":-1===r&&(r="");break;case"maxlength":case"tabindex":(32768===r||2147483647===r||"32768"===r)&&(r="");break;case"multiple":case"compact":case"noshade":case"nowrap":return 65535===r?t:n;case"shape":r=r.toLowerCase();break;default:0===t.indexOf("on")&&r&&(r=(""+r).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1"))}return r!==o&&null!==r&&""!==r?""+r:n},getPos:function(e,t){var n=this,r=0,i=0,o,a=n.doc,s;if(e=n.get(e),t=t||a.body,e){if(t===a.body&&e.getBoundingClie
ntRect)return s=e.getBoundingClientRect(),t=n.boxModel?a.documentElement:a.body,r=s.left+(a.documentElement.scrollLeft||a.body.scrollLeft)-t.clientTop,i=s.top+(a.documentElement.scrollTop||a.body.scrollTop)-t.clientLeft,{x:r,y:i};for(o=e;o&&o!=t&&o.nodeType;)r+=o.offsetLeft||0,i+=o.offsetTop||0,o=o.offsetParent;for(o=e.parentNode;o&&o!=t&&o.nodeType;)r-=o.scrollLeft||0,i-=o.scrollTop||0,o=o.parentNode}return{x:r,y:i}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==c.DOM&&n===document){var o=c.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,c.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet
?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==c.DOM&&n===document?(c.DOM.loadCSS(e),void 0):(e||(e=""),r=n.getElementsByTagName("head")[0],u(e.split(","),function(e){var i;t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),g&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}),void 0)},addClass:function(e,t){return this.run(e,function(e){var n;return t?this.hasClass(e,t)?e.className:(n=this.removeClass(e,t),e.className=n=(""!==n?n+" ":"")+t,n):0})},removeClass:function(e,t){var n=this,r;return n.run(e,function(e){var i;return n.hasClass(e,t)?(r||(r=new RegExp("(^|\\s+)"+t+"(\\s+|$)","g")),i=e.className.replace(r," "),i=p(" "!=i?i:""),e.className=i,i||(e.removeAttribute
("class"),e.removeAttribute("className")),i):e.className})},hasClass:function(e,t){return e=this.get(e),e&&t?-1!==(" "+e.className+" ").indexOf(" "+t+" "):!1},toggleClass:function(e,n,r){r=r===t?!this.hasClass(e,n):r,this.hasClass(e,n)!==r&&(r?this.addClass(e,n):this.removeClass(e,n))},show:function(e){return this.setStyle(e,"display","block")},hide:function(e){return this.setStyle(e,"display","none")},isHidden:function(e){return e=this.get(e),!e||"none"==e.style.display||"none"==this.getStyle(e,"display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){var n=this;return n.run(e,function(e){if(g){for(;e.firstChild;)e.removeChild(e.firstChild);try{e.innerHTML="<br />"+t,e.removeChild(e.firstChild)}catch(r){var i=n.create("div");i.innerHTML="<br />"+t,u(f(i.ch
ildNodes),function(t,n){n&&e.canHaveHTML&&e.appendChild(t)})}}else e.innerHTML=t;return t})},getOuterHTML:function(e){var t,n=this;return(e=n.get(e))?1===e.nodeType&&n.hasOuterHTML?e.outerHTML:(t=(e.ownerDocument||n.doc).createElement("body"),t.appendChild(e.cloneNode(!0)),t.innerHTML):null},setOuterHTML:function(e,t,n){var r=this;return r.run(e,function(e){function i(){var i,o;for(o=n.createElement("body"),o.innerHTML=t,i=o.lastChild;i;)r.insertAfter(i.cloneNode(!0),e),i=i.previousSibling;r.remove(e)}if(1==e.nodeType)if(n=n||e.ownerDocument||r.doc,g)try{1==e.nodeType&&r.hasOuterHTML?e.outerHTML=t:i()}catch(o){i()}else i()})},decode:a.decode,encode:a.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return d(t,"array")&&(e=e.cloneNo
de(!0)),n&&u(f(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),u(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(l.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],u(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(g){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.ge
tAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,o,a,s,l,c=0;if(e=e.firstChild){s=new i(e,e.parentNode),t=t||n.schema?n.schema.getNonEmptyElements():null;do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(o=n.getAttribs(e),r=e.attributes.length;r--;)if(l=e.attributes[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!y.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new o(this)},nodeIndex:function(e,t){var n=0
,r,i,o;if(e)for(r=e.nodeType,e=e.previousSibling,i=e;e;e=e.previousSibling)o=e.nodeType,(!t||3!=o||o!=r&&e.nodeValue.length)&&(n++,r=o);return n},split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=p(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&am
p;&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.replaceChild(n,t):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(l.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(l.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var
t;return 1!=e.nodeType?null:(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null)},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},c.DOM=new c(document),c}),r(y,[v,p],function(e,t){function n(){function e(e,t){function n(){o.remove(s),a&&(a.onreadystatechange=a.onload=a=null),t()}function i(){"undefine
d"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var o=r,a,s;s=o.uniqueId(),a=document.createElement("script"),a.id=s,a.type="text/javascript",a.src=e,"onreadystatechange"in a?a.onreadystatechange=function(){/loaded|complete/.test(a.readyState)&&n()}:a.onload=n,a.onerror=i,(document.getElementsByTagName("head")[0]||document.body).appendChild(a)}var t=0,n=1,a=2,s={},l=[],c={},u=[],d=0,f;this.isDone=function(e){return s[e]==a},this.markDone=function(e){s[e]=a},this.add=this.load=function(e,n,r){var i=s[e];i==f&&(l.push(e),s[e]=t),n&&(c[e]||(c[e]=[]),c[e].push({func:n,scope:r||this}))},this.loadQueue=function(e,t){this.loadScripts(l,e,t)},this.loadScripts=function(t,r,l){function p(e){i(c[e],function(e){e.func.call(e.scope)}),c[e]=f}var h;u.push({func:r,scope:l||this}),h=function(){var r=o(t);t.length=0,i(r,function(t){return s[t]==a?(p(t),void 0):(s[t]!=n&&(s[t]=n,d
++,e(t,function(){s[t]=a,d--,p(t),h()})),void 0)}),d||(i(u,function(e){e.func.call(e.scope)}),u.length=0)},h()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(b,[y,p],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t
+},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t,n){if(r.language&&r.languageLoad!==!1){if(n&&new RegExp("([, ]|\\b)"+r.language+"([, ]|\\b)").test(n)===!1)return;e.ScriptLoader.add(this.urls[t]+"/langs/"+r.language+".js")}},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&(s?a.call(s):a.call(e))}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&
&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(C,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--
;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.p
rev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i
=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(x,[p],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e){var t={},n,r;for(n=0,r=e.length;r>n;n++)t[e[n]]={};return t}var o,l,c,u=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),l=3;l<u.length;l++)"string"==typeof u[l]&&(u[l]=t(u[l])),r.push.apply(r,u[l]);for(e=t(e),o=e.length;o--;)c=[].concat(s,t(n)),a[e[o]]={attributes:i(c),attributesOrder:c,children:i(r)}}function i(e,n){var r,i,o,s;for(e=t(e),r=e.length,n=t(n);r--;)for(i=a[e[r]],o=0,s=n.length;s>o;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},s,l,c,u,d,f,p;return r[e]?r[e]:(s=t("id accesskey class dir lang style tabindex title"),l=t("onabort onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextm
enu oncuechange ondblclick ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended onerror onfocus oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart onmousedown onmousemove onmouseout onmouseover onmouseup onmousewheel onpause onplay onplaying onprogress onratechange onreset onscroll onseeked onseeking onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate onvolumechange onwaiting"),c=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),u=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(s.push.apply(s,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),c.push.apply(c,t("article aside details dialog figure h
eader footer hgroup section nav")),u.push.apply(u,t("audio canvas command datalist mark meter output progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(s.push("xml:lang"),p=t("acronym applet basefont big font strike tt"),u.push.apply(u,p),o(p,function(e){n(e,"",u)}),f=t("center dir isindex noframes"),c.push.apply(c,f),d=[].concat(c,u),o(f,function(e){n(e,"",d)})),d=d||[].concat(c,u),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body",&qu
ot;onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",d),n("address dt dd div caption","",d),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",u),n("blockquote","cite",d),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",d),n("dl","","dt dd"),n("a","href target rel media hreflang type",u),n("q","cite",u),n("ins del","cite datetime",d),n("img","src alt usemap ismap width height"),n("iframe","src name width height",d),n("embed","src type width height"),n("object","data type
typemustmatch name usemap form width height",d,"param"),n("param","name value"),n("map","name",d,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",d),n("th","colspan rowspan headers scope abbr",d),n("form","accept-charset action autocomplete enctype method name novalidate target",d),n("fieldset","disabled form name",d,"legend"),n("label","form for",u),n("input","accept alt autocomp
lete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?d:u),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",d,"li"),n("noscript","",d),"html4"!=e&&(n("wbr"),n("ruby","",u,"rt rp"),n("figcaption","",d),n("mark rt rp summary bdi","",u),n(&qu
ot;canvas","width height",d),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height",d,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls",d,"track source"),n("source","src type media"),n("track","kind src srclang label default"),n("datalist","",u,"option"),n("article section nav aside header footer","",d),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",d,"figcaption"),n("time","datetime",u),n("dialog","open",d),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",u),n("progress","value max",u),n("meter","value min max low high o
ptimum",u),n("details","open",d,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(i("script","language xml:space"),i("style","xml:space"),i("object","declare classid codebase codetype archive standby align border hspace vspace"),i("param","valuetype type"),i("a","charset name rev shape coords"),i("br","clear"),i("applet","codebase archive code object alt name width height align hspace vspace"),i("img","name longdesc align border hspace vspace"),i("iframe","longdesc frameborder marginwidth marginheight scrolling align"),i("font basefont","size color face"),i("input","usemap align"),i("select","onchange"),i("textarea"),i(&quo
t;h1 h2 h3 h4 h5 h6 div p legend caption","align"),i("ul","type compact"),i("li","type"),i("ol dl menu dir","compact"),i("pre","width xml:space"),i("hr","align noshade size width"),i("isindex","prompt"),i("table","summary width frame rules cellspacing cellpadding align bgcolor"),i("col","width align char charoff valign"),i("colgroup","width align char charoff valign"),i("thead","align char charoff valign"),i("tr","align char charoff valign bgcolor"),i("th","axis align char charoff valign nowrap bgcolor width height"),i("form","accept"),i("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),i("tfoot","align char charoff valign"),i("tbody",&
quot;align char charoff valign"),i("area","nohref"),i("body","background bgcolor text link vlink alink")),"html4"!=e&&(i("input button select textarea","autofocus"),i("input textarea","placeholder"),i("a","download"),i("link script img","crossorigin"),i("iframe","srcdoc sandbox seamless allowfullscreen")),o(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,r[e]=a,a)}var r={},i=e.makeMap,o=e.each,a=e.extend,s=e.explode,l=e.inArray;return function(e){function c(t,n,o){var s=e[t];return s?s=i(s,",",i(s.toUpperCase()," ")):(s=r[t],s||(s=i(n," ",i(n.toUpperCase()," ")),s=a(s,o),r[t]=s)),s}function u(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function d(e){var n,r,o,a,s,c
,d,f,p,h,m,g,y,C,x,w,_,N,E,k=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,S=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),v["@"]&&(w=v["@"].attributes,_=v["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=k.exec(e[n])){if(C=s[1],p=s[2],x=s[3],f=s[5],g={},y=[],c={attributes:g,attributesOrder:y},"#"===C&&(c.paddEmpty=!0),"-"===C&&(c.removeEmpty=!0),"!"===s[4]&&(c.removeEmptyAttrs=!0),w){for(N in w)g[N]=w[N];y.push.apply(y,_)}if(f)for(f=t(f,"|"),o=0,a=f.length;a>o;o++)if(s=S.exec(f[o])){if(d={},m=s[1],h=s[2].replace(/::/g,":"),C=s[3],E=s[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(h),d.required=!0),"-"===m){delete g[h],y.splice(l(y,h),1);continue}C&&("="===C&&(c.attributesDefault=c.attributesDefault||[],c.attribu
tesDefault.push({name:h,value:E}),d.defaultValue=E),":"===C&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:h,value:E}),d.forcedValue=E),"<"===C&&(d.validValues=i(E,"?"))),T.test(h)?(c.attributePatterns=c.attributePatterns||[],d.pattern=u(h),c.attributePatterns.push(d)):(g[h]||y.push(h),g[h]=d)}w||"@"!=p||(w=g,_=y),x&&(c.outputName=p,v[x]=c),T.test(p)?(c.pattern=u(p),b.push(c)):v[p]=c}}function f(e){v={},b=[],d(e),o(x,function(e,t){y[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&o(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",s=t[2];if(y[s]=y[i],R[s]=i,r||(k[s.toUpperCase()]={},k[s]={}),!v[s]){var l=v[i];l=a({},l),delete l.removeEmptyAttrs,delete l.removeEmpty,v[s]=l}o(y,function(e){e[i]&&(e[s]=e[i])})})}function h(e){var n=/^([+\-]?)(\w+)\[([^\]]+)\]$/;e&&o(t(e,","),function(e){var r=n.exec(
e),i,a;r&&(a=r[1],i=a?y[r[2]]:y[r[2]]={"#comment":{}},i=y[r[2]],o(t(r[3],"|"),function(e){"-"===a?delete i[e]:i[e]={}}))})}function m(e){var t=v[e],n;if(t)return t;for(n=b.length;n--;)if(t=b[n],t.pattern.test(e))return t}var g=this,v={},y={},b=[],C,x,w,_,N,E,k,S,T,R={},A={};e=e||{},x=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),e.valid_styles&&(C={},o(e.valid_styles,function(e,t){C[t]=s(e)})),w=c("whitespace_elements","pre script noscript style textarea video audio iframe object"),_=c("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),N=c("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),E=c("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls")
,S=c("non_empty_elements","td th iframe video audio object script",N),T=c("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),k=c("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup",T),o((e.special||"script noscript style textarea").split(" "),function(e){A[e]=new RegExp("</"+e+"[^>]*>","gi")}),e.valid_elements?f(e.valid_elements):(o(x,function(e,t){v[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},y[t]=e.children}),"html5"!=e.schema&&o(t("strong/b em/i"),function(e){e=t(e,"/"),v[e[1]].outputName=e[0]}),v.img.attributesDefault=[{name:"alt",value:""}],o(t("ol ul sub sup blockquote span font a table tbody tr
strong em b i"),function(e){v[e]&&(v[e].removeEmpty=!0)}),o(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){v[e].paddEmpty=!0}),o(t("span"),function(e){v[e].removeEmptyAttrs=!0})),p(e.custom_elements),h(e.valid_children),d(e.extended_valid_elements),h("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&o(s(e.invalid_elements),function(e){v[e]&&delete v[e]}),m("span")||d("span[!data-mce-type|*]"),g.children=y,g.styles=C,g.getBoolAttrs=function(){return E},g.getBlockElements=function(){return k},g.getTextBlockElements=function(){return T},g.getShortEndedElements=function(){return N},g.getSelfClosingElements=function(){return _},g.getNonEmptyElements=function(){return S},g.getWhiteSpaceElements=function(){return w},g.getSpecialElements=function(){return A},g.isValidChild=function(e,t){var n=y[e];return!(!n||!n[t])},g.isValid=function(e,t){var n,r,i=m(e);if(i){if(!t)return!0;if(i.attributes[t])re
turn!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},g.getElementRule=m,g.getCustomElements=function(){return R},g.addValidElements=d,g.setValidElements=f,g.addCustomElements=p,g.addValidChildren=h,g.elements=v}}),r(w,[x,m,p],function(e,t,n){var r=n.each;return function(i,o){var a=this,s=function(){};i=i||{},a.schema=o=o||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),r("comment cdata text start end pi doctype".split(" "),function(e){e&&(a[e]=i[e]||s)}),a.parse=function(e){function r(e){var t,n;for(t=f.length;t--&&f[t].name!==e;);if(t>=0){for(n=f.length-1;n>=t;n--)e=f[n],e.valid&&s.end(e.name);f.length=t}}function a(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in C?t:F(n||r||o||""),w&&!v&&0!==t.indexOf("data-")){if(a=S[t],!a&&T){for(s=T.length;s--&&(a=T[s],!a.pattern.test(t)););-1===s&&(a=null)}
if(!a)return;if(a.validValues&&!(n in a.validValues))return}if(W[t]&&!i.allow_script_urls){var c=n.replace(l,"");try{if(c=decodeURIComponent(c),V.test(c))return}catch(u){if(c=unescape(c),V.test(c))return}}p.map[t]=n,p.push({name:t,value:n})}var s=this,l,c=0,u,d,f=[],p,h,m,g,v,y,b,C,x,w,_,N,E,k,S,T,R,A,B,L,D,H,M,P,O,I=0,F=t.decode,z,W=n.makeMap("src,href"),V=/(java|vb)script:/i;for(H=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),M=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,b=o.getShortEndedElements(),D=i.self_closing_elements||o.getSelfClosingElements(),C=o.getBoolAttrs(),w=i.validate,y=i.remove_internals,z=i.f
ix_self_closing,P=o.getSpecialElements();l=H.exec(e);){if(c<l.index&&s.text(F(e.substr(c,l.index-c))),u=l[6])u=u.toLowerCase(),":"===u.charAt(0)&&(u=u.substr(1)),r(u);else if(u=l[7]){if(u=u.toLowerCase(),":"===u.charAt(0)&&(u=u.substr(1)),x=u in b,z&&D[u]&&f.length>0&&f[f.length-1].name===u&&r(u),!w||(_=o.getElementRule(u))){if(N=!0,w&&(S=_.attributes,T=_.attributePatterns),(k=l[8])?(v=-1!==k.indexOf("data-mce-type"),v&&y&&(N=!1),p=[],p.map={},k.replace(M,a)):(p=[],p.map={}),w&&!v){if(R=_.attributesRequired,A=_.attributesDefault,B=_.attributesForced,L=_.removeEmptyAttrs,L&&!p.length&&(N=!1),B)for(h=B.length;h--;)E=B[h],g=E.name,O=E.value,"{$uid}"===O&&(O="mce_"+I++),p.map[g]=O,p.push({name:g,value:O});if(A)for(h=A.length;h--;)E=A[h],g=E.name,g in p.map||(O=E.value,"{$uid}"===O&&(O="mce_"+I+
+),p.map[g]=O,p.push({name:g,value:O}));if(R){for(h=R.length;h--&&!(R[h]in p.map););-1===h&&(N=!1)}p.map["data-mce-bogus"]&&(N=!1)}N&&s.start(u,p,x)}else N=!1;if(d=P[u]){d.lastIndex=c=l.index+l[0].length,(l=d.exec(e))?(N&&(m=e.substr(c,l.index-c)),c=l.index+l[0].length):(m=e.substr(c),c=e.length),N&&(m.length>0&&s.text(m,!0),s.end(u)),H.lastIndex=c;continue}x||(k&&k.indexOf("/")==k.length-1?N&&s.end(u):f.push({name:u,valid:N}))}else(u=l[1])?(">"===u.charAt(0)&&(u=" "+u),i.allow_conditional_comments||"[if"!==u.substr(0,3)||(u=" "+u),s.comment(u)):(u=l[2])?s.cdata(u):(u=l[3])?s.doctype(u):(u=l[4])&&s.pi(u,l[5]);c=l.index+l[0].length}for(c<e.length&&s.text(F(e.substr(c))),h=f.length-1;h>=0;h--)u=f[h],u.valid&&s.end(u.name)}}}),r(_,[C,x,w,p],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return
function(r,l){function c(t){var n,r,o,a,s,c,d,f,p,h,m,g,v,y;for(m=i("tr,td,th,tbody,thead,tfoot,table"),h=l.getNonEmptyElements(),g=l.getTextBlockElements(),n=0;n<t.length;n++)if(r=t[n],r.parent&&!r.fixed)if(g[r.name]&&"li"==r.parent.name){for(v=r.next;v&&g[v.name];)v.name="li",v.fixed=!0,r.parent.insert(v,r.parent),v=v.next;r.unwrap(r)}else{for(a=[r],o=r.parent;o&&!l.isValidChild(o.name,r.name)&&!m[o.name];o=o.parent)a.push(o);if(o&&a.length>1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),p=0;p<a.length-1;p++){for(l.isValidChild(c.name,a[p].name)?(d=u.filterNode(a[p].clone()),c.append(d)):d=c,f=a[p].firstChild;f&&f!=a[p+1];)y=f.next,d.append(f),f=y;c=d}s.isEmpty(h)?o.insert(r,a[0],!0):(o.insert(s,a[0],!0),o.insert(r,s)),o=a[0],(o.isEmpty(h)||o.firstChild===o.lastChild&&"br"===o.firstChild.name)&&o.empty().remove()}else if(r.parent){if("li"===r.name){i
f(v=r.prev,v&&("ul"===v.name||"ul"===v.name)){v.append(r);continue}if(v=r.next,v&&("ul"===v.name||"ul"===v.name)){v.insert(r,v.firstChild,!0);continue}r.wrap(u.filterNode(new e("ul",1)));continue}l.isValidChild(r.parent.name,"div")&&l.isValidChild("div",r.name)?r.wrap(u.filterNode(new e("div",1))):"style"===r.name||"script"===r.name?r.empty().remove():r.unwrap()}}}var u=this,d={},f=[],p={},h={};r=r||{},r.validate="validate"in r?r.validate:!0,r.root_name=r.root_name||"body",u.schema=l=l||new t,u.filterNode=function(e){var t,n,r;n in d&&(r=p[n],r?r.push(e):p[n]=[e]),t=f.length;for(;t--;)n=f[t].name,n in e.attributes.map&&(r=h[n],r?r.push(e):h[n]=[e]);return e},u.addNodeFilter=function(e,t){o(a(e),function(e){var n=d[e];n||(d[e]=n=[]),n.push(t)})},u.addAttributeFilter=function(e,t){o(a(e),function(e){var n;for(n=0;n<f.length;
n++)if(f[n].name===e)return f[n].callbacks.push(t),void 0;f.push({name:e,callbacks:[t]})})},u.parse=function(t,o){function a(){function e(e){e&&(t=e.firstChild,t&&3==t.type&&(t.value=t.value.replace(R,"")),t=e.lastChild,t&&3==t.type&&(t.value=t.value.replace(L,"")))}var t=y.firstChild,n,i;if(l.isValidChild(y.name,I.toLowerCase())){for(;t;)n=t.next,3==t.type||1==t.type&&"p"!==t.name&&!T[t.name]&&!t.attr("data-mce-type")?i?i.append(t):(i=u(I,1),i.attr(r.forced_root_block_attrs),y.insert(i,t),i.append(t)):(e(i),i=null),t=n;e(i)}}function u(t,n){var r=new e(t,n),i;return t in d&&(i=p[t],i?i.push(r):p[t]=[r]),r}function m(e){var t,n,r;for(t=e.prev;t&&3===t.type;)n=t.value.replace(L,""),n.length>0?(t.value=n,t=t.prev):(r=t.prev,t.remove(),t=r)}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v
,y,b,C,x,w,_,N,E,k,S,T,R,A=[],B,L,D,H,M,P,O,I;if(o=o||{},p={},h={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),O=l.getNonEmptyElements(),P=l.children,S=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,M=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,L=/[ \t\r\n]+$/,D=/[ \t\r\n]+/g,H=/^[ \t\r\n]+$/,v=new n({validate:S,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(D," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,m(b)},doctype:function(e){var t;t=b.append(u("#doctype",10))
,t.value=e,m(b)},start:function(e,t,n){var r,i,o,a,s;if(o=S?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=P[b.name],s&&P[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(E=h[a],E?E.push(r):h[a]=[r]);T[e]&&m(r),n||(b=r),!B&&M[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=S?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||H.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(L,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||H.test(i))&&(n.remove(),n=o),n=o}if(B&&M[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&
&b.isEmpty(O))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,b.empty().remove(),b=a,void 0;b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),S&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(k in p){for(E=d[k],C=p[k],_=C.length;_--;)C[_].parent||C.splice(_,1);for(x=0,w=E.length;w>x;x++)E[x](C,k,o)}for(x=0,w=f.length;w>x;x++)if(E=f[x],E.name in h){for(C=h[E.name],_=C.length;_--;)C[_].parent||C.splice(_,1);for(_=0,N=E.callbacks.length;N>_;_++)E.callbacks[_](C,E.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,p,h;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(d=i.prev;d
;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),c.isEmpty(a)&&(p=l.getElementRule(c.name),p&&(p.removeEmpty?c.remove():p.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(h=new e("#text",3),h.value="\xa0",i.replace(h))}}),r.allow_html_in_named_anchor||u.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}})}}),r(N,[m,p],function(e,t){var n=t.makeMap;return function(t){var r=[],i,o,a,s,l;return t=t||{},i=t.indent,o=n(t.indent_before||""),a=n(t.indent_after
||""),s=e.getEncodeFunc(t.entity_encoding||"raw",t.entities),l="html"==t.element_format,{start:function(e,t,n){var c,u,d,f;if(i&&o[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');r[r.length]=!n||l?">":" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push("</",e,">"),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("<![CDATA[",e,"]]>")},comment:function(e){
r.push("<!--",e,"-->")},pi:function(e,t){t?r.push("<?",e," ",t,"?>"):r.push("<?",e,"?>"),i&&r.push("\n")},doctype:function(e){r.push("<!DOCTYPE",e,">",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(E,[N,x],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,p,h,m;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1){for(f=[],f.map={},m=r.getElementRule(e.name),p=0,h=m.attributesOrder.length;h>p;p++)u=m.attributesOrder[p],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(p=0,h=c.length;h>p;p++)u=c[p].name,u in f.map||(d=c.map[u],f.m
ap[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(k,[v,_,m,E,C,x,g,p],function(e,t,n,r,i,o,a,s){var l=s.each,c=s.trim,u=e.DOM;return function(e,i){var s,d,f;return i&&(s=i.dom,d=i.schema),s=s||u,d=d||new o(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,f=new t(e,d),f.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,l=e.url_converter,c=e.url_converter_scope,u;r--;)i=t[r],o=i.attributes.map[a],o!==u?(i.attr(n,o.length>0?o:null),i.attr
(a,null)):(o=i.attributes.map[n],"style"===n?o=s.serializeStyle(s.parseStyle(o),i.name):l&&(o=l.call(c,o,n,i.name)),i.attr(n,o.length>0?o:null))}),f.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null)}),f.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),f.addAttributeFilter("data-mce-expando",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),f.addNodeFilter("noscript",function(e){for(var t=e.length,r;t--;)r=e[t].firstChild,r&&(r.value=n.decode(r.value))}),f.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replac
e(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o;r--;)if(i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t){var a=(i.attr("type")||"text/javascript").replace(/^mce\-/,"");i.attr("type","text/javascript"===a?null:a),o.length>0&&(i.firstChild.value="// <![CDATA[\n"+n(o)+"\n// ]]>")}else o.length>0&&(i.firstChild.value="<!--\n"+n(o)+"\n-->")}),f.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0
===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),f.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&f.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,("ul"===r.name||"ol"===r.name)&&n.prev&&"li"===n.prev.name&&n.prev.append(n)}),f.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:d,addNodeFilter:f.addNodeFilter,addAttributeFilter:f.addAttributeFilter,serialize:function(t,n){var i=this,o,u,p,h,m;return a.ie&&s.select("script,style,select,map").length>0?(m=t.
innerHTML,t=t.cloneNode(!1),s.setHTML(t,m)):t=t.cloneNode(!0),o=t.ownerDocument.implementation,o.createHTMLDocument&&(u=o.createHTMLDocument(""),l("BODY"==t.nodeName?t.childNodes:[t],function(e){u.body.appendChild(u.importNode(e,!0))}),t="BODY"!=t.nodeName?u.body.firstChild:u.body,p=s.doc,s.doc=u),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,i.onPreProcess(n)),h=new r(e,d),n.content=h.serialize(f.parse(c(n.getInner?t.innerHTML:s.getOuterHTML(t)),n)),n.cleanup||(n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||i.onPostProcess(n),p&&(s.doc=p),n.node=null,n.content},addRules:function(e){d.addValidElements(e)},setRules:function(e){d.setValidElements(e)},onPreProcess:function(e){i&&i.fire("PreProcess",e)},onPostProcess:function(e){i&&i.fire("PostProcess",e)}}}}),r(S,[],function(){function e(e){function t(t,n){var
r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r
.hasChildNodes())return a[e?"setStart":"setEnd"](r,0),void 0;if(i===c)return a[e?"setStartBefore":"setEndAfter"](r),void 0;if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return a[e?"setStartAfter":"setEndAfter"](r),void 0;if(!i)return 3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l),void 0;for(;l;){if(u=l.nodeValue,s+=u.length,s>=i){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return 3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l),void 0;for(;l;){if(s+=l.nodeValue.length,s>=i){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentEle
ment(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()
+}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",
s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,h;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),(t==f||t==f.documentElement)&&(t=p,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(h=t.childNodes,h.length?(n>=h.length?i.insertAfter(a,h[h.length-1]):t.insertBefore(a,h[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="<span></span>",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,p=f.body,h,m;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=p.cre
ateTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="":d=null,s.innerHTML="<span></span><span></span>",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",d&&(d.innerHTML=""),void 0;l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(m=s.childNodes[l],a=p.createControlRange(),a.addElement(m),a.select(),h=e.getRng(),h.item&&m===h.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(T,[g],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey},metaKeyPressed:function(t){return(e.mac?t.metaKey:t.ctrlKey)&&!t.altKey}}}),r(R,[T,p,g],function(e,t,n){return function(r,i){
function o(e){return i.settings.object_resizing===!1?!1:/TABLE|IMG|DIV/.test(e.nodeName)?"false"===e.getAttribute("data-mce-resize")?!1:!0:!1}function a(t){var n,r;n=t.screenX-k,r=t.screenY-S,H=n*N[2]+A,M=r*N[3]+B,H=5>H?5:H,M=5>M?5:M,(e.modifierPressed(t)||"IMG"==x.nodeName&&N[2]*N[3]!==0)&&(H=Math.round(M/L),M=Math.round(H*L)),b.setStyles(w,{width:H,height:M}),N[2]<0&&w.clientWidth<=H&&b.setStyle(w,"left",T+(A-H)),N[3]<0&&w.clientHeight<=M&&b.setStyle(w,"top",R+(B-M)),D||(i.fire("ObjectResizeStart",{target:x,width:A,height:B}),D=!0)}function s(){function e(e,t){t&&(x.style[e]||!i.schema.isValid(x.nodeName.toLowerCase(),e)?b.setStyle(x,e,t):b.setAttrib(x,e,t))}D=!1,e("width",H),e("height",M),b.unbind(P,"mousemove",a),b.unbind(P,"mouseup",s),O!=P&&(b.unbind(O,"mousemove",a),b.unbind(O,"mous
eup",s)),b.remove(w),I&&"TABLE"!=x.nodeName||l(x),i.fire("ObjectResized",{target:x,width:H,height:M}),i.nodeChanged()}function l(e,t,n){var r,l,u,d,f,p=i.getBody();r=b.getPos(e,p),T=r.x,R=r.y,f=e.getBoundingClientRect(),l=f.width||f.right-f.left,u=f.height||f.bottom-f.top,x!=e&&(m(),x=e,H=M=0),d=i.fire("ObjectSelected",{target:e}),o(e)&&!d.isDefaultPrevented()?C(_,function(e,r){function o(t){D=!0,k=t.screenX,S=t.screenY,A=x.clientWidth,B=x.clientHeight,L=B/A,N=e,w=x.cloneNode(!0),b.addClass(w,"mce-clonedresizable"),w.contentEditable=!1,w.unSelectabe=!0,b.setStyles(w,{left:T,top:R,margin:0}),w.removeAttribute("data-mce-selected"),i.getBody().appendChild(w),b.bind(P,"mousemove",a),b.bind(P,"mouseup",s),O!=P&&(b.bind(O,"mousemove",a),b.bind(O,"mouseup",s))}var c,d;return t?(r==t&&o(n),void 0):(c=b.get("mceResizeHandle"+r),c?b.show(c):(d=i.getB
ody(),c=b.add(d,"div",{id:"mceResizeHandle"+r,"data-mce-bogus":!0,"class":"mce-resizehandle",contentEditable:!1,unSelectabe:!0,style:"cursor:"+r+"-resize; margin:0; padding:0"}),b.bind(c,"mousedown",function(e){e.preventDefault(),o(e)})),b.setStyles(c,{left:l*e[0]+T-c.offsetWidth/2,top:u*e[1]+R-c.offsetHeight/2}),void 0)}):c(),x.setAttribute("data-mce-selected","1")}function c(){var e,t;x&&x.removeAttribute("data-mce-selected");for(e in _)t=b.get("mceResizeHandle"+e),t&&(b.unbind(t),b.remove(t))}function u(e){function t(e,t){do if(e===t)return!0;while(e=e.parentNode)}var n;return C(b.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),n="mousedown"==e.type?e.target:r.getNode(),n=b.getParent(n,I?"table":"table,img,hr"),n&&(g(),t(r.getStar
t(),n)&&t(r.getEnd(),n)&&(!I||n!=r.getStart()&&"IMG"!==r.getStart().nodeName))?(l(n),void 0):(c(),void 0)}function d(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function f(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function p(e){var t=e.srcElement,n,r,o,a,s,c,u;n=t.getBoundingClientRect(),c=E.clientX-n.left,u=E.clientY-n.top;for(r in _)if(o=_[r],a=t.offsetWidth*o[0],s=t.offsetHeight*o[1],Math.abs(a-c)<8&&Math.abs(s-u)<8){N=o;break}D=!0,i.getDoc().selection.empty(),l(t,r,E)}function h(e){var t=e.srcElement;if(t!=x){if(m(),0===t.id.indexOf("mceResizeHandle"))return e.returnValue=!1,void 0;("IMG"==t.nodeName||"TABLE"==t.nodeName)&&(c(),x=t,d(t,"resizestart",p))}}function m(){f(x,"resizestart",p)}function g(){try{i.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function v(e){var t;if(I){t=P.body.
createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function y(){x=w=null,I&&(m(),f(i.getBody(),"controlselect",h))}var b=i.dom,C=t.each,x,w,_,N,E,k,S,T,R,A,B,L,D,H,M,P=i.getDoc(),O=document,I=n.ie&&n.ie<11;_={n:[.5,0,0,-1],e:[1,.5,1,0],s:[.5,1,0,1],w:[0,.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var F=".mce-content-body";return i.contentStyles.push(F+" div.mce-resizehandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}"+F+" .mce-resizehandle:hover {background: #000}"+F+" img[data-mce-selected], hr[data-mce-selected] {outline: 1px solid black;resize: none}"+F+" .mce-clonedresizable {position: absolute;"+(n.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"),i.on("init",function(){I?(i.on("ObjectResized",function(e){&
quot;TABLE"!=e.target.nodeName&&(c(),v(e.target))}),d(i.getBody(),"controlselect",h),i.on("mousedown",function(e){E=e})):(g(),n.ie>=11&&(i.on("mouseup",function(e){var t=e.target.nodeName;/^(TABLE|IMG|HR)$/.test(t)&&(i.selection.select(e.target,"TABLE"==t),i.nodeChanged())}),i.dom.bind(i.getBody(),"mscontrolselect",function(e){/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&e.preventDefault()}))),i.on("nodechange mousedown mouseup ResizeEditor",u),i.on("keydown keyup",function(e){x&&"TABLE"==x.nodeName&&u(e)})}),{controlSelect:v,destroy:y}}}),r(A,[f,S,R,g,p],function(e,n,r,i,o){function a(e,t,i,o){var a=this;a.dom=e,a.win=t,a.serializer=i,a.editor=o,a.controlSelection=new r(a,o),a.win.getSelection||(a.tridentSel=new n(a))}var s=o.each,l=o.grep,c=o.trim,u=i.ie,d=i.opera;return a.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();e?
(r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)):(n._moveEndPoint(r,n.editor.getBody(),!0),n.setRng(r))},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="<br>"+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t
||{format:"html"},t.set=!0,t.selection=!0,e=t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='<span id="__caret">_</span>',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('<span id="__mce_tmp">_</span>'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(){var e=this,t=e.getRng
(),n,r,i,o;if(t.duplicate||t.item){if(t.item)return t.item(0);for(i=t.duplicate(),i.collapse(1),n=i.parentElement(),n.ownerDocument!==e.dom.doc&&(n=e.dom.getRoot()),r=o=t.parentElement();o=o.parentNode;)if(o==n){n=r;break}return n}return n=t.startContainer,1==n.nodeType&&n.hasChildNodes()&&(n=n.childNodes[Math.min(n.childNodes.length-1,t.startOffset)]),n&&3==n.nodeType?n.parentNode:n},getEnd:function(){var e=this,t=e.getRng(),n,r;return t.duplicate||t.item?t.item?t.item(0):(t=t.duplicate(),t.collapse(0),n=t.parentElement(),n.ownerDocument!==e.dom.doc&&(n=e.dom.getRoot()),n&&"BODY"==n.nodeName?n.lastChild||n:n):(n=t.endContainer,r=t.endOffset,1==n.nodeType&&n.hasChildNodes()&&(n=n.childNodes[r>0?r-1:r]),n&&3==n.nodeType?n.parentNode:n)},getBookmark:function(e,t){function n(e,t){var n=0;return s(a.select(e),function(e,r){e==t&&(n=r)}),n}function r(e){function t(t){var n,r,i,o=t?"start&quo
t;:"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function i(){function e(e,n){var i=e[n?"startContainer":"endContainer"],a=e[n?"startOffset":"endOffset"],s=[],l,c,u=0;if(3==i.nodeType){if(t)for(l=i.previousSibling;l&&3==l.nodeType;l=l.previousSibling)a+=l.nodeValue.length;s.push(a)}else c=i.childNodes,a>=c.length&&c.length&&(u=1,a=Math.max(0,c.length-1)),s.push(o.dom.nodeIndex(c[a],t)+u);for(;i&&i!=r;i=i.parentNode)s.push(o.dom.nodeIndex(i,t));return s}var n=o.getRng(!0),r=a.getRoot(),i={};return i.start=e(n,!0),o.isCollapsed()||(i.end=e(n)),i}var o=this,a=o.dom,l,c,u,d,f,p,h="",m;if(2==e)return p=o.getNode(),f=p.nodeName,"IMG"
==f?{name:f,index:n(f,p)}:o.tridentSel?o.tridentSel.getBookmark(e):i();if(e)return{rng:o.getRng()};if(l=o.getRng(),u=a.uniqueId(),d=o.isCollapsed(),m="overflow:hidden;line-height:0px",l.duplicate||l.item){if(l.item)return p=l.item(0),f=p.nodeName,{name:f,index:n(f,p)};c=l.duplicate();try{l.collapse(),l.pasteHTML('<span data-mce-type="bookmark" id="'+u+'_start" style="'+m+'">'+h+"</span>"),d||(c.collapse(!1),l.moveToElementText(c.parentElement()),0===l.compareEndPoints("StartToEnd",c)&&c.move("character",-1),c.pasteHTML('<span data-mce-type="bookmark" id="'+u+'_end" style="'+m+'">'+h+"</span>"))}catch(g){return null}}else{if(p=o.getNode(),f=p.nodeName,"IMG"==f)return{name:f,index:n(f,p)};c=r(l.cloneRange()),d||(c.collapse(!1),c.insertNode(a.create("span",{"data-mce-type":"bookmark",id:u+"_end",s
tyle:m},h))),l=r(l),l.collapse(!0),l.insertNode(a.create("span",{"data-mce-type":"bookmark",id:u+"_start",style:m},h))}return o.moveToBookmark({id:u,keep:1}),{id:u}},moveToBookmark:function(e){function t(t){var n=e[t?"start":"end"],r,i,o,s;if(n){for(o=n[0],i=c,r=n.length-1;r>=1;r--){if(s=i.childNodes,n[r]>s.length-1)return;i=s[n[r]]}3===i.nodeType&&(o=Math.min(n[0],i.nodeValue.length)),1===i.nodeType&&(o=Math.min(n[0],i.childNodes.length)),t?a.setStart(i,o):a.setEnd(i,o)}return!0}function n(t){var n=o.get(e.id+"_"+t),r,i,a,c,u=e.keep;if(n&&(r=n.parentNode,"start"==t?(u?(r=n.firstChild,i=1):i=o.nodeIndex(n),f=p=r,h=m=i):(u?(r=n.firstChild,i=1):i=o.nodeIndex(n),p=r,m=i),!u)){for(c=n.previousSibling,a=n.nextSibling,s(l(n.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});n=o.get(e.id+"_"+t);)o.remove(n,1);c&&
amp;a&&c.nodeType==a.nodeType&&3==c.nodeType&&!d&&(i=c.nodeValue.length,c.appendData(a.nodeValue),o.remove(a),"start"==t?(f=p=c,h=m=i):(p=c,m=i))}}function r(e){return!o.isBlock(e)||e.innerHTML||u||(e.innerHTML='<br data-mce-bogus="1" />'),e}var i=this,o=i.dom,a,c,f,p,h,m;if(e)if(e.start){if(a=o.createRng(),c=o.getRoot(),i.tridentSel)return i.tridentSel.moveToBookmark(e);t(!0)&&t()&&i.setRng(a)}else e.id?(n("start"),n("end"),f&&(a=o.createRng(),a.setStart(r(f),h),a.setEnd(r(p),m),i.setRng(a))):e.name?i.select(o.select(e.name)[e.index]):e.rng&&i.setRng(e.rng)},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),o;if(n.lastFocusBookmark=null,e){if(!t&&n.controlSelection.controlSelect(e))return;o=r.nodeIndex(e),i.setStart(e.parentNode,o),i.setEnd(e.parentNode,o+1),t&&(n._moveEndPoint(i,e,!0),n._moveEndPoint(i,e)),n.setRng(i)}return e},isCollapsed:function(){
var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){var t=this,n,r,i,o=t.win.document,a;if(!e&&t.lastFocusBookmark){var s=t.lastFocusBookmark;return s.startContainer?(r=o.createRange(),r.setStart(s.startContainer,s.startOffset),r.setEnd(s.endContainer,s.endOffset)):r=s,r}if(e&&t.tridentSel)return t.tridentSel.getRangeAt(0);try{(n=t.getSel())&&(r=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():o.createRange())}catch(l){}if(u&&r&&r.setStart){try{a=o.selection.createRange()}catch(l){}a&&a.item&&(i=a.item(0),r=o.createRange(),r.setStartBefore(i),r.set
EndAfter(i))}return r||(r=o.createRange?o.createRange():o.body.createTextRange()),r.setStart&&9===r.startContainer.nodeType&&r.collapsed&&(i=t.dom.getRoot(),r.setStart(i,0),r.setEnd(i,0)),t.selectedRange&&t.explicitRange&&(0===r.compareBoundaryPoints(r.START_TO_START,t.selectedRange)&&0===r.compareBoundaryPoints(r.END_TO_END,t.selectedRange)?r=t.explicitRange:(t.selectedRange=null,t.explicitRange=null)),r},setRng:function(e,t){var n=this,r;if(e.select)try{e.select()}catch(i){}else if(n.tridentSel){if(e.cloneRange)try{return n.tridentSel.addRange(e),void 0}catch(i){}}else if(r=n.getSel()){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(i){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for
(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,l=t.dom.getRoot();return n?n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&a
mp;n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){function t(t){function a(t,n){for(var r=new e(t,f.getParent(t.parentNode,f.isBlock)||p);t=r[n?"prev":"next"]();)if("BR"===t.nodeName)return!0}function s(e,t){return e.previousSibling&&e.previousSibling.nodeName==t}function l(t,n){var r,a;for(n=n||c,r=new e(n,f.getParent(n.parentNode,f.isBlock)||p);h=r[t?"prev":"next"]();){if(3===h.nodeType&&h.nodeValue.length>0)return c=h,u=t?h.nodeValue.length:0,i=!0,void 0;if(f.isBlock(h)||m[h.nodeName.toLowerCase()])return;a=h}o&&a&&(c=a,i=!0,u=0)}var c,u,d,f=n.dom,p=f.getRoot(),h,m,g,v;if(c=r[(t?"start":
"end")+"Container"],u=r[(t?"start":"end")+"Offset"],m=f.schema.getNonEmptyElements(),v=t,1==c.nodeType&&u>c.childNodes.length-1&&(v=!1),9===c.nodeType&&(c=f.getRoot(),u=0),c===p){if(v&&(h=c.childNodes[u>0?u-1:0],h&&(g=h.nodeName.toLowerCase(),m[h.nodeName]||"TABLE"==h.nodeName)))return;if(c.hasChildNodes()&&(u=Math.min(!v&&u>0?u-1:u,c.childNodes.length-1),c=c.childNodes[u],u=0,c.hasChildNodes()&&!/TABLE/.test(c.nodeName))){h=c,d=new e(c,p);do{if(3===h.nodeType&&h.nodeValue.length>0){u=v?0:h.nodeValue.length,c=h,i=!0;break}if(m[h.nodeName.toLowerCase()]){u=f.nodeIndex(h),c=h.parentNode,"IMG"!=h.nodeName||v||u++,i=!0;break}}while(h=v?d.next():d.prev())}}o&&(3===c.nodeType&&0===u&&l(!0),1===c.nodeType&&(h=c.childNodes[u],!h||"BR"!==h.nodeName||s(h,"A")||a(h)||a(h,!0)||l(!0,c.childNod
es[u]))),v&&!o&&3===c.nodeType&&u===c.nodeValue.length&&l(!1),i&&r["set"+(t?"Start":"End")](c,u)}var n=this,r,i,o;u||(r=n.getRng(),o=r.collapsed,t(!0),o||t(),i&&(o&&r.collapse(!0),n.setRng(r,n.isForward())))},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};s(n.selectorChangedData,function(e,t){s(o,function(n){return i.is(n,t)?(r[t]||(s(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),s(r,function(e,n){a[n]||(delete r[n],s(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHei
ght){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e){function t(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var n,r,i=this,o=i.dom,a=o.getRoot(),s,l;if("BODY"!=a.nodeName){var c=i.getScrollContainer();if(c)return n=t(e).y-t(c).y,l=c.clientHeight,s=c.scrollTop,(s>n||n+25>s+l)&&(c.scrollTop=s>n?n:n-l+25),void 0}r=o.getViewPort(i.editor.getWin()),n=o.getPos(e).y,s=r.y,l=r.h,(n<r.y||n+25>s+l)&&i.editor.getWin().scrollTo(0,s>n?n:n-l+25)},_moveEndPoint:function(t,n,r){var o=n,a=new e(n,o),s=this.dom.schema.getNonEmptyElements();do{if(3==n.nodeType&&0!==c(n.nodeValue).length)return r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length),void 0;if(s[n.nodeName])return r?t.setStartBefore(n):"BR"==n.nodeName?t.setEndBefore(n):t.setEndAfter(n),void 0;if(i.ie&&i.ie<11&&this.dom.isBlock(n)&&this.dom.isEmpty(n))return r?t.setStart(
n,0):t.setEnd(n,0),void 0}while(n=r?a.next():a.prev());"BODY"==o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))},destroy:function(){this.win=null,this.controlSelection.destroy()}},a}),r(B,[p],function(e){function t(e){this.walk=function(t,r){function i(e){var t;return t=e[0],3===t.nodeType&&t===l&&c>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===d&&e.length>0&&t===u&&3===t.nodeType&&e.splice(e.length-1,1),e}function o(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function a(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function s(e,t,n){var a=n?"nextSibling":"previousSibling";for(m=e,g=m.parentNode;m&&m!=t;m=g)g=m.parentNode,v=o(m==e?m:m[a],a),v.length&&(n||v.reverse(),r(i(v)))}var l=t.startContainer,c=t.startOffset,u=t.endContainer,d=t.endOffset,f,p,h,m,g,v,y;if(y=e.select("td.mce-item-selected,th.mce-item-sele
cted"),y.length>0)return n(y,function(e){r([e])}),void 0;if(1==l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[c]),1==u.nodeType&&u.hasChildNodes()&&(u=u.childNodes[Math.min(d-1,u.childNodes.length-1)]),l==u)return r(i([l]));for(f=e.findCommonAncestor(l,u),m=l;m;m=m.parentNode){if(m===u)return s(l,f,!0);if(m===f)break}for(m=u;m;m=m.parentNode){if(m===l)return s(u,f);if(m===f)break}p=a(l,f)||l,h=a(u,f)||u,s(l,p,!0),v=o(p==l?p:p.nextSibling,"nextSibling",h==u?h.nextSibling:h),v.length&&r(i(v)),s(u,h)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&r<n.nodeValue.length&&(i=t(n,r),n=i.previousSibling,o>r?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r<n.nodeValue.length&&(n=t(n,r),r=0),3==i.nodeType&&o>0&a
mp;&o<i.nodeValue.length&&(i=t(i,o).previousSibling,o=i.nodeValue.length)),{startContainer:n,startOffset:r,endContainer:i,endOffset:o}}}var n=e.each;return t.compareRanges=function(e,t){if(e&&t){if(!e.item&&!e.duplicate)return e.startContainer==t.startContainer&&e.startOffset==t.startOffset;if(e.item&&t.item&&e.item(0)===t.item(0))return!0;if(e.isEqual&&t.isEqual&&t.isEqual(e))return!0}return!1},t}),r(L,[f,B,p],function(e,t,n){return function(r){function i(e){return e.nodeType&&(e=e.nodeName),!!r.schema.getTextBlockElements()[e.toLowerCase()]}function o(e,t){return I.getParents(e,t,I.getRoot())}function a(e){return 1===e.nodeType&&"_mce_caret"===e.id}function s(){u({alignleft:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"
left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},defaultBlock:"div"},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"}}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em&q
uot;,remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:!1},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:!1},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},cod
e:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(e,t,n){et(n,function(t,n){I.setAttrib(e,n,t)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]}),et("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){u(e,{block:e,remove:"all"})}),u(r.settings.formats)}function l(){r.addShortcut("ctrl+b","bold_desc","Bold"),r.addShortcut("ctrl+i","italic_desc","Italic"),r.addShortcut("ctrl+u","underline_desc","Underline");for(var e=1;6
>=e;e++)r.addShortcut("ctrl+"+e,"",["FormatBlock",!1,"h"+e]);r.addShortcut("ctrl+7","",["FormatBlock",!1,"p"]),r.addShortcut("ctrl+8","",["FormatBlock",!1,"div"]),r.addShortcut("ctrl+9","",["FormatBlock",!1,"address"])}function c(e){return e?O[e]:O}function u(e,t){e&&("string"!=typeof e?et(e,function(e,t){u(t,e)}):(t=t.length?t:[t],et(t,function(e){e.deep===X&&(e.deep=!e.selector),e.split===X&&(e.split=!e.selector||e.inline),e.remove===X&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),O[e]=t))}function d(e){var t;return r.dom.getParent(e,function(e){return t=r.dom.getStyle(e,"text-decoration"),t&&am
p;"none"!==t}),t}function f(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=d(e.parentNode),r.dom.getStyle(e,"color")&&t?r.dom.setStyle(e,"text-decoration",t):r.dom.getStyle(e,"textdecoration")===t&&r.dom.setStyle(e,"text-decoration",null))}function p(t,n,o){function s(e,t){t=t||m,e&&(t.onformat&&t.onformat(e,t,n,o),et(t.styles,function(t,r){I.setStyle(e,r,E(t,n))}),et(t.attributes,function(t,r){I.setAttrib(e,r,E(t,n))}),et(t.classes,function(t){t=E(t,n),I.hasClass(e,t)||I.addClass(e,t)}))}function l(){function t(t,n){var r=new e(n);for(o=r.current();o;o=r.prev())if(o.childNodes.length>1||o==t||"BR"==o.tagName)return o}var n=r.selection.getRng(),i=n.startContainer,a=n.endContainer;if(i!=a&&0===n.endOffset){var s=t(i,a),l=3==s.nodeType?s.length:s.childNodes.length;n.setEnd(s,l)}return n}function u(e,t,n,r,i){var o=[],a=-1,s,l=-1,c=-1,u;re
turn et(e.childNodes,function(e,t){return"UL"===e.nodeName||"OL"===e.nodeName?(a=t,s=e,!1):void 0}),et(e.childNodes,function(e,n){"SPAN"===e.nodeName&&"bookmark"==I.getAttrib(e,"data-mce-type")&&(e.id==t.id+"_start"?l=n:e.id==t.id+"_end"&&(c=n))}),0>=a||a>l&&c>a?(et(tt(e.childNodes),i),0):(u=I.clone(n,K),et(tt(e.childNodes),function(e,t){(a>l&&a>t||l>a&&t>a)&&(o.push(e),e.parentNode.removeChild(e))}),a>l?e.insertBefore(u,s):l>a&&e.insertBefore(u,s.nextSibling),r.push(u),et(o,function(e){u.appendChild(e)}),u)}function d(e,r,o){var l=[],c,d,f=!0;c=m.inline||m.block,d=I.create(c),s(d),z.walk(e,function(e){function p(e){var y,C,x,_,N;return N=f,y=e.nodeName.toLowerCase(),C=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&J(e)&&(N=f,f="true"===J(e),_=!0),w(y,"br")?(v=0,m.block&&I.rem
ove(e),void 0):m.wrapper&&g(e,t,n)?(v=0,void 0):f&&!_&&m.block&&!m.wrapper&&i(y)&&W(C,c)?(e=I.rename(e,c),s(e),l.push(e),v=0,void 0):m.selector&&(et(h,function(t){"collapsed"in t&&t.collapsed!==b||I.is(e,t.selector)&&!a(e)&&(s(e,t),x=!0)}),!m.inline||x)?(v=0,void 0):(!f||_||!W(c,y)||!W(C,c)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||a(e)||m.inline&&V(e)?"li"==y&&r?v=u(e,r,d,l,p):(v=0,et(tt(e.childNodes),p),_&&(f=N),v=0):(v||(v=I.clone(d,K),e.parentNode.insertBefore(v,e),l.push(v)),v.appendChild(e)),void 0)}var v;et(e,p)}),m.wrap_links===!1&&et(l,function(e){function t(e){var n,r,i;if("A"===e.nodeName){for(r=I.clone(d,K),l.push(r),i=tt(e.childNodes),n=0;n<i.length;n++)r.appendChild(i[n]);e.appendChild(r)}et(tt(e.childNodes),t)}t(e)}),et(l,function(e){function r(e){var t=0;return et
(e.childNodes,function(e){k(e)||L(e)||t++}),t}function i(e){var t,n;return et(e.childNodes,function(e){return 1!=e.nodeType||L(e)||a(e)?void 0:(t=e,K)}),t&&x(t,m)&&(n=I.clone(t,K),s(n),I.replace(n,e,Y),I.remove(t,1)),n||e}var o;if(o=r(e),(l.length>1||!V(e))&&0===o)return I.remove(e,1),void 0;if(m.inline||m.wrapper){if(m.exact||1!==o||(e=i(e)),et(h,function(t){et(I.select(t.inline,e),function(e){var r;if(t.wrap_links===!1){r=e.parentNode;do if("A"===r.nodeName)return;while(r=r.parentNode)}R(t,n,e,t.exact?e:null)})}),g(e.parentNode,t,n))return I.remove(e,1),e=0,Y;m.merge_with_parents&&I.getParent(e.parentNode,function(r){return g(r,t,n)?(I.remove(e,1),e=0,Y):void 0}),e&&m.merge_siblings!==!1&&(e=D(B(e),e),e=D(e,B(e,Y)))}})}var h=c(t),m=h[0],v,y,b=!o&&F.isCollapsed();if(m)if(o)o.nodeType?(y=I.createRng(),y.setStartBefore(o),y.setEndAfter(o),d(T(y,h),null,!0)):d(o,null,!0);else if(b&&m.inline&&!I.select
("td.mce-item-selected,th.mce-item-selected").length)M("apply",t,n);else{var C=r.selection.getNode();U||!h[0].defaultBlock||I.getParent(C,I.isBlock)||p(h[0].defaultBlock),r.selection.setRng(l()),v=F.getBookmark(),d(T(F.getRng(Y),h),v),m.styles&&(m.styles.color||m.styles.textDecoration)&&(nt(C,f,"childNodes"),f(C)),F.moveToBookmark(v),P(F.getRng(Y)),r.nodeChanged()}}function h(e,t,n){function i(e){var n,r,o,a,s;if(1===e.nodeType&&J(e)&&(a=b,b="true"===J(e),s=!0),n=tt(e.childNodes),b&&!s)for(r=0,o=p.length;o>r&&!R(p[r],t,e,e);r++);if(h.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(b=a)}}function a(n){var r;return et(o(n.parentNode).reverse(),function(n){var i;r||"_start"==n.id||"_end"==n.id||(i=g(n,e,t),i&&i.split!==!1&&(r=n))}),r}function s(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode,o=n.parentNode;o&&o!=u;o=o.parentN
ode){for(a=I.clone(o,K),c=0;c<p.length;c++)if(R(p[c],t,a,a)){a=0;break}a&&(s&&a.appendChild(s),l||(l=a),s=a)}!i||h.mixed&&V(e)||(n=I.split(e,n)),s&&(r.parentNode.insertBefore(s,r),l.appendChild(r))}return n}function l(e){return s(a(e),e,e,!0)}function u(e){var t=I.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return L(n)&&(n=n[e?"firstChild":"lastChild"]),I.remove(t,!0),n}function f(e){var t,n,o=e.commonAncestorContainer;e=T(e,p,Y),h.split&&(t=H(e,Y),n=H(e),t!=n?(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"==t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),o&&/^T(HEAD|BODY|FOOT|R)$/.test(o.nodeName)&&/^(TH|TD)$/.test(n.nodeName)&&n.firstChild&&(n=n.firstChild||n),t=S(t,"span",{id:"_start","data-mce-type":"bookmark"}),n=S(n,"span",{id:"_en
d","data-mce-type":"bookmark"}),l(t),l(n),t=u(Y),n=u()):t=n=l(t),e.startContainer=t.parentNode,e.startOffset=q(t),e.endContainer=n.parentNode,e.endOffset=q(n)+1),z.walk(e,function(e){et(e,function(e){i(e),1===e.nodeType&&"underline"===r.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===d(e.parentNode)&&R({deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})}var p=c(e),h=p[0],m,y,b=!0;return n?(n.nodeType?(y=I.createRng(),y.setStartBefore(n),y.setEndAfter(n),f(y)):f(n),void 0):(F.isCollapsed()&&h.inline&&!I.select("td.mce-item-selected,th.mce-item-selected").length?M("remove",e,t):(m=F.getBookmark(),f(F.getRng(Y)),F.moveToBookmark(m),h.inline&&v(e,t,F.getStart())&&P(F.getRng(!0)),r.nodeChanged()),void 0)}function m(e,t,n){var r=c(e);!v(e,t,n)||"toggle"in r[0]&&!r[0].togg
le?p(e,t,n):h(e,t,n)}function g(e,t,n,r){function i(e,t,i){var o,a,s=t[i],l;if(t.onmatch)return t.onmatch(e,t,i);if(s)if(s.length===X){for(o in s)if(s.hasOwnProperty(o)){if(a="attributes"===i?I.getAttrib(e,o):_(e,o),r&&!a&&!t.exact)return;if((!r||t.exact)&&!w(a,N(E(s[o],n),o)))return}}else for(l=0;l<s.length;l++)if("attributes"===i?I.getAttrib(e,s[l]):_(e,s[l]))return t;return t}var o=c(t),a,s,l;if(o&&e)for(s=0;s<o.length;s++)if(a=o[s],x(e,a)&&i(e,a,"attributes")&&i(e,a,"styles")){if(l=a.classes)for(s=0;s<l.length;s++)if(!I.hasClass(e,l[s]))return;return a}}function v(e,t,n){function r(n){var r=I.getRoot();return n===r?!1:(n=I.getParent(n,function(n){return n.parentNode===r||!!g(n,e,t,!0)}),g(n,e,t))}var i;return n?r(n):(n=F.getNode(),r(n)?Y:(i=F.getStart(),i!=n&&r(i)?Y:K))}function y(e,t){var n,r=[],i={};return n=F.getStart(),I.getParent(n,function(n){var o,a;for(o=0;o<e.leng
th;o++)a=e[o],!i[a]&&g(n,a,t)&&(i[a]=!0,r.push(a))},I.getRoot()),r
+}function b(e){var t=c(e),n,r,i,a,s;if(t)for(n=F.getStart(),r=o(n),a=t.length-1;a>=0;a--){if(s=t[a].selector,!s||t[a].defaultBlock)return Y;for(i=r.length-1;i>=0;i--)if(I.is(r[i],s))return Y}return K}function C(e,t,n){var i;return G||(G={},i={},r.on("NodeChange",function(e){var t=o(e.element),n={};et(G,function(e,r){et(t,function(o){return g(o,r,{},e.similar)?(i[r]||(et(e,function(e){e(!0,{node:o,format:r,parents:t})}),i[r]=e),n[r]=e,!1):void 0})}),et(i,function(r,o){n[o]||(delete i[o],et(r,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),et(e.split(","),function(e){G[e]||(G[e]=[],G[e].similar=n),G[e].push(t)}),this}function x(e,t){return w(e,t.inline)?Y:w(e,t.block)?Y:t.selector?1==e.nodeType&&I.is(e,t.selector):void 0}function w(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function _(e,t){return N(I.getStyle(e,t),t)}function N(e,t){return
("color"==t||"backgroundColor"==t)&&(e=I.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function E(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function k(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function S(e,t,n){var r=I.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function T(t,n,a){function s(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=I.getRoot(),3==r.nodeType&&!k(r)&&(e?v>0:b<r.nodeValue.length))return r;for(;;){if(!n[0].block_expand&&V(i))return i;for(o=i[a];o;o=o[a])if
(!L(o)&&!k(o)&&!t(o))return i;if(i.parentNode==s){r=i;break}i=i.parentNode}return r}function l(e,t){for(t===X&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)e=e.childNodes[t],e&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}}function c(e){for(var t=e;t;){if(1===t.nodeType&&J(t))return"false"===J(t)?t:e;t=t.parentNode}return e}function u(t,n,i){function o(e,t){var n,r,o=e.nodeValue;return"undefined"==typeof t&&(t=i?o.length:0),i?(n=o.lastIndexOf(" ",t),r=o.lastIndexOf("\xa0",t),n=n>r?n:r,-1===n||a||n++):(n=o.indexOf(" ",t),r=o.indexOf("\xa0",t),n=-1!==n&&(-1===r||r>n)?n:r),n}var s,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(s=new e(t,I.getParent(t,V)||r.getBody());l=s[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset
:c}}else if(V(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function d(e,r){var i,a,s,l;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=o(e),a=0;a<i.length;a++)for(s=0;s<n.length;s++)if(l=n[s],!("collapsed"in l&&l.collapsed!==t.collapsed)&&I.is(i[a],l.selector))return i[a];return e}function f(e,t){var r,a=I.getRoot();if(n[0].wrapper||(r=I.getParent(e,n[0].block,a)),r||(r=I.getParent(3==e.nodeType?e.parentNode:e,function(e){return e!=a&&i(e)})),r&&n[0].wrapper&&(r=o(r,"ul,ol").reverse()[0]||r),!r)for(r=e;r[t]&&!V(r[t])&&(r=r[t],!w(r,"br")););return r||e}var p,h,m,g=t.startContainer,v=t.startOffset,y=t.endContainer,b=t.endOffset;if(1==g.nodeType&&g.hasChildNodes()&&(p=g.childNodes.length-1,g=g.childNodes[v>p?p:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(p=y.childNodes.length-1,y=y.c
hildNodes[b>p?p:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=c(g),y=c(y),(L(g.parentNode)||L(g))&&(g=L(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(L(y.parentNode)||L(y))&&(y=L(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(m=u(g,v,!0),m&&(g=m.container,v=m.offset),m=u(y,b),m&&(y=m.container,b=m.offset)),h=l(y,b),h.node)){for(;h.node&&0===h.offset&&h.node.previousSibling;)h=l(h.node.previousSibling);h.node&&h.offset>0&&3===h.node.nodeType&&" "===h.node.nodeValue.charAt(h.offset-1)&&h.offset>1&&(y=h.node,y.splitText(h.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=s(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=s())),n[0].selector&&n[0].expand!==K&&!n[0].inline&a
mp;&(g=d(g,"previousSibling"),y=d(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(V(g)||(g=s(!0)),V(y)||(y=s()))),1==g.nodeType&&(v=q(g),g=g.parentNode),1==y.nodeType&&(b=q(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function R(e,t,n,r){var i,o,a;if(!x(n,e))return K;if("all"!=e.remove)for(et(e.styles,function(e,i){e=N(E(e,t),i),"number"==typeof i&&(i=e,r=0),(!r||w(_(r,i),e))&&I.setStyle(n,i,""),a=1}),a&&""===I.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),et(e.attributes,function(e,i){var o;if(e=E(e,t),"number"==typeof i&&(i=e,r=0),!r||w(I.getAttrib(r,i),e)){if("class"==i&&(e=I.getAttrib(n,i),e&&(o="",et(e.split(/\s+/),f
unction(e){/mce\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return I.setAttrib(n,i,o),void 0;"class"==i&&n.removeAttribute("className"),j.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),et(e.classes,function(e){e=E(e,t),(!r||I.hasClass(r,e))&&I.removeClass(n,e)}),o=I.getAttribs(n),i=0;i<o.length;i++)if(0!==o[i].nodeName.indexOf("_"))return K;return"none"!=e.remove?(A(n,e),Y):void 0}function A(e,t){function n(e,t,n){return e=B(e,t,n),!e||"BR"==e.nodeName||V(e)}var i=e.parentNode,o;t.block&&(U?i==I.getRoot()&&(t.list_block&&w(e,t.list_block)||et(tt(e.childNodes),function(e){W(U,e.nodeName.toLowerCase())?o?o.appendChild(e):(o=S(e,U),I.setAttribs(o,r.settings.forced_root_block_attrs)):o=0})):V(e)&&!V(i)&&(n(e,K)||n(e.firstChild,Y,1)||e.insertBefore(I.create("br"),e.firstChild),n(e,Y)||n(e.lastChild,K,1)||e.appendC
hild(I.create("br")))),t.selector&&t.inline&&!w(t.inline,e)||I.remove(e,1)}function B(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1==e.nodeType||!k(e))return e}function L(e){return e&&1==e.nodeType&&"bookmark"==e.getAttribute("data-mce-type")}function D(e,t){function n(e,t){function n(e){var t={};return et(I.getAttribs(e),function(n){var r=n.nodeName.toLowerCase();0!==r.indexOf("_")&&"style"!==r&&(t[r]=I.getAttrib(e,r))}),t}function r(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(n=t[r],n===X)return K;if(e[r]!=n)return K;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return K;return Y}return e.nodeName!=t.nodeName?K:r(n(e),n(t))?r(I.parseStyle(I.getAttrib(e,"style")),I.parseStyle(I.getAttrib(t,"style")))?Y:K:K}function r(e,t){for(i=e;i;i=i[t]){if(3==i.nodeType&&0!==i.nodeValue.length)return e;if(1==i.node
Type&&!L(i))return i}return e}var i,o;if(e&&t&&(e=r(e,"previousSibling"),t=r(t,"nextSibling"),n(e,t))){for(i=e.nextSibling;i&&i!=t;)o=i,i=i.nextSibling,e.appendChild(o);return I.remove(t),et(tt(t.childNodes),function(t){e.appendChild(t)}),e}return t}function H(t,n){var i,o,a;return i=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],1==i.nodeType&&(a=i.childNodes.length-1,!n&&o&&o--,i=i.childNodes[o>a?a:o]),3===i.nodeType&&n&&o>=i.nodeValue.length&&(i=new e(i,r.getBody()).next()||i),3!==i.nodeType||n||0!==o||(i=new e(i,r.getBody()).prev()||i),i}function M(t,n,o){function a(e){var t=I.create("span",{id:y,"data-mce-bogus":!0,style:b?"color:red":""});return e&&t.appendChild(r.getDoc().createTextNode($)),t}function s(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==$||e.
childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function l(e){for(;e;){if(e.id===y)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=F.getRng(!0),s(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),I.remove(e)):(n=u(e),n.nodeValue.charAt(0)===$&&(n=n.deleteData(0,1)),I.remove(e,1)),F.setRng(r);else if(e=l(F.getStart()),!e)for(;e=I.get(y);)d(e,!1)}function f(){var e,t,r,i,s,d,f;e=F.getRng(!0),i=e.startOffset,d=e.startContainer,f=d.nodeValue,t=l(F.getStart()),t&&(r=u(t)),f&&i>0&&i<f.length&&/\w/.test(f.charAt(i))&&/\w/.test(f.charAt(i-1))?(s=F.getBookmark(),e.collapse(!0),e=T(e,c(n)),e=z.split(e),p(n,o,e),F.moveToBookmark(s)):(t&&r.nodeValue===$?p(n,o,t):(t=a(!0),r=t.firstChild,e.insertNode(t),i=1,p(n,o,t)),F.setCursorLocation(r,i))}function m(){var e=F.getRng(!
0),t,r,s,l,u,d,f=[],p,m;for(t=e.startContainer,r=e.startOffset,u=t,3==t.nodeType&&((r!=t.nodeValue.length||t.nodeValue===$)&&(l=!0),u=u.parentNode);u;){if(g(u,n,o)){d=u;break}u.nextSibling&&(l=!0),f.push(u),u=u.parentNode}if(d)if(l)s=F.getBookmark(),e.collapse(!0),e=T(e,c(n),!0),e=z.split(e),h(n,o,e),F.moveToBookmark(s);else{for(m=a(),u=m,p=f.length-1;p>=0;p--)u.appendChild(I.clone(f[p],!1)),u=u.firstChild;u.appendChild(I.doc.createTextNode($)),u=u.firstChild;var v=I.getParent(d,i);v&&I.isEmpty(v)?d.parentNode.replaceChild(m,d):I.insertAfter(m,d),F.setCursorLocation(u,1),I.isEmpty(d)&&I.remove(d)}}function v(){var e;e=l(F.getStart()),e&&!I.isEmpty(e)&&nt(e,function(e){1!=e.nodeType||e.id===y||I.isEmpty(e)||I.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var y="_mce_caret",b=r.settings.caret_debug;r._hasCaretEvents||(Z=function(){var e=[],t;if(s(l(F.getStart()),e))for(t=e.length;t--;)I.setAtt
rib(e[t],"data-mce-bogus","1")},Q=function(e){var t=e.keyCode;d(),(8==t||37==t||39==t)&&d(l(F.getStart())),v()},r.on("SetContent",function(e){e.selection&&v()}),r._hasCaretEvents=!0),"apply"==t?f():m()}function P(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if(3==n.nodeType&&r>=n.nodeValue.length&&(r=q(n),n=n.parentNode,i=!0),1==n.nodeType)for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,I.getParent(n,I.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!k(a))return l=I.create("a",null,$),a.parentNode.insertBefore(l,a),t.setStart(a,0),F.setRng(t),I.remove(l),void 0}var O={},I=r.dom,F=r.selection,z=new t(I),W=r.schema.isValidChild,V=I.isBlock,U=r.settings.forced_root_block,q=I.nodeIndex,$="\ufeff",j=/^(src|href|style)$/,K=!1,Y=!0,G,X,J=I.getContentEditable,Q,Z,et=n.each,tt=n.grep,nt=n.walk,rt=n.extend;rt(this,{get:c,register:
u,apply:p,remove:h,toggle:m,match:v,matchAll:y,matchNode:g,canApply:b,formatChanged:C}),s(),l(),r.on("BeforeGetContent",function(){Z&&Z()}),r.on("mouseup keydown",function(e){Q&&Q(e)})}}),r(D,[g,p],function(e,t){var n=t.trim,r;return r=new RegExp(["<span[^>]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","<div[^>]+data-mce-bogus[^>]+><\\/div>",'\\s?data-mce-selected="[^"]+"'].join("|"),"gi"),function(t){function i(){return n(t.getContent({format:"raw",no_events:1}).replace(r,""))}function o(){a.typing=!1,a.add()}var a,s=0,l=[],c,u,d;return t.on("init",function(){a.add()}),t.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&a.beforeChange()}),t.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&&
quot;Redo"!=t&&"mceRepaint"!=t&&a.add()}),t.on("ObjectResizeStart",function(){a.beforeChange()}),t.on("SaveContent ObjectResized",o),t.dom.bind(t.dom.getRoot(),"dragend",o),t.dom.bind(t.getBody(),"focusout",function(){!t.removed&&a.typing&&o()}),t.on("KeyUp",function(n){var r=n.keyCode;(r>=33&&36>=r||r>=37&&40>=r||45==r||13==r||n.ctrlKey)&&(o(),t.nodeChanged()),(46==r||8==r||e.mac&&(91==r||93==r))&&t.nodeChanged(),u&&a.typing&&(t.isDirty()||(t.isNotDirty=!l[0]||i()==l[0].content,t.isNotDirty||t.fire("change",{level:l[0],lastLevel:null})),t.fire("TypingUndo"),u=!1,t.nodeChanged())}),t.on("KeyDown",function(e){var t=e.keyCode;return t>=33&&36>=t||t>=37&&40>=t||45==t?(a.typing&&o(),void 0):((16>t||t>20)&&224!=t&&91!=t&&!a.typing&
amp;&(a.beforeChange(),a.typing=!0,a.add(),u=!0),void 0)}),t.on("MouseDown",function(){a.typing&&o()}),t.addShortcut("ctrl+z","","Undo"),t.addShortcut("ctrl+y,ctrl+shift+z","","Redo"),t.on("AddUndo Undo Redo ClearUndos MouseUp",function(e){e.isDefaultPrevented()||t.nodeChanged()}),a={data:l,typing:!1,beforeChange:function(){d||(c=t.selection.getBookmark(2,!0))},add:function(e){var n,r=t.settings,o;if(e=e||{},e.content=i(),d||t.fire("BeforeAddUndo",{level:e}).isDefaultPrevented())return null;if(o=l[s],o&&o.content==e.content)return null;if(l[s]&&(l[s].beforeBookmark=c),r.custom_undo_redo_levels&&l.length>r.custom_undo_redo_levels){for(n=0;n<l.length-1;n++)l[n]=l[n+1];l.length--,s=l.length}e.bookmark=t.selection.getBookmark(2,!0),s<l.length-1&&(l.length=s+1),l.push(e),s=l.length-1;var a={level:e,lastLevel:o};return t.fire("AddUndo",a)
,s>0&&(t.fire("change",a),t.isNotDirty=!1),e},undo:function(){var e;return a.typing&&(a.add(),a.typing=!1),s>0&&(e=l[--s],0===s&&(t.isNotDirty=!0),t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(e.beforeBookmark),t.fire("undo",{level:e})),e},redo:function(){var e;return s<l.length-1&&(e=l[++s],t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(e.bookmark),t.fire("redo",{level:e})),e},clear:function(){l=[],s=0,a.typing=!1,t.fire("ClearUndos")},hasUndo:function(){return s>0||a.typing&&l[0]&&i()!=l[0].content},hasRedo:function(){return s<l.length-1&&!this.typing},transact:function(e){a.beforeChange(),d=!0,e(),d=!1,a.add()}}}}),r(H,[f,g],function(e,t){var n=t.ie&&t.ie<11;return function(r){function i(i){function d(e){return e&&o.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&
;!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==o.getContentEditable(e)}function f(e){var t;o.isBlock(e)&&(t=a.getRng(),e.appendChild(o.create("span",null,"\xa0")),a.select(e),e.lastChild.outerHTML="",a.setRng(t))}function p(e){for(var t=e,n=[],r;t=t.firstChild;){if(o.isBlock(t))return;1!=t.nodeType||u[t.nodeName.toLowerCase()]||n.push(t)}for(r=n.length;r--;)t=n[r],!t.hasChildNodes()||t.firstChild==t.lastChild&&""===t.firstChild.nodeValue?o.remove(t):"A"==t.nodeName&&" "===(t.innerText||t.textContent)&&o.remove(t)}function h(n){function r(e){for(;e;){if(1==e.nodeType||3==e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}var i,s,l,c=n,d;if(t.ie&&t.ie<9&&A&&A.firstChild&&A.firstChild==A.lastChild&&"BR"==A.firstChild.tagName&&o.remove(A.firstChild),"LI"==n.nodeName
){var f=r(n.firstChild);f&&/^(UL|OL)$/.test(f.nodeName)&&n.insertBefore(o.doc.createTextNode("\xa0"),n.firstChild)}if(l=o.createRng(),n.hasChildNodes()){for(i=new e(n,n);s=i.current();){if(3==s.nodeType){l.setStart(s,0),l.setEnd(s,0);break}if(u[s.nodeName.toLowerCase()]){l.setStartBefore(s),l.setEndBefore(s);break}c=s,s=i.next()}s||(l.setStart(c,0),l.setEnd(c,0))}else"BR"==n.nodeName?n.nextSibling&&o.isBlock(n.nextSibling)?((!B||9>B)&&(d=o.create("br"),n.parentNode.insertBefore(d,n)),l.setStartBefore(n),l.setEndBefore(n)):(l.setStartAfter(n),l.setEndAfter(n)):(l.setStart(n,0),l.setEnd(n,0));a.setRng(l),o.remove(d),a.scrollIntoView(n)}function m(e){var t=s.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&o.setAttribs(e,s.forced_root_block_attrs)}function g(e){var t=T,r,i,a;if(e||"TABLE"==P?(r=o.create(e||I),m(r)):r=A.cloneNode(!1),a=r,s.keep_styles!==!1)do if(/^(SPAN|STRONG|B|EM|
I|FONT|STRIKE|U)$/.test(t.nodeName)){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),o.setAttrib(i,"id",""),r.hasChildNodes()?(i.appendChild(r.firstChild),r.appendChild(i)):(a=i,r.appendChild(i))}while(t=t.parentNode);return n||(a.innerHTML='<br data-mce-bogus="1">'),r}function v(t){var n,r,i;if(3==T.nodeType&&(t?R>0:R<T.nodeValue.length))return!1;if(T.parentNode==A&&F&&!t)return!0;if(t&&1==T.nodeType&&T==A.firstChild)return!0;if("TABLE"===T.nodeName||T.previousSibling&&"TABLE"==T.previousSibling.nodeName)return F&&!t||!F&&t;for(n=new e(T,A),3==T.nodeType&&(t&&0===R?n.prev():t||R!=T.nodeValue.length||n.next());r=n.current();){if(1===r.nodeType){if(!r.getAttribute("data-mce-bogus")&&(i=r.nodeName.toLowerCase(),u[i]&&"br"!==i))return!1}else if(3===r.nodeType&&!/^[ \t\r\n]*$/.test(r.nodeValue
))return!1;t?n.prev():n.next()}return!0}function y(e,t){var n,i,a,s,l,u,f=I||"P";if(i=o.getParent(e,o.isBlock),u=r.getBody().nodeName.toLowerCase(),!i||!d(i)){if(i=i||S,!i.hasChildNodes())return n=o.create(f),m(n),i.appendChild(n),E.setStart(n,0),E.setEnd(n,0),n;for(s=e;s.parentNode!=i;)s=s.parentNode;for(;s&&!o.isBlock(s);)a=s,s=s.previousSibling;if(a&&c.isValidChild(u,f.toLowerCase())){for(n=o.create(f),m(n),a.parentNode.insertBefore(n,a),s=a;s&&!o.isBlock(s);)l=s.nextSibling,n.appendChild(s),s=l;E.setStart(e,t),E.setEnd(e,t)}}return e}function b(){function e(e){for(var t=M[e?"firstChild":"lastChild"];t&&1!=t.nodeType;)t=t[e?"nextSibling":"previousSibling"];return t===A}function t(){var e=M.parentNode;return"LI"==e.nodeName?e:M}var n=M.parentNode.nodeName;/^(OL|UL|LI)$/.test(n)&&(I="LI"),D=I?g(I):o.create("BR"),e(!0)&&e()?"LI"==n?o.insertAfter(D
,t()):o.replace(D,M):e(!0)?"LI"==n?(o.insertAfter(D,t()),D.appendChild(o.doc.createTextNode(" ")),D.appendChild(M)):M.parentNode.insertBefore(D,M):e()?(o.insertAfter(D,t()),f(D)):(M=t(),k=E.cloneRange(),k.setStartAfter(A),k.setEndAfter(M),H=k.extractContents(),"LI"==I&&"LI"==H.firstChild.nodeName?(D=H.firstChild,o.insertAfter(H,M)):(o.insertAfter(H,M),o.insertAfter(D,M))),o.remove(A),h(D),l.add()}function C(){for(var t=new e(T,A),n;n=t.next();)if(u[n.nodeName.toLowerCase()]||n.length>0)return!0}function x(){var e,t,r;T&&3==T.nodeType&&R>=T.nodeValue.length&&(n||C()||(e=o.create("br"),E.insertNode(e),E.setStartAfter(e),E.setEndAfter(e),t=!0)),e=o.create("br"),E.insertNode(e),n&&"PRE"==P&&(!B||8>B)&&e.parentNode.insertBefore(o.doc.createTextNode("\r"),e),r=o.create("span",{}," "),e.parentNode.insertBefore(r,e),a.s
crollIntoView(r),o.remove(r),t?(E.setStartBefore(e),E.setEndBefore(e)):(E.setStartAfter(e),E.setEndAfter(e)),a.setRng(E),l.add()}function w(e){do 3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)}function _(e){var t=o.getRoot(),n,r;for(n=e;n!==t&&"false"!==o.getContentEditable(n);)"true"===o.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==t?r:t}function N(e){var t;n||(e.normalize(),t=e.lastChild,(!t||/^(left|right)$/gi.test(o.getStyle(t,"float",!0)))&&o.add(e,"br"))}var E=a.getRng(!0),k,S,T,R,A,B,L,D,H,M,P,O,I,F;if(!E.collapsed)return r.execCommand("Delete"),void 0;if(!i.isDefaultPrevented()&&(T=E.startContainer,R=E.startOffset,I=(s.force_p_newlines?"p":"")||s.forced_root_block,I=I?I.toUpperCase():"",B=o.doc.documentMode,L=i.shiftKey,1==T.nodeType&&T.hasChildNodes()&&(F=R>T.childNodes.length
-1,T=T.childNodes[Math.min(R,T.childNodes.length-1)]||T,R=F&&3==T.nodeType?T.nodeValue.length:0),S=_(T))){if(l.beforeChange(),!o.isBlock(S)&&S!=o.getRoot())return(!I||L)&&x(),void 0;if((I&&!L||!I&&L)&&(T=y(T,R)),A=o.getParent(T,o.isBlock),M=A?o.getParent(A.parentNode,o.isBlock):null,P=A?A.nodeName.toUpperCase():"",O=M?M.nodeName.toUpperCase():"","LI"!=O||i.ctrlKey||(A=M,P=O),"LI"==P){if(!I&&L)return x(),void 0;if(o.isEmpty(A))return b(),void 0}if("PRE"==P&&s.br_in_pre!==!1){if(!L)return x(),void 0}else if(!I&&!L&&"LI"!=P||I&&L)return x(),void 0;I&&A===r.getBody()||(I=I||"P",v()?(D=/^(H[1-6]|PRE|FIGURE)$/.test(P)&&"HGROUP"!=O?g(I):g(),s.end_container_on_empty_block&&d(M)&&o.isEmpty(A)?D=o.split(M,A):o.insertAfter(D,A),h(D)):v(!0)?(D=A.parentNode.insertBefore(g(),A),f(D),h(A)):(k=E.cloneR
ange(),k.setEndAfter(A),H=k.extractContents(),w(H),D=H.firstChild,o.insertAfter(H,A),p(D),N(A),h(D)),o.setAttrib(D,"id",""),r.fire("NewBlock",{newBlock:D}),l.add())}}var o=r.dom,a=r.selection,s=r.settings,l=r.undoManager,c=r.schema,u=c.getNonEmptyElements();r.on("keydown",function(e){13==e.keyCode&&i(e)!==!1&&e.preventDefault()})}}),r(M,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,p,h,m=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",m),y.collapsed||
(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",m)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){h=t,t=t.nextSibling,r.remove(h);continue}p||(p=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(p,t),g=!0),h=t,t=t.nextSibling,p.appendChild(h)}else p=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(P,[E,g,p],function(e,n,r){var i=r.each,o=r.extend,a=r.map,s=r.inArray,l=r.explode,c=n.gecko,u=n.ie,d=!0,f
=!1;return function(r){function p(e,t,n){var r;return e=e.toLowerCase(),(r=N.exec[e])?(r(e,t,n),d):f}function h(e){var t;return e=e.toLowerCase(),(t=N.state[e])?t(e):-1}function m(e){var t;return e=e.toLowerCase(),(t=N.value[e])?t(e):f}function g(e,t){t=t||"exec",i(e,function(e,n){i(n.toLowerCase().split(","),function(n){N[t][n]=e})})}function v(e,n,i){return n===t&&(n=f),i===t&&(i=null),r.getDoc().execCommand(e,n,i)}function y(e){return k.match(e)}function b(e,n){k.toggle(e,n?{value:n}:t),r.nodeChanged()}function C(e){S=_.getBookmark(e)}function x(){_.moveToBookmark(S)}var w=r.dom,_=r.selection,N={state:{},exec:{},value:{}},E=r.settings,k=r.formatter,S;o(this,{execCommand:p,queryCommandState:h,queryCommandValue:m,addCommands:g}),g({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){r.undoManager.add()},"Cut,Copy,Paste":function(e){var t=r.getDoc(),i;try{v(e)}catch(o){i=d}
if(i||!t.queryCommandSupported(e)){var a=r.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");n.mac&&(a=a.replace(/Ctrl\+/g,"\u2318+")),r.windowManager.alert(a)}},unlink:function(){if(_.isCollapsed()){var e=_.getNode();return"A"==e.tagName&&r.dom.remove(e,!0),void 0}k.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t=e.substring(7);"full"==t&&(t="justify"),i("left,center,right,justify".split(","),function(e){t!=e&&k.remove("align"+e)}),b("align"+t),p("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;v(e),t=w.getParent(_.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(C(),w.split(n,t),x()))},"Bold,Italic,Underline,Striketh
rough,Superscript,Subscript":function(e){b(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){b(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=l(E.font_size_style_values),r=l(E.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),b(e,n)},RemoveFormat:function(e){k.remove(e)},mceBlockQuote:function(){b("blockquote")},FormatBlock:function(e,t,n){return b(n||"p")},mceCleanup:function(){var e=_.getBookmark();r.setContent(r.getContent({cleanup:d}),{cleanup:d}),_.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var i=n||_.getNode();i!=r.getBody()&&(C(),r.dom.remove(i,d),x())},mceSelectNodeDepth:function(e,t,n){var i=0;w.getParent(_.getNode(),function(e){return 1==e.nodeType&&i++==n?(_.select(e),f):void 0},r.getBody())},mceSelectNode:function(e,t,n){_.select(n)},mceInsertContent:function(t,n,i){function o(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=_.getRng(!0),r=n.startContainer,i=n.star
tOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i<r.length?e=e.replace(/ (<br>|)$/," "):t("nextSibling")||(e=e.replace(/( | )(<br>|)$/," "))),e}var a,s,l,c,d,f,p,h,m,g,v;/^ | $/.test(i)&&(i=o(i)),a=r.parser,s=new e({},r.schema),v='<span id="mce_marker" data-mce-type="bookmark">ÈB;</span>',f={content:i,format:"html",selection:!0},r.fire("BeforeSetContent",f),i=f.content,-1==i.indexOf("{$caret}")&&(i+="{$caret}"),i=i.replace(/\{\$caret\}/,v),h=_.getRng();var y=h.startContainer||(h.parentElement?h.parentElement():null),b=r.getBody();y===b&&_.isCollapsed()&&w.isBlock(b.firstChild)&&w.isEmpty(b.firstChild)&&(h=w.createRng(),h.setStart(b.firstChild,0),h.setEnd(b.firstChild,0)
,_.setRng(h)),_.isCollapsed()||r.getDoc().execCommand("Delete",!1,null),l=_.getNode();var C={context:l.nodeName.toLowerCase()};if(d=a.parse(i,C),m=d.lastChild,"mce_marker"==m.attr("id"))for(p=m,m=m.prev;m;m=m.walk(!0))if(3==m.type||!w.isBlock(m.name)){m.parent.insert(p,m,"br"===m.name);break}if(C.invalid){for(_.setContent(v),l=_.getNode(),c=r.getBody(),9==l.nodeType?l=m=c:m=l;m!==c;)l=m,m=m.parentNode;i=l==c?c.innerHTML:w.getOuterHTML(l),i=s.serialize(a.parse(i.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return s.serialize(d)}))),l==c?w.setHTML(c,i):w.setOuterHTML(l,i)}else i=s.serialize(d),m=l.firstChild,g=l.lastChild,!m||m===g&&"BR"===m.nodeName?w.setHTML(l,i):_.setContent(i);p=w.get("mce_marker"),_.scrollIntoView(p),h=w.createRng(),m=p.previousSibling,m&&3==m.nodeType?(h.setStart(m,m.nodeValue.length),u||(g=p.nextSibling,g&&3==g.nodeType&&(m.ap
pendData(g.data),g.parentNode.removeChild(g)))):(h.setStartBefore(p),h.setEndBefore(p)),w.remove(p),_.setRng(h),r.fire("SetContent",f),r.addVisual()},mceInsertRawHTML:function(e,t,n){_.setContent("tiny_mce_marker"),r.setContent(r.getContent().replace(/tiny_mce_marker/g,function(){return n}))},mceToggleFormat:function(e,t,n){b(n)},mceSetContent:function(e,t,n){r.setContent(n)},"Indent,Outdent":function(e){var t,n,r;t=E.indentation,n=/[a-z%]+$/i.exec(t),t=parseInt(t,10),h("InsertUnorderedList")||h("InsertOrderedList")?v(e):(E.forced_root_block||w.getParent(_.getNode(),w.isBlock)||k.apply("div"),i(_.getSelectedBlocks(),function(i){var o;"LI"!=i.nodeName&&(o="rtl"==w.getStyle(i,"direction",!0)?"paddingRight":"paddingLeft","outdent"==e?(r=Math.max(0,parseInt(i.style[o]||0,10)-t),w.setStyle(i,o,r?r+n:"")):(r=parseInt(i.style[o]||0,10)+t+n,w.setStyle(i,o
,r)))}))},mceRepaint:function(){if(c)try{C(d),_.getSel()&&_.getSel().selectAllChildren(r.getBody()),_.collapse(d),x()}catch(e){}},InsertHorizontalRule:function(){r.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){r.hasVisual=!r.hasVisual,r.addVisual()},mceReplaceContent:function(e,t,n){r.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,_.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=w.getParent(_.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||k.remove("link"),n.href&&k.apply("link",n,r)},selectAll:function(){var e=w.getRoot(),t;_.getRng().setStart?(t=w.createRng(),t.setStart(e,0),t.setEnd(e,e.childNodes.length),_.setRng(t)):(t=_.getRng(),t.item||(t.moveToElementText(e),t.select()))},"delete":function(){v("Delete");var e=r
.getBody();w.isEmpty(e)&&(r.setContent(""),e.firstChild&&w.isBlock(e.firstChild)?r.selection.setCursorLocation(e.firstChild,0):r.selection.setCursorLocation(e,0))},mceNewDocument:function(){r.setContent("")}}),g({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=_.isCollapsed()?[w.getParent(_.getNode(),w.isBlock)]:_.getSelectedBlocks(),r=a(n,function(e){return!!k.matchNode(e,t)});return-1!==s(r,d)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return y(e)},mceBlockQuote:function(){return y("blockquote")},Outdent:function(){var e;if(E.inline_styles){if((e=w.getParent(_.getStart(),w.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return d;if((e=w.getParent(_.getEnd(),w.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return d}return h("InsertUnorderedList")||h("InsertOrderedList")||!E.inline_styles&
&!!w.getParent(_.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=w.getParent(_.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),g({"FontSize,FontName":function(e){var t=0,n;return(n=w.getParent(_.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),g({Undo:function(){r.undoManager.undo()},Redo:function(){r.undoManager.redo()}})}}),r(O,[p],function(e){function t(e,i){var o=this,a,s;if(e=r(e),i=o.settings=i||{},/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return o.source=e,void 0;var l=0===e.indexOf("//");0!==e.indexOf("/")||l||(e=(i.base_uri?i.base_uri.protocol||"http":&q
uot;http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(s=i.base_uri?i.base_uri.path:new t(location.href).directory,e=""===i.base_uri.protocol?"//mce_host"+o.toAbsPath(s,e):(i.base_uri&&i.base_uri.protocol||"http")+"://mce_host"+o.toAbsPath(s,e)),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),o[t]=r}),a=i.base_uri,a&&(o.protocol||(o.protocol=a.protocol),o.userInfo||(o.userI
nfo=a.userInfo),o.port||"mce_host"!==o.host||(o.port=a.port),o.host&&"mce_host"!==o.host||(o.host=a.host),o.source=""),l&&(o.protocol="")}var n=e.each,r=e.trim;return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol&&""!==e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(this.host==e.host&&this.protocol==e.protocol?n:0)},toR
elPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.length<n.length)for(o=0,a=n.length;a>o;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="
;/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return(!n.source||e)&&(t="",e||(t+=n.protocol?n.protocol+"://":"//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t}),r(I,[p],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r;if(!o&&(r=this,r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){t=t;for(var n
in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));
+for(d in e)f=e[d],u[d]="function"==typeof f&&c[d]?s(d,f):f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(F,[I],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.hasClass(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="
;===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.psuedo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a<n.length;a++)">"!=n[a]&&e.push(c(n[a],[],">"===n
[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,p,h;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,h=e,p=0,i=o-1;i>=0;i--)for(c=a[i];h;){if(c.psuedo)for(f=h.parent().items(),u=d=f.length;u--&&f[u]!==h;);for(s=0,l=c.length;l>s;s++)if(!c[s](h,u,d)){s=l+1;break}if(s===l){p++;break}if(i===o-1)break;h=h.parent()}if(p===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(z,[p,F,I],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,i
nit:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].hasClass(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},
exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this}},e.each("fire on off show hide addClass removeClass append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(W,[p,v],function(e,t){return{id:function(){return t.DOM.uniqueId()},createFragment:function(e){return t.DOM.createFragment(e)},getWindowSize:function(){return t.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e
.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,n){return t.DOM.getPos(e,n)},getViewPort:function(e){return t.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,n){return t.DOM.addClass(e,n)},removeClass:function(e,n){return t.DOM.removeClass(e,n)},hasClass:function(e,n){return t.DOM.hasClass(e,n)},toggleClass:function(e,n,r){return t.DOM.toggleClass(e,n,r)},css:function(e,n,r){return t.DOM.setStyle(e,n,r)},on:function(e,n,r,i){return t.DOM.bind(e,n,r,i)},off:function(e,n,r){return t.DOM.unbind(e,n,r)},fire:function(e,n,r){return t.DOM.fire(e,n,r)},innerHtml:function(e,n){t.DOM.setHTML(e,n)}}}),r(V,[I,p,z,W],function(e,t,n,r){var i=t.makeMap("focusin focusout scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave wheel keydown keypress keyup contextmenu"," "),o={},a="onmousewheel"in document,s=!1,l=e.extend({Statics:{controlIdLook
up:{},elementIdCache:o},isRtl:function(){return l.rtl},classPrefix:"mce-",init:function(e){var n=this,i,o;if(n.settings=e=t.extend({},n.Defaults,e),n._id=r.id(),n._text=n._name="",n._width=n._height=0,n._aria={role:e.role},i=e.classes)for(i=i.split(" "),i.map={},o=i.length;o--;)i.map[i[o]]=!0;n._classes=i||[],n.visible(!0),t.each("title text width height name classes visible disabled active value".split(" "),function(t){var r=e[t],i;r!==i?n[t](r):n["_"+t]===i&&(n["_"+t]=!1)}),n.on("click",function(){return n.disabled()?!1:void 0}),e.classes&&t.each(e.classes.split(" "),function(e){n.addClass(e)}),n.settings=e,n._borderBox=n.parseBox(e.border),n._paddingBox=n.parseBox(e.padding),n._marginBox=n.parseBox(e.margin),e.hidden&&n.hide()},Properties:"parent,title,text,width,height,disabled,active,name,value",Methods:"renderHtml",getContainerElm:function(){ret
urn document.body},getParentCtrl:function(e){for(var t;e&&!(t=l.controlIdLookup[e.id]);)e=e.parentNode;return t},parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},borderBox:function(){return this._borderBox},paddingBox:function(){return this._paddingBox},marginBox:function(){return this._marginBox},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}},in
itLayoutRect:function(){var e=this,t=e.settings,n,i,o=e.getEl(),a,s,l,c,u,d,f,p;n=e._borderBox=e._borderBox||e.measureBox(o,"border"),e._paddingBox=e._paddingBox||e.measureBox(o,"padding"),e._marginBox=e._marginBox||e.measureBox(o,"margin"),p=r.getSize(o),d=t.minWidth,f=t.minHeight,l=d||p.width,c=f||p.height,a=t.width,s=t.height,u=t.autoResize,u="undefined"!=typeof u?u:!a&&!s,a=a||l,s=s||c;var h=n.left+n.right,m=n.top+n.bottom,g=t.maxWidth||65535,v=t.maxHeight||65535;return e._layoutRect=i={x:t.x||0,y:t.y||0,w:a,h:s,deltaW:h,deltaH:m,contentW:a-h,contentH:s-m,innerW:a-h,innerH:s-m,startMinWidth:d||0,startMinHeight:f||0,minW:Math.min(l,g),minH:Math.min(c,v),maxW:g,maxH:v,autoResize:u,scrollW:0},e._lastLayoutRect={},i},layoutRect:function(e){var t=this,n=t._layoutRect,r,i,o,a,s,c;return n||(n=t.initLayoutRect()),e?(o=n.deltaW,a=n.deltaH,e.x!==s&&(n.x=e.x),e.y!==s&&(n.y=e.y),e.minW!==s&&(n.minW=e.minW),e.minH!==s&a
mp;&(n.minH=e.minH),i=e.w,i!==s&&(i=i<n.minW?n.minW:i,i=i>n.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=i<n.minH?n.minH:i,i=i>n.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=i<n.minW-o?n.minW-o:i,i=i>n.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=i<n.minH-a?n.minH-a:i,i=i>n.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,(r.x!==n.x||r.y!==n.y||r.w!==n.w||r.h!==n.h)&&(c=l.repaintControls,c&&c.map&&!c.map[t._id]&&(c.push(t),c.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o=0,a=0,s,l;l=document.createRange?function(e){return e}:Math.round,t=e.getEl().style,r=e._layoutRect,s=e._lastRepaintRect||{},i=e._borderBox,o=i.left+i.right,a=i.top+i.bottom,r.x!==s.x&&(t.left=l(r.x)+"px",s.x=r.x),r.y!==s.y&&a
mp;(t.top=l(r.y)+"px",s.y=r.y),r.w!==s.w&&(t.width=l(r.w-o)+"px",s.w=r.w),r.h!==s.h&&(t.height=l(r.h-a)+"px",s.h=r.h),e._hasBody&&r.innerW!==s.innerW&&(n=e.getEl("body").style,n.width=l(r.innerW)+"px",s.innerW=r.innerW),e._hasBody&&r.innerH!==s.innerH&&(n=n||e.getEl("body").style,n.height=l(r.innerH)+"px",s.innerH=r.innerH),e._lastRepaintRect=s,e.fire("repaint",{},!1)},on:function(e,t){function n(e){var t,n;return function(i){return t||r.parents().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t.call(n,i)}}var r=this,o,a,s,l;if(t)for("string"==typeof t&&(t=n(t)),s=e.toLowerCase().split(" "),l=s.length;l--;)e=s[l],o=r._bindings,o||(o=r._bindings={}),a=o[e],a||(a=o[e]=[]),a.push(t),i[e]&&(r._nativeEvents?r._nativeEvents[e]=!0:r._nativeEvents={name:!0},r._rendered&&r.bindPend
ingEvents());return r},off:function(e,t){var n=this,r,i=n._bindings,o,a,s,l;if(i)if(e)for(s=e.toLowerCase().split(" "),r=s.length;r--;){if(e=s[r],o=i[e],!e){for(a in i)i[a].length=0;return n}if(o)if(t)for(l=o.length;l--;)o[l]===t&&o.splice(l,1);else o.length=0}else n._bindings=[];return n},fire:function(e,t,n){function r(){return!1}function i(){return!0}var o=this,a,s,l,c;if(e=e.toLowerCase(),t=t||{},t.type||(t.type=e),t.control||(t.control=o),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=i},t.stopPropagation=function(){t.isPropagationStopped=i},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=i},t.isDefaultPrevented=r,t.isPropagationStopped=r,t.isImmediatePropagationStopped=r),o._bindings&&(l=o._bindings[e]))for(a=0,s=l.length;s>a&&(t.isImmediatePropagationStopped()||l[a].call(o,t)!==!1);a++);if(n!==!1)for(c=o.parent();c&&!t.isPropagationStopped();)c.fire(e,t,!1),c=c.parent();return t},hasEventL
isteners:function(e){return e in this._bindings},parents:function(e){var t=this,r=new n;for(t=t.parent();t;t=t.parent())r.add(t);return e&&(r=r.filter(e)),r},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},findCommonAncestor:function(e,t){for(var n;e;){for(n=t;n&&e!=n;)n=n.parent();if(e==n)break;e=e.parent()}return e},hasClass:function(e,t){var n=this._classes[t||"control"];return e=this.classPrefix+e,n&&!!n.map[e]},addClass:function(e,t){var n=this,r,i;return e=this.classPrefix+e,r=n._classes[t||"control"],r||(r=[],r.map={},n._classes[t||"control"]=r),r.map[e]||(r.map[e]=e,r.push(e),n._rendered&&(i=n.getEl(t),i&&(i.className=r.join(" ")))),n},removeClass:function(e,t){var n=this,r,i,o;if(e=this.classPrefix+e,r=n._classes[t||"control"],r&&r.map[e])for(delete r.map[e],i=r.length;i--;)r[i]===
e&&r.splice(i,1);return n._rendered&&(o=n.getEl(t),o&&(o.className=r.join(" "))),n},toggleClass:function(e,t,n){var r=this;return t?r.addClass(e,n):r.removeClass(e,n),r},classes:function(e){var t=this._classes[e||"control"];return t?t.join(" "):""},innerHtml:function(e){return r.innerHtml(this.getEl(),e),this},getEl:function(e,t){var n,i=e?this._id+"-"+e:this._id;return n=o[i]=(t===!0?null:o[i])||r.get(i)},visible:function(e){var t=this,n;return"undefined"!=typeof e?(t._visible!==e&&(t._rendered&&(t.getEl().style.display=e?"":"none"),t._visible=e,n=t.parent(),n&&(n._lastRect=null),t.fire(e?"show":"hide")),t):t._visible},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=
this,r=n.getEl();return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n._rendered&&("label"==e&&r.setAttribute("aria-labeledby",n._id),r.setAttribute("role"==e?e:"aria-"+e,t)),n)},encode:function(e,t){return t!==!1&&l.translate&&(e=l.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),i,a;if(e.items){var s=e.items().toArray();for(a=s.length;a--;)s[a].remove()}if(n&&n.items&&(i=[],n.items().each(function(t){t!==e&&i.push(t)}),n.items().set(i),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&r.off(t),delete l.controlIdLookup[e._id],dele
te o[e._id],t&&t.parentNode){var c=t.getElementsByTagName("*");for(a=c.length;a--;)delete o[c[a].id];t.parentNode.removeChild(t)}return e},renderBefore:function(e){var t=this;return e.parentNode.insertBefore(r.createFragment(t.renderHtml()),e),t.postRender(),t},renderTo:function(e){var t=this;return e=e||t.getContainerElm(),e.appendChild(r.createFragment(t.renderHtml())),t.postRender(),t},postRender:function(){var e=this,t=e.settings,n,i,o,a,s;for(a in t)0===a.indexOf("on")&&e.on(a.substr(2),t[a]);if(e._eventsRoot){for(o=e.parent();!s&&o;o=o.parent())s=o._eventsRoot;if(s)for(a in s._nativeEvents)e._nativeEvents[a]=!0}e.bindPendingEvents(),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e._visible||r.css(e.getEl(),"display","none"),e.settings.border&&(i=e.borderBox(),r.css(e.getEl(),{"border-top-width":i.top,"border-right-width":i.r
ight,"border-bottom-width":i.bottom,"border-left-width":i.left})),l.controlIdLookup[e._id]=e;for(var c in e._aria)e.aria(c,e._aria[c]);e.fire("postrender",{},!1)},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},bindPendingEvents:function(){function e(e){var t=o.getParentCtrl(e.target);t&&t.fire(e.type,e)}function t(){var e=d._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),d._lastHoverCtrl=null)}function n(e){var t=o.getParentCtrl(e.target),n=d._lastHoverCt
rl,r=0,i,a,s;if(t!==n){if(d._lastHoverCtrl=t,a=t.parents().toArray().reverse(),a.push(t),n){for(s=n.parents().toArray().reverse(),s.push(n),r=0;r<s.length&&a[r]===s[r];r++);for(i=s.length-1;i>=r;i--)n=s[i],n.fire("mouseleave",{target:n.getEl()})}for(i=r;i<a.length;i++)t=a[i],t.fire("mouseenter",{target:t.getEl()})}}function i(e){e.preventDefault(),"mousewheel"==e.type?(e.deltaY=-1/40*e.wheelDelta,e.wheelDeltaX&&(e.deltaX=-1/40*e.wheelDeltaX)):(e.deltaX=0,e.deltaY=e.detail),e=o.fire("wheel",e)}var o=this,l,c,u,d,f,p;if(o._rendered=!0,f=o._nativeEvents){for(u=o.parents().toArray(),u.unshift(o),l=0,c=u.length;!d&&c>l;l++)d=u[l]._eventsRoot;for(d||(d=u[u.length-1]||o),o._eventsRoot=d,c=l,l=0;c>l;l++)u[l]._eventsRoot=d;for(p in f){if(!f)return!1;"wheel"!==p||s?("mouseenter"===p||"mouseleave"===p?d._hasMouseEnter||(r.on(d.getEl(),"mouseleave",t),r.on(d.getEl(),"mouse
over",n),d._hasMouseEnter=1):d[p]||(r.on(d.getEl(),p,e),d[p]=!0),f[p]=!1):a?r.on(o.getEl(),"mousewheel",i):r.on(o.getEl(),"DOMMouseScroll",i)}}},reflow:function(){return this.repaint(),this}});return l}),r(U,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(q,[V,z,F,U,p,W],function(e,t,n,r,i,o){var a={};return e.extend({layout:"",innerClass:"container-inner",init:function(e){var n=this;n._super(e),e=n.settings,n._fixed=e.fixed,n._items=new t,n.isRtl()&&n.addClass("rtl"),n.addClass("container"),n.addClass("container-body","body"),e.containerCls&
&n.addClass(e.containerCls),n._layout=r.create((e.layout||n.layout)+"layout"),n.settings.items&&n.add(n.settings.items),n._hasBody=!0},items:function(){return this._items},find:function(e){return e=a[e]=a[e]||new n(e),e.find(this)},add:function(e){var t=this;return t.items().add(t.create(e)).parent(t),t},focus:function(){var e=this;return e.keyNav?e.keyNav.focusFirst():e._super(),e},replace:function(e,t){for(var n,r=this.items(),i=r.length;i--;)if(r[i]===e){r[i]=t;break}i>=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,o,a=[];return i.isArray(t)||(t=[t]),i.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),o=i.extend({},n.settings.defaults,t),t.type=o.type=o.type||t.type||n.settings.defaultType||(o.defaults?o.defaults.type:null),t=r.create(o)),a.push(t))}),a},renderNew:function(){var e=this;return e
.items().each(function(t,n){var r,i;t.parent(e),t._rendered||(r=e.getEl("body"),i=o.createFragment(t.renderHtml()),r.hasChildNodes()&&n<=r.childNodes.length-1?r.insertBefore(i,r.childNodes[n]):r.appendChild(i),t.postRender())}),e._layout.applyClasses(e),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t<i.length-1&&(t+=1),t>=0&&t<i.length&&(o=i.slice(0,t).toArray(),a=i.slice(t).toArray(),i.set(o.concat(e,a))),r.renderNew()},fromJSON:function(e){var t=this;for(var n in e)t.find("#"+n).value(e[n]);return t},toJSON:function(){var e=this,t={};return e.find("*").each(function(e){var n=e.name(),r=e.value();n&&"undefined"!=typeof r&&(t[n]=r)}),t},preRender:function(){},renderHtml:
function(){var e=this,t=e._layout;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes()+'" role="'+this.settings.role+'"><div id="'+e._id+'-body" class="'+e.classes("body")+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e._rendered=!0,e.settings.style&&o.css(e.getEl(),e.settings.style),e.settings.border&&(t=e.borderBox(),o.css(e.getEl(),{"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(
),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t,n;if(this.visible()){for(e.repaintControls=[],e.repaintControls.map={},n=this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r($,[W],function(e){function t(){var e=document,t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}return function(n,r){function i(){return a.getElementById(r.handle||n)}var o,a=document,s,l,c,u,d,f;r=r||{},l=function(n){var l=t(),p,h;n.preventDefault(),s=n.button,p=i(),d=n.screenX,f=n.screenY,h=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue(&qu
ot;cursor"):p.runtimeStyle.cursor,o=a.createElement("div"),e.css(o,{position:"absolute",top:0,left:0,width:l.width,height:l.height,zIndex:2147483647,opacity:1e-4,background:"red",cursor:h}),a.body.appendChild(o),e.on(a,"mousemove",u),e.on(a,"mouseup",c),r.start(n)},u=function(e){return e.button!==s?c(e):(e.deltaX=e.screenX-d,e.deltaY=e.screenY-f,e.preventDefault(),r.drag(e),void 0)},c=function(t){e.off(a,"mousemove",u),e.off(a,"mouseup",c),o.parentNode.removeChild(o),r.stop&&r.stop(t)},this.destroy=function(){e.off(i())},e.on(i(),"mousedown",l)}}),r(j,[W,$],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,p,h,m,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),i.getEl("absend")&&e.css(i.getEl("absend"),y,i.layoutRect()[l]-1
),!c)return e.css(f,"display","none"),void 0;e.css(f,"display","block"),d=i.getEl("body"),p=i.getEl("scroll"+t+"t"),h=d["client"+s]-2*o,h-=n&&r?f["client"+u]:0,m=d["scroll"+s],g=h/m,v={},v[y]=d["offset"+a]+o,v[b]=h,e.css(f,v),v={},v[y]=d["scroll"+a]*g,v[b]=h*g,e.css(p,v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;i.getEl().appendChild(e.createFragment('<div id="'+u+'" class="'+d+"scrollbar "+d+"scrollbar-"+n+'"><div id="'+u+'t" class="'+d+'scrollbar-thumb"&g
t;</div></div>')),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e.addClass(e.get(u),d+"active")},drag:function(e){var t,u,d,f,p=i.layoutRect();u=p.contentW>p.innerW,d=p.contentH>p.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e.removeClass(e.get(u),d+"active")}})}i.addClass("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}
),e.on(i.getEl("body"),"scroll",n)),n())}}}),r(K,[q,j],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='<div id="'+e._id+'-body" class="'+e.classes("body")+'">'+t.renderHtml(e)+"</div>":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes()+'" hideFocus="1" tabIndex="-1">'+(e._preBodyHtml||"")+n+"</div>"}})}),r(Y,[W],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,p;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t._fixed&&(a-=f.x,s-=f.y),i=t.getEl(),p=e.getSize(i),l=p.width,c=p.height,p=e.getSize(n),u=p.width,d=p.height,r=(r||"").split(""),"b"===r[0]&a
mp;&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o<r.length;o++){var a=t(this,n,r[o]);if(this._fixed){if(a.x>0&&a.x+a.w<i.w&&a.y>0&&a.y+a.h<i.h)return r[o]}else if(a.x>i.x&&a.x+a.w<i.w+i.x&&a.y>i.y&&a.y+a.h<i.h+i.y)return r[o]}return r[0]},moveRel:function(e,n){"string"!=typeof n&&(n=this.testMoveRel(e,n));var r=t(this,e,n);return this.moveTo(r.x,r.y)},moveBy:function(e,t){var n=this,r=n.layoutRect();return n.moveTo(r.x+e,r.y+t),n},moveTo:function(t,n){function r(e,t,n){return 0>e?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.setti
ngs.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i._rendered?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(G,[W],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(X,[K,Y,G,W],function(e,t,n,r){function i(e){var t;for(t=s.length;t--;)s[t]===e&&s.splice(t,1);for(t=l.length;t--;)l[t]===e&&l.splice(t,1)}var o,a,s=[],l=[],c,u=e.extend({Mixins:[t,n],init:function(e){function t(){var e,t=u.zIndex||65535,n;if(l.length)for(e=0;e<l.length;e++)l[e].modal&&(t++,n=l[e]),l[e].getEl().style.zIndex=t,l[e].zIn
dex=t,t++;var i=document.getElementById(d.classPrefix+"modal-block");n?r.css(i,"z-index",n.zIndex-1):i&&(i.parentNode.removeChild(i),c=!1),u.currentZIndex=t}function n(e,t){for(;e;){if(e==t)return!0;e=e.parent()}}function i(e){function t(t,n){for(var r,i=0;i<s.length;i++)if(s[i]!=e)for(r=s[i].parent();r&&(r=r.parent());)r==e&&s[i].fixed(t).moveBy(0,n).repaint()}var n=r.getViewPort().y;e.settings.autofix&&(e._fixed?e._autoFixY>n&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY<n&&(e.fixed(!0).layoutRect({y:0}).repaint(),t(!0,n-e._autoFixY))))}var d=this;d._super(e),d._eventsRoot=d,d.addClass("floatpanel"),e.autohide&&(o||(o=function(e){var t,r=d.getParentCtrl(e.target);for(t=s.length;t--;){var i=s[t];if(i.settings.autohide){if(r&&(n(r,i)||i.parent()===r))continue;e=i.fire("autohide",{target:e.target}),e.isDe
faultPrevented()||i.hide()}}},r.on(document,"click",o)),s.push(d)),e.autofix&&(a||(a=function(){var e;for(e=s.length;e--;)i(s[e])},r.on(window,"scroll",a)),d.on("move",function(){i(this)})),d.on("postrender show",function(e){if(e.control==d){var n,i=d.classPrefix;d.modal&&!c&&(n=r.createFragment('<div id="'+i+'modal-block" class="'+i+"reset "+i+'fade"></div>'),n=n.firstChild,d.getContainerElm().appendChild(n),setTimeout(function(){r.addClass(n,i+"in"),r.addClass(d.getEl(),i+"in")},0),c=!0),l.push(d),t()}}),d.on("close hide",function(e){if(e.control==d){for(var n=l.length;n--;)l[n]===d&&l.splice(n,1);t()}}),d.on("show",function(){d.parents().each(function(e){return e._fixed?(d.fixed(!0),!1):void 0})}),e.popover&&(d._preBodyHtml='<div class="'+d.classPrefix+'arrow"></div>',d.addClass("popover")
.addClass("bottom").addClass(d.isRtl()?"end":"start"))},fixed:function(e){var t=this;if(t._fixed!=e){if(t._rendered){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.toggleClass("fixed",e),t._fixed=e}return t},show:function(){var e=this,t,n=e._super();for(t=s.length;t--&&s[t]!==e;);return-1===t&&s.push(e),n},hide:function(){return i(this),this._super()},hideAll:function(){u.hideAll()},close:function(){var e=this;return e.fire("close"),e.remove()},remove:function(){i(this),this._super()}});return u.hideAll=function(){for(var e=s.length;e--;){var t=s[e];t.settings.autohide&&(t.fire("cancel",{},!1),t.hide(),s.splice(e,1))}},u}),r(J,[W],function(e){return function(t){function n(){if(!h)if(h=[],d.find)d.find("*").each(function(e){e.canFocus&&h.push(e.getEl())});else for(var e=d.getEl().getElementsByTagName("*"),t=0;t<e.length;t++)e[t].id&&e[t]&am
p;&h.push(e[t])}function r(){return document.getElementById(m)}function i(e){return e=e||r(),e&&e.getAttribute("role")}function o(e){for(var t,n=e||r();n=n.parentNode;)if(t=i(n))return t}function a(e){var t=document.getElementById(m);return t?t.getAttribute("aria-"+e):void 0}function s(){var n=r();if(!n||"TEXTAREA"!=n.nodeName&&"text"!=n.type)return t.onAction?t.onAction(m):e.fire(r(),"click",{keyboard:!0}),!0}function l(){var e;t.onCancel?((e=r())&&e.blur(),t.onCancel()):t.root.fire("cancel")}function c(e){function r(e){for(var t=d?d.getEl():document.body;e&&e!=t;){if("none"==e.style.display)return!1;e=e.parentNode}return!0}var i=-1,o,a,l=[];for(n(),a=l.length,a=0;a<h.length;a++)r(h[a])&&l.push(h[a]);for(a=l.length;a--;)if(l[a].id===m){i=a;break}i+=e,0>i?i=l.length-1:i>=l.length&&(i=0),o=l[i],o.focus(),m=o.id,t.actOnFocus&&s()}function u(){var e
,r;for(r=i(t.root.getEl()),n(),e=h.length;e--;)if("toolbar"==r&&h[e].id===m)return h[e].focus(),void 0;h[0].focus()}var d=t.root,f=t.enableUpDown!==!1,p=t.enableLeftRight!==!1,h=t.items,m;return d.on("keydown",function(e){var n=37,r=39,u=38,d=40,h=27,m=14,g=13,v=32,y=9,b;switch(e.keyCode){case n:p&&(t.leftAction?t.leftAction():c(-1),b=!0);break;case r:p&&("menuitem"==i()&&"menu"==o()?a("haspopup")&&s():c(1),b=!0);break;case u:f&&(c(-1),b=!0);break;case d:f&&("menuitem"==i()&&"menubar"==o()?s():"button"==i()&&a("haspopup")?s():c(1),b=!0);break;case y:b=!0,e.shiftKey?c(-1):c(1);break;case h:b=!0,l();break;case m:case g:case v:b=s()}b&&(e.stopPropagation(),e.preventDefault())}),d.on("focusin",function(e){n(),m=e.target.id}),{moveFocus:c,focusFirst:u,cancel:l}}}),r(Q,[X,K,W,J,$],function(e,t,n,r,i){var o=e.ext
end({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e),n.isRtl()&&n.addClass("rtl"),n.addClass("window"),n._fixed=!0,e.buttons&&(n.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.addClass("foot"),n.statusbar.parent(n)),n.on("click",function(e){-1!=e.target.className.indexOf(n.classPrefix+"close")&&n.close()}),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o,a;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.
layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=Math.max(0,a.w/2-t.w/2),t.y=Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='<div id="'+n+'-head" class="'+r+'window-head"><div class="'+r+'title">
'+e.encode(i.title)+'</div><button type="button" class="'+r+'close" aria-hidden="true">×</button><div id="'+n+'-dragh" class="'+r+'dragh"></div></div>'),i.url&&(s='<iframe src="'+i.url+'" tabindex="-1"></iframe>'),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'<div id="'+n+'" class="'+e.classes()+'" hideFocus="1" tabIndex="-1">'+o+'<div id="'+n+'-body" class="'+e.classes("body")+'">'+s+"</div>"+a+"</div>"},fullscreen:function(e){var t=this,r=document.documentElement,i,o=t.classPrefix,a;if(e!=t._fullscreen)if(n.on(window,"resize",function(){var e;if(t._fullscreen)if(i)t._timer||(t._timer=setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),
t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(i=!0)}}),a=t.layoutRect(),t._fullscreen=e,e){t._initial={x:a.x,y:a.y,w:a.w,h:a.h},t._borderBox=t.parseBox("0"),t.getEl("head").style.display="none",a.deltaH-=a.headerH+2,n.addClass(r,o+"fullscreen"),n.addClass(document.body,o+"fullscreen"),t.addClass("fullscreen");
+var s=n.getWindowSize();t.moveTo(0,0).resizeTo(s.w,s.h)}else t._borderBox=t.parseBox(t.settings.border),t.getEl("head").style.display="",a.deltaH+=a.headerH,n.removeClass(r,o+"fullscreen"),n.removeClass(document.body,o+"fullscreen"),t.removeClass("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t=[],n,o,a;setTimeout(function(){e.addClass("in")},0),e.keyboardNavigation=new r({root:e,enableLeftRight:!1,enableUpDown:!1,items:t,onCancel:function(){e.close()}}),e.find("*").each(function(e){e.canFocus&&(o=o||e.settings.autofocus,n=n||e,"filepicker"==e.type?(t.push(e.getEl("inp")),e.getEl("open")&&t.push(e.getEl("open"))):t.push(e.getEl()))}),e.statusbar&&e.statusbar.find("*").each(function(e){e.canFocus&&(o=o||e.settings.autofocus,n=n||e,t.push(e.getEl
()))}),e._super(),e.statusbar&&e.statusbar.postRender(),!o&&n&&n.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){a={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(t){e.moveTo(a.x+t.deltaX,a.y+t.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()})},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t=e.classPrefix;e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),e._fullscreen&&(n.removeClass(document.documentElement,t+"fullscreen"),n.removeClass(document.body,t+"fullscreen"))}});return o}),r(Z,[Q],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",mult
iline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){var r,i=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}},{type:"button",text:"Cancel",onClick:function(e){e.control.parents()[1].close(),i(!1)}}];break;case t.YES_NO:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}];break;case t.YES_NO_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close()}}];break;default:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"
;center",align:"center",buttons:r,title:n.title,items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onClose:n.onClose}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(et,[Q,Z],function(e,t){return function(n){function r(){return o.length?o[o.length-1]:void 0}var i=this,o=[];i.windows=o,i.open=function(t,r){var i;return n.editorManager.activeEditor=n,t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit(
),i.close()}},{text:"Cancel",onclick:function(){i.close()}}]),i=new e(t),o.push(i),i.on("close",function(){for(var e=o.length;e--;)o[e]===i&&o.splice(e,1);n.focus()}),t.data&&i.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),i.features=t||{},i.params=r||{},n.nodeChanged(),i.renderTo(document.body).reflow()},i.alert=function(e,n,r){t.alert(e,function(){n&&n.call(r||this)})},i.confirm=function(e,n,r){t.confirm(e,function(e){n.call(r||this,e)})},i.close=function(){r()&&r().close()},i.getParams=function(){return r()?r().params:null},i.setParams=function(e){r()&&(r().params=e)}}}),r(tt,[T,B,C,m,g,p],function(e,t,n,r,i,o){return function(a){function s(e,t){try{a.getDoc().execCommand(e,!1,t)}catch(n){}}function l(){var e=a.getDoc().documentMode;return e?e:6}function c(e){return e.isDefaultPrevented()}function u(){function t(e){var t=new Mutat
ionObserver(function(){});o.each(a.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&a.dom.setAttrib(e,"style",e.getAttribute("style"))}),t.observe(a.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),a.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null);var n=a.selection.getRng(),r=n.startContainer.parentNode;o.each(t.takeRecords(),function(e){if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}o.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),z.remove(e,!0),i&&
;(n.setStart(i,t),n.setEnd(i,t),a.selection.setRng(n))}})}),t.disconnect(),o.each(a.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")})}var n=a.getDoc();window.MutationObserver&&(a.on("keydown",function(n){var r=n.keyCode==F,i=e.metaKeyPressed(n);if(!c(n)&&(r||n.keyCode==I)){var o=a.selection.getRng(),s=o.startContainer,l=o.startOffset;if(!i&&o.collapsed&&3==s.nodeType&&(r?l<s.data.length:l>0))return;n.preventDefault(),i&&a.selection.getSel().modify("extend",r?"forward":"backward","word"),t(r)}}),a.on("keypress",function(e){c(e)||W.isCollapsed()||!e.charCode||(e.preventDefault(),t(!0),a.selection.setContent(String.fromCharCode(e.charCode)))}),a.addCommand("Delete",function(){t()}),a.addCommand("ForwardDelete",function(){t(!0)}),a.on("dragstart",function(e){e.dataTransfer.setData("mc
e-internal",a.selection.getContent())}),a.on("drop",function(e){if(!c(e)){var r=e.dataTransfer.getData("mce-internal");r&&n.caretRangeFromPoint&&(e.preventDefault(),t(),a.selection.setRng(n.caretRangeFromPoint(e.x,e.y)),a.insertContent(r))}}),a.on("cut",function(e){!c(e)&&e.clipboardData&&(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",a.selection.getContent()),e.clipboardData.setData("text/plain",a.selection.getContent({format:"text"})),t(!0))}))}function d(){function e(e){var t=z.create("body"),n=e.cloneContents();return t.appendChild(n),W.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(a.getBody()),t.compareRanges(n,r)}var i=e(n),o=z.createRng();o.selectNode(a.getBody());var s=e(o);return i===s}a.on("keydown",function(e){var t=e.keyC
ode,r,i;if(!c(e)&&(t==F||t==I)){if(r=a.selection.isCollapsed(),i=a.getBody(),r&&!z.isEmpty(i))return;if(!r&&!n(a.selection.getRng()))return;e.preventDefault(),a.setContent(""),i.firstChild&&z.isBlock(i.firstChild)?a.selection.setCursorLocation(i.firstChild,0):a.selection.setCursorLocation(i,0),a.nodeChanged()}})}function f(){a.on("keydown",function(t){!c(t)&&65==t.keyCode&&e.metaKeyPressed(t)&&(t.preventDefault(),a.execCommand("SelectAll"))})}function p(){a.settings.content_editable||(z.bind(a.getDoc(),"focusin",function(){W.setRng(W.getRng())}),z.bind(a.getDoc(),"mousedown",function(e){e.target==a.getDoc().documentElement&&(a.getWin().focus(),W.setRng(W.getRng()))}))}function h(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===I&&W.isCollapsed()&&0===W.getRng(!0).startOffset){var t=W.getNode(),n=t.previousSibling;if("HR"==t.n
odeName)return z.remove(t),e.preventDefault(),void 0;n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(z.remove(n),e.preventDefault())}})}function m(){window.Range.prototype.getClientRects||a.on("mousedown",function(e){if(!c(e)&&"HTML"===e.target.nodeName){var t=a.getBody();t.blur(),setTimeout(function(){t.focus()},0)}})}function g(){a.on("click",function(e){e=e.target,/^(IMG|HR)$/.test(e.nodeName)&&W.getSel().setBaseAndExtent(e,0,e,1),"A"==e.nodeName&&z.hasClass(e,"mce-item-anchor")&&W.select(e),a.nodeChanged()})}function v(){function e(){var e=z.getAttribs(W.getStart().cloneNode(!1));return function(){var t=W.getStart();t!==a.getBody()&&(z.setAttrib(t,"style",null),O(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!W.isCollapsed()&&z.getParent(W.getStart(),z.isBlock)!=z.getParent(W.getEnd(),z.isBlock)}a.on("keypr
ess",function(n){var r;return c(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),a.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),z.bind(a.getDoc(),"cut",function(n){var r;!c(n)&&t()&&(r=e(),setTimeout(function(){r()},0))})}function y(){var e,n;a.on("selectionchange",function(){n&&(clearTimeout(n),n=0),n=window.setTimeout(function(){var n=W.getRng();e&&t.compareRanges(n,e)||(a.nodeChanged(),e=n)},50)})}function b(){document.body.setAttribute("role","application")}function C(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===I&&W.isCollapsed()&&0===W.getRng(!0).startOffset){var t=W.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function x(){l()>7||(s("RespectVisibilityInDesign",!0),a.contentStyles.push(".mceHideBrInPre pre br {
display: none}"),z.addClass(a.getBody(),"mceHideBrInPre"),U.addNodeFilter("pre",function(e){for(var t=e.length,r,i,o,a;t--;)for(r=e[t].getAll("br"),i=r.length;i--;)o=r[i],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new n("#text",3),o,!0).value="\n"}),q.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function w(){z.bind(a.getBody(),"mouseup",function(){var e,t=W.getNode();"IMG"==t.nodeName&&((e=z.getStyle(t,"width"))&&(z.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),z.setStyle(t,"width","")),(e=z.getStyle(t,"height"))&&(z.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"
;")),z.setStyle(t,"height","")))})}function _(){a.on("keydown",function(t){var n,r,i,o,s;if(!c(t)&&t.keyCode==e.BACKSPACE&&(n=W.getRng(),r=n.startContainer,i=n.startOffset,o=z.getRoot(),s=r,n.collapsed&&0===i)){for(;s&&s.parentNode&&s.parentNode.firstChild==s&&s.parentNode!=o;)s=s.parentNode;"BLOCKQUOTE"===s.tagName&&(a.formatter.toggle("blockquote",null,s),n=z.createRng(),n.setStart(r,0),n.setEnd(r,0),W.setRng(n))}})}function N(){function e(){a._refreshContentEditable(),s("StyleWithCSS",!1),s("enableInlineTableEditing",!1),V.object_resizing||s("enableObjectResizing",!1)}V.readonly||a.on("BeforeExecCommand MouseDown",e)}function E(){function e(){O(z.select("a"),function(e){var t=e.parentNode,n=z.getRoot();if(t.lastChild===e){for(;t&&!z.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}z.add(t,&q
uot;br",{"data-mce-bogus":1})}})}a.on("SetContent ExecCommand",function(t){("setcontent"==t.type||"mceInsertLink"===t.command)&&e()})}function k(){V.forced_root_block&&a.on("init",function(){s("DefaultParagraphSeparator",V.forced_root_block)})}function S(){a.on("Undo Redo SetContent",function(e){e.initial||a.execCommand("mceRepaint")})}function T(){a.on("keydown",function(e){var t;c(e)||e.keyCode!=I||(t=a.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),a.undoManager.beforeChange(),z.remove(t.item(0)),a.undoManager.add()))})}function R(){var e;l()>=10&&(e="",O("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),a.contentStyles.push(e+"{padding-right: 1px !important}"))}function A(){l()<9&&(U.addNodeFilter("noscript&qu
ot;,function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),q.addNodeFilter("noscript",function(e){for(var t=e.length,i,o,a;t--;)i=e[t],o=e[t].firstChild,o?o.value=r.decode(o.value):(a=i.attributes.map["data-mce-innertext"],a&&(i.attr("data-mce-innertext",null),o=new n("#text",3),o.value=a,o.raw=!0,i.append(o)))}))}function B(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),z.unbind(r,"mouseup",n),z.unbind(r,"mousemove",t),a=o=0}var r=z.doc,i=r.body,o,a,s;r.documentElem
ent.unselectable=!0,z.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(z.bind(r,"mouseup",n),z.bind(r,"mousemove",t),z.win.focus(),a.select())}})}function L(){a.on("keyup focusin",function(t){65==t.keyCode&&e.metaKeyPressed(t)||W.normalize()})}function D(){a.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function H(){a.inline||a.on("keydown",function(){document.activeElement==document.body&&a.getWin().focus()})}function M(){a.inline||(a.contentStyles.push("body {min-height: 150px}"),a.on("click",function(e){"HTML"==e.target.nodeName&&(a.execCommand("SelectAll"),a.selection.collapse(!0),a.nodeChanged())}))}function P(){i.mac&&a.on("keydown",function(t
){!e.metaKeyPressed(t)||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),a.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","word"))})}var O=o.each,I=e.BACKSPACE,F=e.DELETE,z=a.dom,W=a.selection,V=a.settings,U=a.parser,q=a.serializer,$=i.gecko,j=i.ie,K=i.webkit;C(),_(),d(),L(),K&&(u(),p(),g(),k(),i.iOS?(y(),H(),M()):f()),j&&i.ie<11&&(h(),b(),x(),w(),T(),R(),A(),B()),i.ie>=11&&M(),i.ie&&f(),$&&(h(),m(),v(),N(),E(),S(),D(),P())}}),r(nt,[p],function(e){function t(){return!1}function n(){return!0}var r="__bindings",i=e.makeMap("focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragstart dragend dragover draggesture dragdrop drop drag"," ");return{fire:function(e,i,o){var a=this,s,l,c,u,d;if(e=e.toLowerCase(),i=
i||{},i.type=e,i.target||(i.target=a),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=n},i.stopPropagation=function(){i.isPropagationStopped=n},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=n},i.isDefaultPrevented=t,i.isPropagationStopped=t,i.isImmediatePropagationStopped=t),a[r]&&(s=a[r][e]))for(l=0,c=s.length;c>l&&(s[l]=u=s[l],!i.isImmediatePropagationStopped());l++)if(u.call(a,i)===!1)return i.preventDefault(),i;if(o!==!1&&a.parent)for(d=a.parent();d&&!i.isPropagationStopped();)d.fire(e,i,!1),d=d.parent();return i},on:function(e,t){var n=this,o,a,s,l;if(t===!1&&(t=function(){return!1}),t)for(s=e.toLowerCase().split(" "),l=s.length;l--;)e=s[l],o=n[r],o||(o=n[r]={}),a=o[e],a||(a=o[e]=[],n.bindNative&&i[e]&&n.bindNative(e)),a.push(t);return n},off:function(e,t){var n=this,o,a=n[r],s,l,c,u;if(a)if(e)for(c=e.toLowerCase().split(" "),o=c.length;o--;){if(e=c[o],s=a[
e],!e){for(l in a)a[e].length=0;return n}if(s){if(t)for(u=s.length;u--;)s[u]===t&&s.splice(u,1);else s.length=0;!s.length&&n.unbindNative&&i[e]&&(n.unbindNative(e),delete a[e])}}else{if(n.unbindNative)for(e in a)n.unbindNative(e);n[r]=[]}return n},hasEventListeners:function(e){var t=this[r];return e=e.toLowerCase(),!(!t||!t[e]||0===t[e].length)}}}),r(rt,[p,g],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122};return function(o){var a=this,s={};o.on("keyup keypress keydown",function(e){(e.altKey||e.ctrlKey||e.metaKey)&&n(s,function(n){var r=t.mac?e.metaKey:e.ctrlKey;if(n.ctrl==r&&n.alt==e.altKey&&n.shift==e.shiftKey)return e.keyCode==n.keyCode||e.charCode&&e.charCode==n.charCode?(e.preventDefault(),"keydown"==e.type&&n.func.call(n.scope),!0):void 0})}),a.add=function(t,a,l,c){var u;return u=l,"string"==typeof l?l=function(){o.execCommand(u,!1,null)}:e.isArray(u)&&a
mp;(l=function(){o.execCommand(u[0],u[1],u[2])}),n(r(t.toLowerCase()),function(e){var t={func:l,scope:c||o,desc:o.translate(a),alt:!1,ctrl:!1,shift:!1};n(r(e,"+"),function(e){switch(e){case"alt":case"ctrl":case"shift":t[e]=!0;break;default:t.charCode=e.charCodeAt(0),t.keyCode=i[e]||e.toUpperCase().charCodeAt(0)}}),s[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t}),!0}}}),r(it,[v,b,C,k,E,A,L,D,H,M,P,O,y,l,et,x,_,tt,g,p,nt,rt],function(e,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w){function _(e,t){return"selectionchange"==t||"drop"==t?e.getDoc():!e.inline&&/^mouse|click|contextmenu/.test(t)?e.getDoc():e.getBody()}function N(e,t,r){var i=this,o,a;o=i.documentBaseUrl=r.documentBaseURL,a=r.baseURI,i.settings=t=T({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugin
s:"",document_base_url:o,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:!0,entity_encoding:"named",
url_converter:i.convertURL,url_converter_scope:i,ie7_compat:!0},t),n.language=t.language||"en",n.languageLoad=t.language_load,n.baseURL=r.baseURL,i.id=t.id=e,i.isNotDirty=!0,i.plugins={},i.documentBaseURI=new f(t.document_base_url||o,{base_uri:a}),i.baseURI=a,i.contentCSS=[],i.contentStyles=[],i.shortcuts=new w(i),i.execCommands={},i.queryStateCommands={},i.queryValueCommands={},i.loadedCSS={},i.suffix=r.suffix,i.editorManager=r,i.inline=t.inline,i.execCallback("setup",i),r.fire("SetupEditor",i)}var E=e.DOM,k=n.ThemeManager,S=n.PluginManager,T=C.extend,R=C.each,A=C.explode,B=C.inArray,L=C.trim,D=C.resolve,H=h.Event,M=b.gecko,P=b.ie;return N.prototype={render:function(){function e(){E.unbind(window,"ready",e),n.render()}function t(){var e=p.ScriptLoader;if(r.language&&"en"!=r.language&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r
.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!k.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",k.load(r.theme,t)}C.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),R(r.external_plugins,function(e,t){S.load(t,e),r.plugins+=" "+t}),R(r.plugins.split(/[ ,]/),function(e){if(e=L(e),e&&!S.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=S.dependencies(e);R(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=S.createUrl(t,e),S.load(e.resource,e)})}else S.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!H.domLoaded)return E.bind(window,"ready",e),void 0;if(n.getElement()&&b.contentE
ditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||E.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(E.insertAfter(E.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},E.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.isNotDirty=!0,a._mceOldSubmit(a)})),n.windowManager=new m(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=E.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",
function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),t()}},init:function(){function e(n){var r=S.get(n),i,o;i=S.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=L(n),r&&-1===B(h,n)&&(R(S.dependencies(n),function(t){e(t)}),o=new r(t,i),t.plugins[n]=o,o.init&&(o.init(t,i),h.push(n)))}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,p,h=[];if(t.rtl=this.editorManager.i18n.rtl,t.editorManager.add(t),n.aria_label=n.aria_label||E.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),l=k.get(n.theme),t.theme=new l(t,k.urls[n.theme]),t.theme.init&&t.theme.init(t,k.urls[n.theme]||t.documentBaseUrl.replace(/\/$/
,""))):t.theme=n.theme),R(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,f=/^[0-9\.]+(|px)$/i,f.test(""+i)&&(i=Math.max(parseInt(i,10)+(l.deltaWidth||0),100)),f.test(""+o)&&(o=Math.max(parseInt(o,10)+(l.deltaHeight||0),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(E.setStyles(l.sizeContainer||l.editorContainer,{wi2dth:i,h2eight:o}),o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContain
er.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&R(A(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();for(t.iframeHTML=n.doctype+"<html><head>",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+='<base href="'+t.documentBaseURI.getURI()+'" />'),!b.caretAfter&&n.ie7_compat&&(t.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'),t.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',p=0;p<t.contentCSS.length;p++){var m=t.contentCSS[p];t.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+m+'" />',t.loadedCSS[m]=!0}u=n.body
_id||"tinymce",-1!=u.indexOf("=")&&(u=t.getParam("body_id","","hash"),u=u[t.id]||u),d=n.body_class||"",-1!=d.indexOf("=")&&(d=t.getParam("body_class","","hash"),d=d[t.id]||""),t.iframeHTML+='</head><body id="'+u+'" class="mce-content-body '+d+'" onload="window.parent.tinymce.get(\''+t.id+"').fire('load');\"><br></body></html>";var g='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';if(document.domain!=location.hostname&&(c=g),s=E.add(l.iframeContainer,"iframe",{id:t.id+"_ifr",src:c||'javascript:""',frameBorder:"0",allowTransparency:"true",title:t.editorManager.tra
nslate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}}),P)try{t.getDoc()}catch(v){s.src=c=g}t.contentAreaContainer=l.iframeContainer,l.editorContainer&&(E.get(l.editorContainer).style.display=t.orgDisplay),E.get(t.id).style.display="none",E.setAttrib(t.id,"aria-hidden",!0),c||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,o=n.settings,f=E.get(n.id),p=n.getDoc(),h,m;o.inline||(n.getElement().style.visibility=n.orgVisibility),t||o.content_editable||(p.open(),p.write(n.iframeHTML),p.close()),o.content_editable&&(n.on("remove",function(){var e=this.getBody();E.removeClass(e,"mce-content-body"),E.removeClass(e,"mce-edit-focus"),E.setAttrib(e,"tabIndex",null),E.setAttrib(e,"contentEditable",null)}),E.addClass(f,"mce-content-body"),f.tabIndex=-1,n.content
Document=p=o.content_document||document,n.contentWindow=o.content_window||window,n.bodyElement=f,o.content_document=o.content_window=null,o.root_name=f.nodeName.toLowerCase()),h=n.getBody(),h.disabled=!0,o.readonly||(n.inline&&"static"==E.getStyle(h,"position",!0)&&(h.style.position="relative"),h.contentEditable=n.getParam("content_editable_state",!0)),h.disabled=!1,n.schema=new g(o),n.dom=new e(p,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:o.force_hex_style_colors,class_filter:o.class_filter,update_styles:!0,root_element:o.content_editable?n.id:null,collect:o.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new v(o,n.schema),n.parser.addAttributeFilter("src,href,style",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)i=e[r],a=i.attr(t),s="data-mce-"+t,i.attributes.map[s]||("style"===t?i.attr(s,o.serializeStyle(o
.parseStyle(a),i.name)):i.attr(s,n.convertURL(a,t,i.name)))}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("type","mce-"+(n.attr("type")||"text/javascript"))}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,i,o=n.schema.getNonEmptyElements();t--;)i=e[t],i.isEmpty(o)&&(i.empty().append(new r("br",1)).shortEnded=!0)}),n.serializer=new i(o,n),n.selection=new a(n.dom,n.getWin(),n.serializer,n),n.formatter=new s(n),n.undoManager=new l(n),n.forceBlocks=new u(n),n.enterKey=new c(n),n.editorCommands=new d(n),n.fire("PreInit"),o.browser_spellcheck||o.gecko_spellcheck||(p.body.spellcheck=!1,E.setAttrib(h,"spellcheck","false")),n.fire("Po
stRender"),n.quirks=y(n),o.directionality&&(h.dir=o.directionality),o.nowrap&&(h.style.whiteSpace="nowrap"),o.protect&&n.on("BeforeSetContent",function(e){R(o.protect,function(t){e.content=e.content.replace(t,function(e){return"<!--mce:protected "+escape(e)+"-->"})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),o.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,R(n._pendingNativeEvents,function(e){n.dom.bind(_(n,e),e,function(e){n.fire(e.type,e)})}),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.contentStyles.length>0&&(m=""
;,R(n.contentStyles,function(e){m+=e+"\r\n"}),n.dom.addStyle(m)),R(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),o.auto_focus&&setTimeout(function(){var e=n.editorManager.get(o.auto_focus);e.selection.select(e.getBody(),1),e.selection.collapse(1),e.getBody().focus(),e.getWin().focus()},100),f=p=h=null},focus:function(e){var t,n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l;e||(o=r.getRng(),o.item&&(a=o.item(0)),n._refreshContentEditable(),i||(b.opera||n.getBody().focus(),n.getWin().focus()),(M||i)&&(l=n.getBody(),l.setActive&&b.ie<11?l.setActive():l.focus(),i&&r.normalize()),a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())),n.editorManager.activeEditor!=n&&((t=n.editorManager.activeEditor)&&t.fire("deactivate",{relatedTarget:n}),n.fire("activate",{relatedTarget:t})),n.editorManager.activeEdit
or=n},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?D(r):0,n=D(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?R(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(&
quot;,"),function(e){e=e.split("="),i[L(e[0])]=e.length>1?L(e[1]):L(e)}):i=r,i):r},nodeChanged:function(){var e=this,t=e.selection,n,r,i;e.initialized&&!e.settings.disable_nodechange&&(i=e.getBody(),n=t.getStart()||i,n=P&&n.ownerDocument!=e.getDoc()?e.getBody():n,"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),r=[],e.dom.getParent(n,function(e){return e===i?!0:(r.push(e),void 0)}),e.fire("NodeChange",{element:n,parents:r}))},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addCommand:function(e,t,n){this.execCommands[e]={func:t,scope:n||this}},addQueryStateHandler:function(e,t,n){this.queryStateCommands[e]={func:t,scope:n
||this}},addQueryValueHandler:function(e,t,n){this.queryValueCommands[e]={func:t,scope:n||this}},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){var i=this,o=0,a;return/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||r&&r.skip_focus||i.focus(),r=T({},r),r=i.fire("BeforeExecCommand",{command:e,ui:t,value:n}),r.isDefaultPrevented()?!1:(a=i.execCommands[e])&&a.func.call(a.scope,t,n)!==!0?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):(R(i.plugins,function(r){return r.execCommand&&r.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),o=!0,!1):void 0}),o?o:i.theme&&i.theme.execCommand&&i.theme.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):i.editorCommands.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):(i.getDoc().execCommand(e,t,n),i.fire("ExecCommand",{c
ommand:e,ui:t,value:n}),void 0))},queryCommandState:function(e){var t=this,n,r;if(!t._isHidden()){if((n=t.queryStateCommands[e])&&(r=n.func.call(n.scope),r!==!0))return r;if(r=t.editorCommands.queryCommandState(e),-1!==r)return r;try{return t.getDoc().queryCommandState(e)}catch(i){}}},queryCommandValue:function(e){var n=this,r,i;if(!n._isHidden()){if((r=n.queryValueCommands[e])&&(i=r.func.call(r.scope),i!==!0))return i;if(i=n.editorCommands.queryCommandValue(e),i!==t)return i;try{return n.getDoc().queryCommandValue(e)}catch(o){}}},show:function(){var e=this;E.show(e.getContainer()),E.hide(e.id),e.load(),e.fire("show")},hide:function(){var e=this,t=e.getDoc();P&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),E.hide(e.getContainer()),E.setStyle(e.id,"display",e.orgDisplay),e.fire("hide")},isHidden:function(){return!E.isHidden(this.id)},setProgressState:function(e,t){this.fire("ProgressState",{
state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(n.innerHTML=r,(i=E.getParent(t.id,"form"))&&R(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&(t.isNotDirty=!0),r},setContent:function(e,t){var n=this,r=n.getBody(),i;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())
?(e=P&&11>P?"":'<br data-mce-bogus="1">',e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):(!P||11>P)&&(e='<br data-mce-bogus="1">'),r.innerHTML=e,n.fire("SetContent",t)):("raw"!==t.format&&(e=new o({},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=L(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content
+},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?r.innerHTML:"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),e.content="text"!=e.format?L(n):n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e){this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},getContainer:function(){var e=this;return e.container||(e.container=E.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return E.get(this.settings.content_element||this.id)},getWin:function(){var e=this,t;return e.contentWindow||(t=E.get(e.id+"_ifr"),t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.conten
tDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),R(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),t&&"0"!=t||(n.hasVisual?i.addClass(e,o):i.removeClass(e,o)),void 0;case"A":return i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id
,o="mce-item-anchor",t&&(n.hasVisual?i.addClass(e,o):i.removeClass(e,o))),void 0}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;if(!e.removed){e.removed=1,e.hasHiddenInput&&E.remove(e.getElement().nextSibling);var t=e.getDoc();P&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),E.setStyle(e.id,"display",e.orgDisplay),e.settings.content_editable||(H.unbind(e.getWin()),H.unbind(e.getDoc()));var n=e.getContainer();H.unbind(e.getBody()),H.unbind(n),e.fire("remove"),e.editorManager.remove(e),E.remove(n),e.destroy()}},bindNative:function(e){var t=this;t.settings.readonly||(t.initialized?t.dom.bind(_(t,e),e,function(n){t.fire(e,n)}):t._pendingNativeEvents?t._pendingNativeEvents.push(e):t._pendingNativeEvents=[e])},unbindNative:function(e){var t=this;t.initialized&&t.dom.unbind(e)},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.remov
ed)return t.remove(),void 0;e&&M&&(H.unbind(t.getDoc()),H.unbind(t.getWin()),H.unbind(t.getBody())),e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),E.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=null,t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},_refreshContentEditable:function(){var e=this,t,n;e._isHidden()&&(t=e.getBody(),n=t.parentNode,n.removeChild(t),n.appendChild(t),t.focus())},_isHidden:function(){var e;return M?(e=this.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}},T(N.prototype,x),N}),r(ot,[],function(){var e={};return{rtl:!1
,add:function(t,n){for(var r in n)e[r]=n[r];this.rtl=this.rtl||"rtl"===e._dir},translate:function(t){if("undefined"==typeof t)return t;if("string"!=typeof t&&t.raw)return t.raw;if(t.push){var n=t.slice(1);t=(e[t[0]]||t[0]).replace(/\{([^\}]+)\}/g,function(e,t){return n[t]})}return e[t]||t},data:e}}),r(at,[v,g],function(e,t){function n(r){function i(){try{return document.activeElement}catch(e){return document.body}}function o(e){return e&&e.startContainer?{startContainer:e.startContainer,startOffset:e.startOffset,endContainer:e.endContainer,endOffset:e.endOffset}:e}function a(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function s(t){return!!e.DOM.getParent(t,n.isEditorUIElement)}function l(e,t){for(var n=t.getBody();e;){if(e==n)return!0;e=e.parentNode}}function c(n){var c=n.editor,u;c.on("init",function(){"onbeforedeact
ivate"in document&&t.ie<11?c.dom.bind(c.getBody(),"beforedeactivate",function(){try{c.lastRng=c.selection.getRng()}catch(e){}c.selection.lastFocusBookmark=o(c.lastRng)}):(c.inline||t.ie>10)&&(c.on("nodechange keyup",function(){var e=document.activeElement;e&&e.id==c.id+"_ifr"&&(e=c.getBody()),l(e,c)&&(c.lastRng=c.selection.getRng())}),t.webkit&&(u=function(){var e=c.selection.getRng();e.collapsed||(c.lastRng=e)},e.DOM.bind(document,"selectionchange",u),c.on("remove",function(){e.DOM.unbind(document,"selectionchange",u)})))}),c.on("setcontent",function(){c.lastRng=null}),c.on("mousedown",function(){c.selection.lastFocusBookmark=null}),c.on("focusin",function(){var e=r.focusedEditor;c.selection.lastFocusBookmark&&(c.selection.setRng(a(c,c.selection.lastFocusBookmark)),c.selection.lastFocusBookmark=null),e!=c&&(e&&e
.fire("blur",{focusedEditor:c}),r.activeEditor=c,r.focusedEditor=c,c.fire("focus",{blurredEditor:e}),c.focus(!1)),c.lastRng=null}),c.on("focusout",function(){window.setTimeout(function(){var e=r.focusedEditor;s(i())||e!=c||(c.fire("blur",{focusedEditor:null}),r.focusedEditor=null,c.selection.lastFocusBookmark=null)},0)})}e.DOM.bind(document,"focusin",function(e){var t=r.activeEditor;t&&e.target.ownerDocument==document&&(t.selection.lastFocusBookmark=o(t.lastRng),s(e.target)||r.focusedEditor!=t||(t.fire("blur",{focusedEditor:null}),r.focusedEditor=null))}),r.on("AddEditor",c)}return n.isEditorUIElement=function(e){return-1!==e.className.indexOf("mce-")},n}),r(st,[it,v,O,g,p,nt,ot,at],function(e,n,r,i,o,a,s,l){var c=n.DOM,u=o.explode,d=o.each,f=o.extend,p=0,h,m={majorVersion:"4",minorVersion:"0.12",releaseDate:"2013-12-18",editors:[],i18n:s,activeEditor:null,se
tup:function(){var e=this,t,n,i="",o;if(n=document.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else for(var a=document.getElementsByTagName("script"),s=0;s<a.length;s++){var c=a[s].src;if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(c)){-1!=c.indexOf(".min")&&(i=".min"),t=c.substring(0,c.lastIndexOf("/"));break}}e.baseURL=new r(n).toAbsolute(t),e.documentBaseURL=n,e.baseURI=new r(e.baseURL),e.suffix=i,e.focusManager=new l(e)},init:function(t){function n(e){var t=e.id;return t||(t=e.name,t=t&&!c.get(t)?e.name:c.uniqueId(),e.setAttribute("id",t)),t}function r(e,t,n){var r=e[t];if(r)return r.apply(n||this,Array.prototype.slice.call(arguments,2))}function i(e,t){return t.constructor===RegExp?t.test(e.className):c.hasClass(e,t)}function o(){var h,m;if(c.unb
ind(window,"ready",o),r(t,"onpageload"),t.types)return d(t.types,function(r){d(c.select(r.selector),function(i){var o=new e(n(i),f({},t,r),a);s.push(o),o.render(1)})}),void 0;if(t.selector)return d(c.select(t.selector),function(r){var i=new e(n(r),t,a);s.push(i),i.render(1)}),void 0;switch(t.mode){case"exact":h=t.elements||"",h.length>0&&d(u(h),function(n){c.get(n)?(l=new e(n,t,a),s.push(l),l.render(!0)):d(document.forms,function(r){d(r.elements,function(r){r.name===n&&(n="mce_editor_"+p++,c.setAttrib(r,"id",n),l=new e(n,t,a),s.push(l),l.render(1))})})});break;case"textareas":case"specific_textareas":d(c.select("textarea"),function(r){t.editor_deselector&&i(r,t.editor_deselector)||(!t.editor_selector||i(r,t.editor_selector))&&(l=new e(n(r),t,a),s.push(l),l.render(!0))})}t.oninit&&(h=m=0,d(s,function(e){m++,e.initialized?h++:e.on("init",functi
on(){h++,h==m&&r(t,"oninit")}),h==m&&r(t,"oninit")}))}var a=this,s=[],l;a.settings=t,c.bind(window,"ready",o)},get:function(e){return e===t?this.editors:this.editors[e]},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),t.activeEditor=e,t.fire("AddEditor",{editor:e}),h||(h=function(){t.fire("BeforeUnload")},c.bind(window,"beforeunload",h)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i,o;{if(e){if("string"==typeof e)return e=e.selector||e,d(c.select(e),function(e){t.remove(r[e.id])}),void 0;if(i=e,!r[i.id])return null;for(delete r[i.id],n=0;n<r.length;n++)if(r[n]==i){r.splice(n,1),o=!0;break}return t.activeEditor==i&&(t.activeEditor=r[0]),o&&t.fire("RemoveEditor",{editor:i}),r.length||c.unbind(window,"beforeunload",h),i.remove(),i}for(n=r.length-1;n>=0;n--)t.remove(r[n])}},execCo
mmand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){d(this.editors,function(e){e.save()})},addI18n:function(e,t){s.add(e,t)},translate:function(e){return s.translate(e)}};return f(m,a),m.setup(),window.tinymce=window.tinyMCE=m,m}),r(lt,[st,p],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inl
ine_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(t,n){e(n,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(ct,[],function(){return{send:function(e){function t(){!e.async||4==n.readyState||r++>1e4?(e.success&&1e4>r&&200==n.status?e.success.call(e.success_scope,""+n.responseText,n,e):e.error&&e.error.call(e.error_scope,r>1e4?"TIMED_OUT":"GENERAL",n,e),n=null):setTimeout(t,10)}var n,r=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async===!1?!1:!0,e.data=e.data||"",n=new XMLHttpRequest){if(n.overrideMimeType&&n.overrideMimeType(e.content_type),n.open(e.type||(e.data?"POST"
;:"GET"),e.url,e.async),e.content_type&&n.setRequestHeader("Content-Type",e.content_type),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(e.data),!e.async)return t();setTimeout(t,10)}}}}),r(ut,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r<t.length;r++)i+=(r>0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="fun
ction"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(dt,[ut,ct,p],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(ft,[v],function(e){return{callbacks:{},count:0,send:
function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(pt,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return l
ocalStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(ht,[v,l,y,b,p,g],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(mt,[I,p],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.addClass(this.settings.containerClass,"body")},applyClass
es:function(e){var t=this,n=t.settings,r,i,o;r=e.items().filter(":visible"),i=n.firstControlClass,o=n.lastControlClass,r.each(function(e){e.removeClass(i).removeClass(o),n.controlClass&&e.addClass(n.controlClass)}),r.eq(0).addClass(i),r.eq(-1).addClass(o)},renderHtml:function(e){var t=this,n=t.settings,r,i="";return r=e.items(),r.eq(0).addClass(n.firstControlClass),r.eq(-1).addClass(n.lastControlClass),r.each(function(e){n.controlClass&&e.addClass(n.controlClass),i+=e.renderHtml()}),i},recalc:function(){},postRender:function(){}})}),r(gt,[mt],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'
+this._super(e)}})}),r(vt,[V,Y],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},text:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().lastChild.innerHTML=t.encode(e)),t):t._value},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes()+'" role="presentation"><div class="'+t+'tooltip-arrow"></div><div class="'+t+'tooltip-inner">'+e.encode(e._text)+"</div></div>"},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(yt,[V,vt],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.t
ooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.toggleClass("tooltip-n","bc-tc"==i),r.toggleClass("tooltip-nw","bc-tl"==i),r.toggleClass("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.tooltip)},tooltip:function(){var e=this;return n||(n=new t({type:"tooltip"}),n.renderTo(e.getContainerElm())),n},active:function(e){var t=this,n;return e!==n&&(t.aria("pressed",e),t.toggleClass("active",e)),t._super(e)},disabled:function(e){var t=this,n;return e!==n&&(t.aria("disabled",e),t.toggleClass("disabled",e)),t._super(e)},postRender:function(){var e=this,t=e.settings;e._rendered=!0,e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&setTimeout(function
(){e.focus()},0)},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(bt,[yt],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t.on("click mousedown",function(e){e.preventDefault()}),t._super(e),n=e.size,e.subtype&&t.addClass(e.subtype),n&&t.addClass("btn-"+n)},icon:function(e){var t=this,n=t.classPrefix;if("undefined"==typeof e)return t.settings.icon;if(t.settings.icon=e,e=e?n+"ico "+n+"i-"+t.settings.icon:"",t._rendered){var r=t.getEl().firstChild,i=r.getElementsByTagName("i")[0];e?(i&&i==r.firstChild||(i=document.createElement("i"),r.insertBefore(i,r.firstChild)),i.className=e):i&&r.removeChild(i),t.text(t._text)}return t},repaint:function(){var e=this.getEl().firstChild.style;e.width=e.height="100%",this._super()},renderHtml:function(){var e=this,t=e._id,n=e
.classPrefix,r=e.settings.icon,i="";return e.settings.image&&(r="none",i=" style=\"background-image: url('"+e.settings.image+"')\""),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'<div id="'+t+'" class="'+e.classes()+'" tabindex="-1"><button role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+i+"></i>":"")+(e._text?(r?"\xa0":"")+e.encode(e._text):"")+"</button></div>"}})}),r(Ct,[q],function(e){return e.extend({Defaults:{defaultType:"button",role:"toolbar"},renderHtml:function(){var e=this,t=e._layout;return e.addClass("btn-group"),e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes()+'"><div id="'+e._id+'-body">'+(e.settings.html||&q
uot;")+t.renderHtml(e)+"</div></div>"}})}),r(xt,[yt],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){var t=this;return"undefined"!=typeof e?(e?t.addClass("checked"):t.removeClass("checked"),t._checked=e,t.aria("checked",e),t):t._checked},value:function(e){return this.checked(e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes()+'" unselectable="on" aria-labeledby="'+t+'-al" tabindex="-1"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+t+'-al" class="'+n+'l
abel">'+e.encode(e._text)+"</span></div>"}})}),r(wt,[bt,X],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.popover=!0,r.autohide=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():e.showPanel())}),e._super()}})}),r(_t,[wt,v],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.addClass("colorbutton")},color:function(e){return e?(this._col
or=e,this.getEl("preview").style.backgroundColor=e,this):this._color},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",i=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"";return'<div id="'+t+'" class="'+e.classes()+'"><button role="presentation" hidefocus type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+i+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+(e._text?(r?" ":"")+e._text:"")+'</button><button type="button" class="'+n+'open" hidefocus tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;re
turn e.on("click",function(r){r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(Nt,[yt,W],function(e,t){return e.extend({init:function(e){var n=this;n._super(e),n.addClass("combobox"),n.on("click",function(e){for(var t=e.target;t;)t.id&&-1!=t.id.indexOf("-open")&&n.fire("action"),t=t.parentNode}),n.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&n.parents().reverse().each(function(t){return e.preventDefault(),n.fire("change"),t.hasEventListeners("submit")&&t.toJSON?(t.fire("submit",{data:t.toJSON()}),!1):void 0})}),e.placeholder&&(n.addClass("placeholder"),n.on("focusin",function(){n._hasOnChange||(t.on(n.getEl("inp"),"change",function(){n.fire("change&qu
ot;)}),n._hasOnChange=!0),n.hasClass("placeholder")&&(n.getEl("inp").value="",n.removeClass("placeholder"))}),n.on("focusout",function(){0===n.value().length&&(n.getEl("inp").value=e.placeholder,n.addClass("placeholder"))}))},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t.removeClass("placeholder"),t._rendered&&(t.getEl("inp").value=e),t):t._rendered?(e=t.getEl("inp").value,e!=t.settings.placeholder?e:""):t._value},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl("inp").disabled=e),t._super(e)},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,n=e.getEl(),r=e.getEl("open"),i=e.layoutRect(),o,a;o=r?i.w-t.getSize(r).width-10:i.w-10;var s=document;return s.all&&(!s.documentMode||s.documentMode<=8)
&&(a=e.layoutRect().h-2+"px"),t.css(n.firstChild,{width:o,lineHeight:a}),e._super(),e},postRender:function(){var e=this;return t.on(this.getEl("inp"),"change",function(){e.fire("change")}),e._super()},remove:function(){t.off(this.getEl("inp")),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=n.value||n.placeholder||"",o,a,s="";return o=n.icon?r+"ico "+r+"i-"+n.icon:"",a=e._text,(o||a)&&(s='<div id="'+t+'-open" class="'+r+"btn "+r+'open" tabIndex="-1"><button id="'+t+'-action" type="button" hidefocus tabindex="-1">'+(o?'<i class="'+o+'"></i>':'<i class="'+r+'caret"></i>')+(a?(o?" ":"")+a:"")+"</button></div>",e.addClass("has-open")),'<div id=&qu
ot;'+t+'" class="'+e.classes()+'"><input id="'+t+'-inp" class="'+r+"textbox "+r+'placeholder" value="'+i+'" hidefocus="true"'+(e.disabled()?' disabled="disabled"':"")+">"+s+"</div>"}})}),r(Et,[yt,J],function(e,t){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.addClass("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.data()[n],index:n})})},focus:function(){var e=this;return e.keyNav=new t({root:e,enableLeftRight:!0}),e.keyNav.focusFirst(),e},data:function(e){var t=this;return"undefined"!=typeof e?(t._data=e,t.update(),t):t._data},update:function(){this.innerHtml(this._getPathHtml())},postRender:function(){var e=this;e._super(),e.data(e.settings.data)},renderHtml:function(){var e=th
is;return'<div id="'+e._id+'" class="'+e.classes()+'">'+e._getPathHtml()+"</div>"},_getPathHtml:function(){var e=this,t=e._data||[],n,r,i="",o=e.classPrefix;for(n=0,r=t.length;r>n;n++)i+=(n>0?'<div class="'+o+'divider" aria-hidden="true"> '+e.settings.delimiter+" </div>":"")+'<div role="button" class="'+o+"path-item"+(n==r-1?" "+o+"last":"")+'" data-index="'+n+'" tabindex="-1" id="'+e._id+"-"+n+'">'+t[n].name+"</div>";return i||(i='<div class="'+o+'path-item"> </div>'),i}})}),r(kt,[Et,st],function(e,t){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))ret
urn!0}return!1}var n=this,r=t.activeEditor;return n.on("select",function(t){var n=[],i,o=r.getBody();for(r.focus(),i=r.selection.getStart();i&&i!=o;)e(i)||n.push(i),i=i.parentNode;r.selection.select(n[n.length-1-t.index]),r.nodeChanged()}),r.on("nodeChange",function(t){for(var i=[],o=t.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=r.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});i.push({name:s.name})}n.data(i)}),n._super()}})}),r(St,[q],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.addClass("formitem"),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes()+'" hideFocus="1" tabIndex="-1">'+(e.settings.title?'<div id="'+e._id+'-title" class="'+n+'title">'+e.settings.title+"</div>&quo
t;:"")+'<div id="'+e._id+'-body" class="'+e.classes("body")+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}})}),r(Tt,[q,St],function(e,t){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,n=e.items();n.each(function(n){var r,i=n.settings.label;i&&(r=new t({layout:"flex",autoResize:"overflow",defaults:{flex:1},items:[{type:"label",text:i,flex:0,forId:n._id}]}),r.type="formitem","undefined"==typeof n.settings.flex&&(n.settings.flex=1),e.replace(n,r),r.add(n))})},recalcLabels:function(){var e=this,t=0,n=[],r,i;if(e.settings.labelGapCalc!==!1)for(e.items().filter("formitem").each(function(e){var r=e.items()[0],i=r.getEl().c
lientWidth;t=i>t?i:t,n.push(r)}),i=e.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=t+i},visible:function(e){var t=this._super(e);return e===!0&&this._rendered&&this.recalcLabels(),t},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.recalcLabels(),e.fromJSON(e.settings.data)}})}),r(Rt,[Tt],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'<fieldset id="'+e._id+'" class="'+e.classes()+'" hideFocus="1" tabIndex="-1">'+(e.settings.title?'<legend id="'+e._id+'-title" class="'+n+'fieldset-title">'+e.settings.title+"</legend>":"
;")+'<div id="'+e._id+'-body" class="'+e.classes("body")+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></fieldset>"}})}),r(At,[Nt],function(e){return e.extend({init:function(e){var t=this,n=tinymce.activeEditor,r;e.spellcheck=!1,r=n.settings.file_browser_callback,r&&(e.icon="browse",e.onaction=function(){r(t.getEl("inp").id,t.getEl("inp").value,e.filetype,window)}),t._super(e)}})}),r(Bt,[gt],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox();e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(Lt,[gt],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v=[],y,b,C,x,w,_,N,E,k,S,T,R,A,B,L,D,H,M,P,O,I,F,z,W,V=Math.max,U=Math.min;for(r=e.items().filter(":visible"),i=e.layout
Rect(),o=e._paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,("row-reversed"==f||"column-reverse"==f)&&(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(k="y",N="h",E="minH",S="maxH",R="innerH",T="top",A="bottom",B="deltaH",L="contentH",I="left",M="w",D="x",H="innerW",P="minW",O="maxW",F="right",z="deltaW",W="contentW"):(k="x",N="w",E="minW",S="maxW",R="innerW",T="left",A="right",B="deltaW",L="contentW",I="top",M="h",D="y",H="innerH",P="minH",O="maxH",F="bottom",z="deltaH",W=
"contentH"),d=i[R]-o[T]-o[T],_=u=0,t=0,n=r.length;n>t;t++)p=r[t],h=p.layoutRect(),m=p.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,h[S]&&v.push(p),h.flex=g),d-=h[E],y=o[I]+h[P]+o[F],y>_&&(_=y);if(x={},x[E]=0>d?i[E]-d+i[B]:i[R]-d+i[B],x[P]=_+i[z],x[L]=i[R]-d,x[W]=_,x.minW=U(x.minW,i.maxW),x.minH=U(x.minH,i.maxH),x.minW=V(x.minW,i.startMinWidth),x.minH=V(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)p=v[t],h=p.layoutRect(),b=h[S],y=h[E]+h.flex*C,y>b?(d-=h[S]-h[E],u-=h.flex,h.flex=0,h.maxFlexSize=b):h.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[D]=o[I],t=0,n=r.length;n>t;t++)p=r[t],h=p.layoutRect(),y=h.maxFlexSize||h[E],"center"===s?x[D]=Math.round(i[H]/2-h[M]/2):&
quot;stretch"===s?(x[M]=V(h[P]||0,i[H]-o[I]-o[F]),x[D]=o[I]):"end"===s&&(x[D]=i[H]-h[M]-o.top),h.flex>0&&(y+=h.flex*C),x[N]=y,x[k]=w,p.layoutRect(x),p.recalc&&p.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var q=e.parent();q&&(q._lastRect=null,q.recalc())}}})}),r(Dt,[mt],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})}})}),r(Ht,[V,yt,X,p,st,g],function(e,t,n,r,i,o){function a(e){function t(t){function n(e){return e.replace(/%(\w+)/g,"")}var r,i,o=e.dom,a="",l,c;return c=e.settings.preview_styles,c===!1?"":(c||(c="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius"),(t=e.for
matter.get(t))?(t=t[0],r=t.block||t.inline||"span",i=o.create(r),s(t.styles,function(e,t){e=n(e),e&&o.setStyle(i,t,e)}),s(t.attributes,function(e,t){e=n(e),e&&o.setAttrib(i,t,e)}),s(t.classes,function(e){e=n(e),o.hasClass(i,e)||o.addClass(i,e)}),e.fire("PreviewFormats"),o.setStyles(i,{position:"absolute",left:-65535}),e.getBody().appendChild(i),l=o.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,s(c.split(" "),function(t){var n=o.getStyle(i,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=o.getStyle(e.getBody(),t,!0),"#ffffff"==o.toHex(n).toLowerCase())||"color"==t&&"#000000"==o.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(a+="padding:0 2px;"
;),a+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),o.remove(i),a):void 0)}function r(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;s(i.parents,function(e){return s(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function i(e){e=e.split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function o(){function n(e){var t=[];if(e)return s(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=n(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a}t.push(o)}),t}var r=0,i=[],o=[{title:"Headers",items:[{title:"Header 1",format:"h1"},{title:"Header 2",format:"h2"},{title:"Header 3",format:"h3"},{title:"Header 4",format:"h4"},{tit
le:"Header 5",format:"h5"},{title:"Header 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{tit
le:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];
+e.on("init",function(){s(i,function(t){e.formatter.register(t.name,t)})});var a=n(e.settings.style_formats||o);return a={type:"menu",items:a,onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?t(this.settings.format):void 0},onPostRender:function(){var t=this,n=this.settings.format;n&&t.parent().on("show",function(){t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))})},onclick:function(){this.settings.format&&f(this.settings.format)}}}}function a(){return e.undoManager?e.undoManager.hasUndo():!1}function l(){return e.undoManager?e.undoManager.hasRedo():!1}function c(){var t=this;t.disabled(!a()),e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!a())})}function u(){var t=this;t.disabled(!l()),e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!l())})}function d(){var t=this;e.on(&qu
ot;VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function f(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var p;p=o(),s({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})},onclick:function(){f(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],hr
:["Insert horizontal rule","InsertHorizontalRule"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Toggle blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){var t=this;e.formatter?e.
formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}})}),e.addButton("undo",{tooltip:"Undo",onPostRender:c,cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:u,cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",shortcut:"Ctrl+N",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Ctrl+Z",onPostRender:c,cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Ctrl+Y",onPostRender:u,cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:d,cmd:"mceToggleVisualAid"}),s({cut:["Cut","Cut","Ctrl+X"],copy:["Copy","C
opy","Ctrl+C"],paste:["Paste","Paste","Ctrl+V"],selectall:["Select all","SelectAll","Ctrl+A"],bold:["Bold","Bold","Ctrl+B"],italic:["Italic","Italic","Ctrl+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:p}),e.addButton("formatselect",function(){var n=[],o=i(e.settings.block_formats||"Paragraph=p;Address=address;Pre=pre;Header 1=h1;Header 2=h2;Header 3=h3
;Header 4=h4;Header 5=h5;Header 6=h6");return s(o,function(e){n.push({text:e[0],value:e[1],textStyle:function(){return t(e[1])}})}),{type:"listbox",text:o[0][0],values:n,fixedWidth:!0,onselect:f,onPostRender:r(n)}}),e.addButton("fontselect",function(){var t="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",n=[],o=i(e.settings.font_formats||t);return s(o,function(e){n.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"list
box",text:"Font Family",tooltip:"Font Family",values:n,fixedWidth:!0,onPostRender:r(n,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var t=[],n="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||n;return s(i.split(" "),function(e){t.push({text:e,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:!0,onPostRender:r(t,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:p})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(Mt,[gt],function(e){retu
rn e.extend({recalc:function(e){var t=e.settings,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_,N=[],E=[],k,S,T,R,A,B;for(t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e._paddingBox,C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]),d=0;r>d;d++)N.push(0);for(f=0;n>f;f++)E.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),k=c.minW,S=c.minH,N[d]=k>N[d]?k:N[d],E[f]=S>E[f]?S:E[f];for(A=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=N[d]+(d>0?y:0),A-=(d>0?y:0)+N[d];for(B=o.innerH-g.top-g.bottom,_=0,f=0;n>f;f++)_+=E[f]+(f>0?b:0),B-=(f>0?b:0)+E[f];if(w+=g.left+g.right,_+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=_+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o
.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var L;L="start"==t.packV?0:B>0?Math.floor(B/n):0;var D=0,H=t.flexWidths;if(H)for(d=0;d<H.length;d++)D+=H[d];else D=r;var M=A/D;for(d=0;r>d;d++)N[d]+=H?H[d]*M:M;for(h=g.top,f=0;n>f;f++){for(p=g.left,s=E[f]+L,d=0;r>d&&(u=i[f*r+d],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(N[d],c.startMinWidth),T=R=0,c.x=p,c.y=h,v=m.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=p+a/2-c.w/2:"right"==v?c.x=p+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=h+s/2-c.h/2:"bottom"==v?c.y=h+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),p+=a+y,u.recalc&&u.recalc();h+=s+b}
}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var P=e.parent();P&&(P._lastRect=null,P.recalc())}}})}),r(Pt,[yt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("iframe"),e.canFocus=!1,'<iframe id="'+e._id+'" class="'+e.classes()+'" tabindex="-1" src="'+(e.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,r=this.getEl().contentWindow.document.body;return r?(r.innerHTML=e,t&&t()):setTimeout(function(){n.html(e)},0),this}})}),r(Ot,[yt,W],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.addClass("widget"),t.addClass("label"),t.canFocus=!1,e.multiline&&t.addClass("autoscroll"),e.strong&&t.addClass("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.setting
s.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.addClass("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},text:function(e){var t=this;return t._rendered&&e&&this.innerHtml(t.encode(e)),t._super(e)},renderHtml:function(){var e=this,t=e.settings.forId;return'<label id="'+e._id+'" class="'+e.classes()+'"'+(t?' for="'+t:"")+'">'+e.encode(e._text)+"</label>"}})}),r(It,[q,J],function(e,t){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.addClass("toolbar")},postRender:function(){var e=this;return e.items().addClass("toolbar-item"),e.keyNav=new t({root:e,enableLeft
Right:!0}),e._super()}})}),r(Ft,[It],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",defaults:{type:"menubutton"}}})}),r(zt,[bt,U,Ft],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),t.addClass("menubtn"),e.fixedWidth&&t.addClass("fixed-width"),t.aria("haspopup",!0),t.hasPopup=!0},showMenu:function(){var e=this,n=e.settings,r;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type)}).fire("show
"),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]),void 0)},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1))},activeMenu:function(e){this.toggleClass("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon?r+"ico "+r+"i-"+e.settings.icon:"";return e.aria("role",e.parent()instanceof n?"menuitem":"button"),'<div id="'+t+'" class="'+e.classes()+'" tabindex="-1"><button id="'+t+'-open" role="presentation" type="button" tabindex="-1">'+(i?'<i class="'+i+'"></i>':"")+"<span>"+(e._text?(i?"\xa
0":"")+e.encode(e._text):"")+'</span> <i class="'+r+'caret"></i></button></div>'},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.keyboard&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},text:function(e){var t=this,n,r;if(t._rendered)for(r=t.getEl("open").getElementsByTagName("span"),n=0;n<r.length;n++)r[n].innerHTML=(t.settings.icon&&e?"\xa0":"")+t.encode(e);return this._super(e)},remove:function(){this._super(),this.menu&&this.men
u.remove()}});return i}),r(Wt,[zt],function(e){return e.extend({init:function(e){var t=this,n,r,i,o,a;if(t._values=n=e.values,n){for(r=0;r<n.length;r++)i=n[r].selected||e.value===n[r].value,i&&(o=o||n[r].text,t._value=n[r].value);e.menu=n}e.text=e.text||o||n[0].text,t._super(e),t.addClass("listbox"),t.on("select",function(n){var r=n.control;a&&(n.lastControl=a),e.multiple?r.active(!r.active()):t.value(n.control.settings.value),a=r})},value:function(e){function t(e,n){e.items().each(function(e){r=e.value()===n,r&&(i=i||e.text()),e.active(r),e.menu&&t(e.menu,n)})}var n=this,r,i,o,a;if("undefined"!=typeof e){if(n.menu)t(n.menu,e);else for(o=n.settings.menu,a=0;a<o.length;a++)r=o[a].value==e,r&&(i=i||o[a].text),o[a].active=r;n.text(i||this.settings.text)}return n._super(e)}})}),r(Vt,[yt,U,g],function(e,t,n){return e.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t=this;t.hasPopup=!0,t
._super(e),e=t.settings,t.addClass("menu-item"),e.menu&&t.addClass("menu-item-expand"),e.preview&&t.addClass("menu-item-preview"),("-"===t._text||"|"===t._text)&&(t.addClass("menu-item-sep"),t.aria("role","separator"),t.canFocus=!1,t._text="-"),e.selectable&&(t.aria("role","menuitemcheckbox"),t.aria("checked",!0),t.addClass("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||t.addClass("menu-item-normal"),t.on("mousedown",function(e){e.preventDefault()}),t.on("mouseenter click",function(n){n.control===t&&(e.menu||"click"!==n.type?(t.showMenu(),n.keyboard&&setTimeout(function(){t.menu.items()[0].focus()},0)):(t.parent().hideAll(),t.fire("cancel"),t.fire("select")))}),e.menu&&t.aria("haspopup",!0)},hasMenus:fu
nction(){return!!this.settings.menu},showMenu:function(){var e=this,n=e.settings,r,i=e.parent();if(i.items().each(function(t){t!==e&&t.hideMenu()}),n.menu){r=e.menu,r?r.show():(r=n.menu,r.length?r={type:"menu",items:r}:r.type=r.type||"menu",i.settings.itemDefaults&&(r.itemDefaults=i.settings.itemDefaults),r=e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),r.reflow(),r.fire("show"),r.on("cancel",function(){e.focus()}),r.on("hide",function(t){t.control===r&&e.removeClass("selected")})),r._parentMenu=i,r.addClass("menu-sub");var o=r.testMoveRel(e.getEl(),e.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);r.moveRel(e.getEl(),o),r.rel=o,o="menu-sub-"+o,r.removeClass(r._lastRel),r.addClass(o),r._lastRel=o,e.addClass("selected"),e.aria("expanded",!0)}}
,hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){var e=this,t=e._id,r=e.settings,i=e.classPrefix,o=e.encode(e._text),a=e.settings.icon,s="",l=r.shortcut;return a&&e.parent().addClass("menu-has-icons"),r.image&&(a="none",s=" style=\"background-image: url('"+r.image+"')\""),l&&n.mac&&(l=l.replace(/ctrl\+alt\+/i,"⌥⌘"),l=l.replace(/ctrl\+/i,"⌘"),l=l.replace(/alt\+/i,"⌥"),l=l.replace(/shift\+/i,"⇧")),a=i+"ico "+i+"i-"+(e.settings.icon||"none"),'<div id="'+t+'" class="'+e.classes()+'" tabindex="-1">'+("-"!==o?'<i class="'+a+'"'+s+"></i> ":"&q
uot;)+("-"!==o?'<span id="'+t+'-text" class="'+i+'text">'+o+"</span>":"")+(l?'<div id="'+t+'-shortcut" class="'+i+'menu-shortcut">'+l+"</div>":"")+(r.menu?'<div class="'+i+'caret"></div>':"")+"</div>"},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var r=e.getEl("text");r&&r.setAttribute("style",n)}return e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Ut,[X,J,Vt,p],function(e,t,n,r){var i=e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"menu"},init:function(e){var i=this;if(e.autohide=!0,e.constrainToViewport=!0,e.itemDefaults)for(var o=e.items,a=o.length;a--;)o[a]=r.extend({},e.itemDefaults,o[a]);i._super(e),i.addClass("m
enu"),i.keyNav=new t({root:i,enableUpDown:!0,enableLeftRight:!0,leftAction:function(){i.parent()instanceof n&&i.keyNav.cancel()},onCancel:function(){i.fire("cancel",{},!1),i.hide()}})},repaint:function(){return this.toggleClass("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("cancel"),e.fire("select")},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.selectable?(e._hasIcons=!0,!1):void 0}),e._super()}});return i}),r(qt,[xt],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r($t,[yt,$],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.addClass("resizehandle"
;),"both"==e.settings.direction&&e.addClass("resizehandle-both"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes()+'"><i class="'+t+"ico "+t+'i-resize"></i></div>'},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},end:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(jt,[yt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("spacer"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes()+'"></div>'}})}),r(Kt,[zt,W],function(e,t){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"splitbutton"},repa
int:function(){var e=this,n=e.getEl(),r=e.layoutRect(),i,o;return e._super(),i=n.firstChild,o=n.lastChild,t.css(i,{width:r.w-t.getSize(o).width,height:r.h-2}),t.css(o,{height:r.h-2}),e},activeMenu:function(e){var n=this;t.toggleClass(n.getEl().lastChild,n.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"";return'<div id="'+t+'" class="'+e.classes()+'"><button type="button" hidefocus tabindex="-1">'+(r?'<i class="'+r+'"></i>':"")+(e._text?(r?" ":"")+e._text:"")+'</button><button type="button" class="'+n+'open" hidefocus tabindex="-1">'+(e._menuBtnText?(r?"\xa0":"")+e._menuBtnText:"")+' <i class="'+n+'caret"></i></button></div>'},postRender:functi
on(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if("BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),t.call(this,e),void 0;n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Yt,[Dt],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"}})}),r(Gt,[K,W],function(e,t){return e.extend({lastIdx:0,Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){this.activeTabId&&t.removeClass(this.getEl(this.activeTabId),this.classPrefix+"active"),this.activeTabId="t"+e,t.addClass(this.getEl("t"+e),this.classPrefix+"active"),e!=this.lastIdx&&(this.items()[this.lastIdx].hide(),this.lastIdx=e),this.items()[e].show().fire("showtab"),this.reflow()},rend
erHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){n+='<div id="'+e._id+"-t"+i+'" class="'+r+'tab" unselectable="on">'+e.encode(t.settings.title)+"</div>"}),'<div id="'+e._id+'" class="'+e.classes()+'" hideFocus="1" tabIndex="-1"><div id="'+e._id+'-head" class="'+r+'tabs">'+n+'</div><div id="'+e._id+'-body" class="'+e.classes("body")+'">'+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayout
Rect:function(){var e=this,n,r,i;r=t.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(t,n){r=Math.max(r,t.layoutRect().minW),i=Math.max(i,t.layoutRect().minH),e.settings.activeTab!=n&&t.hide()}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=t.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,n=e._super(),n.deltaH+=o,n.innerH=n.h-n.deltaH,n}})}),r(Xt,[yt,W],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t._value=e.value||"",t.addClass("textbox"),e.multiline?t.addClass("multiline"):t.on("keydown",function(e){13==e.keyCode&&t.parents().reverse().each(function(t){return e.preventDefault(),t.hasEventListeners("submit")&&t.toJSON?(t.fire("submit",{data:t.toJSON()}),!1):void 0})})},disabled:function(e){var t=this;return t._ren
dered&&"undefined"!=typeof e&&(t.getEl().disabled=e),t._super(e)},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().value=e),t):t._rendered?t.getEl().value:t._value},repaint:function(){var e=this,t,n,r,i=0,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e._borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.encode(e._value,!1),i="";return"spellcheck"in n
&&(i+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(i+=' maxlength="'+n.maxLength+'"'),n.size&&(i+=' size="'+n.size+'"'),n.subtype&&(i+=' type="'+n.subtype+'"'),e.disabled()&&(i+=' disabled="disabled"'),n.multiline?'<textarea id="'+t+'" class="'+e.classes()+'" '+(n.rows?' rows="'+n.rows+'"':"")+' hidefocus="true"'+i+">"+r+"</textarea>":'<input id="'+t+'" class="'+e.classes()+'" value="'+r+'" hidefocus="true"'+i+">"},postRender:function(){var e=this;return t.on(e.getEl(),"change",function(t){e.fire("change",t)}),e._super()},remove:function(){t.off(this.getEl()),this._super()}})}),r(Jt,[W],function(e){return function(t){var n=this,r;n.show=function(i){return n.hide(),r=!0,window.setTimeout(function(){r&&t.appendChild(e.createFragme
nt('<div class="mce-throbber"></div>'))},i||0),n},n.hide=function(){var e=t.lastChild;return e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),r=!1,n}}}),a([l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_,N,E,k,S,T,R,A,B,L,D,H,M,P,O,I,F,z,W,V,U,q,$,j,K,Y,G,X,J,Q,Z,et,tt,nt,rt,it,ot,at,st,lt,ct,ut,dt,ft,pt,ht,mt,gt,vt,yt,bt,Ct,xt,wt,_t,Nt,Et,kt,St,Tt,Rt,At,Bt,Lt,Dt,Ht,Mt,Pt,Ot,It,Ft,zt,Wt,Vt,Ut,qt,$t,jt,Kt,Yt,Gt,Xt,Jt])}(this);
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/src/wp-includes/js/tinymce/tinymce.min.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpincludesjstinymceutilseditable_selectsjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/utils/editable_selects.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/utils/editable_selects.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/utils/editable_selects.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,11 +1,11 @@
</span><span class="cx"> /**
</span><span class="cx"> * editable_selects.js
</span><span class="cx"> *
</span><del>- * Copyright 2009, Moxiecode Systems AB
</del><ins>+ * Copyright, Moxiecode Systems AB
</ins><span class="cx"> * Released under LGPL License.
</span><span class="cx"> *
</span><del>- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
</del><ins>+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> var TinyMCE_EditableSelects = {
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymceutilsform_utilsjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/utils/form_utils.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/utils/form_utils.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/utils/form_utils.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,11 +1,11 @@
</span><span class="cx"> /**
</span><span class="cx"> * form_utils.js
</span><span class="cx"> *
</span><del>- * Copyright 2009, Moxiecode Systems AB
</del><ins>+ * Copyright, Moxiecode Systems AB
</ins><span class="cx"> * Released under LGPL License.
</span><span class="cx"> *
</span><del>- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
</del><ins>+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
</span><span class="lines">@@ -132,9 +132,9 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> } else {
</span><del>- tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
</del><ins>+ /*tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
</ins><span class="cx"> styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
</span><del>- });
</del><ins>+ });*/
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymceutilsmctabsjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/utils/mctabs.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/utils/mctabs.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/utils/mctabs.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,13 +1,15 @@
</span><span class="cx"> /**
</span><span class="cx"> * mctabs.js
</span><span class="cx"> *
</span><del>- * Copyright 2009, Moxiecode Systems AB
</del><ins>+ * Copyright, Moxiecode Systems AB
</ins><span class="cx"> * Released under LGPL License.
</span><span class="cx"> *
</span><del>- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
</del><ins>+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
</ins><span class="cx"> */
</span><span class="cx">
</span><ins>+/*jshint globals: tinyMCEPopup */
+
</ins><span class="cx"> function MCTabs() {
</span><span class="cx"> this.settings = [];
</span><span class="cx"> this.onChange = tinyMCEPopup.editor.windowManager.createInstance('tinymce.util.Dispatcher');
</span><span class="lines">@@ -122,9 +124,9 @@
</span><span class="cx"> var tinymce = tinyMCEPopup.getWin().tinymce, dom = tinyMCEPopup.dom, each = tinymce.each;
</span><span class="cx">
</span><span class="cx"> each(dom.select('div.tabs'), function(tabContainerElm) {
</span><del>- var keyNav;
</del><ins>+ //var keyNav;
</ins><span class="cx">
</span><del>- dom.setAttrib(tabContainerElm, "role", "tablist");
</del><ins>+ dom.setAttrib(tabContainerElm, "role", "tablist");
</ins><span class="cx">
</span><span class="cx"> var items = tinyMCEPopup.dom.select('li', tabContainerElm);
</span><span class="cx"> var action = function(id) {
</span><span class="lines">@@ -141,7 +143,7 @@
</span><span class="cx">
</span><span class="cx"> dom.bind(dom.getRoot(), 'keydown', function(evt) {
</span><span class="cx"> if (evt.keyCode === 9 && evt.ctrlKey && !evt.altKey) { // Tab
</span><del>- keyNav.moveFocus(evt.shiftKey ? -1 : 1);
</del><ins>+ //keyNav.moveFocus(evt.shiftKey ? -1 : 1);
</ins><span class="cx"> tinymce.dom.Event.cancel(evt);
</span><span class="cx"> }
</span><span class="cx"> });
</span><span class="lines">@@ -150,13 +152,13 @@
</span><span class="cx"> dom.setAttrib(a, 'tabindex', '-1');
</span><span class="cx"> });
</span><span class="cx">
</span><del>- keyNav = tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
</del><ins>+ /*keyNav = tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
</ins><span class="cx"> root: tabContainerElm,
</span><span class="cx"> items: items,
</span><span class="cx"> onAction: action,
</span><span class="cx"> actOnFocus: true,
</span><span class="cx"> enableLeftRight: true,
</span><span class="cx"> enableUpDown: true
</span><del>- }, tinyMCEPopup.dom);
</del><ins>+ }, tinyMCEPopup.dom);*/
</ins><span class="cx"> });
</span><span class="cx"> });
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymceutilsvalidatejs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/utils/validate.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/utils/validate.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/utils/validate.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,11 +1,11 @@
</span><span class="cx"> /**
</span><span class="cx"> * validate.js
</span><span class="cx"> *
</span><del>- * Copyright 2009, Moxiecode Systems AB
</del><ins>+ * Copyright, Moxiecode Systems AB
</ins><span class="cx"> * Released under LGPL License.
</span><span class="cx"> *
</span><del>- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
</del><ins>+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcewpmcehelpphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/wp-mce-help.php (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/wp-mce-help.php 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/wp-mce-help.php 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -230,15 +230,11 @@
</span><span class="cx">
</span><span class="cx"> <p><?php _e('Version:'); ?> <span id="version"></span> (<span id="date"></span>)</p>
</span><span class="cx"> <p><?php printf(__('TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor released as Open Source under %sLGPL</a> by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.'), '<a href="'.home_url('/wp-includes/js/tinymce/license.txt').'" target="_blank" title="'.esc_attr__('GNU Library General Public License').'">'); ?></p>
</span><del>- <p><?php _e('Copyright © 2003-2011, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.'); ?></p>
</del><ins>+ <p><?php _e('Copyright © 2003-2014, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.'); ?></p>
</ins><span class="cx"> <p><?php _e('For more information about this software visit the <a href="http://tinymce.com" target="_blank">TinyMCE website</a>.'); ?></p>
</span><ins>+</div>
</ins><span class="cx">
</span><del>- <div id="buttoncontainer">
- <a href="http://www.moxiecode.com" target="_blank"><img src="themes/advanced/img/gotmoxie.png" alt="<?php esc_attr_e('Got Moxie?'); ?>" style="border: 0" /></a>
- </div>
-
</del><span class="cx"> </div>
</span><del>-</div>
</del><span class="cx">
</span><span class="cx"> <div class="mceActionPanel">
</span><span class="cx"> <div style="margin: 8px auto; text-align: center;padding-bottom: 10px;">
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcewptinymceschemajs"></a>
<div class="delfile"><h4>Deleted: trunk/src/wp-includes/js/tinymce/wp-tinymce-schema.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/wp-tinymce-schema.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/tinymce/wp-tinymce-schema.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,940 +0,0 @@
</span><del>-/**
- * TinyMCE Schema.js
- *
- * Duck-punched by WordPress core to support a sane schema superset.
- *
- * Copyright, Moxiecode Systems AB
- * Released under LGPL
- *
- * License: http://www.tinymce.com/license
- * Contributing: http://www.tinymce.com/contributing
- */
-
-(function(tinymce) {
- var mapCache = {}, makeMap = tinymce.makeMap, each = tinymce.each;
-
- function split(str, delim) {
- return str.split(delim || ',');
- };
-
- /**
- * Unpacks the specified lookup and string data it will also parse it into an object
- * map with sub object for it's children. This will later also include the attributes.
- */
- function unpack(lookup, data) {
- var key, elements = {};
-
- function replace(value) {
- return value.replace(/[A-Z]+/g, function(key) {
- return replace(lookup[key]);
- });
- };
-
- // Unpack lookup
- for (key in lookup) {
- if (lookup.hasOwnProperty(key))
- lookup[key] = replace(lookup[key]);
- }
-
- // Unpack and parse data into object map
- replace(data).replace(/#/g, '#text').replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g, function(str, name, attributes, children) {
- attributes = split(attributes, '|');
-
- elements[name] = {
- attributes : makeMap(attributes),
- attributesOrder : attributes,
- children : makeMap(children, '|', {'#comment' : {}})
- }
- });
-
- return elements;
- };
-
- /**
- * Returns the HTML5 schema and caches it in the mapCache.
- */
- function getHTML5() {
- var html5 = mapCache.html5;
-
- if (!html5) {
- html5 = mapCache.html5 = unpack({
- A : 'accesskey|class|contextmenu|dir|draggable|dropzone|hidden|id|inert|itemid|itemprop|itemref|itemscope|itemtype|lang|spellcheck|style|tabindex|title|translate|item|role|subject|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup',
- B : '#|a|abbr|area|audio|b|bdi|bdo|br|button|canvas|cite|code|command|data|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|math|meta|meter|noscript|object|output|progress|q|ruby|s|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|u|var|video|wbr',
- C : '#|a|abbr|area|address|article|aside|audio|b|bdi|bdo|blockquote|br|button|canvas|cite|code|command|data|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|math|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|s|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|u|ul|var|video|wbr'
- }, 'html[A|manifest][body|head]' +
- 'head[A][base|command|link|meta|noscript|script|style|title]' +
- 'title[A][#]' +
- 'base[A|href|target][]' +
- 'link[A|href|rel|media|type|sizes|crossorigin|hreflang][]' +
- 'meta[A|http-equiv|name|content|charset][]' +
- 'style[A|type|media|scoped][#]' +
- 'script[A|charset|type|src|defer|async|crossorigin][#]' +
- 'noscript[A][C]' +
- 'body[A|onafterprint|onbeforeprint|onbeforeunload|onblur|onerror|onfocus|onfullscreenchange|onfullscreenerror|onhashchange|onload|onmessage|onoffline|ononline|onpagehide|onpageshow|onpopstate|onresize|onscroll|onstorage|onunload][C]' +
- 'section[A][C]' +
- 'nav[A][C]' +
- 'article[A][C]' +
- 'aside[A][C]' +
- 'h1[A][B]' +
- 'h2[A][B]' +
- 'h3[A][B]' +
- 'h4[A][B]' +
- 'h5[A][B]' +
- 'h6[A][B]' +
- 'hgroup[A][h1|h2|h3|h4|h5|h6]' +
- 'header[A][C]' +
- 'footer[A][C]' +
- 'address[A][C]' +
- 'p[A][B]' +
- 'br[A][]' +
- 'pre[A][B]' +
- 'dialog[A|open][C|dd|dt]' +
- 'blockquote[A|cite][C]' +
- 'ol[A|start|reversed][li]' +
- 'ul[A][li]' +
- 'li[A|value][C]' +
- 'dl[A][dd|dt]' +
- 'dt[A][C|B]' +
- 'dd[A][C]' +
- 'a[A|href|target|download|ping|rel|media|type][B]' +
- 'em[A][B]' +
- 'strong[A][B]' +
- 'small[A][B]' +
- 's[A][B]' +
- 'cite[A][B]' +
- 'q[A|cite][B]' +
- 'dfn[A][B]' +
- 'abbr[A][B]' +
- 'code[A][B]' +
- 'var[A][B]' +
- 'samp[A][B]' +
- 'kbd[A][B]' +
- 'sub[A][B]' +
- 'sup[A][B]' +
- 'i[A][B]' +
- 'b[A][B]' +
- 'u[A][B]' +
- 'mark[A][B]' +
- 'progress[A|value|max][B]' +
- 'meter[A|value|min|max|low|high|optimum][B]' +
- 'time[A|datetime][B]' +
- 'ruby[A][B|rt|rp]' +
- 'rt[A][B]' +
- 'rp[A][B]' +
- 'bdi[A][B]' +
- 'bdo[A][B]' +
- 'span[A][B]' +
- 'ins[A|cite|datetime][C|B]' +
- 'del[A|cite|datetime][C|B]' +
- 'figure[A][C|legend|figcaption]' +
- 'figcaption[A][C]' +
- 'img[A|alt|src|srcset|crossorigin|usemap|ismap|width|height][]' +
- 'iframe[A|name|src|srcdoc|height|width|sandbox|seamless|allowfullscreen][C|B]' +
- 'embed[A|src|height|width|type][]' +
- 'object[A|data|type|typemustmatch|name|usemap|form|width|height][C|B|param]' +
- 'param[A|name|value][]' +
- 'summary[A][B]' +
- 'details[A|open][C|legend|summary]' +
- 'command[A|type|label|icon|disabled|checked|radiogroup|command][]' +
- 'menu[A|type|label][C|li]' +
- 'legend[A][C|B]' +
- 'div[A][C]' +
- 'source[A|src|type|media][]' +
- 'track[A|kind|src|srclang|label|default][]' +
- 'audio[A|src|autobuffer|autoplay|loop|controls|crossorigin|preload|mediagroup|muted][C|source|track]' +
- 'video[A|src|autobuffer|autoplay|loop|controls|width|height|poster|crossorigin|preload|mediagroup|muted][C|source|track]' +
- 'hr[A][]' +
- 'form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]' +
- 'fieldset[A|disabled|form|name][C|legend]' +
- 'label[A|form|for][B]' +
- 'input[A|type|accept|alt|autocomplete|autofocus|checked|dirname|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|inputmode|list|max|maxlength|min|multiple|name|pattern|placeholder|readonly|required|size|src|step|value|width|files][]' +
- 'button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|type|value][B]' +
- 'select[A|autofocus|disabled|form|multiple|name|required|size][option|optgroup]' +
- 'data[A|value][B]' +
- 'datalist[A][B|option]' +
- 'optgroup[A|disabled|label][option]' +
- 'option[A|disabled|selected|label|value][#]' +
- 'textarea[A|autocomplete|autofocus|cols|dirname|disabled|form|inputmode|maxlength|name|placeholder|readonly|required|rows|wrap][#]' +
- 'keygen[A|autofocus|challenge|disabled|form|keytype|name][]' +
- 'output[A|for|form|name][B]' +
- 'canvas[A|width|height][a|button|input]' +
- 'map[A|name][C|B]' +
- 'area[A|alt|coords|shape|href|target|download|ping|rel|media|hreflang|type][]' +
- 'math[A][]' +
- 'svg[A][]' +
- 'table[A][caption|colgroup|thead|tfoot|tbody|tr]' +
- 'caption[A][C]' +
- 'colgroup[A|span][col]' +
- 'col[A|span][]' +
- 'thead[A][tr]' +
- 'tfoot[A][tr]' +
- 'tbody[A][tr]' +
- 'tr[A][th|td]' +
- 'th[A|headers|rowspan|colspan|scope][C]' +
- 'td[A|headers|rowspan|colspan][C]' +
- 'wbr[A][]'
- );
- }
-
- return html5;
- };
-
- /**
- * Returns the HTML4 schema and caches it in the mapCache.
- */
- function getHTML4() {
- var html4 = mapCache.html4;
-
- if (!html4) {
- // This is the XHTML 1.0 transitional elements with it's attributes and children packed to reduce it's size
- html4 = mapCache.html4 = unpack({
- Z : 'H|K|N|O|P',
- Y : 'X|form|R|Q',
- ZG : 'E|span|width|align|char|charoff|valign',
- X : 'p|T|div|U|W|isindex|fieldset|table',
- ZF : 'E|align|char|charoff|valign',
- W : 'pre|hr|blockquote|address|center|noframes',
- ZE : 'abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height',
- ZD : '[E][S]',
- 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',
- E : 'A|B|C',
- D : 'accesskey|tabindex|onfocus|onblur',
- C : 'onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup',
- B : 'lang|xml:lang|dir',
- A : 'id|class|style|title'
- }, 'script[id|charset|type|language|src|defer|xml:space][]' +
- 'style[B|id|type|media|title|xml:space][]' +
- 'object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]' +
- 'param[id|name|value|valuetype|type][]' +
- 'p[E|align][#|S]' +
- 'a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]' +
- 'br[A|clear][]' +
- 'span[E][#|S]' +
- 'bdo[A|C|B][#|S]' +
- 'applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]' +
- 'h1[E|align][#|S]' +
- 'img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]' +
- 'map[B|C|A|name][X|form|Q|area]' +
- 'h2[E|align][#|S]' +
- 'iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]' +
- 'h3[E|align][#|S]' +
- 'tt[E][#|S]' +
- 'i[E][#|S]' +
- 'b[E][#|S]' +
- 'u[E][#|S]' +
- 's[E][#|S]' +
- 'strike[E][#|S]' +
- 'big[E][#|S]' +
- 'small[E][#|S]' +
- 'font[A|B|size|color|face][#|S]' +
- 'basefont[id|size|color|face][]' +
- 'em[E][#|S]' +
- 'strong[E][#|S]' +
- 'dfn[E][#|S]' +
- 'code[E][#|S]' +
- 'q[E|cite][#|S]' +
- 'samp[E][#|S]' +
- 'kbd[E][#|S]' +
- 'var[E][#|S]' +
- 'cite[E][#|S]' +
- 'abbr[E][#|S]' +
- 'acronym[E][#|S]' +
- 'sub[E][#|S]' +
- 'sup[E][#|S]' +
- 'input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]' +
- 'select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]' +
- 'optgroup[E|disabled|label][option]' +
- 'option[E|selected|disabled|label|value][]' +
- 'textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]' +
- 'label[E|for|accesskey|onfocus|onblur][#|S]' +
- 'button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]' +
- 'h4[E|align][#|S]' +
- 'ins[E|cite|datetime][#|Y]' +
- 'h5[E|align][#|S]' +
- 'del[E|cite|datetime][#|Y]' +
- 'h6[E|align][#|S]' +
- 'div[E|align][#|Y]' +
- 'ul[E|type|compact][li]' +
- 'li[E|type|value][#|Y]' +
- 'ol[E|type|compact|start][li]' +
- 'dl[E|compact][dt|dd]' +
- 'dt[E][#|S]' +
- 'dd[E][#|Y]' +
- 'menu[E|compact][li]' +
- 'dir[E|compact][li]' +
- 'pre[E|width|xml:space][#|ZA]' +
- 'hr[E|align|noshade|size|width][]' +
- 'blockquote[E|cite][#|Y]' +
- 'address[E][#|S|p]' +
- 'center[E][#|Y]' +
- 'noframes[E][#|Y]' +
- 'isindex[A|B|prompt][]' +
- 'fieldset[E][#|legend|Y]' +
- 'legend[E|accesskey|align][#|S]' +
- 'table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]' +
- 'caption[E|align][#|S]' +
- 'col[ZG][]' +
- 'colgroup[ZG][col]' +
- 'thead[ZF][tr]' +
- 'tr[ZF|bgcolor][th|td]' +
- 'th[E|ZE][#|Y]' +
- 'form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]' +
- 'noscript[E][#|Y]' +
- 'td[E|ZE][#|Y]' +
- 'tfoot[ZF][tr]' +
- 'tbody[ZF][tr]' +
- 'area[E|D|shape|coords|href|nohref|alt|target][]' +
- 'base[id|href|target][]' +
- 'body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]'
- );
- }
-
- return html4;
- };
-
- /**
- * WordPress Core
- *
- * Returns a schema that is the result of a deep merge between the HTML5
- * and HTML4 schemas.
- */
- function getSaneSchema() {
- var cachedMapCache = mapCache,
- html5, html4;
-
- if ( mapCache.sane )
- return mapCache.sane;
-
- // Bust the mapCache so we're not dealing with the other schema objects.
- mapCache = {};
- html5 = getHTML5();
- html4 = getHTML4();
- mapCache = cachedMapCache;
-
- each( html4, function( html4settings, tag ) {
- var html5settings = html5[ tag ],
- difference = [];
-
- // Merge tags missing in HTML5 mode.
- if ( ! html5settings ) {
- html5[ tag ] = html4settings;
- return;
- }
-
- // Merge attributes missing from this HTML5 tag.
- each( html4settings.attributes, function( attribute, key ) {
- if ( ! html5settings.attributes[ key ] )
- html5settings.attributes[ key ] = attribute;
- });
-
- // Merge any missing attributes into the attributes order.
- each( html4settings.attributesOrder, function( key ) {
- if ( -1 === tinymce.inArray( html5settings.attributesOrder, key ) )
- difference.push( key );
- });
-
- html5settings.attributesOrder = html5settings.attributesOrder.concat( difference );
-
- // Merge children missing from this HTML5 tag.
- each( html4settings.children, function( child, key ) {
- if ( ! html5settings.children[ key ] )
- html5settings.children[ key ] = child;
- });
- });
-
- return mapCache.sane = html5;
- }
-
- /**
- * Schema validator class.
- *
- * @class tinymce.html.Schema
- * @example
- * if (tinymce.activeEditor.schema.isValidChild('p', 'span'))
- * alert('span is valid child of p.');
- *
- * if (tinymce.activeEditor.schema.getElementRule('p'))
- * alert('P is a valid element.');
- *
- * @class tinymce.html.Schema
- * @version 3.4
- */
-
- /**
- * Constructs a new Schema instance.
- *
- * @constructor
- * @method Schema
- * @param {Object} settings Name/value settings object.
- */
- tinymce.html.Schema = function(settings) {
- var self = this, elements = {}, children = {}, patternElements = [], validStyles, schemaItems;
- var whiteSpaceElementsMap, selfClosingElementsMap, shortEndedElementsMap, boolAttrMap, blockElementsMap, nonEmptyElementsMap, customElementsMap = {};
-
- // Creates an lookup table map object for the specified option or the default value
- function createLookupTable(option, default_value, extend) {
- var value = settings[option];
-
- if (!value) {
- // Get cached default map or make it if needed
- value = mapCache[option];
-
- if (!value) {
- value = makeMap(default_value, ' ', makeMap(default_value.toUpperCase(), ' '));
- value = tinymce.extend(value, extend);
-
- mapCache[option] = value;
- }
- } else {
- // Create custom map
- value = makeMap(value, ',', makeMap(value.toUpperCase(), ' '));
- }
-
- return value;
- };
-
- settings = settings || {};
-
- /**
- * WordPress core uses a sane schema in place of the default "HTML5" schema.
- */
- schemaItems = settings.schema == "html5" ? getSaneSchema() : getHTML4();
-
- // Allow all elements and attributes if verify_html is set to false
- if (settings.verify_html === false)
- settings.valid_elements = '*[*]';
-
- // Build styles list
- if (settings.valid_styles) {
- validStyles = {};
-
- // Convert styles into a rule list
- each(settings.valid_styles, function(value, key) {
- validStyles[key] = tinymce.explode(value);
- });
- }
-
- // Setup map objects
- whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea');
- selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr');
- shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link meta param embed source wbr');
- boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls');
- nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object', shortEndedElementsMap);
- textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' +
- 'blockquote center dir fieldset header footer article section hgroup aside nav figure');
- blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' +
- 'th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup', textBlockElementsMap);
-
- // Converts a wildcard expression string to a regexp for example *a will become /.*a/.
- function patternToRegExp(str) {
- return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$');
- };
-
- // Parses the specified valid_elements string and adds to the current rules
- // This function is a bit hard to read since it's heavily optimized for speed
- function addValidElements(valid_elements) {
- var ei, el, ai, al, yl, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder,
- prefix, outputName, globalAttributes, globalAttributesOrder, transElement, key, childKey, value,
- elementRuleRegExp = /^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,
- attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,
- hasPatternsRegExp = /[*?+]/;
-
- if (valid_elements) {
- // Split valid elements into an array with rules
- valid_elements = split(valid_elements);
-
- if (elements['@']) {
- globalAttributes = elements['@'].attributes;
- globalAttributesOrder = elements['@'].attributesOrder;
- }
-
- // Loop all rules
- for (ei = 0, el = valid_elements.length; ei < el; ei++) {
- // Parse element rule
- matches = elementRuleRegExp.exec(valid_elements[ei]);
- if (matches) {
- // Setup local names for matches
- prefix = matches[1];
- elementName = matches[2];
- outputName = matches[3];
- attrData = matches[4];
-
- // Create new attributes and attributesOrder
- attributes = {};
- attributesOrder = [];
-
- // Create the new element
- element = {
- attributes : attributes,
- attributesOrder : attributesOrder
- };
-
- // Padd empty elements prefix
- if (prefix === '#')
- element.paddEmpty = true;
-
- // Remove empty elements prefix
- if (prefix === '-')
- element.removeEmpty = true;
-
- // Copy attributes from global rule into current rule
- if (globalAttributes) {
- for (key in globalAttributes)
- attributes[key] = globalAttributes[key];
-
- attributesOrder.push.apply(attributesOrder, globalAttributesOrder);
- }
-
- // Attributes defined
- if (attrData) {
- attrData = split(attrData, '|');
- for (ai = 0, al = attrData.length; ai < al; ai++) {
- matches = attrRuleRegExp.exec(attrData[ai]);
- if (matches) {
- attr = {};
- attrType = matches[1];
- attrName = matches[2].replace(/::/g, ':');
- prefix = matches[3];
- value = matches[4];
-
- // Required
- if (attrType === '!') {
- element.attributesRequired = element.attributesRequired || [];
- element.attributesRequired.push(attrName);
- attr.required = true;
- }
-
- // Denied from global
- if (attrType === '-') {
- delete attributes[attrName];
- attributesOrder.splice(tinymce.inArray(attributesOrder, attrName), 1);
- continue;
- }
-
- // Default value
- if (prefix) {
- // Default value
- if (prefix === '=') {
- element.attributesDefault = element.attributesDefault || [];
- element.attributesDefault.push({name: attrName, value: value});
- attr.defaultValue = value;
- }
-
- // Forced value
- if (prefix === ':') {
- element.attributesForced = element.attributesForced || [];
- element.attributesForced.push({name: attrName, value: value});
- attr.forcedValue = value;
- }
-
- // Required values
- if (prefix === '<')
- attr.validValues = makeMap(value, '?');
- }
-
- // Check for attribute patterns
- if (hasPatternsRegExp.test(attrName)) {
- element.attributePatterns = element.attributePatterns || [];
- attr.pattern = patternToRegExp(attrName);
- element.attributePatterns.push(attr);
- } else {
- // Add attribute to order list if it doesn't already exist
- if (!attributes[attrName])
- attributesOrder.push(attrName);
-
- attributes[attrName] = attr;
- }
- }
- }
- }
-
- // Global rule, store away these for later usage
- if (!globalAttributes && elementName == '@') {
- globalAttributes = attributes;
- globalAttributesOrder = attributesOrder;
- }
-
- // Handle substitute elements such as b/strong
- if (outputName) {
- element.outputName = elementName;
- elements[outputName] = element;
- }
-
- // Add pattern or exact element
- if (hasPatternsRegExp.test(elementName)) {
- element.pattern = patternToRegExp(elementName);
- patternElements.push(element);
- } else
- elements[elementName] = element;
- }
- }
- }
- };
-
- function setValidElements(valid_elements) {
- elements = {};
- patternElements = [];
-
- addValidElements(valid_elements);
-
- each(schemaItems, function(element, name) {
- children[name] = element.children;
- });
- };
-
- // Adds custom non HTML elements to the schema
- function addCustomElements(custom_elements) {
- var customElementRegExp = /^(~)?(.+)$/;
-
- if (custom_elements) {
- each(split(custom_elements), function(rule) {
- var matches = customElementRegExp.exec(rule),
- inline = matches[1] === '~',
- cloneName = inline ? 'span' : 'div',
- name = matches[2];
-
- children[name] = children[cloneName];
- customElementsMap[name] = cloneName;
-
- // If it's not marked as inline then add it to valid block elements
- if (!inline) {
- blockElementsMap[name.toUpperCase()] = {};
- blockElementsMap[name] = {};
- }
-
- // Add elements clone if needed
- if (!elements[name]) {
- elements[name] = elements[cloneName];
- }
-
- // Add custom elements at span/div positions
- each(children, function(element, child) {
- if (element[cloneName])
- element[name] = element[cloneName];
- });
- });
- }
- };
-
- // Adds valid children to the schema object
- function addValidChildren(valid_children) {
- var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/;
-
- if (valid_children) {
- each(split(valid_children), function(rule) {
- var matches = childRuleRegExp.exec(rule), parent, prefix;
-
- if (matches) {
- prefix = matches[1];
-
- // Add/remove items from default
- if (prefix)
- parent = children[matches[2]];
- else
- parent = children[matches[2]] = {'#comment' : {}};
-
- parent = children[matches[2]];
-
- each(split(matches[3], '|'), function(child) {
- if (prefix === '-')
- delete parent[child];
- else
- parent[child] = {};
- });
- }
- });
- }
- };
-
- function getElementRule(name) {
- var element = elements[name], i;
-
- // Exact match found
- if (element)
- return element;
-
- // No exact match then try the patterns
- i = patternElements.length;
- while (i--) {
- element = patternElements[i];
-
- if (element.pattern.test(name))
- return element;
- }
- };
-
- if (!settings.valid_elements) {
- // No valid elements defined then clone the elements from the schema spec
- each(schemaItems, function(element, name) {
- elements[name] = {
- attributes : element.attributes,
- attributesOrder : element.attributesOrder
- };
-
- children[name] = element.children;
- });
-
- // Switch these on HTML4
- if (settings.schema != "html5") {
- each(split('strong/b,em/i'), function(item) {
- item = split(item, '/');
- elements[item[1]].outputName = item[0];
- });
- }
-
- // Add default alt attribute for images
- elements.img.attributesDefault = [{name: 'alt', value: ''}];
-
- // Remove these if they are empty by default
- each(split('ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr'), function(name) {
- if (elements[name]) {
- elements[name].removeEmpty = true;
- }
- });
-
- // Padd these by default
- each(split('p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption'), function(name) {
- elements[name].paddEmpty = true;
- });
- } else
- setValidElements(settings.valid_elements);
-
- addCustomElements(settings.custom_elements);
- addValidChildren(settings.valid_children);
- addValidElements(settings.extended_valid_elements);
-
- // Todo: Remove this when we fix list handling to be valid
- addValidChildren('+ol[ul|ol],+ul[ul|ol]');
-
- // Delete invalid elements
- if (settings.invalid_elements) {
- tinymce.each(tinymce.explode(settings.invalid_elements), function(item) {
- if (elements[item])
- delete elements[item];
- });
- }
-
- // If the user didn't allow span only allow internal spans
- if (!getElementRule('span'))
- addValidElements('span[!data-mce-type|*]');
-
- /**
- * Name/value map object with valid parents and children to those parents.
- *
- * @example
- * children = {
- * div:{p:{}, h1:{}}
- * };
- * @field children
- * @type {Object}
- */
- self.children = children;
-
- /**
- * Name/value map object with valid styles for each element.
- *
- * @field styles
- * @type {Object}
- */
- self.styles = validStyles;
-
- /**
- * Returns a map with boolean attributes.
- *
- * @method getBoolAttrs
- * @return {Object} Name/value lookup map for boolean attributes.
- */
- self.getBoolAttrs = function() {
- return boolAttrMap;
- };
-
- /**
- * Returns a map with block elements.
- *
- * @method getBlockElements
- * @return {Object} Name/value lookup map for block elements.
- */
- self.getBlockElements = function() {
- return blockElementsMap;
- };
-
- /**
- * Returns a map with text block elements. Such as: p,h1-h6,div,address
- *
- * @method getTextBlockElements
- * @return {Object} Name/value lookup map for block elements.
- */
- self.getTextBlockElements = function() {
- return textBlockElementsMap;
- };
-
- /**
- * Returns a map with short ended elements such as BR or IMG.
- *
- * @method getShortEndedElements
- * @return {Object} Name/value lookup map for short ended elements.
- */
- self.getShortEndedElements = function() {
- return shortEndedElementsMap;
- };
-
- /**
- * Returns a map with self closing tags such as <li>.
- *
- * @method getSelfClosingElements
- * @return {Object} Name/value lookup map for self closing tags elements.
- */
- self.getSelfClosingElements = function() {
- return selfClosingElementsMap;
- };
-
- /**
- * Returns a map with elements that should be treated as contents regardless if it has text
- * content in them or not such as TD, VIDEO or IMG.
- *
- * @method getNonEmptyElements
- * @return {Object} Name/value lookup map for non empty elements.
- */
- self.getNonEmptyElements = function() {
- return nonEmptyElementsMap;
- };
-
- /**
- * Returns a map with elements where white space is to be preserved like PRE or SCRIPT.
- *
- * @method getWhiteSpaceElements
- * @return {Object} Name/value lookup map for white space elements.
- */
- self.getWhiteSpaceElements = function() {
- return whiteSpaceElementsMap;
- };
-
- /**
- * Returns true/false if the specified element and it's child is valid or not
- * according to the schema.
- *
- * @method isValidChild
- * @param {String} name Element name to check for.
- * @param {String} child Element child to verify.
- * @return {Boolean} True/false if the element is a valid child of the specified parent.
- */
- self.isValidChild = function(name, child) {
- var parent = children[name];
-
- return !!(parent && parent[child]);
- };
-
- /**
- * Returns true/false if the specified element name and optional attribute is
- * valid according to the schema.
- *
- * @method isValid
- * @param {String} name Name of element to check.
- * @param {String} attr Optional attribute name to check for.
- * @return {Boolean} True/false if the element and attribute is valid.
- */
- self.isValid = function(name, attr) {
- var attrPatterns, i, rule = getElementRule(name);
-
- // Check if it's a valid element
- if (rule) {
- if (attr) {
- // Check if attribute name exists
- if (rule.attributes[attr]) {
- return true;
- }
-
- // Check if attribute matches a regexp pattern
- attrPatterns = rule.attributePatterns;
- if (attrPatterns) {
- i = attrPatterns.length;
- while (i--) {
- if (attrPatterns[i].pattern.test(name)) {
- return true;
- }
- }
- }
- } else {
- return true;
- }
- }
-
- // No match
- return false;
- };
-
- /**
- * Returns true/false if the specified element is valid or not
- * according to the schema.
- *
- * @method getElementRule
- * @param {String} name Element name to check for.
- * @return {Object} Element object or undefined if the element isn't valid.
- */
- self.getElementRule = getElementRule;
-
- /**
- * Returns an map object of all custom elements.
- *
- * @method getCustomElements
- * @return {Object} Name/value map object of all custom elements.
- */
- self.getCustomElements = function() {
- return customElementsMap;
- };
-
- /**
- * Parses a valid elements string and adds it to the schema. The valid elements format is for example "element[attr=default|otherattr]".
- * Existing rules will be replaced with the ones specified, so this extends the schema.
- *
- * @method addValidElements
- * @param {String} valid_elements String in the valid elements format to be parsed.
- */
- self.addValidElements = addValidElements;
-
- /**
- * Parses a valid elements string and sets it to the schema. The valid elements format is for example "element[attr=default|otherattr]".
- * Existing rules will be replaced with the ones specified, so this extends the schema.
- *
- * @method setValidElements
- * @param {String} valid_elements String in the valid elements format to be parsed.
- */
- self.setValidElements = setValidElements;
-
- /**
- * Adds custom non HTML elements to the schema.
- *
- * @method addCustomElements
- * @param {String} custom_elements Comma separated list of custom elements to add.
- */
- self.addCustomElements = addCustomElements;
-
- /**
- * Parses a valid children string and adds them to the schema structure. The valid children format is for example: "element[child1|child2]".
- *
- * @method addValidChildren
- * @param {String} valid_children Valid children elements string to parse
- */
- self.addValidChildren = addValidChildren;
-
- self.elements = elements;
- };
-})(tinymce);
</del></span></pre></div>
<a id="trunksrcwpincludesjswpdialogjsfromrev26863trunksrcwpincludesjstinymcepluginswpdialogsjswpdialogjs"></a>
<div class="copfile"><h4>Copied: trunk/src/wp-includes/js/wpdialog.js (from rev 26863, trunk/src/wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.js) (0 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/wpdialog.js (rev 0)
+++ trunk/src/wp-includes/js/wpdialog.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+( function($) {
+ $.widget('wp.wpdialog', $.ui.dialog, {
+ open: function() {
+ // Add beforeOpen event.
+ if ( this.isOpen() || false === this._trigger('beforeOpen') ) {
+ return;
+ }
+
+ // Open the dialog.
+ this._super();
+ // WebKit leaves focus in the TinyMCE editor unless we shift focus.
+ this.element.focus();
+ this._trigger('refresh');
+ }
+ });
+
+ $.wp.wpdialog.prototype.options.closeOnEscape = false;
+
+})(jQuery);
</ins></span></pre></div>
<a id="trunksrcwpincludesjswplinkjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/wplink.js (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/wplink.js 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/js/wplink.js 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-/* global ajaxurl, tinymce, wpLinkL10n, tinyMCEPopup, setUserSetting, wpActiveEditor */
</del><ins>+/* global ajaxurl, tinymce, wpLinkL10n, setUserSetting, wpActiveEditor */
</ins><span class="cx"> var wpLink;
</span><span class="cx">
</span><span class="cx"> (function($){
</span><span class="lines">@@ -59,13 +59,26 @@
</span><span class="cx"> }
</span><span class="cx"> },
</span><span class="cx">
</span><del>- open : function() {
- if ( !wpActiveEditor )
</del><ins>+ open : function( editorId ) {
+ if ( editorId ) {
+ window.wpActiveEditor = editorId;
+ }
+
+ if ( ! window.wpActiveEditor ) {
</ins><span class="cx"> return;
</span><ins>+ }
</ins><span class="cx">
</span><del>- this.textarea = $('#'+wpActiveEditor).get(0);
</del><ins>+ this.textarea = $( '#' + wpActiveEditor ).get(0);
</ins><span class="cx">
</span><del>- // Initialize the dialog if necessary (html mode).
</del><ins>+ if ( typeof tinymce !== 'undefined' ) {
+ ed = tinymce.get( wpActiveEditor );
+
+ if ( ed && tinymce.isIE ) {
+ ed.windowManager.bookmark = ed.selection.getBookmark();
+ }
+ }
+
+ // Initialize the dialog
</ins><span class="cx"> if ( ! inputs.dialog.data('wpdialog') ) {
</span><span class="cx"> inputs.dialog.wpdialog({
</span><span class="cx"> title: wpLinkL10n.title,
</span><span class="lines">@@ -80,7 +93,7 @@
</span><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> isMCE : function() {
</span><del>- return tinyMCEPopup && ( ed = tinyMCEPopup.editor ) && ! ed.isHidden();
</del><ins>+ return ed && ! ed.isHidden();
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> refresh : function() {
</span><span class="lines">@@ -102,19 +115,16 @@
</span><span class="cx"> rivers.recent.ajax();
</span><span class="cx"> },
</span><span class="cx">
</span><del>- mceRefresh : function() {
</del><ins>+ mceRefresh: function() {
</ins><span class="cx"> var e;
</span><del>- ed = tinyMCEPopup.editor;
</del><span class="cx">
</span><del>- tinyMCEPopup.restoreSelection();
-
</del><span class="cx"> // If link exists, select proper values.
</span><del>- if ( e = ed.dom.getParent(ed.selection.getNode(), 'A') ) {
</del><ins>+ if ( e = ed.dom.getParent( ed.selection.getNode(), 'A' ) ) {
</ins><span class="cx"> // Set URL and description.
</span><del>- inputs.url.val( ed.dom.getAttrib(e, 'href') );
- inputs.title.val( ed.dom.getAttrib(e, 'title') );
</del><ins>+ inputs.url.val( ed.dom.getAttrib( e, 'href' ) );
+ inputs.title.val( ed.dom.getAttrib( e, 'title' ) );
</ins><span class="cx"> // Set open in new tab.
</span><del>- inputs.openInNewTab.prop('checked', ( '_blank' == ed.dom.getAttrib( e, 'target' ) ) );
</del><ins>+ inputs.openInNewTab.prop( 'checked', ( '_blank' === ed.dom.getAttrib( e, 'target' ) ) );
</ins><span class="cx"> // Update save prompt.
</span><span class="cx"> inputs.submit.val( wpLinkL10n.update );
</span><span class="cx">
</span><span class="lines">@@ -124,16 +134,14 @@
</span><span class="cx"> }
</span><span class="cx"> },
</span><span class="cx">
</span><del>- close : function() {
- if ( wpLink.isMCE() )
- tinyMCEPopup.close();
- else
- inputs.dialog.wpdialog('close');
</del><ins>+ close: function() {
+ inputs.dialog.wpdialog('close');
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> onClose: function() {
</span><span class="cx"> if ( ! wpLink.isMCE() ) {
</span><span class="cx"> wpLink.textarea.focus();
</span><ins>+
</ins><span class="cx"> if ( wpLink.range ) {
</span><span class="cx"> wpLink.range.moveToBookmark( wpLink.range.getBookmark() );
</span><span class="cx"> wpLink.range.select();
</span><span class="lines">@@ -141,7 +149,7 @@
</span><span class="cx"> }
</span><span class="cx"> },
</span><span class="cx">
</span><del>- getAttrs : function() {
</del><ins>+ getAttrs: function() {
</ins><span class="cx"> return {
</span><span class="cx"> href : inputs.url.val(),
</span><span class="cx"> title : inputs.title.val(),
</span><span class="lines">@@ -149,15 +157,15 @@
</span><span class="cx"> };
</span><span class="cx"> },
</span><span class="cx">
</span><del>- update : function() {
</del><ins>+ update: function() {
</ins><span class="cx"> if ( wpLink.isMCE() )
</span><span class="cx"> wpLink.mceUpdate();
</span><span class="cx"> else
</span><span class="cx"> wpLink.htmlUpdate();
</span><span class="cx"> },
</span><span class="cx">
</span><del>- htmlUpdate : function() {
- var attrs, html, begin, end, cursor, selection,
</del><ins>+ htmlUpdate: function() {
+ var attrs, html, begin, end, cursor,
</ins><span class="cx"> textarea = wpLink.textarea;
</span><span class="cx">
</span><span class="cx"> if ( ! textarea )
</span><span class="lines">@@ -213,67 +221,43 @@
</span><span class="cx"> textarea.focus();
</span><span class="cx"> },
</span><span class="cx">
</span><del>- mceUpdate : function() {
- var ed = tinyMCEPopup.editor,
- attrs = wpLink.getAttrs(),
- e, b;
</del><ins>+ mceUpdate: function() {
+ var link,
+ attrs = wpLink.getAttrs();
</ins><span class="cx">
</span><del>- tinyMCEPopup.restoreSelection();
- e = ed.dom.getParent(ed.selection.getNode(), 'A');
</del><ins>+ wpLink.close();
+ ed.focus();
</ins><span class="cx">
</span><ins>+ if ( tinymce.isIE ) {
+ ed.selection.moveToBookmark( ed.windowManager.bookmark );
+ }
+
+ link = ed.dom.getParent( ed.selection.getNode(), 'a[href]' );
+
</ins><span class="cx"> // If the values are empty, unlink and return
</span><span class="cx"> if ( ! attrs.href || attrs.href == 'http://' ) {
</span><del>- if ( e ) {
- b = ed.selection.getBookmark();
- ed.dom.remove(e, 1);
- ed.selection.moveToBookmark(b);
- tinyMCEPopup.execCommand('mceEndUndoLevel');
- wpLink.close();
- }
</del><ins>+ ed.execCommand('unlink');
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (e == null) {
- ed.getDoc().execCommand('unlink', false, null);
- tinyMCEPopup.execCommand('mceInsertLink', false, '#mce_temp_url#', {skip_undo : 1});
-
- tinymce.each(ed.dom.select('a'), function(n) {
- if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {
- e = n;
- ed.dom.setAttribs(e, attrs);
- }
- });
-
- // Sometimes WebKit lets a user create a link where
- // they shouldn't be able to. In this case, CreateLink
- // injects "#mce_temp_url#" into their content. Fix it.
- if ( tinymce.isWebKit && $(e).text() == '#mce_temp_url#' ) {
- ed.dom.remove(e);
- e = null;
- }
</del><ins>+ if ( link ) {
+ ed.dom.setAttribs( link, attrs );
</ins><span class="cx"> } else {
</span><del>- ed.dom.setAttribs(e, attrs);
</del><ins>+ ed.execCommand( 'mceInsertLink', false, attrs );
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- // Move the caret if selection was not an image.
- if ( e && (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') ) {
- ed.selection.select(e);
- ed.selection.collapse(0);
- tinyMCEPopup.storeSelection();
- }
-
- ed.execCommand('mceEndUndoLevel');
- wpLink.close();
- ed.focus();
</del><ins>+ // Move the cursor to the end of the selection
+ ed.selection.collapse();
</ins><span class="cx"> },
</span><span class="cx">
</span><del>- updateFields : function( e, li, originalEvent ) {
</del><ins>+ updateFields: function( e, li, originalEvent ) {
</ins><span class="cx"> inputs.url.val( li.children('.item-permalink').val() );
</span><span class="cx"> inputs.title.val( li.hasClass('no-title') ? '' : li.children('.item-title').text() );
</span><span class="cx"> if ( originalEvent && originalEvent.type == 'click' )
</span><span class="cx"> inputs.url.focus();
</span><span class="cx"> },
</span><del>- setDefaultValues : function() {
</del><ins>+
+ setDefaultValues: function() {
</ins><span class="cx"> // Set URL and description to defaults.
</span><span class="cx"> // Leave the new tab setting as-is.
</span><span class="cx"> inputs.url.val('http://');
</span><span class="lines">@@ -283,7 +267,7 @@
</span><span class="cx"> inputs.submit.val( wpLinkL10n.save );
</span><span class="cx"> },
</span><span class="cx">
</span><del>- searchInternalLinks : function() {
</del><ins>+ searchInternalLinks: function() {
</ins><span class="cx"> var t = $(this), waiting,
</span><span class="cx"> search = t.val();
</span><span class="cx">
</span><span class="lines">@@ -306,16 +290,17 @@
</span><span class="cx"> }
</span><span class="cx"> },
</span><span class="cx">
</span><del>- next : function() {
</del><ins>+ next: function() {
</ins><span class="cx"> rivers.search.next();
</span><span class="cx"> rivers.recent.next();
</span><span class="cx"> },
</span><del>- prev : function() {
</del><ins>+
+ prev: function() {
</ins><span class="cx"> rivers.search.prev();
</span><span class="cx"> rivers.recent.prev();
</span><span class="cx"> },
</span><span class="cx">
</span><del>- keydown : function( event ) {
</del><ins>+ keydown: function( event ) {
</ins><span class="cx"> var fn, key = $.ui.keyCode;
</span><span class="cx">
</span><span class="cx"> if ( event.which !== key.UP && event.which !== key.DOWN ) {
</span><span class="lines">@@ -345,7 +330,7 @@
</span><span class="cx"> }
</span><span class="cx"> },
</span><span class="cx">
</span><del>- delayedCallback : function( func, delay ) {
</del><ins>+ delayedCallback: function( func, delay ) {
</ins><span class="cx"> var timeoutTriggered, funcTriggered, funcArgs, funcContext;
</span><span class="cx">
</span><span class="cx"> if ( ! delay )
</span><span class="lines">@@ -368,7 +353,7 @@
</span><span class="cx"> };
</span><span class="cx"> },
</span><span class="cx">
</span><del>- toggleInternalLinking : function( event ) {
</del><ins>+ toggleInternalLinking: function( event ) {
</ins><span class="cx"> var panel = $('#search-panel'),
</span><span class="cx"> widget = inputs.dialog.wpdialog('widget'),
</span><span class="cx"> // We're about to toggle visibility; it's currently the opposite
</span></span></pre></div>
<a id="trunksrcwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/script-loader.php (26875 => 26876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/script-loader.php 2013-12-28 05:24:32 UTC (rev 26875)
+++ trunk/src/wp-includes/script-loader.php 2013-12-28 23:52:04 UTC (rev 26876)
</span><span class="lines">@@ -342,10 +342,8 @@
</span><span class="cx"> 'noMatchesFound' => __('No matches found.')
</span><span class="cx"> ) );
</span><span class="cx">
</span><del>- $scripts->add( 'wpdialogs', "/wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog$suffix.js", array( 'jquery-ui-dialog' ), false, 1 );
</del><ins>+ $scripts->add( 'wpdialogs', "/wp-includes/js/wpdialog$suffix.js", array( 'jquery-ui-dialog' ), false, 1 );
</ins><span class="cx">
</span><del>- $scripts->add( 'wpdialogs-popup', "/wp-includes/js/tinymce/plugins/wpdialogs/js/popup$suffix.js", array( 'wpdialogs' ), false, 1 );
-
</del><span class="cx"> $scripts->add( 'word-count', "/wp-admin/js/word-count$suffix.js", array( 'jquery' ), false, 1 );
</span><span class="cx"> did_action( 'init' ) && $scripts->localize( 'word-count', 'wordCountL10n', array(
</span><span class="cx"> /* translators: If your word count is based on single characters (East Asian characters),
</span></span></pre>
</div>
</div>
</body>
</html>