<!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>[40583] trunk/src: TinyMCE: update to 4.6.0.</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" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/40583">40583</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/40583","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>azaozz</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2017-05-08 05:31:08 +0000 (Mon, 08 May 2017)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>TinyMCE: update to 4.6.0. Has many new features and bug fixes, changelog: https://www.tinymce.com/docs/changelog/#version460-may42017.

Fixes <a href="https://core.trac.wordpress.org/ticket/40690">#40690</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesupdatecorephp">trunk/src/wp-admin/includes/update-core.php</a></li>
<li><a href="#trunksrcwpincludesclasswpeditorphp">trunk/src/wp-includes/class-wp-editor.php</a></li>
<li><a href="#trunksrcwpincludesgeneraltemplatephp">trunk/src/wp-includes/general-template.php</a></li>
<li><a href="#trunksrcwpincludesjstinymcelicensetxt">trunk/src/wp-includes/js/tinymce/license.txt</a></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><a href="#trunksrcwpincludesjstinymcepluginscolorpickerpluginjs">trunk/src/wp-includes/js/tinymce/plugins/colorpicker/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginscolorpickerpluginminjs">trunk/src/wp-includes/js/tinymce/plugins/colorpicker/plugin.min.js</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><a href="#trunksrcwpincludesjstinymcepluginshrpluginjs">trunk/src/wp-includes/js/tinymce/plugins/hr/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginshrpluginminjs">trunk/src/wp-includes/js/tinymce/plugins/hr/plugin.min.js</a></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><a href="#trunksrcwpincludesjstinymcepluginslistspluginjs">trunk/src/wp-includes/js/tinymce/plugins/lists/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginslistspluginminjs">trunk/src/wp-includes/js/tinymce/plugins/lists/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="#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><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="#trunksrcwpincludesjstinymcepluginswpviewpluginjs">trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js</a></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><a href="#trunksrcwpincludesjstinymceskinslightgrayskinmincss">trunk/src/wp-includes/js/tinymce/skins/lightgray/skin.min.css</a></li>
<li><a href="#trunksrcwpincludesjstinymcethemesinlitethemejs">trunk/src/wp-includes/js/tinymce/themes/inlite/theme.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcethemesinlitethememinjs">trunk/src/wp-includes/js/tinymce/themes/inlite/theme.min.js</a></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="#trunksrcwpincludesjstinymcetiny_mce_popupjs">trunk/src/wp-includes/js/tinymce/tiny_mce_popup.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="#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="#trunksrcwpincludesversionphp">trunk/src/wp-includes/version.php</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesjstinymcepluginsmediamoxieplayerswf">trunk/src/wp-includes/js/tinymce/plugins/media/moxieplayer.swf</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayfontsreadmemd">trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/readme.md</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayfontstinymcesmalljson">trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.json</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayfontstinymcejson">trunk/src/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.json</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinslightgrayskinie7mincss">trunk/src/wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesupdatecorephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/update-core.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/update-core.php       2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-admin/includes/update-core.php 2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -705,6 +705,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp-includes/theme-compat/comments-popup.php',
</span><span class="cx" style="display: block; padding: 0 10px"> // 4.6
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp-admin/includes/class-wp-automatic-upgrader.php', // Wrong file name, see #37628.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// 4.8
+'wp-includes/js/tinymce/plugins/media/moxieplayer.swf',
+'wp-includes/js/tinymce/skins/lightgray/fonts/readme.md',
+'wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.json',
+'wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.json',
+'wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css',
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpeditorphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-editor.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-editor.php 2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/class-wp-editor.php   2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -947,6 +947,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'cache_suffix' => 'wp-mce-' . $tinymce_version,
</span><span class="cx" style="display: block; padding: 0 10px">                        'resize' => 'vertical',
</span><span class="cx" style="display: block; padding: 0 10px">                        'menubar' => false,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        'branding' => false,
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        // Limit the preview styles in the menu/toolbar
</span><span class="cx" style="display: block; padding: 0 10px">                        'preview_styles' => 'font-family font-size font-weight font-style text-decoration text-transform',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1039,6 +1040,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'Name' => _x( 'Name', 'Name of link anchor (TinyMCE)' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'Anchor' => _x( 'Anchor', 'Link anchor (TinyMCE)' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'Anchors' => _x( 'Anchors', 'Link anchors (TinyMCE)' ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        'Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.' =>
+                               __( 'Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.' ),
+                       'Id' => _x( 'Id', 'Id for link anchor (TinyMCE)' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        // Fullpage plugin
</span><span class="cx" style="display: block; padding: 0 10px">                        'Document properties' => __( 'Document properties' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1050,6 +1054,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'Author' => __( 'Author' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        // Media, image plugins
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        'Image' => __( 'Image' ),
</ins><span class="cx" style="display: block; padding: 0 10px">                         'Insert/edit image' => array( __( 'Insert/edit image' ), 'accessM' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'General' => __( 'General' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'Advanced' => __( 'Advanced' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1061,8 +1066,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'Style' => __( 'Style' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'Dimensions' => __( 'Dimensions' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'Insert image' => __( 'Insert image' ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        'Date/time' => __( 'Date/time' ),
</ins><span class="cx" style="display: block; padding: 0 10px">                         'Insert date/time' => __( 'Insert date/time' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'Insert/edit video' => __( 'Insert/edit video' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'Table of Contents' => __( 'Table of Contents' ),
+                       'Insert/Edit code sample' => __( 'Insert/edit code sample' ),
+                       'Language' => __( 'Language' ),
+                       'Media' => __( 'Media' ),
+                       'Insert/edit media' => __( 'Insert/edit media' ),
</ins><span class="cx" style="display: block; padding: 0 10px">                         'Poster' => __( 'Poster' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'Alternative source' => __( 'Alternative source' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'Paste your embed code below:' => __( 'Paste your embed code below:' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1087,10 +1097,26 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'Insert/edit link' => array( __( 'Insert/edit link' ), 'metaK' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'Remove link' => array( __( 'Remove link' ), 'accessS' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        // Link plugin
+                       'Link' => __( 'Link' ),
+                       'Insert link' => __( 'Insert link' ),
+                       'Insert/edit link' => __( 'Insert/edit link' ),
+                       'Target' => __( 'Target' ),
+                       'New window' => __( 'New window' ),
+                       'Text to display' => __( 'Text to display' ),
+                       'Url' => __( 'URL' ),
+                       'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?' =>
+                               __( 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?' ),
+                       'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?' =>
+                               __( 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?' ),
+
</ins><span class="cx" style="display: block; padding: 0 10px">                         'Color' => __( 'Color' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'Custom color' => __( 'Custom color' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'Custom...' => _x( 'Custom...', 'label for custom color' ), // no ellipsis
</span><span class="cx" style="display: block; padding: 0 10px">                        'No color' => __( 'No color' ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        'R' => _x( 'R', 'Short for red in RGB' ),
+                       'G' => _x( 'G', 'Short for green in RGB' ),
+                       'B' => _x( 'B', 'Short for blue in RGB' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        // Spelling, search/replace plugins
</span><span class="cx" style="display: block; padding: 0 10px">                        'Could not find the specified string.' => __( 'Could not find the specified string.' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1235,16 +1261,27 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                /**
-                * Link plugin (not included):
-                *      Insert link
-                *      Target
-                *      New window
-                *      Text to display
-                *      The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?
-                *      The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?
-                *      Url
-                */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         /*
+               Imagetools plugin (not included):
+                       'Edit image' => __( 'Edit image' ),
+                       'Image options' => __( 'Image options' ),
+                       'Back' => __( 'Back' ),
+                       'Invert' => __( 'Invert' ),
+                       'Flip horizontally' => __( 'Flip horizontally' ),
+                       'Flip vertically' => __( 'Flip vertically' ),
+                       'Crop' => __( 'Crop' ),
+                       'Orientation' => __( 'Orientation' ),
+                       'Resize' => __( 'Resize' ),
+                       'Rotate clockwise' => __( 'Rotate clockwise' ),
+                       'Rotate counterclockwise' => __( 'Rotate counterclockwise' ),
+                       'Sharpen' => __( 'Sharpen' ),
+                       'Brightness' => __( 'Brightness' ),
+                       'Color levels' => __( 'Color levels' ),
+                       'Contrast' => __( 'Contrast' ),
+                       'Gamma' => __( 'Gamma' ),
+                       'Zoom in' => __( 'Zoom in' ),
+                       'Zoom out' => __( 'Zoom out' ),
+               */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                return self::$translation;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1456,6 +1493,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        var init, id, $wrap;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( typeof tinymce !== 'undefined' ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                if ( tinymce.Env.ie && tinymce.Env.ie < 11 ) {
+                                       tinymce.$( '.wp-editor-wrap ' ).removeClass( 'tmce-active' ).addClass( 'html-active' );
+                                       return;
+                               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                                 for ( id in tinyMCEPreInit.mceInit ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        init = tinyMCEPreInit.mceInit[id];
</span><span class="cx" style="display: block; padding: 0 10px">                                        $wrap = tinymce.$( '#wp-' + id + '-wrap' );
</span></span></pre></div>
<a id="trunksrcwpincludesgeneraltemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/general-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/general-template.php        2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/general-template.php  2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2988,7 +2988,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                if ( get_user_option( 'rich_editing' ) == 'true' || ! is_user_logged_in() ) { // default to 'true' for logged out users
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( $is_safari ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $wp_rich_edit = ! wp_is_mobile() || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval( $match[1] ) >= 534 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        } elseif ( $is_gecko || $is_chrome || $is_IE || $is_edge || ( $is_opera && !wp_is_mobile() ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 } elseif ( $is_IE ) {
+                               $wp_rich_edit = ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE ' ) === false );
+                       } elseif ( $is_gecko || $is_chrome || $is_edge || ( $is_opera && !wp_is_mobile() ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $wp_rich_edit = true;
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcelicensetxt"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/tinymce/license.txt</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/tinymce/license.txt      2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/js/tinymce/license.txt        2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +1,5 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                  GNU LESSER GENERAL PUBLIC LICENSE
-                      Version 2.1, February 1999
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      GNU LESSER GENERAL PUBLIC LICENSE
+           Version 2.1, February 1999
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">  Copyright (C) 1991, 1999 Free Software Foundation, Inc.
</span><span class="cx" style="display: block; padding: 0 10px">  51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,7 +10,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">  as the successor of the GNU Library Public License, version 2, hence
</span><span class="cx" style="display: block; padding: 0 10px">  the version number 2.1.]
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                            Preamble
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          Preamble
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">   The licenses for most software are designed to take away your
</span><span class="cx" style="display: block; padding: 0 10px"> freedom to share and change it.  By contrast, the GNU General Public
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -112,7 +112,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> former contains code derived from the library, whereas the latter must
</span><span class="cx" style="display: block; padding: 0 10px"> be combined with the library in order to run.
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                  GNU LESSER GENERAL PUBLIC LICENSE
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      GNU LESSER GENERAL PUBLIC LICENSE
</ins><span class="cx" style="display: block; padding: 0 10px">    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">   0. This License Agreement applies to any software library or other
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -432,7 +432,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> of all derivatives of our free software and of promoting the sharing
</span><span class="cx" style="display: block; padding: 0 10px"> and reuse of software generally.
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                            NO WARRANTY
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          NO WARRANTY
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">   15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
</span><span class="cx" style="display: block; padding: 0 10px"> WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -455,7 +455,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
</span><span class="cx" style="display: block; padding: 0 10px"> DAMAGES.
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                     END OF TERMS AND CONDITIONS
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         END OF TERMS AND CONDITIONS
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">            How to Apply These Terms to Your New Libraries
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginscharmappluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.js        2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.js  2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,466 +1,614 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+(function () {
+
+var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
+
+// Used when there is no 'main' module.
+// The name is probably (hopefully) unique so minification removes for releases.
+var register_3795 = function (id) {
+  var module = dem(id);
+  var fragments = id.split('.');
+  var target = Function('return this;')();
+  for (var i = 0; i < fragments.length - 1; ++i) {
+    if (target[fragments[i]] === undefined)
+      target[fragments[i]] = {};
+    target = target[fragments[i]];
+  }
+  target[fragments[fragments.length - 1]] = module;
+};
+
+var instantiate = function (id) {
+  var actual = defs[id];
+  var dependencies = actual.deps;
+  var definition = actual.defn;
+  var len = dependencies.length;
+  var instances = new Array(len);
+  for (var i = 0; i < len; ++i)
+    instances[i] = dem(dependencies[i]);
+  var defResult = definition.apply(null, instances);
+  if (defResult === undefined)
+     throw 'module [' + id + '] returned undefined';
+  actual.instance = defResult;
+};
+
+var def = function (id, dependencies, definition) {
+  if (typeof id !== 'string')
+    throw 'module id must be a string';
+  else if (dependencies === undefined)
+    throw 'no dependencies for ' + id;
+  else if (definition === undefined)
+    throw 'no definition function for ' + id;
+  defs[id] = {
+    deps: dependencies,
+    defn: definition,
+    instance: undefined
+  };
+};
+
+var dem = function (id) {
+  var actual = defs[id];
+  if (actual === undefined)
+    throw 'module [' + id + '] was undefined';
+  else if (actual.instance === undefined)
+    instantiate(id);
+  return actual.instance;
+};
+
+var req = function (ids, callback) {
+  var len = ids.length;
+  var instances = new Array(len);
+  for (var i = 0; i < len; ++i)
+    instances.push(dem(ids[i]));
+  callback.apply(null, callback);
+};
+
+var ephox = {};
+
+ephox.bolt = {
+  module: {
+    api: {
+      define: def,
+      require: req,
+      demand: dem
+    }
+  }
+};
+
+var define = def;
+var require = req;
+var demand = dem;
+// this helps with minificiation when using a lot of global references
+var defineGlobal = function (id, ref) {
+  define(id, [], function () { return ref; });
+};
+/*jsc
+["tinymce.plugins.charmap.Plugin","tinymce.core.PluginManager","tinymce.core.util.Tools","global!tinymce.util.Tools.resolve"]
+jsc*/
+defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * plugin.js
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * ResolveGlobal.js
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Released under LGPL License.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * License: http://www.tinymce.com/license
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/*global tinymce:true */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.core.PluginManager',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.PluginManager');
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-tinymce.PluginManager.add('charmap', function(editor) {
-       var isArray = tinymce.util.Tools.isArray;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * ResolveGlobal.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function getDefaultCharMap() {
-               return [
-                       ['160', 'no-break space'],
-                       ['173', 'soft hyphen'],
-                       ['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'],
-                       ['256', 'A - macron'],
-                       ['198', 'ligature AE'],
-                       ['199', 'C - cedilla'],
-                       ['200', 'E - grave'],
-                       ['201', 'E - acute'],
-                       ['202', 'E - circumflex'],
-                       ['203', 'E - diaeresis'],
-                       ['274', 'E - macron'],
-                       ['204', 'I - grave'],
-                       ['205', 'I - acute'],
-                       ['206', 'I - circumflex'],
-                       ['207', 'I - diaeresis'],
-                       ['298', 'I - macron'],
-                       ['208', 'ETH'],
-                       ['209', 'N - tilde'],
-                       ['210', 'O - grave'],
-                       ['211', 'O - acute'],
-                       ['212', 'O - circumflex'],
-                       ['213', 'O - tilde'],
-                       ['214', 'O - diaeresis'],
-                       ['216', 'O - slash'],
-                       ['332', 'O - macron'],
-                       ['338', 'ligature OE'],
-                       ['352', 'S - caron'],
-                       ['217', 'U - grave'],
-                       ['218', 'U - acute'],
-                       ['219', 'U - circumflex'],
-                       ['220', 'U - diaeresis'],
-                       ['362', 'U - macron'],
-                       ['221', 'Y - acute'],
-                       ['376', 'Y - diaeresis'],
-                       ['562', 'Y - macron'],
-                       ['222', 'THORN'],
-                       ['224', 'a - grave'],
-                       ['225', 'a - acute'],
-                       ['226', 'a - circumflex'],
-                       ['227', 'a - tilde'],
-                       ['228', 'a - diaeresis'],
-                       ['229', 'a - ring above'],
-                       ['257', 'a - macron'],
-                       ['230', 'ligature ae'],
-                       ['231', 'c - cedilla'],
-                       ['232', 'e - grave'],
-                       ['233', 'e - acute'],
-                       ['234', 'e - circumflex'],
-                       ['235', 'e - diaeresis'],
-                       ['275', 'e - macron'],
-                       ['236', 'i - grave'],
-                       ['237', 'i - acute'],
-                       ['238', 'i - circumflex'],
-                       ['239', 'i - diaeresis'],
-                       ['299', 'i - macron'],
-                       ['240', 'eth'],
-                       ['241', 'n - tilde'],
-                       ['242', 'o - grave'],
-                       ['243', 'o - acute'],
-                       ['244', 'o - circumflex'],
-                       ['245', 'o - tilde'],
-                       ['246', 'o - diaeresis'],
-                       ['248', 'o slash'],
-                       ['333', 'o macron'],
-                       ['339', 'ligature oe'],
-                       ['353', 's - caron'],
-                       ['249', 'u - grave'],
-                       ['250', 'u - acute'],
-                       ['251', 'u - circumflex'],
-                       ['252', 'u - diaeresis'],
-                       ['363', 'u - macron'],
-                       ['253', 'y - acute'],
-                       ['254', 'thorn'],
-                       ['255', 'y - diaeresis'],
-                       ['563', 'y - macron'],
-                       ['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']
-               ];
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.core.util.Tools',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.util.Tools');
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function charmapFilter(charmap) {
-               return tinymce.util.Tools.grep(charmap, function(item) {
-                       return isArray(item) && item.length == 2;
-               });
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Plugin.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function getCharsFromSetting(settingValue) {
-               if (isArray(settingValue)) {
-                       return [].concat(charmapFilter(settingValue));
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * This class contains all core logic for the charmap plugin.
+ *
+ * @class tinymce.charmap.Plugin
+ * @private
+ */
+define(
+  'tinymce.plugins.charmap.Plugin',
+  [
+    'tinymce.core.PluginManager',
+    'tinymce.core.util.Tools'
+  ],
+  function (PluginManager, Tools) {
+    PluginManager.add('charmap', function (editor) {
+      var isArray = Tools.isArray;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (typeof settingValue == "function") {
-                       return settingValue();
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function getDefaultCharMap() {
+        return [
+          ['160', 'no-break space'],
+          ['173', 'soft hyphen'],
+          ['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'],
+          ['256', 'A - macron'],
+          ['198', 'ligature AE'],
+          ['199', 'C - cedilla'],
+          ['200', 'E - grave'],
+          ['201', 'E - acute'],
+          ['202', 'E - circumflex'],
+          ['203', 'E - diaeresis'],
+          ['274', 'E - macron'],
+          ['204', 'I - grave'],
+          ['205', 'I - acute'],
+          ['206', 'I - circumflex'],
+          ['207', 'I - diaeresis'],
+          ['298', 'I - macron'],
+          ['208', 'ETH'],
+          ['209', 'N - tilde'],
+          ['210', 'O - grave'],
+          ['211', 'O - acute'],
+          ['212', 'O - circumflex'],
+          ['213', 'O - tilde'],
+          ['214', 'O - diaeresis'],
+          ['216', 'O - slash'],
+          ['332', 'O - macron'],
+          ['338', 'ligature OE'],
+          ['352', 'S - caron'],
+          ['217', 'U - grave'],
+          ['218', 'U - acute'],
+          ['219', 'U - circumflex'],
+          ['220', 'U - diaeresis'],
+          ['362', 'U - macron'],
+          ['221', 'Y - acute'],
+          ['376', 'Y - diaeresis'],
+          ['562', 'Y - macron'],
+          ['222', 'THORN'],
+          ['224', 'a - grave'],
+          ['225', 'a - acute'],
+          ['226', 'a - circumflex'],
+          ['227', 'a - tilde'],
+          ['228', 'a - diaeresis'],
+          ['229', 'a - ring above'],
+          ['257', 'a - macron'],
+          ['230', 'ligature ae'],
+          ['231', 'c - cedilla'],
+          ['232', 'e - grave'],
+          ['233', 'e - acute'],
+          ['234', 'e - circumflex'],
+          ['235', 'e - diaeresis'],
+          ['275', 'e - macron'],
+          ['236', 'i - grave'],
+          ['237', 'i - acute'],
+          ['238', 'i - circumflex'],
+          ['239', 'i - diaeresis'],
+          ['299', 'i - macron'],
+          ['240', 'eth'],
+          ['241', 'n - tilde'],
+          ['242', 'o - grave'],
+          ['243', 'o - acute'],
+          ['244', 'o - circumflex'],
+          ['245', 'o - tilde'],
+          ['246', 'o - diaeresis'],
+          ['248', 'o slash'],
+          ['333', 'o macron'],
+          ['339', 'ligature oe'],
+          ['353', 's - caron'],
+          ['249', 'u - grave'],
+          ['250', 'u - acute'],
+          ['251', 'u - circumflex'],
+          ['252', 'u - diaeresis'],
+          ['363', 'u - macron'],
+          ['253', 'y - acute'],
+          ['254', 'thorn'],
+          ['255', 'y - diaeresis'],
+          ['563', 'y - macron'],
+          ['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']
+        ];
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return [];
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function charmapFilter(charmap) {
+        return Tools.grep(charmap, function (item) {
+          return isArray(item) && item.length == 2;
+        });
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function extendCharMap(charmap) {
-               var settings = editor.settings;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function getCharsFromSetting(settingValue) {
+        if (isArray(settingValue)) {
+          return [].concat(charmapFilter(settingValue));
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (settings.charmap) {
-                       charmap = getCharsFromSetting(settings.charmap);
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (typeof settingValue == "function") {
+          return settingValue();
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (settings.charmap_append) {
-                       return [].concat(charmap).concat(getCharsFromSetting(settings.charmap_append));
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        return [];
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return charmap;
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function extendCharMap(charmap) {
+        var settings = editor.settings;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function getCharMap() {
-               return extendCharMap(getDefaultCharMap());
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (settings.charmap) {
+          charmap = getCharsFromSetting(settings.charmap);
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function insertChar(chr) {
-               editor.fire('insertCustomChar', {chr: chr}).chr;
-               editor.execCommand('mceInsertContent', false, chr);
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (settings.charmap_append) {
+          return [].concat(charmap).concat(getCharsFromSetting(settings.charmap_append));
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function showDialog() {
-               var gridHtml, x, y, win;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        return charmap;
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function getParentTd(elm) {
-                       while (elm) {
-                               if (elm.nodeName == 'TD') {
-                                       return elm;
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function getCharMap() {
+        return extendCharMap(getDefaultCharMap());
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                elm = elm.parentNode;
-                       }
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function insertChar(chr) {
+        editor.fire('insertCustomChar', { chr: chr }).chr;
+        editor.execCommand('mceInsertContent', false, chr);
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                gridHtml = '<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function showDialog() {
+        var gridHtml, x, y, win;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                var charmap = getCharMap();
-               var width = Math.min(charmap.length, 25);
-               var height = Math.ceil(charmap.length / width);
-               for (y = 0; y < height; y++) {
-                       gridHtml += '<tr>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        function getParentTd(elm) {
+          while (elm) {
+            if (elm.nodeName == 'TD') {
+              return elm;
+            }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        for (x = 0; x < width; x++) {
-                               var index = y * width + x;
-                               if (index < charmap.length) {
-                                       var chr = charmap[index];
-                                       var chrText = chr ? String.fromCharCode(parseInt(chr[0], 10)) : '&nbsp;';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            elm = elm.parentNode;
+          }
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        gridHtml += (
-                                               '<td title="' + chr[1] + '"><div tabindex="-1" title="' + chr[1] + '" role="button" data-chr="' + chrText + '">' +
-                                                       chrText +
-                                               '</div></td>'
-                                       );
-                               } else {
-                                       gridHtml += '<td />';
-                               }
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        gridHtml = '<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        gridHtml += '</tr>';
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        var charmap = getCharMap();
+        var width = Math.min(charmap.length, 25);
+        var height = Math.ceil(charmap.length / width);
+        for (y = 0; y < height; y++) {
+          gridHtml += '<tr>';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                gridHtml += '</tbody></table>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          for (x = 0; x < width; x++) {
+            var index = y * width + x;
+            if (index < charmap.length) {
+              var chr = charmap[index];
+              var chrText = chr ? String.fromCharCode(parseInt(chr[0], 10)) : '&nbsp;';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                var charMapPanel = {
-                       type: 'container',
-                       html: gridHtml,
-                       onclick: function(e) {
-                               var target = e.target;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+              gridHtml += (
+                '<td title="' + chr[1] + '">' +
+                '<div tabindex="-1" title="' + chr[1] + '" role="button" data-chr="' + chrText + '">' +
+                chrText +
+                '</div>' +
+                '</td>'
+              );
+            } else {
+              gridHtml += '<td />';
+            }
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (/^(TD|DIV)$/.test(target.nodeName)) {
-                                       if (getParentTd(target).firstChild) {
-                                               insertChar(target.getAttribute('data-chr'));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          gridHtml += '</tr>';
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                if (!e.ctrlKey) {
-                                                       win.close();
-                                               }
-                                       }
-                               }
-                       },
-                       onmouseover: function(e) {
-                               var td = getParentTd(e.target);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        gridHtml += '</tbody></table>';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (td && td.firstChild) {
-                                       win.find('#preview').text(td.firstChild.firstChild.data);
-                                       win.find('#previewTitle').text(td.title);
-                               } else {
-                                       win.find('#preview').text(' ');
-                                       win.find('#previewTitle').text(' ');
-                               }
-                       }
-               };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        var charMapPanel = {
+          type: 'container',
+          html: gridHtml,
+          onclick: function (e) {
+            var target = e.target;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                win = editor.windowManager.open({
-                       title: "Special character",
-                       spacing: 10,
-                       padding: 10,
-                       items: [
-                               charMapPanel,
-                               {
-                                       type: 'container',
-                                       layout: 'flex',
-                                       direction: 'column',
-                                       align: 'center',
-                                       spacing: 5,
-                                       minWidth: 160,
-                                       minHeight: 160,
-                                       items: [
-                                               {
-                                                       type: 'label',
-                                                       name: 'preview',
-                                                       text: ' ',
-                                                       style: 'font-size: 40px; text-align: center',
-                                                       border: 1,
-                                                       minWidth: 140,
-                                                       minHeight: 80
-                                               },
-                                               {
-                                                       type: 'label',
-                                                       name: 'previewTitle',
-                                                       text: ' ',
-                                                       style: 'text-align: center',
-                                                       border: 1,
-                                                       minWidth: 140,
-                                                       minHeight: 80
-                                               }
-                                       ]
-                               }
-                       ],
-                       buttons: [
-                               {text: "Close", onclick: function() {
-                                       win.close();
-                               }}
-                       ]
-               });
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            if (/^(TD|DIV)$/.test(target.nodeName)) {
+              var charDiv = getParentTd(target).firstChild;
+              if (charDiv && charDiv.hasAttribute('data-chr')) {
+                insertChar(charDiv.getAttribute('data-chr'));
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.addCommand('mceShowCharmap', showDialog);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                if (!e.ctrlKey) {
+                  win.close();
+                }
+              }
+            }
+          },
+          onmouseover: function (e) {
+            var td = getParentTd(e.target);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.addButton('charmap', {
-               icon: 'charmap',
-               tooltip: 'Special character',
-               cmd: 'mceShowCharmap'
-       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            if (td && td.firstChild) {
+              win.find('#preview').text(td.firstChild.firstChild.data);
+              win.find('#previewTitle').text(td.title);
+            } else {
+              win.find('#preview').text(' ');
+              win.find('#previewTitle').text(' ');
+            }
+          }
+        };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.addMenuItem('charmap', {
-               icon: 'charmap',
-               text: 'Special character',
-               cmd: 'mceShowCharmap',
-               context: 'insert'
-       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        win = editor.windowManager.open({
+          title: "Special character",
+          spacing: 10,
+          padding: 10,
+          items: [
+            charMapPanel,
+            {
+              type: 'container',
+              layout: 'flex',
+              direction: 'column',
+              align: 'center',
+              spacing: 5,
+              minWidth: 160,
+              minHeight: 160,
+              items: [
+                {
+                  type: 'label',
+                  name: 'preview',
+                  text: ' ',
+                  style: 'font-size: 40px; text-align: center',
+                  border: 1,
+                  minWidth: 140,
+                  minHeight: 80
+                },
+                {
+                  type: 'label',
+                  name: 'previewTitle',
+                  text: ' ',
+                  style: 'text-align: center',
+                  border: 1,
+                  minWidth: 140,
+                  minHeight: 80
+                }
+              ]
+            }
+          ],
+          buttons: [
+            {
+              text: "Close", onclick: function () {
+                win.close();
+              }
+            }
+          ]
+        });
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        return {
-               getCharMap: getCharMap,
-               insertChar: insertChar
-       };
-});
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      editor.addCommand('mceShowCharmap', showDialog);
+
+      editor.addButton('charmap', {
+        icon: 'charmap',
+        tooltip: 'Special character',
+        cmd: 'mceShowCharmap'
+      });
+
+      editor.addMenuItem('charmap', {
+        icon: 'charmap',
+        text: 'Special character',
+        cmd: 'mceShowCharmap',
+        context: 'insert'
+      });
+
+      return {
+        getCharMap: getCharMap,
+        insertChar: insertChar
+      };
+    });
+
+    return function () { };
+  }
+);
+dem('tinymce.plugins.charmap.Plugin')();
+})();
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginscharmappluginminjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.min.js    2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/js/tinymce/plugins/charmap/plugin.min.js      2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1 +1 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-tinymce.PluginManager.add("charmap",function(e){function t(){return[["160","no-break space"],["173","soft hyphen"],["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"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign&quo
 t;],["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"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254",&quo
 t;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"],["402","function / florin"],["8747","integral"],[&quot
 ;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","as
 terisk 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"],["256","A - macron"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["274","E - macron"],["204",&quot
 ;I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["298","I - macron"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["332","O - macron"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["362","U - macron"],["221","Y - acute"],["376","Y - diaeresis"],["562","Y - macron"],["222","THORN
 "],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["257","a - macron"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["275","e - macron"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["299","i - macron"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumfle
 x"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["333","o macron"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["363","u - macron"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["563","y - macron"],["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&quo
 t;],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["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","upwa
 rds 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",&
 quot;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"]]}function n(e){return tinymce.util.Tools.grep(e,function(e){return l(e)&&2==e.length})}function r(e){return l(e)?[].concat(n(e)):"function"==typeof e?e():[]}function i(t){var n=e.settings;return n.charmap&&(t=r(n.charmap)),n.charmap_append?[].concat(t).concat(r(n.charmap_append)):t}function o(){return i(t())}function a(t){e.fire("insertCustomChar",{chr:t}).chr,e.execCommand("mceInsertContent",!1,t)}function s(){function t(e){for(;e;){if("TD&quo
 t;==e.nodeName)return e;e=e.parentNode}}var n,r,i,s;n='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';var l=o(),u=Math.min(l.length,25),c=Math.ceil(l.length/u);for(i=0;i<c;i++){for(n+="<tr>",r=0;r<u;r++){var d=i*u+r;if(d<l.length){var f=l[d],p=f?String.fromCharCode(parseInt(f[0],10)):"&nbsp;";n+='<td title="'+f[1]+'"><div tabindex="-1" title="'+f[1]+'" role="button" data-chr="'+p+'">'+p+"</div></td>"}else n+="<td />"}n+="</tr>"}n+="</tbody></table>";var h={type:"container",html:n,onclick:function(e){var n=e.target;/^(TD|DIV)$/.test(n.nodeName)&&t(n).firstChild&&(a(n.getAttribute("data-chr")),e.ctrlKey||s.close())},onmouseover:function(e){var n=t(e.target);n&&n.firstChild?(s.find("#preview")
 .text(n.firstChild.firstChild.data),s.find("#previewTitle").text(n.title)):(s.find("#preview").text(" "),s.find("#previewTitle").text(" "))}};s=e.windowManager.open({title:"Special character",spacing:10,padding:10,items:[h,{type:"container",layout:"flex",direction:"column",align:"center",spacing:5,minWidth:160,minHeight:160,items:[{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:140,minHeight:80},{type:"label",name:"previewTitle",text:" ",style:"text-align: center",border:1,minWidth:140,minHeight:80}]}],buttons:[{text:"Close",onclick:function(){s.close()}}]})}var l=tinymce.util.Tools.isArray;return e.addCommand("mceShowCharmap",s),e.addButton("charmap",{icon:"charmap",tooltip:"Special character",cmd:"m
 ceShowCharmap"}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",cmd:"mceShowCharmap",context:"insert"}),{getCharMap:o,insertChar:a}});
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("3",tinymce.util.Tools.resolve),g("1",[&q
 uot;3"],function(a){return a("tinymce.PluginManager")}),g("2",["3"],function(a){return a("tinymce.util.Tools")}),g("0",["1","2"],function(a,b){return a.add("charmap",function(a){function c(){return[["160","no-break space"],["173","soft hyphen"],["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"],["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"],["8211","en da
 sh"],["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 qu
 arters"],["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"],["87
 09","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"],["256","A - macron"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"]
 ,["203","E - diaeresis"],["274","E - macron"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["298","I - macron"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["332","O - macron"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["362","U - macron"],["221","Y - acute"],[&quo
 t;376","Y - diaeresis"],["562","Y - macron"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["257","a - macron"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["275","e - macron"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["299","i - macron"],["240","eth"],["241","n - tilde"],["2
 42","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["333","o macron"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["363","u - macron"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["563","y - macron"],["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"],["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",&qu
 ot;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"],["900
 2","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"]]}function d(a){return b.grep(a,function(a){return j(a)&&2==a.length})}function e(a){return j(a)?[].concat(d(a)):"function"==typeof a?a():[]}function f(b){var c=a.settings;return c.charmap&&(b=e(c.charmap)),c.charmap_append?[].concat(b).concat(e(c.charmap_append)):b}function g(){return f(c())}function h(b){a.fire("insertCustomChar",{chr:b}).chr,a.execCom
 mand("mceInsertContent",!1,b)}function i(){function b(a){for(;a;){if("TD"==a.nodeName)return a;a=a.parentNode}}var c,d,e,f;c='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';var i=g(),j=Math.min(i.length,25),k=Math.ceil(i.length/j);for(e=0;e<k;e++){for(c+="<tr>",d=0;d<j;d++){var l=e*j+d;if(l<i.length){var m=i[l],n=m?String.fromCharCode(parseInt(m[0],10)):"&nbsp;";c+='<td title="'+m[1]+'"><div tabindex="-1" title="'+m[1]+'" role="button" data-chr="'+n+'">'+n+"</div></td>"}else c+="<td />"}c+="</tr>"}c+="</tbody></table>";var o={type:"container",html:c,onclick:function(a){var c=a.target;if(/^(TD|DIV)$/.test(c.nodeName)){var d=b(c).firstChild;d&&d.hasAttribute("data-chr")&&(h(d.getAttribute(&
 quot;data-chr")),a.ctrlKey||f.close())}},onmouseover:function(a){var c=b(a.target);c&&c.firstChild?(f.find("#preview").text(c.firstChild.firstChild.data),f.find("#previewTitle").text(c.title)):(f.find("#preview").text(" "),f.find("#previewTitle").text(" "))}};f=a.windowManager.open({title:"Special character",spacing:10,padding:10,items:[o,{type:"container",layout:"flex",direction:"column",align:"center",spacing:5,minWidth:160,minHeight:160,items:[{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:140,minHeight:80},{type:"label",name:"previewTitle",text:" ",style:"text-align: center",border:1,minWidth:140,minHeight:80}]}],buttons:[{text:"Close",onclick:function(){f.close()}}]})}var j=b.isArray;return a.addCommand("mceShow
 Charmap",i),a.addButton("charmap",{icon:"charmap",tooltip:"Special character",cmd:"mceShowCharmap"}),a.addMenuItem("charmap",{icon:"charmap",text:"Special character",cmd:"mceShowCharmap",context:"insert"}),{getCharMap:g,insertChar:h}}),function(){}}),d("0")()}();
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginscolorpickerpluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/tinymce/plugins/colorpicker/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/tinymce/plugins/colorpicker/plugin.js    2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/js/tinymce/plugins/colorpicker/plugin.js      2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,112 +1,255 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+(function () {
+
+var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
+
+// Used when there is no 'main' module.
+// The name is probably (hopefully) unique so minification removes for releases.
+var register_3795 = function (id) {
+  var module = dem(id);
+  var fragments = id.split('.');
+  var target = Function('return this;')();
+  for (var i = 0; i < fragments.length - 1; ++i) {
+    if (target[fragments[i]] === undefined)
+      target[fragments[i]] = {};
+    target = target[fragments[i]];
+  }
+  target[fragments[fragments.length - 1]] = module;
+};
+
+var instantiate = function (id) {
+  var actual = defs[id];
+  var dependencies = actual.deps;
+  var definition = actual.defn;
+  var len = dependencies.length;
+  var instances = new Array(len);
+  for (var i = 0; i < len; ++i)
+    instances[i] = dem(dependencies[i]);
+  var defResult = definition.apply(null, instances);
+  if (defResult === undefined)
+     throw 'module [' + id + '] returned undefined';
+  actual.instance = defResult;
+};
+
+var def = function (id, dependencies, definition) {
+  if (typeof id !== 'string')
+    throw 'module id must be a string';
+  else if (dependencies === undefined)
+    throw 'no dependencies for ' + id;
+  else if (definition === undefined)
+    throw 'no definition function for ' + id;
+  defs[id] = {
+    deps: dependencies,
+    defn: definition,
+    instance: undefined
+  };
+};
+
+var dem = function (id) {
+  var actual = defs[id];
+  if (actual === undefined)
+    throw 'module [' + id + '] was undefined';
+  else if (actual.instance === undefined)
+    instantiate(id);
+  return actual.instance;
+};
+
+var req = function (ids, callback) {
+  var len = ids.length;
+  var instances = new Array(len);
+  for (var i = 0; i < len; ++i)
+    instances.push(dem(ids[i]));
+  callback.apply(null, callback);
+};
+
+var ephox = {};
+
+ephox.bolt = {
+  module: {
+    api: {
+      define: def,
+      require: req,
+      demand: dem
+    }
+  }
+};
+
+var define = def;
+var require = req;
+var demand = dem;
+// this helps with minificiation when using a lot of global references
+var defineGlobal = function (id, ref) {
+  define(id, [], function () { return ref; });
+};
+/*jsc
+["tinymce.plugins.colorpicker.Plugin","tinymce.core.PluginManager","tinymce.core.util.Color","global!tinymce.util.Tools.resolve"]
+jsc*/
+defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * plugin.js
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * ResolveGlobal.js
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Released under LGPL License.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * License: http://www.tinymce.com/license
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/*global tinymce:true */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.core.PluginManager',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.PluginManager');
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-tinymce.PluginManager.add('colorpicker', function(editor) {
-       function colorPickerCallback(callback, value) {
-               function setColor(value) {
-                       var color = new tinymce.util.Color(value), rgb = color.toRgb();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * ResolveGlobal.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        win.fromJSON({
-                               r: rgb.r,
-                               g: rgb.g,
-                               b: rgb.b,
-                               hex: color.toHex().substr(1)
-                       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.core.util.Color',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.util.Color');
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        showPreview(color.toHex());
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Plugin.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function showPreview(hexColor) {
-                       win.find('#preview')[0].getEl().style.background = hexColor;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * This class contains all core logic for the colorpicker plugin.
+ *
+ * @class tinymce.colorpicker.Plugin
+ * @private
+ */
+define(
+  'tinymce.plugins.colorpicker.Plugin',
+  [
+    'tinymce.core.PluginManager',
+    'tinymce.core.util.Color'
+  ],
+  function (PluginManager, Color) {
+    PluginManager.add('colorpicker', function (editor) {
+      function colorPickerCallback(callback, value) {
+        function setColor(value) {
+          var color = new Color(value), rgb = color.toRgb();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                var win = editor.windowManager.open({
-                       title: 'Color',
-                       items: {
-                               type: 'container',
-                               layout: 'flex',
-                               direction: 'row',
-                               align: 'stretch',
-                               padding: 5,
-                               spacing: 10,
-                               items: [
-                                       {
-                                               type: 'colorpicker',
-                                               value: value,
-                                               onchange: function() {
-                                                       var rgb = this.rgb();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          win.fromJSON({
+            r: rgb.r,
+            g: rgb.g,
+            b: rgb.b,
+            hex: color.toHex().substr(1)
+          });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                        if (win) {
-                                                               win.find('#r').value(rgb.r);
-                                                               win.find('#g').value(rgb.g);
-                                                               win.find('#b').value(rgb.b);
-                                                               win.find('#hex').value(this.value().substr(1));
-                                                               showPreview(this.value());
-                                                       }
-                                               }
-                                       },
-                                       {
-                                               type: 'form',
-                                               padding: 0,
-                                               labelGap: 5,
-                                               defaults: {
-                                                       type: 'textbox',
-                                                       size: 7,
-                                                       value: '0',
-                                                       flex: 1,
-                                                       spellcheck: false,
-                                                       onchange: function() {
-                                                               var colorPickerCtrl = win.find('colorpicker')[0];
-                                                               var name, value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          showPreview(color.toHex());
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                                name = this.name();
-                                                               value = this.value();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        function showPreview(hexColor) {
+          win.find('#preview')[0].getEl().style.background = hexColor;
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                                if (name == "hex") {
-                                                                       value = '#' + value;
-                                                                       setColor(value);
-                                                                       colorPickerCtrl.value(value);
-                                                                       return;
-                                                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        var win = editor.windowManager.open({
+          title: 'Color',
+          items: {
+            type: 'container',
+            layout: 'flex',
+            direction: 'row',
+            align: 'stretch',
+            padding: 5,
+            spacing: 10,
+            items: [
+              {
+                type: 'colorpicker',
+                value: value,
+                onchange: function () {
+                  var rgb = this.rgb();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                                value = {
-                                                                       r: win.find('#r').value(),
-                                                                       g: win.find('#g').value(),
-                                                                       b: win.find('#b').value()
-                                                               };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                  if (win) {
+                    win.find('#r').value(rgb.r);
+                    win.find('#g').value(rgb.g);
+                    win.find('#b').value(rgb.b);
+                    win.find('#hex').value(this.value().substr(1));
+                    showPreview(this.value());
+                  }
+                }
+              },
+              {
+                type: 'form',
+                padding: 0,
+                labelGap: 5,
+                defaults: {
+                  type: 'textbox',
+                  size: 7,
+                  value: '0',
+                  flex: 1,
+                  spellcheck: false,
+                  onchange: function () {
+                    var colorPickerCtrl = win.find('colorpicker')[0];
+                    var name, value;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                                colorPickerCtrl.value(value);
-                                                               setColor(value);
-                                                       }
-                                               },
-                                               items: [
-                                                       {name: 'r', label: 'R', autofocus: 1},
-                                                       {name: 'g', label: 'G'},
-                                                       {name: 'b', label: 'B'},
-                                                       {name: 'hex', label: '#', value: '000000'},
-                                                       {name: 'preview', type: 'container', border: 1}
-                                               ]
-                                       }
-                               ]
-                       },
-                       onSubmit: function() {
-                               callback('#' + this.toJSON().hex);
-                       }
-               });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                    name = this.name();
+                    value = this.value();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                setColor(value);
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                    if (name == "hex") {
+                      value = '#' + value;
+                      setColor(value);
+                      colorPickerCtrl.value(value);
+                      return;
+                    }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if (!editor.settings.color_picker_callback) {
-               editor.settings.color_picker_callback = colorPickerCallback;
-       }
-});
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                    value = {
+                      r: win.find('#r').value(),
+                      g: win.find('#g').value(),
+                      b: win.find('#b').value()
+                    };
+
+                    colorPickerCtrl.value(value);
+                    setColor(value);
+                  }
+                },
+                items: [
+                  { name: 'r', label: 'R', autofocus: 1 },
+                  { name: 'g', label: 'G' },
+                  { name: 'b', label: 'B' },
+                  { name: 'hex', label: '#', value: '000000' },
+                  { name: 'preview', type: 'container', border: 1 }
+                ]
+              }
+            ]
+          },
+          onSubmit: function () {
+            callback('#' + this.toJSON().hex);
+          }
+        });
+
+        setColor(value);
+      }
+
+      if (!editor.settings.color_picker_callback) {
+        editor.settings.color_picker_callback = colorPickerCallback;
+      }
+    });
+
+    return function () { };
+  }
+);
+dem('tinymce.plugins.colorpicker.Plugin')();
+})();
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginscolorpickerpluginminjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/tinymce/plugins/colorpicker/plugin.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/tinymce/plugins/colorpicker/plugin.min.js        2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/js/tinymce/plugins/colorpicker/plugin.min.js  2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1 +1 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-tinymce.PluginManager.add("colorpicker",function(e){function t(t,n){function r(e){var t=new tinymce.util.Color(e),n=t.toRgb();o.fromJSON({r:n.r,g:n.g,b:n.b,hex:t.toHex().substr(1)}),i(t.toHex())}function i(e){o.find("#preview")[0].getEl().style.background=e}var o=e.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:n,onchange:function(){var e=this.rgb();o&&(o.find("#r").value(e.r),o.find("#g").value(e.g),o.find("#b").value(e.b),o.find("#hex").value(this.value().substr(1)),i(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var e,t,n=o.find(&quot
 ;colorpicker")[0];return e=this.name(),t=this.value(),"hex"==e?(t="#"+t,r(t),void n.value(t)):(t={r:o.find("#r").value(),g:o.find("#g").value(),b:o.find("#b").value()},n.value(t),void r(t))}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){t("#"+this.toJSON().hex)}});r(n)}e.settings.color_picker_callback||(e.settings.color_picker_callback=t)});
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("3",tinymce.util.Tools.resolve),g("1",[&q
 uot;3"],function(a){return a("tinymce.PluginManager")}),g("2",["3"],function(a){return a("tinymce.util.Color")}),g("0",["1","2"],function(a,b){return a.add("colorpicker",function(a){function c(c,d){function e(a){var c=new b(a),d=c.toRgb();g.fromJSON({r:d.r,g:d.g,b:d.b,hex:c.toHex().substr(1)}),f(c.toHex())}function f(a){g.find("#preview")[0].getEl().style.background=a}var g=a.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:d,onchange:function(){var a=this.rgb();g&&(g.find("#r").value(a.r),g.find("#g").value(a.g),g.find("#b").value(a.b),g.find("#hex").value(this.value().substr(1)),f(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox"
 ,size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var a,b,c=g.find("colorpicker")[0];return a=this.name(),b=this.value(),"hex"==a?(b="#"+b,e(b),void c.value(b)):(b={r:g.find("#r").value(),g:g.find("#g").value(),b:g.find("#b").value()},c.value(b),void e(b))}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){c("#"+this.toJSON().hex)}});e(d)}a.settings.color_picker_callback||(a.settings.color_picker_callback=c)}),function(){}}),d("0")()}();
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginscompat3xpluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.js       2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.js 2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2,7 +2,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * plugin.js
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Released under LGPL License.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * License: http://www.tinymce.com/license
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -19,288 +19,301 @@
</span><span class="cx" style="display: block; padding: 0 10px">  *  - No editor.onEvent
</span><span class="cx" style="display: block; padding: 0 10px">  *  - Can't cancel execCommands with beforeExecCommand
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-(function(tinymce) {
-       var reported;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+(function (tinymce) {
+  var reported;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function noop() {
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  function noop() {
+  }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function log(apiCall) {
-               if (!reported && window && window.console) {
-                       reported = true;
-                       console.log("Deprecated TinyMCE API call: " + apiCall);
-               }
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  function log(apiCall) {
+    if (!reported && window && window.console) {
+      reported = true;
+      console.log("Deprecated TinyMCE API call: " + apiCall);
+    }
+  }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function Dispatcher(target, newEventName, argsMap, defaultScope) {
-               target = target || this;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  function Dispatcher(target, newEventName, argsMap, defaultScope) {
+    target = target || this;
+    var cbs = [];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (!newEventName) {
-                       this.add = this.addToTop = this.remove = this.dispatch = noop;
-                       return;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    if (!newEventName) {
+      this.add = this.addToTop = this.remove = this.dispatch = noop;
+      return;
+    }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                this.add = function(callback, scope, prepend) {
-                       log('<target>.on' + newEventName + ".add(..)");
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    this.add = function (callback, scope, prepend) {
+      log('<target>.on' + newEventName + ".add(..)");
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2)
-                       function patchedEventCallback(e) {
-                               var callbackArgs = [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      // Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2)
+      function patchedEventCallback(e) {
+        var callbackArgs = [];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (typeof argsMap == "string") {
-                                       argsMap = argsMap.split(" ");
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (typeof argsMap == "string") {
+          argsMap = argsMap.split(" ");
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (argsMap && typeof argsMap != "function") {
-                                       for (var i = 0; i < argsMap.length; i++) {
-                                               callbackArgs.push(e[argsMap[i]]);
-                                       }
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (argsMap && typeof argsMap != "function") {
+          for (var i = 0; i < argsMap.length; i++) {
+            callbackArgs.push(e[argsMap[i]]);
+          }
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (typeof argsMap == "function") {
-                                       callbackArgs = argsMap(newEventName, e, target);
-                                       if (!callbackArgs) {
-                                               return;
-                                       }
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (typeof argsMap == "function") {
+          callbackArgs = argsMap(newEventName, e, target);
+          if (!callbackArgs) {
+            return;
+          }
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (!argsMap) {
-                                       callbackArgs = [e];
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (!argsMap) {
+          callbackArgs = [e];
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                callbackArgs.unshift(defaultScope || target);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        callbackArgs.unshift(defaultScope || target);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (callback.apply(scope || defaultScope || target, callbackArgs) === false) {
-                                       e.stopImmediatePropagation();
-                               }
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (callback.apply(scope || defaultScope || target, callbackArgs) === false) {
+          e.stopImmediatePropagation();
+        }
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        target.on(newEventName, patchedEventCallback, prepend);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      target.on(newEventName, patchedEventCallback, prepend);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        return patchedEventCallback;
-               };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      var handlers = {
+        original: callback,
+        patched: patchedEventCallback
+      };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                this.addToTop = function(callback, scope) {
-                       this.add(callback, scope, true);
-               };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      cbs.push(handlers);
+      return patchedEventCallback;
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                this.remove = function(callback) {
-                       return target.off(newEventName, callback);
-               };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    this.addToTop = function (callback, scope) {
+      this.add(callback, scope, true);
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                this.dispatch = function() {
-                       target.fire(newEventName);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    this.remove = function (callback) {
+      cbs.forEach(function (item, i) {
+        if (item.original === callback) {
+          cbs.splice(i, 1);
+          return target.off(newEventName, item.patched);
+        }
+      });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        return true;
-               };
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      return target.off(newEventName, callback);
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        tinymce.util.Dispatcher = Dispatcher;
-       tinymce.onBeforeUnload = new Dispatcher(tinymce, "BeforeUnload");
-       tinymce.onAddEditor = new Dispatcher(tinymce, "AddEditor", "editor");
-       tinymce.onRemoveEditor = new Dispatcher(tinymce, "RemoveEditor", "editor");
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    this.dispatch = function () {
+      target.fire(newEventName);
+      return true;
+    };
+  }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        tinymce.util.Cookie = {
-               get: noop, getHash: noop, remove: noop, set: noop, setHash: noop
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  tinymce.util.Dispatcher = Dispatcher;
+  tinymce.onBeforeUnload = new Dispatcher(tinymce, "BeforeUnload");
+  tinymce.onAddEditor = new Dispatcher(tinymce, "AddEditor", "editor");
+  tinymce.onRemoveEditor = new Dispatcher(tinymce, "RemoveEditor", "editor");
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function patchEditor(editor) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  tinymce.util.Cookie = {
+    get: noop, getHash: noop, remove: noop, set: noop, setHash: noop
+  };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function translate(str) {
-                       var prefix = editor.settings.language || "en";
-                       var prefixedStr = [prefix, str].join('.');
-                       var translatedStr = tinymce.i18n.translate(prefixedStr);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  function patchEditor(editor) {
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        return prefixedStr !== translatedStr ? translatedStr : tinymce.i18n.translate(str);
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    function translate(str) {
+      var prefix = editor.settings.language || "en";
+      var prefixedStr = [prefix, str].join('.');
+      var translatedStr = tinymce.i18n.translate(prefixedStr);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function patchEditorEvents(oldEventNames, argsMap) {
-                       tinymce.each(oldEventNames.split(" "), function(oldName) {
-                               editor["on" + oldName] = new Dispatcher(editor, oldName, argsMap);
-                       });
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      return prefixedStr !== translatedStr ? translatedStr : tinymce.i18n.translate(str);
+    }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function convertUndoEventArgs(type, event, target) {
-                       return [
-                               event.level,
-                               target
-                       ];
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    function patchEditorEvents(oldEventNames, argsMap) {
+      tinymce.each(oldEventNames.split(" "), function (oldName) {
+        editor["on" + oldName] = new Dispatcher(editor, oldName, argsMap);
+      });
+    }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function filterSelectionEvents(needsSelection) {
-                       return function(type, e) {
-                               if ((!e.selection && !needsSelection) || e.selection == needsSelection) {
-                                       return [e];
-                               }
-                       };
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    function convertUndoEventArgs(type, event, target) {
+      return [
+        event.level,
+        target
+      ];
+    }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (editor.controlManager) {
-                       return;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    function filterSelectionEvents(needsSelection) {
+      return function (type, e) {
+        if ((!e.selection && !needsSelection) || e.selection == needsSelection) {
+          return [e];
+        }
+      };
+    }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function cmNoop() {
-                       var obj = {}, methods = 'add addMenu addSeparator collapse createMenu destroy displayColor expand focus ' +
-                               'getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark ' +
-                               'postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex ' +
-                               'setActive setAriaProperty setColor setDisabled setSelected setState showMenu update';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    if (editor.controlManager) {
+      return;
+    }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        log('editor.controlManager.*');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    function cmNoop() {
+      var obj = {}, methods = 'add addMenu addSeparator collapse createMenu destroy displayColor expand focus ' +
+        'getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark ' +
+        'postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex ' +
+        'setActive setAriaProperty setColor setDisabled setSelected setState showMenu update';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        function _noop() {
-                               return cmNoop();
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      log('editor.controlManager.*');
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        tinymce.each(methods.split(' '), function(method) {
-                               obj[method] = _noop;
-                       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function _noop() {
+        return cmNoop();
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        return obj;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      tinymce.each(methods.split(' '), function (method) {
+        obj[method] = _noop;
+      });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                editor.controlManager = {
-                       buttons: {},
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      return obj;
+    }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        setDisabled: function(name, state) {
-                               log("controlManager.setDisabled(..)");
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    editor.controlManager = {
+      buttons: {},
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (this.buttons[name]) {
-                                       this.buttons[name].disabled(state);
-                               }
-                       },
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      setDisabled: function (name, state) {
+        log("controlManager.setDisabled(..)");
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        setActive: function(name, state) {
-                               log("controlManager.setActive(..)");
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (this.buttons[name]) {
+          this.buttons[name].disabled(state);
+        }
+      },
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (this.buttons[name]) {
-                                       this.buttons[name].active(state);
-                               }
-                       },
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      setActive: function (name, state) {
+        log("controlManager.setActive(..)");
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        onAdd: new Dispatcher(),
-                       onPostRender: new Dispatcher(),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (this.buttons[name]) {
+          this.buttons[name].active(state);
+        }
+      },
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        add: function(obj) {
-                               return obj;
-                       },
-                       createButton: cmNoop,
-                       createColorSplitButton: cmNoop,
-                       createControl: cmNoop,
-                       createDropMenu: cmNoop,
-                       createListBox: cmNoop,
-                       createMenuButton: cmNoop,
-                       createSeparator: cmNoop,
-                       createSplitButton: cmNoop,
-                       createToolbar: cmNoop,
-                       createToolbarGroup: cmNoop,
-                       destroy: noop,
-                       get: noop,
-                       setControlType: cmNoop
-               };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      onAdd: new Dispatcher(),
+      onPostRender: new Dispatcher(),
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                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);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      add: function (obj) {
+        return obj;
+      },
+      createButton: cmNoop,
+      createColorSplitButton: cmNoop,
+      createControl: cmNoop,
+      createDropMenu: cmNoop,
+      createListBox: cmNoop,
+      createMenuButton: cmNoop,
+      createSeparator: cmNoop,
+      createSplitButton: cmNoop,
+      createToolbar: cmNoop,
+      createToolbarGroup: cmNoop,
+      destroy: noop,
+      get: noop,
+      setControlType: cmNoop
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                patchEditorEvents("NodeChange", function(type, e) {
-                       return [
-                               editor.controlManager,
-                               e.element,
-                               editor.selection.isCollapsed(),
-                               e
-                       ];
-               });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    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);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                var originalAddButton = editor.addButton;
-               editor.addButton = function(name, settings) {
-                       var originalOnPostRender;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    patchEditorEvents("NodeChange", function (type, e) {
+      return [
+        editor.controlManager,
+        e.element,
+        editor.selection.isCollapsed(),
+        e
+      ];
+    });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        function patchedPostRender() {
-                               editor.controlManager.buttons[name] = this;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var originalAddButton = editor.addButton;
+    editor.addButton = function (name, settings) {
+      var originalOnPostRender;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (originalOnPostRender) {
-                                       return originalOnPostRender.apply(this, arguments);
-                               }
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function patchedPostRender() {
+        editor.controlManager.buttons[name] = this;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        for (var key in settings) {
-                               if (key.toLowerCase() === "onpostrender") {
-                                       originalOnPostRender = settings[key];
-                                       settings.onPostRender = patchedPostRender;
-                               }
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (originalOnPostRender) {
+          return originalOnPostRender.apply(this, arguments);
+        }
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (!originalOnPostRender) {
-                               settings.onPostRender = patchedPostRender;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      for (var key in settings) {
+        if (key.toLowerCase() === "onpostrender") {
+          originalOnPostRender = settings[key];
+          settings.onPostRender = patchedPostRender;
+        }
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (settings.title) {
-                               settings.title = translate(settings.title);
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (!originalOnPostRender) {
+        settings.onPostRender = patchedPostRender;
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        return originalAddButton.call(this, name, settings);
-               };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (settings.title) {
+        settings.title = translate(settings.title);
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                editor.on('init', function() {
-                       var undoManager = editor.undoManager, selection = editor.selection;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      return originalAddButton.call(this, name, settings);
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        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);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    editor.on('init', function () {
+      var undoManager = editor.undoManager, selection = editor.selection;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        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);
-               });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      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);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                editor.on('BeforeRenderUI', function() {
-                       var windowManager = editor.windowManager;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      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);
+    });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        windowManager.onOpen = new Dispatcher();
-                       windowManager.onClose = new Dispatcher();
-                       windowManager.createInstance = function(className, a, b, c, d, e) {
-                               log("windowManager.createInstance(..)");
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    editor.on('BeforeRenderUI', function () {
+      var windowManager = editor.windowManager;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                var constr = tinymce.resolve(className);
-                               return new constr(a, b, c, d, e);
-                       };
-               });
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      windowManager.onOpen = new Dispatcher();
+      windowManager.onClose = new Dispatcher();
+      windowManager.createInstance = function (className, a, b, c, d, e) {
+        log("windowManager.createInstance(..)");
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        tinymce.on('SetupEditor', patchEditor);
-       tinymce.PluginManager.add("compat3x", patchEditor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        var constr = tinymce.resolve(className);
+        return new constr(a, b, c, d, e);
+      };
+    });
+  }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        tinymce.addI18n = function(prefix, o) {
-               var I18n = tinymce.util.I18n, each = tinymce.each;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  tinymce.on('SetupEditor', patchEditor);
+  tinymce.PluginManager.add("compat3x", patchEditor);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (typeof prefix == "string" && prefix.indexOf('.') === -1) {
-                       I18n.add(prefix, o);
-                       return;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  tinymce.addI18n = function (prefix, o) {
+    var I18n = tinymce.util.I18n, each = tinymce.each;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                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;
-                       });
-               }
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    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;
+      });
+    }
+  };
</ins><span class="cx" style="display: block; padding: 0 10px"> })(tinymce);
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginscompat3xpluginminjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.min.js   2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/js/tinymce/plugins/compat3x/plugin.min.js     2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1 +1 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-!function(e){function t(){}function n(e){!o&&window&&window.console&&(o=!0,console.log("Deprecated TinyMCE API call: "+e))}function r(e,r,i,o){return e=e||this,r?(this.add=function(t,a,s){function l(n){var s=[];if("string"==typeof i&&(i=i.split(" ")),i&&"function"!=typeof i)for(var l=0;l<i.length;l++)s.push(n[i[l]]);("function"!=typeof i||(s=i(r,n,e)))&&(i||(s=[n]),s.unshift(o||e),t.apply(a||o||e,s)===!1&&n.stopImmediatePropagation())}return n("<target>.on"+r+".add(..)"),e.on(r,l,s),l},this.addToTop=function(e,t){this.add(e,t,!0)},this.remove=function(t){return e.off(r,t)},void(this.dispatch=function(){return e.fire(r),!0})):void(this.add=this.addToTop=this.remove=this.dispatch=t)}function i(i){function o(t){var n=i.settings.language||"en",r=[n,
 t].join("."),o=e.i18n.translate(r);return r!==o?o:e.i18n.translate(t)}function a(t,n){e.each(t.split(" "),function(e){i["on"+e]=new r(i,e,n)})}function s(e,t,n){return[t.level,n]}function l(e){return function(t,n){if(!n.selection&&!e||n.selection==e)return[n]}}function u(){function t(){return u()}var r={},i="add addMenu addSeparator collapse createMenu destroy displayColor expand focus getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex setActive setAriaProperty setColor setDisabled setSelected setState showMenu update";return n("editor.controlManager.*"),e.each(i.split(" "),function(e){r[e]=t}),r}if(!i.controlManager){i.controlManager={buttons:{},setDisabled:function(e,t){n("controlManager.setDisabled(..)"),this.buttons[e]&&this.buttons[e].disabled(t)},setActive:function(e,
 t){n("controlManager.setActive(..)"),this.buttons[e]&&this.buttons[e].active(t)},onAdd:new r,onPostRender:new r,add:function(e){return e},createButton:u,createColorSplitButton:u,createControl:u,createDropMenu:u,createListBox:u,createMenuButton:u,createSeparator:u,createSplitButton:u,createToolbar:u,createToolbarGroup:u,destroy:t,get:t,setControlType:u},a("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate","editor"),a("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset"),a("BeforeExecCommand ExecCommand","command ui value args"),a("PreProcess PostProcess LoadContent SaveContent Change"),a("BeforeSetContent BeforeGetContent SetContent GetContent",l(!1)),a("SetProgressState","state time"),a("VisualAid","element hasVisual"),a("Undo Redo",s),a("NodeChange",function(e,t){return[i.control
 Manager,t.element,i.selection.isCollapsed(),t]});var c=i.addButton;i.addButton=function(e,t){function n(){if(i.controlManager.buttons[e]=this,r)return r.apply(this,arguments)}var r;for(var a in t)"onpostrender"===a.toLowerCase()&&(r=t[a],t.onPostRender=n);return r||(t.onPostRender=n),t.title&&(t.title=o(t.title)),c.call(this,e,t)},i.on("init",function(){var e=i.undoManager,t=i.selection;e.onUndo=new r(i,"Undo",s,null,e),e.onRedo=new r(i,"Redo",s,null,e),e.onBeforeAdd=new r(i,"BeforeAddUndo",null,e),e.onAdd=new r(i,"AddUndo",null,e),t.onBeforeGetContent=new r(i,"BeforeGetContent",l(!0),t),t.onGetContent=new r(i,"GetContent",l(!0),t),t.onBeforeSetContent=new r(i,"BeforeSetContent",l(!0),t),t.onSetContent=new r(i,"SetContent",l(!0),t)}),i.on("BeforeRenderUI",function(){var t=i.windowManager;t.onOpen=new r,t.onClose=new r,t.createInstance=function(t,r,i,o,a,s){n(
 "windowManager.createInstance(..)");var l=e.resolve(t);return new l(r,i,o,a,s)}})}}var o;e.util.Dispatcher=r,e.onBeforeUnload=new r(e,"BeforeUnload"),e.onAddEditor=new r(e,"AddEditor","editor"),e.onRemoveEditor=new r(e,"RemoveEditor","editor"),e.util.Cookie={get:t,getHash:t,remove:t,set:t,setHash:t},e.on("SetupEditor",i),e.PluginManager.add("compat3x",i),e.addI18n=function(t,n){var r=e.util.I18n,i=e.each;return"string"==typeof t&&t.indexOf(".")===-1?void r.add(t,n):void(e.is(t,"string")?i(n,function(e,n){r.data[t+"."+n]=e}):i(t,function(e,t){i(e,function(e,n){i(e,function(e,i){"common"===n?r.data[t+"."+i]=e:r.data[t+"."+n+"."+i]=e})})}))}}(tinymce);
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+!function(a){function b(){}function c(a){!f&&window&&window.console&&(f=!0,console.log("Deprecated TinyMCE API call: "+a))}function d(a,d,e,f){a=a||this;var g=[];return d?(this.add=function(b,h,i){function j(c){var g=[];if("string"==typeof e&&(e=e.split(" ")),e&&"function"!=typeof e)for(var i=0;i<e.length;i++)g.push(c[e[i]]);("function"!=typeof e||(g=e(d,c,a)))&&(e||(g=[c]),g.unshift(f||a),b.apply(h||f||a,g)===!1&&c.stopImmediatePropagation())}c("<target>.on"+d+".add(..)"),a.on(d,j,i);var k={original:b,patched:j};return g.push(k),j},this.addToTop=function(a,b){this.add(a,b,!0)},this.remove=function(b){return g.forEach(function(c,e){if(c.original===b)return g.splice(e,1),a.off(d,c.patched)}),a.off(d,b)},void(this.dispatch=function(){return a.fire(d),!0})):
 void(this.add=this.addToTop=this.remove=this.dispatch=b)}function e(e){function f(b){var c=e.settings.language||"en",d=[c,b].join("."),f=a.i18n.translate(d);return d!==f?f:a.i18n.translate(b)}function g(b,c){a.each(b.split(" "),function(a){e["on"+a]=new d(e,a,c)})}function h(a,b,c){return[b.level,c]}function i(a){return function(b,c){if(!c.selection&&!a||c.selection==a)return[c]}}function j(){function b(){return j()}var d={},e="add addMenu addSeparator collapse createMenu destroy displayColor expand focus getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex setActive setAriaProperty setColor setDisabled setSelected setState showMenu update";return c("editor.controlManager.*"),a.each(e.split(" "),function(a){d[a]=b}),d}if(!e.controlManager){e.controlManager={buttons:{},setDisabled:fun
 ction(a,b){c("controlManager.setDisabled(..)"),this.buttons[a]&&this.buttons[a].disabled(b)},setActive:function(a,b){c("controlManager.setActive(..)"),this.buttons[a]&&this.buttons[a].active(b)},onAdd:new d,onPostRender:new d,add:function(a){return a},createButton:j,createColorSplitButton:j,createControl:j,createDropMenu:j,createListBox:j,createMenuButton:j,createSeparator:j,createSplitButton:j,createToolbar:j,createToolbarGroup:j,destroy:b,get:b,setControlType:j},g("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate","editor"),g("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset"),g("BeforeExecCommand ExecCommand","command ui value args"),g("PreProcess PostProcess LoadContent SaveContent Change"),g("BeforeSetContent BeforeGetContent SetContent GetContent",i(!1)),g("SetProgressState","state time"),g(&qu
 ot;VisualAid","element hasVisual"),g("Undo Redo",h),g("NodeChange",function(a,b){return[e.controlManager,b.element,e.selection.isCollapsed(),b]});var k=e.addButton;e.addButton=function(a,b){function c(){if(e.controlManager.buttons[a]=this,d)return d.apply(this,arguments)}var d;for(var g in b)"onpostrender"===g.toLowerCase()&&(d=b[g],b.onPostRender=c);return d||(b.onPostRender=c),b.title&&(b.title=f(b.title)),k.call(this,a,b)},e.on("init",function(){var a=e.undoManager,b=e.selection;a.onUndo=new d(e,"Undo",h,null,a),a.onRedo=new d(e,"Redo",h,null,a),a.onBeforeAdd=new d(e,"BeforeAddUndo",null,a),a.onAdd=new d(e,"AddUndo",null,a),b.onBeforeGetContent=new d(e,"BeforeGetContent",i(!0),b),b.onGetContent=new d(e,"GetContent",i(!0),b),b.onBeforeSetContent=new d(e,"BeforeSetContent",i(!0),b),b.onSetContent=new d(e,"SetContent",i(!0),b)}),e.on(
 "BeforeRenderUI",function(){var b=e.windowManager;b.onOpen=new d,b.onClose=new d,b.createInstance=function(b,d,e,f,g,h){c("windowManager.createInstance(..)");var i=a.resolve(b);return new i(d,e,f,g,h)}})}}var f;a.util.Dispatcher=d,a.onBeforeUnload=new d(a,"BeforeUnload"),a.onAddEditor=new d(a,"AddEditor","editor"),a.onRemoveEditor=new d(a,"RemoveEditor","editor"),a.util.Cookie={get:b,getHash:b,remove:b,set:b,setHash:b},a.on("SetupEditor",e),a.PluginManager.add("compat3x",e),a.addI18n=function(b,c){var d=a.util.I18n,e=a.each;return"string"==typeof b&&b.indexOf(".")===-1?void d.add(b,c):void(a.is(b,"string")?e(c,function(a,c){d.data[b+"."+c]=a}):e(b,function(a,b){e(a,function(a,c){e(a,function(a,e){"common"===c?d.data[b+"."+e]=a:d.data[b+"."+c+"."+e]=a})})}))}}(tinymce);
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsdirectionalitypluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/tinymce/plugins/directionality/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/tinymce/plugins/directionality/plugin.js 2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/js/tinymce/plugins/directionality/plugin.js   2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,64 +1,207 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+(function () {
+
+var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
+
+// Used when there is no 'main' module.
+// The name is probably (hopefully) unique so minification removes for releases.
+var register_3795 = function (id) {
+  var module = dem(id);
+  var fragments = id.split('.');
+  var target = Function('return this;')();
+  for (var i = 0; i < fragments.length - 1; ++i) {
+    if (target[fragments[i]] === undefined)
+      target[fragments[i]] = {};
+    target = target[fragments[i]];
+  }
+  target[fragments[fragments.length - 1]] = module;
+};
+
+var instantiate = function (id) {
+  var actual = defs[id];
+  var dependencies = actual.deps;
+  var definition = actual.defn;
+  var len = dependencies.length;
+  var instances = new Array(len);
+  for (var i = 0; i < len; ++i)
+    instances[i] = dem(dependencies[i]);
+  var defResult = definition.apply(null, instances);
+  if (defResult === undefined)
+     throw 'module [' + id + '] returned undefined';
+  actual.instance = defResult;
+};
+
+var def = function (id, dependencies, definition) {
+  if (typeof id !== 'string')
+    throw 'module id must be a string';
+  else if (dependencies === undefined)
+    throw 'no dependencies for ' + id;
+  else if (definition === undefined)
+    throw 'no definition function for ' + id;
+  defs[id] = {
+    deps: dependencies,
+    defn: definition,
+    instance: undefined
+  };
+};
+
+var dem = function (id) {
+  var actual = defs[id];
+  if (actual === undefined)
+    throw 'module [' + id + '] was undefined';
+  else if (actual.instance === undefined)
+    instantiate(id);
+  return actual.instance;
+};
+
+var req = function (ids, callback) {
+  var len = ids.length;
+  var instances = new Array(len);
+  for (var i = 0; i < len; ++i)
+    instances.push(dem(ids[i]));
+  callback.apply(null, callback);
+};
+
+var ephox = {};
+
+ephox.bolt = {
+  module: {
+    api: {
+      define: def,
+      require: req,
+      demand: dem
+    }
+  }
+};
+
+var define = def;
+var require = req;
+var demand = dem;
+// this helps with minificiation when using a lot of global references
+var defineGlobal = function (id, ref) {
+  define(id, [], function () { return ref; });
+};
+/*jsc
+["tinymce.plugins.directionality.Plugin","tinymce.core.PluginManager","tinymce.core.util.Tools","global!tinymce.util.Tools.resolve"]
+jsc*/
+defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * plugin.js
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * ResolveGlobal.js
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Released under LGPL License.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * License: http://www.tinymce.com/license
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/*global tinymce:true */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.core.PluginManager',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.PluginManager');
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-tinymce.PluginManager.add('directionality', function(editor) {
-       function setDir(dir) {
-               var dom = editor.dom, curDir, blocks = editor.selection.getSelectedBlocks();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * ResolveGlobal.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (blocks.length) {
-                       curDir = dom.getAttrib(blocks[0], "dir");
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.core.util.Tools',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.util.Tools');
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        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);
-                                       }
-                               }
-                       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Plugin.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        editor.nodeChanged();
-               }
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * This class contains all core logic for the directionality plugin.
+ *
+ * @class tinymce.directionality.Plugin
+ * @private
+ */
+define(
+  'tinymce.plugins.directionality.Plugin',
+  [
+    'tinymce.core.PluginManager',
+    'tinymce.core.util.Tools'
+  ],
+  function (PluginManager, Tools) {
+    PluginManager.add('directionality', function (editor) {
+      function setDir(dir) {
+        var dom = editor.dom, curDir, blocks = editor.selection.getSelectedBlocks();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function generateSelector(dir) {
-               var selector = [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (blocks.length) {
+          curDir = dom.getAttrib(blocks[0], "dir");
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                tinymce.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function(name) {
-                       selector.push(name + '[dir=' + dir + ']');
-               });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          Tools.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);
+              }
+            }
+          });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return selector.join(',');
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          editor.nodeChanged();
+        }
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.addCommand('mceDirectionLTR', function() {
-               setDir("ltr");
-       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function generateSelector(dir) {
+        var selector = [];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.addCommand('mceDirectionRTL', function() {
-               setDir("rtl");
-       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        Tools.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function (name) {
+          selector.push(name + '[dir=' + dir + ']');
+        });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.addButton('ltr', {
-               title: 'Left to right',
-               cmd: 'mceDirectionLTR',
-               stateSelector: generateSelector('ltr')
-       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        return selector.join(',');
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.addButton('rtl', {
-               title: 'Right to left',
-               cmd: 'mceDirectionRTL',
-               stateSelector: generateSelector('rtl')
-       });
-});
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      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')
+      });
+    });
+
+    return function () { };
+  }
+);
+dem('tinymce.plugins.directionality.Plugin')();
+})();
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsdirectionalitypluginminjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/tinymce/plugins/directionality/plugin.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/tinymce/plugins/directionality/plugin.min.js     2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/js/tinymce/plugins/directionality/plugin.min.js       2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1 +1 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-tinymce.PluginManager.add("directionality",function(e){function t(t){var n,r=e.dom,i=e.selection.getSelectedBlocks();i.length&&(n=r.getAttrib(i[0],"dir"),tinymce.each(i,function(e){r.getParent(e.parentNode,"*[dir='"+t+"']",r.getRoot())||(n!=t?r.setAttrib(e,"dir",t):r.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:&
 quot;mceDirectionRTL",stateSelector:n("rtl")})});
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("3",tinymce.util.Tools.resolve),g("1",[&q
 uot;3"],function(a){return a("tinymce.PluginManager")}),g("2",["3"],function(a){return a("tinymce.util.Tools")}),g("0",["1","2"],function(a,b){return a.add("directionality",function(a){function c(c){var d,e=a.dom,f=a.selection.getSelectedBlocks();f.length&&(d=e.getAttrib(f[0],"dir"),b.each(f,function(a){e.getParent(a.parentNode,"*[dir='"+c+"']",e.getRoot())||(d!=c?e.setAttrib(a,"dir",c):e.setAttrib(a,"dir",null))}),a.nodeChanged())}function d(a){var c=[];return b.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(b){c.push(b+"[dir="+a+"]")}),c.join(",")}a.addCommand("mceDirectionLTR",function(){c("ltr")}),a.addCommand("mceDirectionRTL",function(){c("rtl")}),a.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",state
 Selector:d("ltr")}),a.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:d("rtl")})}),function(){}}),d("0")()}();
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsfullscreenpluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/tinymce/plugins/fullscreen/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/tinymce/plugins/fullscreen/plugin.js     2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/js/tinymce/plugins/fullscreen/plugin.js       2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,154 +1,299 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+(function () {
+
+var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
+
+// Used when there is no 'main' module.
+// The name is probably (hopefully) unique so minification removes for releases.
+var register_3795 = function (id) {
+  var module = dem(id);
+  var fragments = id.split('.');
+  var target = Function('return this;')();
+  for (var i = 0; i < fragments.length - 1; ++i) {
+    if (target[fragments[i]] === undefined)
+      target[fragments[i]] = {};
+    target = target[fragments[i]];
+  }
+  target[fragments[fragments.length - 1]] = module;
+};
+
+var instantiate = function (id) {
+  var actual = defs[id];
+  var dependencies = actual.deps;
+  var definition = actual.defn;
+  var len = dependencies.length;
+  var instances = new Array(len);
+  for (var i = 0; i < len; ++i)
+    instances[i] = dem(dependencies[i]);
+  var defResult = definition.apply(null, instances);
+  if (defResult === undefined)
+     throw 'module [' + id + '] returned undefined';
+  actual.instance = defResult;
+};
+
+var def = function (id, dependencies, definition) {
+  if (typeof id !== 'string')
+    throw 'module id must be a string';
+  else if (dependencies === undefined)
+    throw 'no dependencies for ' + id;
+  else if (definition === undefined)
+    throw 'no definition function for ' + id;
+  defs[id] = {
+    deps: dependencies,
+    defn: definition,
+    instance: undefined
+  };
+};
+
+var dem = function (id) {
+  var actual = defs[id];
+  if (actual === undefined)
+    throw 'module [' + id + '] was undefined';
+  else if (actual.instance === undefined)
+    instantiate(id);
+  return actual.instance;
+};
+
+var req = function (ids, callback) {
+  var len = ids.length;
+  var instances = new Array(len);
+  for (var i = 0; i < len; ++i)
+    instances.push(dem(ids[i]));
+  callback.apply(null, callback);
+};
+
+var ephox = {};
+
+ephox.bolt = {
+  module: {
+    api: {
+      define: def,
+      require: req,
+      demand: dem
+    }
+  }
+};
+
+var define = def;
+var require = req;
+var demand = dem;
+// this helps with minificiation when using a lot of global references
+var defineGlobal = function (id, ref) {
+  define(id, [], function () { return ref; });
+};
+/*jsc
+["tinymce.plugins.fullscreen.Plugin","tinymce.core.dom.DOMUtils","tinymce.core.PluginManager","global!tinymce.util.Tools.resolve"]
+jsc*/
+defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * plugin.js
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * ResolveGlobal.js
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Released under LGPL License.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * License: http://www.tinymce.com/license
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/*global tinymce:true */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.core.dom.DOMUtils',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.dom.DOMUtils');
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-tinymce.PluginManager.add('fullscreen', function(editor) {
-       var fullscreenState = false, DOM = tinymce.DOM, iframeWidth, iframeHeight, resizeHandler;
-       var containerWidth, containerHeight, scrollPos;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * ResolveGlobal.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if (editor.settings.inline) {
-               return;
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.core.PluginManager',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.PluginManager');
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function getWindowSize() {
-               var w, h, win = window, doc = document;
-               var body = doc.body;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Plugin.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // Old IE
-               if (body.offsetWidth) {
-                       w = body.offsetWidth;
-                       h = body.offsetHeight;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * This class contains all core logic for the fullscreen plugin.
+ *
+ * @class tinymce.fullscreen.Plugin
+ * @private
+ */
+define(
+  'tinymce.plugins.fullscreen.Plugin',
+  [
+    'tinymce.core.dom.DOMUtils',
+    'tinymce.core.PluginManager'
+  ],
+  function (DOMUtils, PluginManager) {
+    var DOM = DOMUtils.DOM;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // Modern browsers
-               if (win.innerWidth && win.innerHeight) {
-                       w = win.innerWidth;
-                       h = win.innerHeight;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    PluginManager.add('fullscreen', function (editor) {
+      var fullscreenState = false, iframeWidth, iframeHeight, resizeHandler;
+      var containerWidth, containerHeight, scrollPos;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return {w: w, h: h};
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (editor.settings.inline) {
+        return;
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function getScrollPos() {
-               var vp = tinymce.DOM.getViewPort();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function getWindowSize() {
+        var w, h, win = window, doc = document;
+        var body = doc.body;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return {
-                       x: vp.x,
-                       y: vp.y
-               };
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        // Old IE
+        if (body.offsetWidth) {
+          w = body.offsetWidth;
+          h = body.offsetHeight;
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function setScrollPos(pos) {
-               scrollTo(pos.x, pos.y);
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        // Modern browsers
+        if (win.innerWidth && win.innerHeight) {
+          w = win.innerWidth;
+          h = win.innerHeight;
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function toggleFullscreen() {
-               var body = document.body, documentElement = document.documentElement, editorContainerStyle;
-               var editorContainer, iframe, iframeStyle;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        return { w: w, h: h };
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function resize() {
-                       DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight));
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function getScrollPos() {
+        var vp = DOM.getViewPort();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                fullscreenState = !fullscreenState;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        return {
+          x: vp.x,
+          y: vp.y
+        };
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                editorContainer = editor.getContainer();
-               editorContainerStyle = editorContainer.style;
-               iframe = editor.getContentAreaContainer().firstChild;
-               iframeStyle = iframe.style;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function setScrollPos(pos) {
+        window.scrollTo(pos.x, pos.y);
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (fullscreenState) {
-                       scrollPos = getScrollPos();
-                       iframeWidth = iframeStyle.width;
-                       iframeHeight = iframeStyle.height;
-                       iframeStyle.width = iframeStyle.height = '100%';
-                       containerWidth = editorContainerStyle.width;
-                       containerHeight = editorContainerStyle.height;
-                       editorContainerStyle.width = editorContainerStyle.height = '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function toggleFullscreen() {
+        var body = document.body, documentElement = document.documentElement, editorContainerStyle;
+        var editorContainer, iframe, iframeStyle;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        DOM.addClass(body, 'mce-fullscreen');
-                       DOM.addClass(documentElement, 'mce-fullscreen');
-                       DOM.addClass(editorContainer, 'mce-fullscreen');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        function resize() {
+          DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight));
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        DOM.bind(window, 'resize', resize);
-                       resize();
-                       resizeHandler = resize;
-               } else {
-                       iframeStyle.width = iframeWidth;
-                       iframeStyle.height = iframeHeight;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        fullscreenState = !fullscreenState;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (containerWidth) {
-                               editorContainerStyle.width = containerWidth;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        editorContainer = editor.getContainer();
+        editorContainerStyle = editorContainer.style;
+        iframe = editor.getContentAreaContainer().firstChild;
+        iframeStyle = iframe.style;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (containerHeight) {
-                               editorContainerStyle.height = containerHeight;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (fullscreenState) {
+          scrollPos = getScrollPos();
+          iframeWidth = iframeStyle.width;
+          iframeHeight = iframeStyle.height;
+          iframeStyle.width = iframeStyle.height = '100%';
+          containerWidth = editorContainerStyle.width;
+          containerHeight = editorContainerStyle.height;
+          editorContainerStyle.width = editorContainerStyle.height = '';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        DOM.removeClass(body, 'mce-fullscreen');
-                       DOM.removeClass(documentElement, 'mce-fullscreen');
-                       DOM.removeClass(editorContainer, 'mce-fullscreen');
-                       DOM.unbind(window, 'resize', resizeHandler);
-                       setScrollPos(scrollPos);
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          DOM.addClass(body, 'mce-fullscreen');
+          DOM.addClass(documentElement, 'mce-fullscreen');
+          DOM.addClass(editorContainer, 'mce-fullscreen');
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                editor.fire('FullscreenStateChanged', {state: fullscreenState});
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          DOM.bind(window, 'resize', resize);
+          resize();
+          resizeHandler = resize;
+        } else {
+          iframeStyle.width = iframeWidth;
+          iframeStyle.height = iframeHeight;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.on('init', function() {
-               editor.addShortcut('Ctrl+Shift+F', '', toggleFullscreen);
-       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (containerWidth) {
+            editorContainerStyle.width = containerWidth;
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.on('remove', function() {
-               if (resizeHandler) {
-                       DOM.unbind(window, 'resize', resizeHandler);
-               }
-       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (containerHeight) {
+            editorContainerStyle.height = containerHeight;
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.addCommand('mceFullScreen', toggleFullscreen);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          DOM.removeClass(body, 'mce-fullscreen');
+          DOM.removeClass(documentElement, 'mce-fullscreen');
+          DOM.removeClass(editorContainer, 'mce-fullscreen');
+          DOM.unbind(window, 'resize', resizeHandler);
+          setScrollPos(scrollPos);
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.addMenuItem('fullscreen', {
-               text: 'Fullscreen',
-               shortcut: 'Ctrl+Shift+F',
-               selectable: true,
-               onClick: function() {
-                       toggleFullscreen();
-                       editor.focus();
-               },
-               onPostRender: function() {
-                       var self = this;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        editor.fire('FullscreenStateChanged', { state: fullscreenState });
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        editor.on('FullscreenStateChanged', function(e) {
-                               self.active(e.state);
-                       });
-               },
-               context: 'view'
-       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      editor.on('init', function () {
+        editor.addShortcut('Ctrl+Shift+F', '', toggleFullscreen);
+      });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.addButton('fullscreen', {
-               tooltip: 'Fullscreen',
-               shortcut: 'Ctrl+Shift+F',
-               onClick: toggleFullscreen,
-               onPostRender: function() {
-                       var self = this;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      editor.on('remove', function () {
+        if (resizeHandler) {
+          DOM.unbind(window, 'resize', resizeHandler);
+        }
+      });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        editor.on('FullscreenStateChanged', function(e) {
-                               self.active(e.state);
-                       });
-               }
-       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      editor.addCommand('mceFullScreen', toggleFullscreen);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        return {
-               isFullscreen: function() {
-                       return fullscreenState;
-               }
-       };
-});
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      editor.addMenuItem('fullscreen', {
+        text: 'Fullscreen',
+        shortcut: 'Ctrl+Shift+F',
+        selectable: true,
+        onClick: function () {
+          toggleFullscreen();
+          editor.focus();
+        },
+        onPostRender: function () {
+          var self = this;
+
+          editor.on('FullscreenStateChanged', function (e) {
+            self.active(e.state);
+          });
+        },
+        context: 'view'
+      });
+
+      editor.addButton('fullscreen', {
+        tooltip: 'Fullscreen',
+        shortcut: 'Ctrl+Shift+F',
+        onClick: toggleFullscreen,
+        onPostRender: function () {
+          var self = this;
+
+          editor.on('FullscreenStateChanged', function (e) {
+            self.active(e.state);
+          });
+        }
+      });
+
+      return {
+        isFullscreen: function () {
+          return fullscreenState;
+        }
+      };
+    });
+
+    return function () { };
+  }
+);
+dem('tinymce.plugins.fullscreen.Plugin')();
+})();
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsfullscreenpluginminjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js 2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js   2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1 +1 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-tinymce.PluginManager.add("fullscreen",function(e){function t(){var e,t,n=window,r=document,i=r.body;return i.offsetWidth&&(e=i.offsetWidth,t=i.offsetHeight),n.innerWidth&&n.innerHeight&&(e=n.innerWidth,t=n.innerHeight),{w:e,h:t}}function n(){var e=tinymce.DOM.getViewPort();return{x:e.x,y:e.y}}function r(e){scrollTo(e.x,e.y)}function i(){function i(){f.setStyle(m,"height",t().h-(h.clientHeight-m.clientHeight))}var p,h,m,g,v=document.body,y=document.documentElement;d=!d,h=e.getContainer(),p=h.style,m=e.getContentAreaContainer().firstChild,g=m.style,d?(c=n(),o=g.width,a=g.height,g.width=g.height="100%",l=p.width,u=p.height,p.width=p.height="",f.addClass(v,"mce-fullscreen"),f.addClass(y,"mce-fullscreen"),f.addClass(h,"mce-fullscreen"),f.bind(window,"resize",i),i(),s=i):(g.width=o,g.height
 =a,l&&(p.width=l),u&&(p.height=u),f.removeClass(v,"mce-fullscreen"),f.removeClass(y,"mce-fullscreen"),f.removeClass(h,"mce-fullscreen"),f.unbind(window,"resize",s),r(c)),e.fire("FullscreenStateChanged",{state:d})}var o,a,s,l,u,c,d=!1,f=tinymce.DOM;if(!e.settings.inline)return e.on("init",function(){e.addShortcut("Ctrl+Shift+F","",i)}),e.on("remove",function(){s&&f.unbind(window,"resize",s)}),e.addCommand("mceFullScreen",i),e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Shift+F",selectable:!0,onClick:function(){i(),e.focus()},onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})},context:"view"}),e.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Shift+F",onClick:i,onPostRender:function(){var t=this;e.on(&q
 uot;FullscreenStateChanged",function(e){t.active(e.state)})}}),{isFullscreen:function(){return d}}});
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("3",tinymce.util.Tools.resolve),g("1",[&q
 uot;3"],function(a){return a("tinymce.dom.DOMUtils")}),g("2",["3"],function(a){return a("tinymce.PluginManager")}),g("0",["1","2"],function(a,b){var c=a.DOM;return b.add("fullscreen",function(a){function b(){var a,b,c=window,d=document,e=d.body;return e.offsetWidth&&(a=e.offsetWidth,b=e.offsetHeight),c.innerWidth&&c.innerHeight&&(a=c.innerWidth,b=c.innerHeight),{w:a,h:b}}function d(){var a=c.getViewPort();return{x:a.x,y:a.y}}function e(a){window.scrollTo(a.x,a.y)}function f(){function f(){c.setStyle(p,"height",b().h-(o.clientHeight-p.clientHeight))}var n,o,p,q,r=document.body,s=document.documentElement;m=!m,o=a.getContainer(),n=o.style,p=a.getContentAreaContainer().firstChild,q=p.style,m?(l=d(),g=q.width,h=q.height,q.width=q.height="100%",j=n.width,k=n.height,n.width=n.height="",c.addClass(r,"mce-fullscreen"),c.addClass(s,"mce-full
 screen"),c.addClass(o,"mce-fullscreen"),c.bind(window,"resize",f),f(),i=f):(q.width=g,q.height=h,j&&(n.width=j),k&&(n.height=k),c.removeClass(r,"mce-fullscreen"),c.removeClass(s,"mce-fullscreen"),c.removeClass(o,"mce-fullscreen"),c.unbind(window,"resize",i),e(l)),a.fire("FullscreenStateChanged",{state:m})}var g,h,i,j,k,l,m=!1;if(!a.settings.inline)return a.on("init",function(){a.addShortcut("Ctrl+Shift+F","",f)}),a.on("remove",function(){i&&c.unbind(window,"resize",i)}),a.addCommand("mceFullScreen",f),a.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Shift+F",selectable:!0,onClick:function(){f(),a.focus()},onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})},context:"view"}),a.addButton("fullscreen",{tooltip:&quo
 t;Fullscreen",shortcut:"Ctrl+Shift+F",onClick:f,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})}}),{isFullscreen:function(){return m}}}),function(){}}),d("0")()}();
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginshrpluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/tinymce/plugins/hr/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/tinymce/plugins/hr/plugin.js     2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/js/tinymce/plugins/hr/plugin.js       2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,30 +1,152 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+(function () {
+
+var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
+
+// Used when there is no 'main' module.
+// The name is probably (hopefully) unique so minification removes for releases.
+var register_3795 = function (id) {
+  var module = dem(id);
+  var fragments = id.split('.');
+  var target = Function('return this;')();
+  for (var i = 0; i < fragments.length - 1; ++i) {
+    if (target[fragments[i]] === undefined)
+      target[fragments[i]] = {};
+    target = target[fragments[i]];
+  }
+  target[fragments[fragments.length - 1]] = module;
+};
+
+var instantiate = function (id) {
+  var actual = defs[id];
+  var dependencies = actual.deps;
+  var definition = actual.defn;
+  var len = dependencies.length;
+  var instances = new Array(len);
+  for (var i = 0; i < len; ++i)
+    instances[i] = dem(dependencies[i]);
+  var defResult = definition.apply(null, instances);
+  if (defResult === undefined)
+     throw 'module [' + id + '] returned undefined';
+  actual.instance = defResult;
+};
+
+var def = function (id, dependencies, definition) {
+  if (typeof id !== 'string')
+    throw 'module id must be a string';
+  else if (dependencies === undefined)
+    throw 'no dependencies for ' + id;
+  else if (definition === undefined)
+    throw 'no definition function for ' + id;
+  defs[id] = {
+    deps: dependencies,
+    defn: definition,
+    instance: undefined
+  };
+};
+
+var dem = function (id) {
+  var actual = defs[id];
+  if (actual === undefined)
+    throw 'module [' + id + '] was undefined';
+  else if (actual.instance === undefined)
+    instantiate(id);
+  return actual.instance;
+};
+
+var req = function (ids, callback) {
+  var len = ids.length;
+  var instances = new Array(len);
+  for (var i = 0; i < len; ++i)
+    instances.push(dem(ids[i]));
+  callback.apply(null, callback);
+};
+
+var ephox = {};
+
+ephox.bolt = {
+  module: {
+    api: {
+      define: def,
+      require: req,
+      demand: dem
+    }
+  }
+};
+
+var define = def;
+var require = req;
+var demand = dem;
+// this helps with minificiation when using a lot of global references
+var defineGlobal = function (id, ref) {
+  define(id, [], function () { return ref; });
+};
+/*jsc
+["tinymce.plugins.hr.Plugin","tinymce.core.PluginManager","global!tinymce.util.Tools.resolve"]
+jsc*/
+defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * plugin.js
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * ResolveGlobal.js
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Released under LGPL License.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * License: http://www.tinymce.com/license
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/*global tinymce:true */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.core.PluginManager',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.PluginManager');
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-tinymce.PluginManager.add('hr', function(editor) {
-       editor.addCommand('InsertHorizontalRule', function() {
-               editor.execCommand('mceInsertContent', false, '<hr />');
-       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Plugin.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.addButton('hr', {
-               icon: 'hr',
-               tooltip: 'Horizontal line',
-               cmd: 'InsertHorizontalRule'
-       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * This class contains all core logic for the hr plugin.
+ *
+ * @class tinymce.hr.Plugin
+ * @private
+ */
+define(
+  'tinymce.plugins.hr.Plugin',
+  [
+    'tinymce.core.PluginManager'
+  ],
+  function (PluginManager) {
+    PluginManager.add('hr', function (editor) {
+      editor.addCommand('InsertHorizontalRule', function () {
+        editor.execCommand('mceInsertContent', false, '<hr />');
+      });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.addMenuItem('hr', {
-               icon: 'hr',
-               text: 'Horizontal line',
-               cmd: 'InsertHorizontalRule',
-               context: 'insert'
-       });
-});
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      editor.addButton('hr', {
+        icon: 'hr',
+        tooltip: 'Horizontal line',
+        cmd: 'InsertHorizontalRule'
+      });
+
+      editor.addMenuItem('hr', {
+        icon: 'hr',
+        text: 'Horizontal line',
+        cmd: 'InsertHorizontalRule',
+        context: 'insert'
+      });
+    });
+
+    return function () { };
+  }
+);
+dem('tinymce.plugins.hr.Plugin')();
+})();
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginshrpluginminjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/tinymce/plugins/hr/plugin.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/tinymce/plugins/hr/plugin.min.js 2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/js/tinymce/plugins/hr/plugin.min.js   2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1 +1 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-tinymce.PluginManager.add("hr",function(e){e.addCommand("InsertHorizontalRule",function(){e.execCommand("mceInsertContent",!1,"<hr />")}),e.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),e.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})});
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("2",tinymce.util.Tools.resolve),g("1",[&q
 uot;2"],function(a){return a("tinymce.PluginManager")}),g("0",["1"],function(a){return a.add("hr",function(a){a.addCommand("InsertHorizontalRule",function(){a.execCommand("mceInsertContent",!1,"<hr />")}),a.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),a.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})}),function(){}}),d("0")()}();
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsimagepluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/tinymce/plugins/image/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/tinymce/plugins/image/plugin.js  2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/js/tinymce/plugins/image/plugin.js    2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,655 +1,844 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+(function () {
+
+var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
+
+// Used when there is no 'main' module.
+// The name is probably (hopefully) unique so minification removes for releases.
+var register_3795 = function (id) {
+  var module = dem(id);
+  var fragments = id.split('.');
+  var target = Function('return this;')();
+  for (var i = 0; i < fragments.length - 1; ++i) {
+    if (target[fragments[i]] === undefined)
+      target[fragments[i]] = {};
+    target = target[fragments[i]];
+  }
+  target[fragments[fragments.length - 1]] = module;
+};
+
+var instantiate = function (id) {
+  var actual = defs[id];
+  var dependencies = actual.deps;
+  var definition = actual.defn;
+  var len = dependencies.length;
+  var instances = new Array(len);
+  for (var i = 0; i < len; ++i)
+    instances[i] = dem(dependencies[i]);
+  var defResult = definition.apply(null, instances);
+  if (defResult === undefined)
+     throw 'module [' + id + '] returned undefined';
+  actual.instance = defResult;
+};
+
+var def = function (id, dependencies, definition) {
+  if (typeof id !== 'string')
+    throw 'module id must be a string';
+  else if (dependencies === undefined)
+    throw 'no dependencies for ' + id;
+  else if (definition === undefined)
+    throw 'no definition function for ' + id;
+  defs[id] = {
+    deps: dependencies,
+    defn: definition,
+    instance: undefined
+  };
+};
+
+var dem = function (id) {
+  var actual = defs[id];
+  if (actual === undefined)
+    throw 'module [' + id + '] was undefined';
+  else if (actual.instance === undefined)
+    instantiate(id);
+  return actual.instance;
+};
+
+var req = function (ids, callback) {
+  var len = ids.length;
+  var instances = new Array(len);
+  for (var i = 0; i < len; ++i)
+    instances.push(dem(ids[i]));
+  callback.apply(null, callback);
+};
+
+var ephox = {};
+
+ephox.bolt = {
+  module: {
+    api: {
+      define: def,
+      require: req,
+      demand: dem
+    }
+  }
+};
+
+var define = def;
+var require = req;
+var demand = dem;
+// this helps with minificiation when using a lot of global references
+var defineGlobal = function (id, ref) {
+  define(id, [], function () { return ref; });
+};
+/*jsc
+["tinymce.plugins.image.Plugin","tinymce.core.Env","tinymce.core.PluginManager","tinymce.core.util.JSON","tinymce.core.util.Tools","tinymce.core.util.XHR","global!tinymce.util.Tools.resolve"]
+jsc*/
+defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * plugin.js
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * ResolveGlobal.js
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Released under LGPL License.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * License: http://www.tinymce.com/license
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/*global tinymce:true */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.core.Env',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.Env');
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-tinymce.PluginManager.add('image', function(editor) {
-       function getImageSize(url, callback) {
-               var img = document.createElement('img');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * ResolveGlobal.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function done(width, height) {
-                       if (img.parentNode) {
-                               img.parentNode.removeChild(img);
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.core.PluginManager',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.PluginManager');
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        callback({width: width, height: height});
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * ResolveGlobal.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                img.onload = function() {
-                       done(Math.max(img.width, img.clientWidth), Math.max(img.height, img.clientHeight));
-               };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.core.util.JSON',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.util.JSON');
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                img.onerror = function() {
-                       done();
-               };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * ResolveGlobal.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                var style = img.style;
-               style.visibility = 'hidden';
-               style.position = 'fixed';
-               style.bottom = style.left = 0;
-               style.width = style.height = 'auto';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.core.util.Tools',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.util.Tools');
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                document.body.appendChild(img);
-               img.src = url;
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * ResolveGlobal.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function buildListItems(inputList, itemCallback, startItems) {
-               function appendItems(values, output) {
-                       output = output || [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.core.util.XHR',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.util.XHR');
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        tinymce.each(values, function(item) {
-                               var menuItem = {text: item.text || item.title};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Plugin.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (item.menu) {
-                                       menuItem.menu = appendItems(item.menu);
-                               } else {
-                                       menuItem.value = item.value;
-                                       itemCallback(menuItem);
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * This class contains all core logic for the image plugin.
+ *
+ * @class tinymce.image.Plugin
+ * @private
+ */
+define(
+  'tinymce.plugins.image.Plugin',
+  [
+    'tinymce.core.Env',
+    'tinymce.core.PluginManager',
+    'tinymce.core.util.JSON',
+    'tinymce.core.util.Tools',
+    'tinymce.core.util.XHR'
+  ],
+  function (Env, PluginManager, JSON, Tools, XHR) {
+    PluginManager.add('image', function (editor) {
+      function getImageSize(url, callback) {
+        var img = document.createElement('img');
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                output.push(menuItem);
-                       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        function done(width, height) {
+          if (img.parentNode) {
+            img.parentNode.removeChild(img);
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        return output;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          callback({ width: width, height: height });
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return appendItems(inputList, startItems || []);
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        img.onload = function () {
+          done(Math.max(img.width, img.clientWidth), Math.max(img.height, img.clientHeight));
+        };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function createImageList(callback) {
-               return function() {
-                       var imageList = editor.settings.image_list;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        img.onerror = function () {
+          done();
+        };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (typeof imageList == "string") {
-                               tinymce.util.XHR.send({
-                                       url: imageList,
-                                       success: function(text) {
-                                               callback(tinymce.util.JSON.parse(text));
-                                       }
-                               });
-                       } else if (typeof imageList == "function") {
-                               imageList(callback);
-                       } else {
-                               callback(imageList);
-                       }
-               };
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        var style = img.style;
+        style.visibility = 'hidden';
+        style.position = 'fixed';
+        style.bottom = style.left = 0;
+        style.width = style.height = 'auto';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function showDialog(imageList) {
-               var win, data = {}, dom = editor.dom, imgElm, figureElm;
-               var width, height, imageListCtrl, classListCtrl, imageDimensions = editor.settings.image_dimensions !== false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        document.body.appendChild(img);
+        img.src = url;
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function recalcSize() {
-                       var widthCtrl, heightCtrl, newWidth, newHeight;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function buildListItems(inputList, itemCallback, startItems) {
+        function appendItems(values, output) {
+          output = output || [];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        widthCtrl = win.find('#width')[0];
-                       heightCtrl = win.find('#height')[0];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          Tools.each(values, function (item) {
+            var menuItem = { text: item.text || item.title };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (!widthCtrl || !heightCtrl) {
-                               return;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            if (item.menu) {
+              menuItem.menu = appendItems(item.menu);
+            } else {
+              menuItem.value = item.value;
+              itemCallback(menuItem);
+            }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        newWidth = widthCtrl.value();
-                       newHeight = heightCtrl.value();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            output.push(menuItem);
+          });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (win.find('#constrain')[0].checked() && width && height && newWidth && newHeight) {
-                               if (width != newWidth) {
-                                       newHeight = Math.round((newWidth / width) * newHeight);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          return output;
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        if (!isNaN(newHeight)) {
-                                               heightCtrl.value(newHeight);
-                                       }
-                               } else {
-                                       newWidth = Math.round((newHeight / height) * newWidth);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        return appendItems(inputList, startItems || []);
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        if (!isNaN(newWidth)) {
-                                               widthCtrl.value(newWidth);
-                                       }
-                               }
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function createImageList(callback) {
+        return function () {
+          var imageList = editor.settings.image_list;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        width = newWidth;
-                       height = newHeight;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (typeof imageList == "string") {
+            XHR.send({
+              url: imageList,
+              success: function (text) {
+                callback(JSON.parse(text));
+              }
+            });
+          } else if (typeof imageList == "function") {
+            imageList(callback);
+          } else {
+            callback(imageList);
+          }
+        };
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function onSubmitForm() {
-                       var figureElm, oldImg;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      function showDialog(imageList) {
+        var win, data = {}, dom = editor.dom, imgElm, figureElm;
+        var width, height, imageListCtrl, classListCtrl, imageDimensions = editor.settings.image_dimensions !== false;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        function waitLoad(imgElm) {
-                               function selectImage() {
-                                       imgElm.onload = imgElm.onerror = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        function recalcSize() {
+          var widthCtrl, heightCtrl, newWidth, newHeight;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        if (editor.selection) {
-                                               editor.selection.select(imgElm);
-                                               editor.nodeChanged();
-                                       }
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          widthCtrl = win.find('#width')[0];
+          heightCtrl = win.find('#height')[0];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                imgElm.onload = function() {
-                                       if (!data.width && !data.height && imageDimensions) {
-                                               dom.setAttribs(imgElm, {
-                                                       width: imgElm.clientWidth,
-                                                       height: imgElm.clientHeight
-                                               });
-                                               //WP
-                                               editor.fire( 'wpNewImageRefresh', { node: imgElm } );
-                                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (!widthCtrl || !heightCtrl) {
+            return;
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        selectImage();
-                               };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          newWidth = widthCtrl.value();
+          newHeight = heightCtrl.value();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                imgElm.onerror = selectImage;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (win.find('#constrain')[0].checked() && width && height && newWidth && newHeight) {
+            if (width != newWidth) {
+              newHeight = Math.round((newWidth / width) * newHeight);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        updateStyle();
-                       recalcSize();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+              if (!isNaN(newHeight)) {
+                heightCtrl.value(newHeight);
+              }
+            } else {
+              newWidth = Math.round((newHeight / height) * newWidth);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        data = tinymce.extend(data, win.toJSON());
-                       var wpcaption = data.wpcaption; // WP
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+              if (!isNaN(newWidth)) {
+                widthCtrl.value(newWidth);
+              }
+            }
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (!data.alt) {
-                               data.alt = '';
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          width = newWidth;
+          height = newHeight;
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (!data.title) {
-                               data.title = '';
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        function onSubmitForm() {
+          var figureElm, oldImg;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (data.width === '') {
-                               data.width = null;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          function waitLoad(imgElm) {
+            function selectImage() {
+              imgElm.onload = imgElm.onerror = null;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (data.height === '') {
-                               data.height = null;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+              if (editor.selection) {
+                editor.selection.select(imgElm);
+                editor.nodeChanged();
+              }
+            }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (!data.style) {
-                               data.style = null;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            imgElm.onload = function () {
+              if (!data.width && !data.height && imageDimensions) {
+                dom.setAttribs(imgElm, {
+                  width: imgElm.clientWidth,
+                  height: imgElm.clientHeight
+                });
+              }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // Setup new data excluding style properties
-                       /*eslint dot-notation: 0*/
-                       data = {
-                               src: data.src,
-                               alt: data.alt,
-                               title: data.title,
-                               width: data.width,
-                               height: data.height,
-                               style: data.style,
-                               caption: data.caption,
-                               "class": data["class"]
-                       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+              selectImage();
+            };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        editor.undoManager.transact(function() {
-                               // WP
-                               var eventData = { node: imgElm, data: data, wpcaption: wpcaption };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            imgElm.onerror = selectImage;
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                editor.fire( 'wpImageFormSubmit', { imgData: eventData } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          updateStyle();
+          recalcSize();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if ( eventData.cancel ) {
-                                       waitLoad( eventData.node );
-                                       return;
-                               }
-                               // WP end
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          data = Tools.extend(data, win.toJSON());
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (!data.src) {
-                                       if (imgElm) {
-                                               dom.remove(imgElm);
-                                               editor.focus();
-                                               editor.nodeChanged();
-                                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (!data.alt) {
+            data.alt = '';
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        return;
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (!data.title) {
+            data.title = '';
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (data.title === "") {
-                                       data.title = null;
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (data.width === '') {
+            data.width = null;
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (!imgElm) {
-                                       data.id = '__mcenew';
-                                       editor.focus();
-                                       editor.selection.setContent(dom.createHTML('img', data));
-                                       imgElm = dom.get('__mcenew');
-                                       dom.setAttrib(imgElm, 'id', null);
-                               } else {
-                                       dom.setAttribs(imgElm, data);
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (data.height === '') {
+            data.height = null;
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                editor.editorUpload.uploadImagesAuto();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (!data.style) {
+            data.style = null;
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (data.caption === false) {
-                                       if (dom.is(imgElm.parentNode, 'figure.image')) {
-                                               figureElm = imgElm.parentNode;
-                                               dom.insertAfter(imgElm, figureElm);
-                                               dom.remove(figureElm);
-                                       }
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          // Setup new data excluding style properties
+          /*eslint dot-notation: 0*/
+          data = {
+            src: data.src,
+            alt: data.alt,
+            title: data.title,
+            width: data.width,
+            height: data.height,
+            style: data.style,
+            caption: data.caption,
+            "class": data["class"]
+          };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                function isTextBlock(node) {
-                                       return editor.schema.getTextBlockElements()[node.nodeName];
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          editor.undoManager.transact(function () {
+            if (!data.src) {
+              if (imgElm) {
+                dom.remove(imgElm);
+                editor.focus();
+                editor.nodeChanged();
+              }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (data.caption === true) {
-                                       if (!dom.is(imgElm.parentNode, 'figure.image')) {
-                                               oldImg = imgElm;
-                                               imgElm = imgElm.cloneNode(true);
-                                               figureElm = dom.create('figure', {'class': 'image'});
-                                               figureElm.appendChild(imgElm);
-                                               figureElm.appendChild(dom.create('figcaption', {contentEditable: true}, 'Caption'));
-                                               figureElm.contentEditable = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+              return;
+            }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                var textBlock = dom.getParent(oldImg, isTextBlock);
-                                               if (textBlock) {
-                                                       dom.split(textBlock, oldImg, figureElm);
-                                               } else {
-                                                       dom.replace(figureElm, oldImg);
-                                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            if (data.title === "") {
+              data.title = null;
+            }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                editor.selection.select(figureElm);
-                                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            if (!imgElm) {
+              data.id = '__mcenew';
+              editor.focus();
+              editor.selection.setContent(dom.createHTML('img', data));
+              imgElm = dom.get('__mcenew');
+              dom.setAttrib(imgElm, 'id', null);
+            } else {
+              dom.setAttribs(imgElm, data);
+            }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        return;
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            editor.editorUpload.uploadImagesAuto();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                waitLoad(imgElm);
-                       });
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            if (data.caption === false) {
+              if (dom.is(imgElm.parentNode, 'figure.image')) {
+                figureElm = imgElm.parentNode;
+                dom.insertAfter(imgElm, figureElm);
+                dom.remove(figureElm);
+              }
+            }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function removePixelSuffix(value) {
-                       if (value) {
-                               value = value.replace(/px$/, '');
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            function isTextBlock(node) {
+              return editor.schema.getTextBlockElements()[node.nodeName];
+            }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        return value;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            if (data.caption === true) {
+              if (!dom.is(imgElm.parentNode, 'figure.image')) {
+                oldImg = imgElm;
+                imgElm = imgElm.cloneNode(true);
+                figureElm = dom.create('figure', { 'class': 'image' });
+                figureElm.appendChild(imgElm);
+                figureElm.appendChild(dom.create('figcaption', { contentEditable: true }, 'Caption'));
+                figureElm.contentEditable = false;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function srcChange(e) {
-                       var srcURL, prependURL, absoluteURLPattern, meta = e.meta || {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                var textBlock = dom.getParent(oldImg, isTextBlock);
+                if (textBlock) {
+                  dom.split(textBlock, oldImg, figureElm);
+                } else {
+                  dom.replace(figureElm, oldImg);
+                }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (imageListCtrl) {
-                               imageListCtrl.value(editor.convertURL(this.value(), 'src'));
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                editor.selection.select(figureElm);
+              }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        tinymce.each(meta, function(value, key) {
-                               win.find('#' + key).value(value);
-                       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+              return;
+            }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (!meta.width && !meta.height) {
-                               srcURL = editor.convertURL(this.value(), 'src');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            waitLoad(imgElm);
+          });
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                // Pattern test the src url and make sure we haven't already prepended the url
-                               prependURL = editor.settings.image_prepend_url;
-                               absoluteURLPattern = new RegExp('^(?:[a-z]+:)?//', 'i');
-                               if (prependURL && !absoluteURLPattern.test(srcURL) && srcURL.substring(0, prependURL.length) !== prependURL) {
-                                       srcURL = prependURL + srcURL;
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        function removePixelSuffix(value) {
+          if (value) {
+            value = value.replace(/px$/, '');
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                this.value(srcURL);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          return value;
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                getImageSize(editor.documentBaseURI.toAbsolute(this.value()), function(data) {
-                                       if (data.width && data.height && imageDimensions) {
-                                               width = data.width;
-                                               height = data.height;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        function srcChange(e) {
+          var srcURL, prependURL, absoluteURLPattern, meta = e.meta || {};
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                win.find('#width').value(width);
-                                               win.find('#height').value(height);
-                                       }
-                               });
-                       }
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (imageListCtrl) {
+            imageListCtrl.value(editor.convertURL(this.value(), 'src'));
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function onBeforeCall(e) {
-                       e.meta = win.toJSON();
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          Tools.each(meta, function (value, key) {
+            win.find('#' + key).value(value);
+          });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                imgElm = editor.selection.getNode();
-               figureElm = dom.getParent(imgElm, 'figure.image');
-               if (figureElm) {
-                       imgElm = dom.select('img', figureElm)[0];
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (!meta.width && !meta.height) {
+            srcURL = editor.convertURL(this.value(), 'src');
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (imgElm && (imgElm.nodeName != 'IMG' || imgElm.getAttribute('data-mce-object') || imgElm.getAttribute('data-mce-placeholder'))) {
-                       imgElm = null;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            // Pattern test the src url and make sure we haven't already prepended the url
+            prependURL = editor.settings.image_prepend_url;
+            absoluteURLPattern = new RegExp('^(?:[a-z]+:)?//', 'i');
+            if (prependURL && !absoluteURLPattern.test(srcURL) && srcURL.substring(0, prependURL.length) !== prependURL) {
+              srcURL = prependURL + srcURL;
+            }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (imgElm) {
-                       width = dom.getAttrib(imgElm, 'width');
-                       height = dom.getAttrib(imgElm, 'height');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            this.value(srcURL);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        data = {
-                               src: dom.getAttrib(imgElm, 'src'),
-                               alt: dom.getAttrib(imgElm, 'alt'),
-                               title: dom.getAttrib(imgElm, 'title'),
-                               "class": dom.getAttrib(imgElm, 'class'),
-                               width: width,
-                               height: height,
-                               caption: !!figureElm
-                       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            getImageSize(editor.documentBaseURI.toAbsolute(this.value()), function (data) {
+              if (data.width && data.height && imageDimensions) {
+                width = data.width;
+                height = data.height;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // WP
-                       editor.fire( 'wpLoadImageData', { imgData: { data: data, node: imgElm } } );
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                win.find('#width').value(width);
+                win.find('#height').value(height);
+              }
+            });
+          }
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (imageList) {
-                       imageListCtrl = {
-                               type: 'listbox',
-                               label: 'Image list',
-                               values: buildListItems(
-                                       imageList,
-                                       function(item) {
-                                               item.value = editor.convertURL(item.value || item.url, 'src');
-                                       },
-                                       [{text: 'None', value: ''}]
-                               ),
-                               value: data.src && editor.convertURL(data.src, 'src'),
-                               onselect: function(e) {
-                                       var altCtrl = win.find('#alt');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        function onBeforeCall(e) {
+          e.meta = win.toJSON();
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        if (!altCtrl.value() || (e.lastControl && altCtrl.value() == e.lastControl.text())) {
-                                               altCtrl.value(e.control.text());
-                                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        imgElm = editor.selection.getNode();
+        figureElm = dom.getParent(imgElm, 'figure.image');
+        if (figureElm) {
+          imgElm = dom.select('img', figureElm)[0];
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        win.find('#src').value(e.control.value()).fire('change');
-                               },
-                               onPostRender: function() {
-                                       /*eslint consistent-this: 0*/
-                                       imageListCtrl = this;
-                               }
-                       };
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (imgElm &&
+          (imgElm.nodeName != 'IMG' ||
+            imgElm.getAttribute('data-mce-object') ||
+            imgElm.getAttribute('data-mce-placeholder'))) {
+          imgElm = null;
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (editor.settings.image_class_list) {
-                       classListCtrl = {
-                               name: 'class',
-                               type: 'listbox',
-                               label: 'Class',
-                               values: buildListItems(
-                                       editor.settings.image_class_list,
-                                       function(item) {
-                                               if (item.value) {
-                                                       item.textStyle = function() {
-                                                               return editor.formatter.getCssText({inline: 'img', classes: [item.value]});
-                                                       };
-                                               }
-                                       }
-                               )
-                       };
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (imgElm) {
+          width = dom.getAttrib(imgElm, 'width');
+          height = dom.getAttrib(imgElm, 'height');
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // General settings shared between simple and advanced dialogs
-               var generalFormItems = [
-                       {
-                               name: 'src',
-                               type: 'filepicker',
-                               filetype: 'image',
-                               label: 'Source',
-                               autofocus: true,
-                               onchange: srcChange,
-                               onbeforecall: onBeforeCall
-                       },
-                       imageListCtrl
-               ];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          data = {
+            src: dom.getAttrib(imgElm, 'src'),
+            alt: dom.getAttrib(imgElm, 'alt'),
+            title: dom.getAttrib(imgElm, 'title'),
+            "class": dom.getAttrib(imgElm, 'class'),
+            width: width,
+            height: height,
+            caption: !!figureElm
+          };
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (editor.settings.image_description !== false) {
-                       generalFormItems.push({name: 'alt', type: 'textbox', label: 'Image description'});
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (imageList) {
+          imageListCtrl = {
+            type: 'listbox',
+            label: 'Image list',
+            values: buildListItems(
+              imageList,
+              function (item) {
+                item.value = editor.convertURL(item.value || item.url, 'src');
+              },
+              [{ text: 'None', value: '' }]
+            ),
+            value: data.src && editor.convertURL(data.src, 'src'),
+            onselect: function (e) {
+              var altCtrl = win.find('#alt');
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (editor.settings.image_title) {
-                       generalFormItems.push({name: 'title', type: 'textbox', label: 'Image Title'});
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+              if (!altCtrl.value() || (e.lastControl && altCtrl.value() == e.lastControl.text())) {
+                altCtrl.value(e.control.text());
+              }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (imageDimensions) {
-                       generalFormItems.push({
-                               type: 'container',
-                               label: 'Dimensions',
-                               layout: 'flex',
-                               direction: 'row',
-                               align: 'center',
-                               spacing: 5,
-                               items: [
-                                       {name: 'width', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize, ariaLabel: 'Width'},
-                                       {type: 'label', text: 'x'},
-                                       {name: 'height', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize, ariaLabel: 'Height'},
-                                       {name: 'constrain', type: 'checkbox', checked: true, text: 'Constrain proportions'}
-                               ]
-                       });
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+              win.find('#src').value(e.control.value()).fire('change');
+            },
+            onPostRender: function () {
+              /*eslint consistent-this: 0*/
+              imageListCtrl = this;
+            }
+          };
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                generalFormItems.push(classListCtrl);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (editor.settings.image_class_list) {
+          classListCtrl = {
+            name: 'class',
+            type: 'listbox',
+            label: 'Class',
+            values: buildListItems(
+              editor.settings.image_class_list,
+              function (item) {
+                if (item.value) {
+                  item.textStyle = function () {
+                    return editor.formatter.getCssText({ inline: 'img', classes: [item.value] });
+                  };
+                }
+              }
+            )
+          };
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (editor.settings.image_caption && tinymce.Env.ceFalse) {
-                       generalFormItems.push({name: 'caption', type: 'checkbox', label: 'Caption'});
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        // General settings shared between simple and advanced dialogs
+        var generalFormItems = [
+          {
+            name: 'src',
+            type: 'filepicker',
+            filetype: 'image',
+            label: 'Source',
+            autofocus: true,
+            onchange: srcChange,
+            onbeforecall: onBeforeCall
+          },
+          imageListCtrl
+        ];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // WP
-               editor.fire( 'wpLoadImageForm', { data: generalFormItems } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (editor.settings.image_description !== false) {
+          generalFormItems.push({ name: 'alt', type: 'textbox', label: 'Image description' });
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function mergeMargins(css) {
-                       if (css.margin) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (editor.settings.image_title) {
+          generalFormItems.push({ name: 'title', type: 'textbox', label: 'Image Title' });
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                var splitMargin = css.margin.split(" ");
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (imageDimensions) {
+          generalFormItems.push({
+            type: 'container',
+            label: 'Dimensions',
+            layout: 'flex',
+            direction: 'row',
+            align: 'center',
+            spacing: 5,
+            items: [
+              { name: 'width', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize, ariaLabel: 'Width' },
+              { type: 'label', text: 'x' },
+              { name: 'height', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize, ariaLabel: 'Height' },
+              { name: 'constrain', type: 'checkbox', checked: true, text: 'Constrain proportions' }
+            ]
+          });
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                switch (splitMargin.length) {
-                                       case 1: //margin: toprightbottomleft;
-                                               css['margin-top'] = css['margin-top'] || splitMargin[0];
-                                               css['margin-right'] = css['margin-right'] || splitMargin[0];
-                                               css['margin-bottom'] = css['margin-bottom'] || splitMargin[0];
-                                               css['margin-left'] = css['margin-left'] || splitMargin[0];
-                                               break;
-                                       case 2: //margin: topbottom rightleft;
-                                               css['margin-top'] = css['margin-top'] || splitMargin[0];
-                                               css['margin-right'] = css['margin-right'] || splitMargin[1];
-                                               css['margin-bottom'] = css['margin-bottom'] || splitMargin[0];
-                                               css['margin-left'] = css['margin-left'] || splitMargin[1];
-                                               break;
-                                       case 3: //margin: top rightleft bottom;
-                                               css['margin-top'] = css['margin-top'] || splitMargin[0];
-                                               css['margin-right'] = css['margin-right'] || splitMargin[1];
-                                               css['margin-bottom'] = css['margin-bottom'] || splitMargin[2];
-                                               css['margin-left'] = css['margin-left'] || splitMargin[1];
-                                               break;
-                                       case 4: //margin: top right bottom left;
-                                               css['margin-top'] = css['margin-top'] || splitMargin[0];
-                                               css['margin-right'] = css['margin-right'] || splitMargin[1];
-                                               css['margin-bottom'] = css['margin-bottom'] || splitMargin[2];
-                                               css['margin-left'] = css['margin-left'] || splitMargin[3];
-                               }
-                               delete css.margin;
-                       }
-                       return css;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        generalFormItems.push(classListCtrl);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function updateStyle() {
-                       function addPixelSuffix(value) {
-                               if (value.length > 0 && /^[0-9]+$/.test(value)) {
-                                       value += 'px';
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (editor.settings.image_caption && Env.ceFalse) {
+          generalFormItems.push({ name: 'caption', type: 'checkbox', label: 'Caption' });
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                return value;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        function mergeMargins(css) {
+          if (css.margin) {
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (!editor.settings.image_advtab) {
-                               return;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            var splitMargin = css.margin.split(" ");
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        var data = win.toJSON(),
-                               css = dom.parseStyle(data.style);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            switch (splitMargin.length) {
+              case 1: //margin: toprightbottomleft;
+                css['margin-top'] = css['margin-top'] || splitMargin[0];
+                css['margin-right'] = css['margin-right'] || splitMargin[0];
+                css['margin-bottom'] = css['margin-bottom'] || splitMargin[0];
+                css['margin-left'] = css['margin-left'] || splitMargin[0];
+                break;
+              case 2: //margin: topbottom rightleft;
+                css['margin-top'] = css['margin-top'] || splitMargin[0];
+                css['margin-right'] = css['margin-right'] || splitMargin[1];
+                css['margin-bottom'] = css['margin-bottom'] || splitMargin[0];
+                css['margin-left'] = css['margin-left'] || splitMargin[1];
+                break;
+              case 3: //margin: top rightleft bottom;
+                css['margin-top'] = css['margin-top'] || splitMargin[0];
+                css['margin-right'] = css['margin-right'] || splitMargin[1];
+                css['margin-bottom'] = css['margin-bottom'] || splitMargin[2];
+                css['margin-left'] = css['margin-left'] || splitMargin[1];
+                break;
+              case 4: //margin: top right bottom left;
+                css['margin-top'] = css['margin-top'] || splitMargin[0];
+                css['margin-right'] = css['margin-right'] || splitMargin[1];
+                css['margin-bottom'] = css['margin-bottom'] || splitMargin[2];
+                css['margin-left'] = css['margin-left'] || splitMargin[3];
+            }
+            delete css.margin;
+          }
+          return css;
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        css = mergeMargins(css);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        function updateStyle() {
+          function addPixelSuffix(value) {
+            if (value.length > 0 && /^[0-9]+$/.test(value)) {
+              value += 'px';
+            }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (data.vspace) {
-                               css['margin-top'] = css['margin-bottom'] = addPixelSuffix(data.vspace);
-                       }
-                       if (data.hspace) {
-                               css['margin-left'] = css['margin-right'] = addPixelSuffix(data.hspace);
-                       }
-                       if (data.border) {
-                               css['border-width'] = addPixelSuffix(data.border);
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            return value;
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        win.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css))));
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (!editor.settings.image_advtab) {
+            return;
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function updateVSpaceHSpaceBorder() {
-                       if (!editor.settings.image_advtab) {
-                               return;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          var data = win.toJSON(),
+            css = dom.parseStyle(data.style);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        var data = win.toJSON(),
-                               css = dom.parseStyle(data.style);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          css = mergeMargins(css);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        win.find('#vspace').value("");
-                       win.find('#hspace').value("");
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (data.vspace) {
+            css['margin-top'] = css['margin-bottom'] = addPixelSuffix(data.vspace);
+          }
+          if (data.hspace) {
+            css['margin-left'] = css['margin-right'] = addPixelSuffix(data.hspace);
+          }
+          if (data.border) {
+            css['border-width'] = addPixelSuffix(data.border);
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        css = mergeMargins(css);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          win.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css))));
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        //Move opposite equal margins to vspace/hspace field
-                       if ((css['margin-top'] && css['margin-bottom']) || (css['margin-right'] && css['margin-left'])) {
-                               if (css['margin-top'] === css['margin-bottom']) {
-                                       win.find('#vspace').value(removePixelSuffix(css['margin-top']));
-                               } else {
-                                       win.find('#vspace').value('');
-                               }
-                               if (css['margin-right'] === css['margin-left']) {
-                                       win.find('#hspace').value(removePixelSuffix(css['margin-right']));
-                               } else {
-                                       win.find('#hspace').value('');
-                               }
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        function updateVSpaceHSpaceBorder() {
+          if (!editor.settings.image_advtab) {
+            return;
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        //Move border-width
-                       if (css['border-width']) {
-                               win.find('#border').value(removePixelSuffix(css['border-width']));
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          var data = win.toJSON(),
+            css = dom.parseStyle(data.style);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        win.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css))));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          win.find('#vspace').value("");
+          win.find('#hspace').value("");
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          css = mergeMargins(css);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (editor.settings.image_advtab) {
-                       // Parse styles from img
-                       if (imgElm) {
-                               if (imgElm.style.marginLeft && imgElm.style.marginRight && imgElm.style.marginLeft === imgElm.style.marginRight) {
-                                       data.hspace = removePixelSuffix(imgElm.style.marginLeft);
-                               }
-                               if (imgElm.style.marginTop && imgElm.style.marginBottom && imgElm.style.marginTop === imgElm.style.marginBottom) {
-                                       data.vspace = removePixelSuffix(imgElm.style.marginTop);
-                               }
-                               if (imgElm.style.borderWidth) {
-                                       data.border = removePixelSuffix(imgElm.style.borderWidth);
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          //Move opposite equal margins to vspace/hspace field
+          if ((css['margin-top'] && css['margin-bottom']) || (css['margin-right'] && css['margin-left'])) {
+            if (css['margin-top'] === css['margin-bottom']) {
+              win.find('#vspace').value(removePixelSuffix(css['margin-top']));
+            } else {
+              win.find('#vspace').value('');
+            }
+            if (css['margin-right'] === css['margin-left']) {
+              win.find('#hspace').value(removePixelSuffix(css['margin-right']));
+            } else {
+              win.find('#hspace').value('');
+            }
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                data.style = editor.dom.serializeStyle(editor.dom.parseStyle(editor.dom.getAttrib(imgElm, 'style')));
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          //Move border-width
+          if (css['border-width']) {
+            win.find('#border').value(removePixelSuffix(css['border-width']));
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // 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
-                                       },
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          win.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css))));
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        {
-                                               title: 'Advanced',
-                                               type: 'form',
-                                               pack: 'start',
-                                               items: [
-                                                       {
-                                                               label: 'Style',
-                                                               name: 'style',
-                                                               type: 'textbox',
-                                                               onchange: updateVSpaceHSpaceBorder
-                                                       },
-                                                       {
-                                                               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
-                       });
-               }
-       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.on('preInit', function() {
-               function hasImageClass(node) {
-                       var className = node.attr('class');
-                       return className && /\bimage\b/.test(className);
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (editor.settings.image_advtab) {
+          // Parse styles from img
+          if (imgElm) {
+            if (imgElm.style.marginLeft && imgElm.style.marginRight && imgElm.style.marginLeft === imgElm.style.marginRight) {
+              data.hspace = removePixelSuffix(imgElm.style.marginLeft);
+            }
+            if (imgElm.style.marginTop && imgElm.style.marginBottom && imgElm.style.marginTop === imgElm.style.marginBottom) {
+              data.vspace = removePixelSuffix(imgElm.style.marginTop);
+            }
+            if (imgElm.style.borderWidth) {
+              data.border = removePixelSuffix(imgElm.style.borderWidth);
+            }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                function toggleContentEditableState(state) {
-                       return function(nodes) {
-                               var i = nodes.length, node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            data.style = editor.dom.serializeStyle(editor.dom.parseStyle(editor.dom.getAttrib(imgElm, 'style')));
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                function toggleContentEditable(node) {
-                                       node.attr('contenteditable', state ? 'true' : null);
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          // 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
+              },
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                while (i--) {
-                                       node = nodes[i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+              {
+                title: 'Advanced',
+                type: 'form',
+                pack: 'start',
+                items: [
+                  {
+                    label: 'Style',
+                    name: 'style',
+                    type: 'textbox',
+                    onchange: updateVSpaceHSpaceBorder
+                  },
+                  {
+                    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
+          });
+        }
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        if (hasImageClass(node)) {
-                                               node.attr('contenteditable', state ? 'false' : null);
-                                               tinymce.each(node.getAll('figcaption'), toggleContentEditable);
-                                       }
-                               }
-                       };
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      editor.on('preInit', function () {
+        function hasImageClass(node) {
+          var className = node.attr('class');
+          return className && /\bimage\b/.test(className);
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                editor.parser.addNodeFilter('figure', toggleContentEditableState(true));
-               editor.serializer.addNodeFilter('figure', toggleContentEditableState(false));
-       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        function toggleContentEditableState(state) {
+          return function (nodes) {
+            var i = nodes.length, node;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.addButton('image', {
-               icon: 'image',
-               tooltip: 'Insert/edit image',
-               onclick: createImageList(showDialog),
-               stateSelector: 'img:not([data-mce-object],[data-mce-placeholder]),figure.image'
-       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            function toggleContentEditable(node) {
+              node.attr('contenteditable', state ? 'true' : null);
+            }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.addMenuItem('image', {
-               icon: 'image',
-               text: 'Image',
-               onclick: createImageList(showDialog),
-               context: 'insert',
-               prependToContext: true
-       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            while (i--) {
+              node = nodes[i];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        editor.addCommand('mceImage', createImageList(showDialog));
-});
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+              if (hasImageClass(node)) {
+                node.attr('contenteditable', state ? 'false' : null);
+                Tools.each(node.getAll('figcaption'), toggleContentEditable);
+              }
+            }
+          };
+        }
+
+        editor.parser.addNodeFilter('figure', toggleContentEditableState(true));
+        editor.serializer.addNodeFilter('figure', toggleContentEditableState(false));
+      });
+
+      editor.addButton('image', {
+        icon: 'image',
+        tooltip: 'Insert/edit image',
+        onclick: createImageList(showDialog),
+        stateSelector: 'img:not([data-mce-object],[data-mce-placeholder]),figure.image'
+      });
+
+      editor.addMenuItem('image', {
+        icon: 'image',
+        text: 'Image',
+        onclick: createImageList(showDialog),
+        context: 'insert',
+        prependToContext: true
+      });
+
+      editor.addCommand('mceImage', createImageList(showDialog));
+    });
+
+    return function () { };
+  }
+);
+dem('tinymce.plugins.image.Plugin')();
+})();
</ins></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginsimagepluginminjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/tinymce/plugins/image/plugin.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/tinymce/plugins/image/plugin.min.js      2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/js/tinymce/plugins/image/plugin.min.js        2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1 +1 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-tinymce.PluginManager.add("image",function(a){function b(a,b){function c(a,c){d.parentNode&&d.parentNode.removeChild(d),b({width:a,height:c})}var d=document.createElement("img");d.onload=function(){c(Math.max(d.width,d.clientWidth),Math.max(d.height,d.clientHeight))},d.onerror=function(){c()};var e=d.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left=0,e.width=e.height="auto",document.body.appendChild(d),d.src=a}function c(a,b,c){function d(a,c){return c=c||[],tinymce.each(a,function(a){var e={text:a.text||a.title};a.menu?e.menu=d(a.menu):(e.value=a.value,b(e)),c.push(e)}),c}return d(a,c||[])}function d(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))}}):"function"==typeof c?c(b):b(c)}}function e(d){fun
 ction e(){var a,b,c,d;a=m.find("#width")[0],b=m.find("#height")[0],a&&b&&(c=a.value(),d=b.value(),m.find("#constrain")[0].checked()&&p&&q&&c&&d&&(p!=c?(d=Math.round(c/p*d),isNaN(d)||b.value(d)):(c=Math.round(d/q*c),isNaN(c)||a.value(c))),p=c,q=d)}function f(){function b(b){function c(){b.onload=b.onerror=null,a.selection&&(a.selection.select(b),a.nodeChanged())}b.onload=function(){t.width||t.height||!v||(u.setAttribs(b,{width:b.clientWidth,height:b.clientHeight}),a.fire("wpNewImageRefresh",{node:b})),c()},b.onerror=c}var c,d;k(),e(),t=tinymce.extend(t,m.toJSON());var f=t.wpcaption;t.alt||(t.alt=""),t.title||(t.title=""),""===t.width&&(t.width=null),""===t.height&&(t.height=null),t.style||(t.style=null),t={src:t.src,alt:t.alt,title:t.title,width:t.width,height:t.height,style:t.style,caption:t.caption,"class":t["
 class"]},a.undoManager.transact(function(){function e(b){return a.schema.getTextBlockElements()[b.nodeName]}var g={node:n,data:t,wpcaption:f};if(a.fire("wpImageFormSubmit",{imgData:g}),g.cancel)return void b(g.node);if(!t.src)return void(n&&(u.remove(n),a.focus(),a.nodeChanged()));if(""===t.title&&(t.title=null),n?u.setAttribs(n,t):(t.id="__mcenew",a.focus(),a.selection.setContent(u.createHTML("img",t)),n=u.get("__mcenew"),u.setAttrib(n,"id",null)),a.editorUpload.uploadImagesAuto(),t.caption===!1&&u.is(n.parentNode,"figure.image")&&(c=n.parentNode,u.insertAfter(n,c),u.remove(c)),t.caption!==!0)b(n);else if(!u.is(n.parentNode,"figure.image")){d=n,n=n.cloneNode(!0),c=u.create("figure",{"class":"image"}),c.appendChild(n),c.appendChild(u.create("figcaption",{contentEditable:!0},"Caption")),c.contentEditable=!1;var h=u.getP
 arent(d,e);h?u.split(h,d,c):u.replace(c,d),a.selection.select(c)}})}function g(a){return a&&(a=a.replace(/px$/,"")),a}function h(c){var d,e,f,g=c.meta||{};r&&r.value(a.convertURL(this.value(),"src")),tinymce.each(g,function(a,b){m.find("#"+b).value(a)}),g.width||g.height||(d=a.convertURL(this.value(),"src"),e=a.settings.image_prepend_url,f=new RegExp("^(?:[a-z]+:)?//","i"),e&&!f.test(d)&&d.substring(0,e.length)!==e&&(d=e+d),this.value(d),b(a.documentBaseURI.toAbsolute(this.value()),function(a){a.width&&a.height&&v&&(p=a.width,q=a.height,m.find("#width").value(p),m.find("#height").value(q))}))}function i(a){a.meta=m.toJSON()}function j(a){if(a.margin){var b=a.margin.split(" ");switch(b.length){case 1:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[0],a["margin
 -bottom"]=a["margin-bottom"]||b[0],a["margin-left"]=a["margin-left"]||b[0];break;case 2:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[0],a["margin-left"]=a["margin-left"]||b[1];break;case 3:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[2],a["margin-left"]=a["margin-left"]||b[1];break;case 4:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[2],a["margin-left"]=a["margin-left"]||b[3]}delete a.margin}return a}function k(){function b(a){return a.length>0&&/^[0-9]+$/.test(a)&&(a+=&q
 uot;px"),a}if(a.settings.image_advtab){var c=m.toJSON(),d=u.parseStyle(c.style);d=j(d),c.vspace&&(d["margin-top"]=d["margin-bottom"]=b(c.vspace)),c.hspace&&(d["margin-left"]=d["margin-right"]=b(c.hspace)),c.border&&(d["border-width"]=b(c.border)),m.find("#style").value(u.serializeStyle(u.parseStyle(u.serializeStyle(d))))}}function l(){if(a.settings.image_advtab){var b=m.toJSON(),c=u.parseStyle(b.style);m.find("#vspace").value(""),m.find("#hspace").value(""),c=j(c),(c["margin-top"]&&c["margin-bottom"]||c["margin-right"]&&c["margin-left"])&&(c["margin-top"]===c["margin-bottom"]?m.find("#vspace").value(g(c["margin-top"])):m.find("#vspace").value(""),c["margin-right"]===c["margin-left"]?m.find("#hspace").valu
 e(g(c["margin-right"])):m.find("#hspace").value("")),c["border-width"]&&m.find("#border").value(g(c["border-width"])),m.find("#style").value(u.serializeStyle(u.parseStyle(u.serializeStyle(c))))}}var m,n,o,p,q,r,s,t={},u=a.dom,v=a.settings.image_dimensions!==!1;n=a.selection.getNode(),o=u.getParent(n,"figure.image"),o&&(n=u.select("img",o)[0]),n&&("IMG"!=n.nodeName||n.getAttribute("data-mce-object")||n.getAttribute("data-mce-placeholder"))&&(n=null),n&&(p=u.getAttrib(n,"width"),q=u.getAttrib(n,"height"),t={src:u.getAttrib(n,"src"),alt:u.getAttrib(n,"alt"),title:u.getAttrib(n,"title"),"class":u.getAttrib(n,"class"),width:p,height:q,caption:!!o},a.fire("wpLoadImageData",{imgData:{data:t,node:n}})),d&&(r={type:"listbox",label:"I
 mage list",values:c(d,function(b){b.value=a.convertURL(b.value||b.url,"src")},[{text:"None",value:""}]),value:t.src&&a.convertURL(t.src,"src"),onselect:function(a){var b=m.find("#alt");(!b.value()||a.lastControl&&b.value()==a.lastControl.text())&&b.value(a.control.text()),m.find("#src").value(a.control.value()).fire("change")},onPostRender:function(){r=this}}),a.settings.image_class_list&&(s={name:"class",type:"listbox",label:"Class",values:c(a.settings.image_class_list,function(b){b.value&&(b.textStyle=function(){return a.formatter.getCssText({inline:"img",classes:[b.value]})})})});var w=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:h,onbeforecall:i},r];a.settings.image_description!==!1&&w.push({name:"alt",type:"textbox",lab
 el:"Image description"}),a.settings.image_title&&w.push({name:"title",type:"textbox",label:"Image Title"}),v&&w.push({type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:e,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:e,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),w.push(s),a.settings.image_caption&&tinymce.Env.ceFalse&&w.push({name:"caption",type:"checkbox",label:"Caption"}),a.fire("wpLoadImageForm",{data:w}),a.settings.image_advtab?(n&&(n.style.marginLeft&&n.style.marginRight&&n.styl
 e.marginLeft===n.style.marginRight&&(t.hspace=g(n.style.marginLeft)),n.style.marginTop&&n.style.marginBottom&&n.style.marginTop===n.style.marginBottom&&(t.vspace=g(n.style.marginTop)),n.style.borderWidth&&(t.border=g(n.style.borderWidth)),t.style=a.dom.serializeStyle(a.dom.parseStyle(a.dom.getAttrib(n,"style")))),m=a.windowManager.open({title:"Insert/edit image",data:t,bodyType:"tabpanel",body:[{title:"General",type:"form",items:w},{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox",onchange:l},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:k},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:&quot
 ;hspace"},{label:"Border",name:"border"}]}]}],onSubmit:f})):m=a.windowManager.open({title:"Insert/edit image",data:t,body:w,onSubmit:f})}a.on("preInit",function(){function b(a){var b=a.attr("class");return b&&/\bimage\b/.test(b)}function c(a){return function(c){function d(b){b.attr("contenteditable",a?"true":null)}for(var e,f=c.length;f--;)e=c[f],b(e)&&(e.attr("contenteditable",a?"false":null),tinymce.each(e.getAll("figcaption"),d))}}a.parser.addNodeFilter("figure",c(!0)),a.serializer.addNodeFilter("figure",c(!1))}),a.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:d(e),stateSelector:"img:not([data-mce-object],[data-mce-placeholder]),figure.image"}),a.addMenuItem("image",{icon:"image",text:"Image",onclick:d(e),context:"insert",prependToContext:!0
 }),a.addCommand("mceImage",d(e))});
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("6",tinymce.util.Tools.resolve),g("1",[&q
 uot;6"],function(a){return a("tinymce.Env")}),g("2",["6"],function(a){return a("tinymce.PluginManager")}),g("3",["6"],function(a){return a("tinymce.util.JSON")}),g("4",["6"],function(a){return a("tinymce.util.Tools")}),g("5",["6"],function(a){return a("tinymce.util.XHR")}),g("0",["1","2","3","4","5"],function(a,b,c,d,e){return b.add("image",function(b){function f(a,b){function c(a,c){d.parentNode&&d.parentNode.removeChild(d),b({width:a,height:c})}var d=document.createElement("img");d.onload=function(){c(Math.max(d.width,d.clientWidth),Math.max(d.height,d.clientHeight))},d.onerror=function(){c()};var e=d.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left=0,e.width=e.height="auto",document.body.appendChild(d),d.src=a}functio
 n g(a,b,c){function e(a,c){return c=c||[],d.each(a,function(a){var d={text:a.text||a.title};a.menu?d.menu=e(a.menu):(d.value=a.value,b(d)),c.push(d)}),c}return e(a,c||[])}function h(a){return function(){var d=b.settings.image_list;"string"==typeof d?e.send({url:d,success:function(b){a(c.parse(b))}}):"function"==typeof d?d(a):a(d)}}function i(c){function e(){var a,b,c,d;a=o.find("#width")[0],b=o.find("#height")[0],a&&b&&(c=a.value(),d=b.value(),o.find("#constrain")[0].checked()&&r&&s&&c&&d&&(r!=c?(d=Math.round(c/r*d),isNaN(d)||b.value(d)):(c=Math.round(d/s*c),isNaN(c)||a.value(c))),r=c,s=d)}function h(){function a(a){function c(){a.onload=a.onerror=null,b.selection&&(b.selection.select(a),b.nodeChanged())}a.onload=function(){v.width||v.height||!x||w.setAttribs(a,{width:a.clientWidth,height:a.clientHeight}),c()},a.onerror=c}var c,f;m(),e(),v=d.extend(v,o.toJSON()),v.alt||(
 v.alt=""),v.title||(v.title=""),""===v.width&&(v.width=null),""===v.height&&(v.height=null),v.style||(v.style=null),v={src:v.src,alt:v.alt,title:v.title,width:v.width,height:v.height,style:v.style,caption:v.caption,"class":v["class"]},b.undoManager.transact(function(){function d(a){return b.schema.getTextBlockElements()[a.nodeName]}if(!v.src)return void(p&&(w.remove(p),b.focus(),b.nodeChanged()));if(""===v.title&&(v.title=null),p?w.setAttribs(p,v):(v.id="__mcenew",b.focus(),b.selection.setContent(w.createHTML("img",v)),p=w.get("__mcenew"),w.setAttrib(p,"id",null)),b.editorUpload.uploadImagesAuto(),v.caption===!1&&w.is(p.parentNode,"figure.image")&&(c=p.parentNode,w.insertAfter(p,c),w.remove(c)),v.caption!==!0)a(p);else if(!w.is(p.parentNode,"figure.image")){f=p,p=p.cloneNode(!0),c=w.create("figure"
 ,{"class":"image"}),c.appendChild(p),c.appendChild(w.create("figcaption",{contentEditable:!0},"Caption")),c.contentEditable=!1;var e=w.getParent(f,d);e?w.split(e,f,c):w.replace(c,f),b.selection.select(c)}})}function i(a){return a&&(a=a.replace(/px$/,"")),a}function j(a){var c,e,g,h=a.meta||{};t&&t.value(b.convertURL(this.value(),"src")),d.each(h,function(a,b){o.find("#"+b).value(a)}),h.width||h.height||(c=b.convertURL(this.value(),"src"),e=b.settings.image_prepend_url,g=new RegExp("^(?:[a-z]+:)?//","i"),e&&!g.test(c)&&c.substring(0,e.length)!==e&&(c=e+c),this.value(c),f(b.documentBaseURI.toAbsolute(this.value()),function(a){a.width&&a.height&&x&&(r=a.width,s=a.height,o.find("#width").value(r),o.find("#height").value(s))}))}function k(a){a.meta=o.toJSON()}function l(a){if(a.margin){var b=a.margin.split(
 " ");switch(b.length){case 1:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[0],a["margin-bottom"]=a["margin-bottom"]||b[0],a["margin-left"]=a["margin-left"]||b[0];break;case 2:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[0],a["margin-left"]=a["margin-left"]||b[1];break;case 3:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[2],a["margin-left"]=a["margin-left"]||b[1];break;case 4:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[2],a[&
 quot;margin-left"]=a["margin-left"]||b[3]}delete a.margin}return a}function m(){function a(a){return a.length>0&&/^[0-9]+$/.test(a)&&(a+="px"),a}if(b.settings.image_advtab){var c=o.toJSON(),d=w.parseStyle(c.style);d=l(d),c.vspace&&(d["margin-top"]=d["margin-bottom"]=a(c.vspace)),c.hspace&&(d["margin-left"]=d["margin-right"]=a(c.hspace)),c.border&&(d["border-width"]=a(c.border)),o.find("#style").value(w.serializeStyle(w.parseStyle(w.serializeStyle(d))))}}function n(){if(b.settings.image_advtab){var a=o.toJSON(),c=w.parseStyle(a.style);o.find("#vspace").value(""),o.find("#hspace").value(""),c=l(c),(c["margin-top"]&&c["margin-bottom"]||c["margin-right"]&&c["margin-left"])&&(c["margin-top"]===c["margin-bottom"]?o.find("#vspace").
 value(i(c["margin-top"])):o.find("#vspace").value(""),c["margin-right"]===c["margin-left"]?o.find("#hspace").value(i(c["margin-right"])):o.find("#hspace").value("")),c["border-width"]&&o.find("#border").value(i(c["border-width"])),o.find("#style").value(w.serializeStyle(w.parseStyle(w.serializeStyle(c))))}}var o,p,q,r,s,t,u,v={},w=b.dom,x=b.settings.image_dimensions!==!1;p=b.selection.getNode(),q=w.getParent(p,"figure.image"),q&&(p=w.select("img",q)[0]),p&&("IMG"!=p.nodeName||p.getAttribute("data-mce-object")||p.getAttribute("data-mce-placeholder"))&&(p=null),p&&(r=w.getAttrib(p,"width"),s=w.getAttrib(p,"height"),v={src:w.getAttrib(p,"src"),alt:w.getAttrib(p,"alt"),title:w.getAttrib(p,"title"),"class":w.getA
 ttrib(p,"class"),width:r,height:s,caption:!!q}),c&&(t={type:"listbox",label:"Image list",values:g(c,function(a){a.value=b.convertURL(a.value||a.url,"src")},[{text:"None",value:""}]),value:v.src&&b.convertURL(v.src,"src"),onselect:function(a){var b=o.find("#alt");(!b.value()||a.lastControl&&b.value()==a.lastControl.text())&&b.value(a.control.text()),o.find("#src").value(a.control.value()).fire("change")},onPostRender:function(){t=this}}),b.settings.image_class_list&&(u={name:"class",type:"listbox",label:"Class",values:g(b.settings.image_class_list,function(a){a.value&&(a.textStyle=function(){return b.formatter.getCssText({inline:"img",classes:[a.value]})})})});var y=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:j,onbefore
 call:k},t];b.settings.image_description!==!1&&y.push({name:"alt",type:"textbox",label:"Image description"}),b.settings.image_title&&y.push({name:"title",type:"textbox",label:"Image Title"}),x&&y.push({type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:e,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:e,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),y.push(u),b.settings.image_caption&&a.ceFalse&&y.push({name:"caption",type:"checkbox",label:"Caption"}),b.settings.image_advtab?(p&&(p.style
 .marginLeft&&p.style.marginRight&&p.style.marginLeft===p.style.marginRight&&(v.hspace=i(p.style.marginLeft)),p.style.marginTop&&p.style.marginBottom&&p.style.marginTop===p.style.marginBottom&&(v.vspace=i(p.style.marginTop)),p.style.borderWidth&&(v.border=i(p.style.borderWidth)),v.style=b.dom.serializeStyle(b.dom.parseStyle(b.dom.getAttrib(p,"style")))),o=b.windowManager.open({title:"Insert/edit image",data:v,bodyType:"tabpanel",body:[{title:"General",type:"form",items:y},{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox",onchange:n},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:m},items:[{label:"Vertical space",name:"vspa
 ce"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]}],onSubmit:h})):o=b.windowManager.open({title:"Insert/edit image",data:v,body:y,onSubmit:h})}b.on("preInit",function(){function a(a){var b=a.attr("class");return b&&/\bimage\b/.test(b)}function c(b){return function(c){function e(a){a.attr("contenteditable",b?"true":null)}for(var f,g=c.length;g--;)f=c[g],a(f)&&(f.attr("contenteditable",b?"false":null),d.each(f.getAll("figcaption"),e))}}b.parser.addNodeFilter("figure",c(!0)),b.serializer.addNodeFilter("figure",c(!1))}),b.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:h(i),stateSelector:"img:not([data-mce-object],[data-mce-placeholder]),figure.image"}),b.addMenuItem("image",{icon:"image",text:"Image",onclick:h
 (i),context:"insert",prependToContext:!0}),b.addCommand("mceImage",h(i))}),function(){}}),d("0")()}();
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginslistspluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/tinymce/plugins/lists/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/tinymce/plugins/lists/plugin.js  2017-05-08 05:00:29 UTC (rev 40582)
+++ trunk/src/wp-includes/js/tinymce/plugins/lists/plugin.js    2017-05-08 05:31:08 UTC (rev 40583)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,12 +81,90 @@
</span><span class="cx" style="display: block; padding: 0 10px">   define(id, [], function () { return ref; });
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px"> /*jsc
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-["tinymce.lists.Plugin","global!tinymce.PluginManager","global!tinymce.util.Tools","global!tinymce.util.VK","tinymce.lists.core.NodeType","tinymce.lists.core.Delete","tinymce.lists.actions.Indent","tinymce.lists.actions.Outdent","tinymce.lists.actions.ToggleList","global!tinymce.dom.TreeWalker","global!tinymce.dom.RangeUtils","tinymce.lists.core.Selection","tinymce.lists.core.Bookmark","tinymce.lists.core.Range","tinymce.lists.core.NormalizeLists","global!tinymce.dom.BookmarkManager","tinymce.lists.core.SplitList","global!tinymce.dom.DOMUtils.DOM","tinymce.lists.core.TextBlock","global!tinymce.Env"]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+["tinymce.plugins.lists.Plugin","tinymce.core.PluginManager","tinymce.core.util.Tools","tinymce.core.util.VK","tinymce.plugins.lists.actions.Indent","tinymce.plugins.lists.actions.Outdent","tinymce.plugins.lists.actions.ToggleList","tinymce.plugins.lists.core.Delete","tinymce.plugins.lists.core.NodeType","global!tinymce.util.Tools.resolve","tinymce.core.dom.DOMUtils","tinymce.plugins.lists.core.Bookmark","tinymce.plugins.lists.core.Selection","tinymce.plugins.lists.core.NormalizeLists","tinymce.plugins.lists.core.SplitList","tinymce.plugins.lists.core.TextBlock","tinymce.core.dom.BookmarkManager","tinymce.core.dom.RangeUtils","tinymce.core.dom.TreeWalker","tinymce.plugins.lists.core.Range",&q
 uot;tinymce.core.Env"]
</ins><span class="cx" style="display: block; padding: 0 10px"> jsc*/
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-defineGlobal("global!tinymce.PluginManager", tinymce.PluginManager);
-defineGlobal("global!tinymce.util.Tools", tinymce.util.Tools);
-defineGlobal("global!tinymce.util.VK", tinymce.util.VK);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * ResolveGlobal.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define(
+  'tinymce.core.PluginManager',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.PluginManager');
+  }
+);
+
+/**
+ * ResolveGlobal.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define(
+  'tinymce.core.util.Tools',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.util.Tools');
+  }
+);
+
+/**
+ * ResolveGlobal.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define(
+  'tinymce.core.util.VK',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.util.VK');
+  }
+);
+
+/**
+ * ResolveGlobal.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define(
+  'tinymce.core.dom.DOMUtils',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.dom.DOMUtils');
+  }
+);
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px">  * NodeType.js
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Released under LGPL License.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,81 +174,83 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-define("tinymce.lists.core.NodeType", [
-], function () {
-       var isTextNode = function (node) {
-               return node && node.nodeType === 3;
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.plugins.lists.core.NodeType',
+  [
+  ],
+  function () {
+    var isTextNode = function (node) {
+      return node && node.nodeType === 3;
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var isListNode = function (node) {
-               return node && (/^(OL|UL|DL)$/).test(node.nodeName);
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var isListNode = function (node) {
+      return node && (/^(OL|UL|DL)$/).test(node.nodeName);
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var isListItemNode = function (node) {
-               return node && /^(LI|DT|DD)$/.test(node.nodeName);
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var isListItemNode = function (node) {
+      return node && /^(LI|DT|DD)$/.test(node.nodeName);
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var isBr = function (node) {
-               return node && node.nodeName === 'BR';
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var isBr = function (node) {
+      return node && node.nodeName === 'BR';
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var isFirstChild = function (node) {
-               return node.parentNode.firstChild === node;
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var isFirstChild = function (node) {
+      return node.parentNode.firstChild === node;
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var isLastChild = function (node) {
-               return node.parentNode.lastChild === node;
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var isLastChild = function (node) {
+      return node.parentNode.lastChild === node;
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var isTextBlock = function (editor, node) {
-               return node && !!editor.schema.getTextBlockElements()[node.nodeName];
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var isTextBlock = function (editor, node) {
+      return node && !!editor.schema.getTextBlockElements()[node.nodeName];
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var isBogusBr = function (dom, node) {
-               if (!isBr(node)) {
-                       return false;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var isBogusBr = function (dom, node) {
+      if (!isBr(node)) {
+        return false;
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (dom.isBlock(node.nextSibling) && !isBr(node.previousSibling)) {
-                       return true;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (dom.isBlock(node.nextSibling) && !isBr(node.previousSibling)) {
+        return true;
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return false;
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      return false;
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var isEmpty = function (dom, elm, keepBookmarks) {
-               var empty = dom.isEmpty(elm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var isEmpty = function (dom, elm, keepBookmarks) {
+      var empty = dom.isEmpty(elm);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (keepBookmarks && dom.select('span[data-mce-type=bookmark]', elm).length > 0) {
-                       return false;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (keepBookmarks && dom.select('span[data-mce-type=bookmark]', elm).length > 0) {
+        return false;
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return empty;
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      return empty;
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var isChildOfBody = function (dom, elm) {
-               return dom.isChildOf(elm, dom.getRoot());
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var isChildOfBody = function (dom, elm) {
+      return dom.isChildOf(elm, dom.getRoot());
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        return {
-               isTextNode: isTextNode,
-               isListNode: isListNode,
-               isListItemNode: isListItemNode,
-               isBr: isBr,
-               isFirstChild: isFirstChild,
-               isLastChild: isLastChild,
-               isTextBlock: isTextBlock,
-               isBogusBr: isBogusBr,
-               isEmpty: isEmpty,
-               isChildOfBody: isChildOfBody
-       };
-});
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    return {
+      isTextNode: isTextNode,
+      isListNode: isListNode,
+      isListItemNode: isListItemNode,
+      isBr: isBr,
+      isFirstChild: isFirstChild,
+      isLastChild: isLastChild,
+      isTextBlock: isTextBlock,
+      isBogusBr: isBogusBr,
+      isEmpty: isEmpty,
+      isChildOfBody: isChildOfBody
+    };
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-defineGlobal("global!tinymce.dom.TreeWalker", tinymce.dom.TreeWalker);
-defineGlobal("global!tinymce.dom.RangeUtils", tinymce.dom.RangeUtils);
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Selection.js
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * ResolveGlobal.js
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Released under LGPL License.
</span><span class="cx" style="display: block; padding: 0 10px">  * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -179,23 +259,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-define("tinymce.lists.core.Selection", [
-       "global!tinymce.util.Tools",
-       "tinymce.lists.core.NodeType"
-], function (Tools, NodeType) {
-       var getSelectedListItems = function (editor) {
-               return Tools.grep(editor.selection.getSelectedBlocks(), function (block) {
-                       return NodeType.isListItemNode(block);
-               });
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.core.dom.RangeUtils',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.dom.RangeUtils');
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        return {
-               getSelectedListItems: getSelectedListItems
-       };
-});
-
-
-defineGlobal("global!tinymce.dom.DOMUtils.DOM", tinymce.dom.DOMUtils.DOM);
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px">  * Range.js
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -206,38 +279,42 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-define("tinymce.lists.core.Range", [
-       "global!tinymce.dom.RangeUtils",
-       "tinymce.lists.core.NodeType"
-], function (RangeUtils, NodeType) {
-       var getNormalizedEndPoint = function (container, offset) {
-               var node = RangeUtils.getNode(container, offset);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.plugins.lists.core.Range',
+  [
+    'tinymce.core.dom.RangeUtils',
+    'tinymce.plugins.lists.core.NodeType'
+  ],
+  function (RangeUtils, NodeType) {
+    var getNormalizedEndPoint = function (container, offset) {
+      var node = RangeUtils.getNode(container, offset);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (NodeType.isListItemNode(container) && NodeType.isTextNode(node)) {
-                       var textNodeOffset = offset >= container.childNodes.length ? node.data.length : 0;
-                       return {container: node, offset: textNodeOffset};
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (NodeType.isListItemNode(container) && NodeType.isTextNode(node)) {
+        var textNodeOffset = offset >= container.childNodes.length ? node.data.length : 0;
+        return { container: node, offset: textNodeOffset };
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return {container: container, offset: offset};
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      return { container: container, offset: offset };
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var normalizeRange = function (rng) {
-               var outRng = rng.cloneRange();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var normalizeRange = function (rng) {
+      var outRng = rng.cloneRange();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                var rangeStart = getNormalizedEndPoint(rng.startContainer, rng.startOffset);
-               outRng.setStart(rangeStart.container, rangeStart.offset);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      var rangeStart = getNormalizedEndPoint(rng.startContainer, rng.startOffset);
+      outRng.setStart(rangeStart.container, rangeStart.offset);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                var rangeEnd = getNormalizedEndPoint(rng.endContainer, rng.endOffset);
-               outRng.setEnd(rangeEnd.container, rangeEnd.offset);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      var rangeEnd = getNormalizedEndPoint(rng.endContainer, rng.endOffset);
+      outRng.setEnd(rangeEnd.container, rangeEnd.offset);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return outRng;
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      return outRng;
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        return {
-               getNormalizedEndPoint: getNormalizedEndPoint,
-               normalizeRange: normalizeRange
-       };
-});
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    return {
+      getNormalizedEndPoint: getNormalizedEndPoint,
+      normalizeRange: normalizeRange
+    };
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -250,125 +327,268 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-define("tinymce.lists.core.Bookmark", [
-       "global!tinymce.dom.DOMUtils.DOM",
-       "tinymce.lists.core.NodeType",
-       "tinymce.lists.core.Range"
-], function (DOM, NodeType, Range) {
-       /**
-        * Returns a range bookmark. This will convert indexed bookmarks into temporary span elements with
-        * index 0 so that they can be restored properly after the DOM has been modified. Text bookmarks will not have spans
-        * added to them since they can be restored after a dom operation.
-        *
-        * So this: <p><b>|</b><b>|</b></p>
-        * becomes: <p><b><span data-mce-type="bookmark">|</span></b><b data-mce-type="bookmark">|</span></b></p>
-        *
-        * @param  {DOMRange} rng DOM Range to get bookmark on.
-        * @return {Object} Bookmark object.
-        */
-       var createBookmark = function (rng) {
-               var bookmark = {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.plugins.lists.core.Bookmark',
+  [
+    'tinymce.core.dom.DOMUtils',
+    'tinymce.plugins.lists.core.NodeType',
+    'tinymce.plugins.lists.core.Range'
+  ],
+  function (DOMUtils, NodeType, Range) {
+    var DOM = DOMUtils.DOM;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                var setupEndPoint = function (start) {
-                       var offsetNode, container, offset;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    /**
+     * Returns a range bookmark. This will convert indexed bookmarks into temporary span elements with
+     * index 0 so that they can be restored properly after the DOM has been modified. Text bookmarks will not have spans
+     * added to them since they can be restored after a dom operation.
+     *
+     * So this: <p><b>|</b><b>|</b></p>
+     * becomes: <p><b><span data-mce-type="bookmark">|</span></b><b data-mce-type="bookmark">|</span></b></p>
+     *
+     * @param  {DOMRange} rng DOM Range to get bookmark on.
+     * @return {Object} Bookmark object.
+     */
+    var createBookmark = function (rng) {
+      var bookmark = {};
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        container = rng[start ? 'startContainer' : 'endContainer'];
-                       offset = rng[start ? 'startOffset' : 'endOffset'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      var setupEndPoint = function (start) {
+        var offsetNode, container, offset;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (container.nodeType === 1) {
-                               offsetNode = DOM.create('span', {'data-mce-type': 'bookmark'});
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        container = rng[start ? 'startContainer' : 'endContainer'];
+        offset = rng[start ? 'startOffset' : 'endOffset'];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (container.hasChildNodes()) {
-                                       offset = Math.min(offset, container.childNodes.length - 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (container.nodeType === 1) {
+          offsetNode = DOM.create('span', { 'data-mce-type': 'bookmark' });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        if (start) {
-                                               container.insertBefore(offsetNode, container.childNodes[offset]);
-                                       } else {
-                                               DOM.insertAfter(offsetNode, container.childNodes[offset]);
-                                       }
-                               } else {
-                                       container.appendChild(offsetNode);
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (container.hasChildNodes()) {
+            offset = Math.min(offset, container.childNodes.length - 1);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                container = offsetNode;
-                               offset = 0;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            if (start) {
+              container.insertBefore(offsetNode, container.childNodes[offset]);
+            } else {
+              DOM.insertAfter(offsetNode, container.childNodes[offset]);
+            }
+          } else {
+            container.appendChild(offsetNode);
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        bookmark[start ? 'startContainer' : 'endContainer'] = container;
-                       bookmark[start ? 'startOffset' : 'endOffset'] = offset;
-               };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          container = offsetNode;
+          offset = 0;
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                setupEndPoint(true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        bookmark[start ? 'startContainer' : 'endContainer'] = container;
+        bookmark[start ? 'startOffset' : 'endOffset'] = offset;
+      };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (!rng.collapsed) {
-                       setupEndPoint();
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      setupEndPoint(true);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return bookmark;
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (!rng.collapsed) {
+        setupEndPoint();
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var resolveBookmark = function (bookmark) {
-               function restoreEndPoint (start) {
-                       var container, offset, node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      return bookmark;
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        var nodeIndex = function (container) {
-                               var node = container.parentNode.firstChild, idx = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var resolveBookmark = function (bookmark) {
+      function restoreEndPoint(start) {
+        var container, offset, node;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                while (node) {
-                                       if (node === container) {
-                                               return idx;
-                                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        var nodeIndex = function (container) {
+          var node = container.parentNode.firstChild, idx = 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        // Skip data-mce-type=bookmark nodes
-                                       if (node.nodeType !== 1 || node.getAttribute('data-mce-type') !== 'bookmark') {
-                                               idx++;
-                                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          while (node) {
+            if (node === container) {
+              return idx;
+            }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        node = node.nextSibling;
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            // Skip data-mce-type=bookmark nodes
+            if (node.nodeType !== 1 || node.getAttribute('data-mce-type') !== 'bookmark') {
+              idx++;
+            }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                return -1;
-                       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            node = node.nextSibling;
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        container = node = bookmark[start ? 'startContainer' : 'endContainer'];
-                       offset = bookmark[start ? 'startOffset' : 'endOffset'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          return -1;
+        };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (!container) {
-                               return;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        container = node = bookmark[start ? 'startContainer' : 'endContainer'];
+        offset = bookmark[start ? 'startOffset' : 'endOffset'];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (container.nodeType === 1) {
-                               offset = nodeIndex(container);
-                               container = container.parentNode;
-                               DOM.remove(node);
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (!container) {
+          return;
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        bookmark[start ? 'startContainer' : 'endContainer'] = container;
-                       bookmark[start ? 'startOffset' : 'endOffset'] = offset;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (container.nodeType === 1) {
+          offset = nodeIndex(container);
+          container = container.parentNode;
+          DOM.remove(node);
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                restoreEndPoint(true);
-               restoreEndPoint();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        bookmark[start ? 'startContainer' : 'endContainer'] = container;
+        bookmark[start ? 'startOffset' : 'endOffset'] = offset;
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                var rng = DOM.createRng();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      restoreEndPoint(true);
+      restoreEndPoint();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                rng.setStart(bookmark.startContainer, bookmark.startOffset);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      var rng = DOM.createRng();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (bookmark.endContainer) {
-                       rng.setEnd(bookmark.endContainer, bookmark.endOffset);
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      rng.setStart(bookmark.startContainer, bookmark.startOffset);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return Range.normalizeRange(rng);
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (bookmark.endContainer) {
+        rng.setEnd(bookmark.endContainer, bookmark.endOffset);
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        return {
-               createBookmark: createBookmark,
-               resolveBookmark: resolveBookmark
-       };
-});
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      return Range.normalizeRange(rng);
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    return {
+      createBookmark: createBookmark,
+      resolveBookmark: resolveBookmark
+    };
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Selection.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define(
+  'tinymce.plugins.lists.core.Selection',
+  [
+    'tinymce.core.util.Tools',
+    'tinymce.plugins.lists.core.NodeType'
+  ],
+  function (Tools, NodeType) {
+    var getSelectedListItems = function (editor) {
+      return Tools.grep(editor.selection.getSelectedBlocks(), function (block) {
+        return NodeType.isListItemNode(block);
+      });
+    };
+
+    return {
+      getSelectedListItems: getSelectedListItems
+    };
+  }
+);
+
+
+/**
+ * Indent.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define(
+  'tinymce.plugins.lists.actions.Indent',
+  [
+    'tinymce.core.dom.DOMUtils',
+    'tinymce.plugins.lists.core.Bookmark',
+    'tinymce.plugins.lists.core.NodeType',
+    'tinymce.plugins.lists.core.Selection'
+  ],
+  function (DOMUtils, Bookmark, NodeType, Selection) {
+    var DOM = DOMUtils.DOM;
+
+    var mergeLists = function (from, to) {
+      var node;
+
+      if (NodeType.isListNode(from)) {
+        while ((node = from.firstChild)) {
+          to.appendChild(node);
+        }
+
+        DOM.remove(from);
+      }
+    };
+
+    var indent = function (li) {
+      var sibling, newList, listStyle;
+
+      if (li.nodeName === 'DT') {
+        DOM.rename(li, 'DD');
+        return true;
+      }
+
+      sibling = li.previousSibling;
+
+      if (sibling && NodeType.isListNode(sibling)) {
+        sibling.appendChild(li);
+        return true;
+      }
+
+      if (sibling && sibling.nodeName === 'LI' && NodeType.isListNode(sibling.lastChild)) {
+        sibling.lastChild.appendChild(li);
+        mergeLists(li.lastChild, sibling.lastChild);
+        return true;
+      }
+
+      sibling = li.nextSibling;
+
+      if (sibling && NodeType.isListNode(sibling)) {
+        sibling.insertBefore(li, sibling.firstChild);
+        return true;
+      }
+
+      /*if (sibling && sibling.nodeName === 'LI' && isListNode(li.lastChild)) {
+        return false;
+      }*/
+
+      sibling = li.previousSibling;
+      if (sibling && sibling.nodeName === 'LI') {
+        newList = DOM.create(li.parentNode.nodeName);
+        listStyle = DOM.getStyle(li.parentNode, 'listStyleType');
+        if (listStyle) {
+          DOM.setStyle(newList, 'listStyleType', listStyle);
+        }
+        sibling.appendChild(newList);
+        newList.appendChild(li);
+        mergeLists(li.lastChild, newList);
+        return true;
+      }
+
+      return false;
+    };
+
+    var indentSelection = function (editor) {
+      var listElements = Selection.getSelectedListItems(editor);
+
+      if (listElements.length) {
+        var bookmark = Bookmark.createBookmark(editor.selection.getRng(true));
+
+        for (var i = 0; i < listElements.length; i++) {
+          if (!indent(listElements[i]) && i === 0) {
+            break;
+          }
+        }
+
+        editor.selection.setRng(Bookmark.resolveBookmark(bookmark));
+        editor.nodeChanged();
+
+        return true;
+      }
+    };
+
+    return {
+      indentSelection: indentSelection
+    };
+  }
+);
+
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px">  * NormalizeLists.js
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Released under LGPL License.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -378,53 +598,77 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-define("tinymce.lists.core.NormalizeLists", [
-       "global!tinymce.dom.DOMUtils.DOM",
-       "global!tinymce.util.Tools",
-       "tinymce.lists.core.NodeType"
-], function (DOM, Tools, NodeType) {
-       var normalizeList = function (dom, ul) {
-               var sibling, parentNode = ul.parentNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.plugins.lists.core.NormalizeLists',
+  [
+    'tinymce.core.dom.DOMUtils',
+    'tinymce.core.util.Tools',
+    'tinymce.plugins.lists.core.NodeType'
+  ],
+  function (DOMUtils, Tools, NodeType) {
+    var DOM = DOMUtils.DOM;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // Move UL/OL to previous LI if it's the only child of a LI
-               if (parentNode.nodeName === 'LI' && parentNode.firstChild === ul) {
-                       sibling = parentNode.previousSibling;
-                       if (sibling && sibling.nodeName === 'LI') {
-                               sibling.appendChild(ul);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var normalizeList = function (dom, ul) {
+      var sibling, parentNode = ul.parentNode;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (NodeType.isEmpty(dom, parentNode)) {
-                                       DOM.remove(parentNode);
-                               }
-                       } else {
-                               DOM.setStyle(parentNode, 'listStyleType', 'none');
-                       }
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      // Move UL/OL to previous LI if it's the only child of a LI
+      if (parentNode.nodeName === 'LI' && parentNode.firstChild === ul) {
+        sibling = parentNode.previousSibling;
+        if (sibling && sibling.nodeName === 'LI') {
+          sibling.appendChild(ul);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // Append OL/UL to previous LI if it's in a parent OL/UL i.e. old HTML4
-               if (NodeType.isListNode(parentNode)) {
-                       sibling = parentNode.previousSibling;
-                       if (sibling && sibling.nodeName === 'LI') {
-                               sibling.appendChild(ul);
-                       }
-               }
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (NodeType.isEmpty(dom, parentNode)) {
+            DOM.remove(parentNode);
+          }
+        } else {
+          DOM.setStyle(parentNode, 'listStyleType', 'none');
+        }
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var normalizeLists = function (dom, element) {
-               Tools.each(Tools.grep(dom.select('ol,ul', element)), function (ul) {
-                       normalizeList(dom, ul);
-               });
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      // Append OL/UL to previous LI if it's in a parent OL/UL i.e. old HTML4
+      if (NodeType.isListNode(parentNode)) {
+        sibling = parentNode.previousSibling;
+        if (sibling && sibling.nodeName === 'LI') {
+          sibling.appendChild(ul);
+        }
+      }
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        return {
-               normalizeList: normalizeList,
-               normalizeLists: normalizeLists
-       };
-});
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var normalizeLists = function (dom, element) {
+      Tools.each(Tools.grep(dom.select('ol,ul', element)), function (ul) {
+        normalizeList(dom, ul);
+      });
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    return {
+      normalizeList: normalizeList,
+      normalizeLists: normalizeLists
+    };
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-defineGlobal("global!tinymce.dom.BookmarkManager", tinymce.dom.BookmarkManager);
-defineGlobal("global!tinymce.Env", tinymce.Env);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * ResolveGlobal.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define(
+  'tinymce.core.Env',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.Env');
+  }
+);
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px">  * TextBlock.js
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Released under LGPL License.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -434,71 +678,77 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-define("tinymce.lists.core.TextBlock", [
-       "global!tinymce.dom.DOMUtils.DOM",
-       "global!tinymce.Env"
-], function (DOM, Env) {
-       var createNewTextBlock = function (editor, contentNode, blockName) {
-               var node, textBlock, fragment = DOM.createFragment(), hasContentNode;
-               var blockElements = editor.schema.getBlockElements();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.plugins.lists.core.TextBlock',
+  [
+    'tinymce.core.dom.DOMUtils',
+    'tinymce.core.Env'
+  ],
+  function (DOMUtils, Env) {
+    var DOM = DOMUtils.DOM;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (editor.settings.forced_root_block) {
-                       blockName = blockName || editor.settings.forced_root_block;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var createNewTextBlock = function (editor, contentNode, blockName) {
+      var node, textBlock, fragment = DOM.createFragment(), hasContentNode;
+      var blockElements = editor.schema.getBlockElements();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (blockName) {
-                       textBlock = DOM.create(blockName);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (editor.settings.forced_root_block) {
+        blockName = blockName || editor.settings.forced_root_block;
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (textBlock.tagName === editor.settings.forced_root_block) {
-                               DOM.setAttribs(textBlock, editor.settings.forced_root_block_attrs);
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (blockName) {
+        textBlock = DOM.create(blockName);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        fragment.appendChild(textBlock);
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (textBlock.tagName === editor.settings.forced_root_block) {
+          DOM.setAttribs(textBlock, editor.settings.forced_root_block_attrs);
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (contentNode) {
-                       while ((node = contentNode.firstChild)) {
-                               var nodeName = node.nodeName;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        fragment.appendChild(textBlock);
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (!hasContentNode && (nodeName !== 'SPAN' || node.getAttribute('data-mce-type') !== 'bookmark')) {
-                                       hasContentNode = true;
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (contentNode) {
+        while ((node = contentNode.firstChild)) {
+          var nodeName = node.nodeName;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if (blockElements[nodeName]) {
-                                       fragment.appendChild(node);
-                                       textBlock = null;
-                               } else {
-                                       if (blockName) {
-                                               if (!textBlock) {
-                                                       textBlock = DOM.create(blockName);
-                                                       fragment.appendChild(textBlock);
-                                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (!hasContentNode && (nodeName !== 'SPAN' || node.getAttribute('data-mce-type') !== 'bookmark')) {
+            hasContentNode = true;
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                textBlock.appendChild(node);
-                                       } else {
-                                               fragment.appendChild(node);
-                                       }
-                               }
-                       }
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          if (blockElements[nodeName]) {
+            fragment.appendChild(node);
+            textBlock = null;
+          } else {
+            if (blockName) {
+              if (!textBlock) {
+                textBlock = DOM.create(blockName);
+                fragment.appendChild(textBlock);
+              }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (!editor.settings.forced_root_block) {
-                       fragment.appendChild(DOM.create('br'));
-               } else {
-                       // BR is needed in empty blocks on non IE browsers
-                       if (!hasContentNode && (!Env.ie || Env.ie > 10)) {
-                               textBlock.appendChild(DOM.create('br', {'data-mce-bogus': '1'}));
-                       }
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+              textBlock.appendChild(node);
+            } else {
+              fragment.appendChild(node);
+            }
+          }
+        }
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return fragment;
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (!editor.settings.forced_root_block) {
+        fragment.appendChild(DOM.create('br'));
+      } else {
+        // BR is needed in empty blocks on non IE browsers
+        if (!hasContentNode && (!Env.ie || Env.ie > 10)) {
+          textBlock.appendChild(DOM.create('br', { 'data-mce-bogus': '1' }));
+        }
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        return {
-               createNewTextBlock: createNewTextBlock
-       };
-});
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      return fragment;
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    return {
+      createNewTextBlock: createNewTextBlock
+    };
+  }
+);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px">  * SplitList.js
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -509,60 +759,66 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-define("tinymce.lists.core.SplitList", [
-       "global!tinymce.dom.DOMUtils.DOM",
-       "global!tinymce.util.Tools",
-       "tinymce.lists.core.TextBlock",
-       "tinymce.lists.core.NodeType"
-], function (DOM, Tools, TextBlock, NodeType) {
-       var splitList = function (editor, ul, li, newBlock) {
-               var tmpRng, fragment, bookmarks, node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.plugins.lists.core.SplitList',
+  [
+    'tinymce.core.dom.DOMUtils',
+    'tinymce.plugins.lists.core.NodeType',
+    'tinymce.plugins.lists.core.TextBlock',
+    'tinymce.core.util.Tools'
+  ],
+  function (DOMUtils, NodeType, TextBlock, Tools) {
+    var DOM = DOMUtils.DOM;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                var removeAndKeepBookmarks = function (targetNode) {
-                       Tools.each(bookmarks, function (node) {
-                               targetNode.parentNode.insertBefore(node, li.parentNode);
-                       });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var splitList = function (editor, ul, li, newBlock) {
+      var tmpRng, fragment, bookmarks, node;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        DOM.remove(targetNode);
-               };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      var removeAndKeepBookmarks = function (targetNode) {
+        Tools.each(bookmarks, function (node) {
+          targetNode.parentNode.insertBefore(node, li.parentNode);
+        });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                bookmarks = DOM.select('span[data-mce-type="bookmark"]', ul);
-               newBlock = newBlock || TextBlock.createNewTextBlock(editor, li);
-               tmpRng = DOM.createRng();
-               tmpRng.setStartAfter(li);
-               tmpRng.setEndAfter(ul);
-               fragment = tmpRng.extractContents();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        DOM.remove(targetNode);
+      };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                for (node = fragment.firstChild; node; node = node.firstChild) {
-                       if (node.nodeName === 'LI' && editor.dom.isEmpty(node)) {
-                               DOM.remove(node);
-                               break;
-                       }
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      bookmarks = DOM.select('span[data-mce-type="bookmark"]', ul);
+      newBlock = newBlock || TextBlock.createNewTextBlock(editor, li);
+      tmpRng = DOM.createRng();
+      tmpRng.setStartAfter(li);
+      tmpRng.setEndAfter(ul);
+      fragment = tmpRng.extractContents();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (!editor.dom.isEmpty(fragment)) {
-                       DOM.insertAfter(fragment, ul);
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      for (node = fragment.firstChild; node; node = node.firstChild) {
+        if (node.nodeName === 'LI' && editor.dom.isEmpty(node)) {
+          DOM.remove(node);
+          break;
+        }
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                DOM.insertAfter(newBlock, ul);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (!editor.dom.isEmpty(fragment)) {
+        DOM.insertAfter(fragment, ul);
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (NodeType.isEmpty(editor.dom, li.parentNode)) {
-                       removeAndKeepBookmarks(li.parentNode);
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      DOM.insertAfter(newBlock, ul);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                DOM.remove(li);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (NodeType.isEmpty(editor.dom, li.parentNode)) {
+        removeAndKeepBookmarks(li.parentNode);
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (NodeType.isEmpty(editor.dom, ul)) {
-                       DOM.remove(ul);
-               }
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      DOM.remove(li);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        return {
-               splitList: splitList
-       };
-});
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (NodeType.isEmpty(editor.dom, ul)) {
+        DOM.remove(ul);
+      }
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    return {
+      splitList: splitList
+    };
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px">  * Outdent.js
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -573,132 +829,158 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-define("tinymce.lists.actions.Outdent", [
-       "global!tinymce.dom.DOMUtils.DOM",
-       "tinymce.lists.core.NodeType",
-       "tinymce.lists.core.Bookmark",
-       "tinymce.lists.core.Selection",
-       "tinymce.lists.core.SplitList",
-       "tinymce.lists.core.NormalizeLists",
-       "tinymce.lists.core.TextBlock"
-], function (DOM, NodeType, Bookmark, Selection, SplitList, NormalizeLists, TextBlock) {
-       var removeEmptyLi = function (dom, li) {
-               if (NodeType.isEmpty(dom, li)) {
-                       DOM.remove(li);
-               }
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.plugins.lists.actions.Outdent',
+  [
+    'tinymce.core.dom.DOMUtils',
+    'tinymce.plugins.lists.core.Bookmark',
+    'tinymce.plugins.lists.core.NodeType',
+    'tinymce.plugins.lists.core.NormalizeLists',
+    'tinymce.plugins.lists.core.Selection',
+    'tinymce.plugins.lists.core.SplitList',
+    'tinymce.plugins.lists.core.TextBlock'
+  ],
+  function (DOMUtils, Bookmark, NodeType, NormalizeLists, Selection, SplitList, TextBlock) {
+    var DOM = DOMUtils.DOM;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var outdent = function (editor, li) {
-               var ul = li.parentNode, ulParent = ul.parentNode, newBlock;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var removeEmptyLi = function (dom, li) {
+      if (NodeType.isEmpty(dom, li)) {
+        DOM.remove(li);
+      }
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (ul === editor.getBody()) {
-                       return true;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var outdent = function (editor, li) {
+      var ul = li.parentNode, ulParent = ul.parentNode, newBlock;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (li.nodeName === 'DD') {
-                       DOM.rename(li, 'DT');
-                       return true;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (ul === editor.getBody()) {
+        return true;
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (NodeType.isFirstChild(li) && NodeType.isLastChild(li)) {
-                       if (ulParent.nodeName === "LI") {
-                               DOM.insertAfter(li, ulParent);
-                               removeEmptyLi(editor.dom, ulParent);
-                               DOM.remove(ul);
-                       } else if (NodeType.isListNode(ulParent)) {
-                               DOM.remove(ul, true);
-                       } else {
-                               ulParent.insertBefore(TextBlock.createNewTextBlock(editor, li), ul);
-                               DOM.remove(ul);
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (li.nodeName === 'DD') {
+        DOM.rename(li, 'DT');
+        return true;
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        return true;
-               } else if (NodeType.isFirstChild(li)) {
-                       if (ulParent.nodeName === "LI") {
-                               DOM.insertAfter(li, ulParent);
-                               li.appendChild(ul);
-                               removeEmptyLi(editor.dom, ulParent);
-                       } else if (NodeType.isListNode(ulParent)) {
-                               ulParent.insertBefore(li, ul);
-                       } else {
-                               ulParent.insertBefore(TextBlock.createNewTextBlock(editor, li), ul);
-                               DOM.remove(li);
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (NodeType.isFirstChild(li) && NodeType.isLastChild(li)) {
+        if (ulParent.nodeName === "LI") {
+          DOM.insertAfter(li, ulParent);
+          removeEmptyLi(editor.dom, ulParent);
+          DOM.remove(ul);
+        } else if (NodeType.isListNode(ulParent)) {
+          DOM.remove(ul, true);
+        } else {
+          ulParent.insertBefore(TextBlock.createNewTextBlock(editor, li), ul);
+          DOM.remove(ul);
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        return true;
-               } else if (NodeType.isLastChild(li)) {
-                       if (ulParent.nodeName === "LI") {
-                               DOM.insertAfter(li, ulParent);
-                       } else if (NodeType.isListNode(ulParent)) {
-                               DOM.insertAfter(li, ul);
-                       } else {
-                               DOM.insertAfter(TextBlock.createNewTextBlock(editor, li), ul);
-                               DOM.remove(li);
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        return true;
+      } else if (NodeType.isFirstChild(li)) {
+        if (ulParent.nodeName === "LI") {
+          DOM.insertAfter(li, ulParent);
+          li.appendChild(ul);
+          removeEmptyLi(editor.dom, ulParent);
+        } else if (NodeType.isListNode(ulParent)) {
+          ulParent.insertBefore(li, ul);
+        } else {
+          ulParent.insertBefore(TextBlock.createNewTextBlock(editor, li), ul);
+          DOM.remove(li);
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        return true;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        return true;
+      } else if (NodeType.isLastChild(li)) {
+        if (ulParent.nodeName === "LI") {
+          DOM.insertAfter(li, ulParent);
+        } else if (NodeType.isListNode(ulParent)) {
+          DOM.insertAfter(li, ul);
+        } else {
+          DOM.insertAfter(TextBlock.createNewTextBlock(editor, li), ul);
+          DOM.remove(li);
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (ulParent.nodeName === 'LI') {
-                       ul = ulParent;
-                       newBlock = TextBlock.createNewTextBlock(editor, li, 'LI');
-               } else if (NodeType.isListNode(ulParent)) {
-                       newBlock = TextBlock.createNewTextBlock(editor, li, 'LI');
-               } else {
-                       newBlock = TextBlock.createNewTextBlock(editor, li);
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        return true;
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                SplitList.splitList(editor, ul, li, newBlock);
-               NormalizeLists.normalizeLists(editor.dom, ul.parentNode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (ulParent.nodeName === 'LI') {
+        ul = ulParent;
+        newBlock = TextBlock.createNewTextBlock(editor, li, 'LI');
+      } else if (NodeType.isListNode(ulParent)) {
+        newBlock = TextBlock.createNewTextBlock(editor, li, 'LI');
+      } else {
+        newBlock = TextBlock.createNewTextBlock(editor, li);
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return true;
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      SplitList.splitList(editor, ul, li, newBlock);
+      NormalizeLists.normalizeLists(editor.dom, ul.parentNode);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var outdentSelection = function (editor) {
-               var listElements = Selection.getSelectedListItems(editor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      return true;
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (listElements.length) {
-                       var bookmark = Bookmark.createBookmark(editor.selection.getRng(true));
-                       var i, y, root = editor.getBody();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var outdentSelection = function (editor) {
+      var listElements = Selection.getSelectedListItems(editor);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        i = listElements.length;
-                       while (i--) {
-                               var node = listElements[i].parentNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (listElements.length) {
+        var bookmark = Bookmark.createBookmark(editor.selection.getRng(true));
+        var i, y, root = editor.getBody();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                while (node && node !== root) {
-                                       y = listElements.length;
-                                       while (y--) {
-                                               if (listElements[y] === node) {
-                                                       listElements.splice(i, 1);
-                                                       break;
-                                               }
-                                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        i = listElements.length;
+        while (i--) {
+          var node = listElements[i].parentNode;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        node = node.parentNode;
-                               }
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          while (node && node !== root) {
+            y = listElements.length;
+            while (y--) {
+              if (listElements[y] === node) {
+                listElements.splice(i, 1);
+                break;
+              }
+            }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        for (i = 0; i < listElements.length; i++) {
-                               if (!outdent(editor, listElements[i]) && i === 0) {
-                                       break;
-                               }
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+            node = node.parentNode;
+          }
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        editor.selection.setRng(Bookmark.resolveBookmark(bookmark));
-                       editor.nodeChanged();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        for (i = 0; i < listElements.length; i++) {
+          if (!outdent(editor, listElements[i]) && i === 0) {
+            break;
+          }
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        return true;
-               }
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        editor.selection.setRng(Bookmark.resolveBookmark(bookmark));
+        editor.nodeChanged();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        return {
-               outdent: outdent,
-               outdentSelection: outdentSelection
-       };
-});
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        return true;
+      }
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    return {
+      outdent: outdent,
+      outdentSelection: outdentSelection
+    };
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * ResolveGlobal.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+define(
+  'tinymce.core.dom.BookmarkManager',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.dom.BookmarkManager');
+  }
+);
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px">  * ToggleList.js
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Released under LGPL License.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -708,276 +990,280 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-define("tinymce.lists.actions.ToggleList", [
-       "global!tinymce.util.Tools",
-       "global!tinymce.dom.BookmarkManager",
-       "tinymce.lists.core.Selection",
-       "tinymce.lists.core.NodeType",
-       "tinymce.lists.core.Bookmark",
-       "tinymce.lists.core.SplitList",
-       "tinymce.lists.core.NormalizeLists",
-       "tinymce.lists.actions.Outdent"
-], function (Tools, BookmarkManager, Selection, NodeType, Bookmark, SplitList, NormalizeLists, Outdent) {
-       var updateListStyle = function (dom, el, detail) {
-               var type = detail['list-style-type'] ? detail['list-style-type'] : null;
-               dom.setStyle(el, 'list-style-type', type);
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.plugins.lists.actions.ToggleList',
+  [
+    'tinymce.core.dom.BookmarkManager',
+    'tinymce.core.util.Tools',
+    'tinymce.plugins.lists.actions.Outdent',
+    'tinymce.plugins.lists.core.Bookmark',
+    'tinymce.plugins.lists.core.NodeType',
+    'tinymce.plugins.lists.core.NormalizeLists',
+    'tinymce.plugins.lists.core.Selection',
+    'tinymce.plugins.lists.core.SplitList'
+  ],
+  function (BookmarkManager, Tools, Outdent, Bookmark, NodeType, NormalizeLists, Selection, SplitList) {
+    var updateListStyle = function (dom, el, detail) {
+      var type = detail['list-style-type'] ? detail['list-style-type'] : null;
+      dom.setStyle(el, 'list-style-type', type);
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var setAttribs = function (elm, attrs) {
-               Tools.each(attrs, function (value, key) {
-                       elm.setAttribute(key, value);
-               });
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var setAttribs = function (elm, attrs) {
+      Tools.each(attrs, function (value, key) {
+        elm.setAttribute(key, value);
+      });
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var updateListAttrs = function (dom, el, detail) {
-               setAttribs(el, detail['list-attributes']);
-               Tools.each(dom.select('li', el), function (li) {
-                       setAttribs(li, detail['list-item-attributes']);
-               });
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var updateListAttrs = function (dom, el, detail) {
+      setAttribs(el, detail['list-attributes']);
+      Tools.each(dom.select('li', el), function (li) {
+        setAttribs(li, detail['list-item-attributes']);
+      });
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var updateListWithDetails = function (dom, el, detail) {
-               updateListStyle(dom, el, detail);
-               updateListAttrs(dom, el, detail);
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var updateListWithDetails = function (dom, el, detail) {
+      updateListStyle(dom, el, detail);
+      updateListAttrs(dom, el, detail);
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var getEndPointNode = function (editor, rng, start) {
-               var container, offset, root = editor.getBody();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var getEndPointNode = function (editor, rng, start) {
+      var container, offset, root = editor.getBody();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                container = rng[start ? 'startContainer' : 'endContainer'];
-               offset = rng[start ? 'startOffset' : 'endOffset'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      container = rng[start ? 'startContainer' : 'endContainer'];
+      offset = rng[start ? 'startOffset' : 'endOffset'];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // Resolve node index
-               if (container.nodeType === 1) {
-                       container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      // Resolve node index
+      if (container.nodeType === 1) {
+        container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                while (container.parentNode !== root) {
-                       if (NodeType.isTextBlock(editor, container)) {
-                               return container;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      while (container.parentNode !== root) {
+        if (NodeType.isTextBlock(editor, container)) {
+          return container;
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (/^(TD|TH)$/.test(container.parentNode.nodeName)) {
-                               return container;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (/^(TD|TH)$/.test(container.parentNode.nodeName)) {
+          return container;
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        container = container.parentNode;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        container = container.parentNode;
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return container;
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      return container;
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var getSelectedTextBlocks = function (editor, rng) {
-               var textBlocks = [], root = editor.getBody(), dom = editor.dom;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var getSelectedTextBlocks = function (editor, rng) {
+      var textBlocks = [], root = editor.getBody(), dom = editor.dom;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                var startNode = getEndPointNode(editor, rng, true);
-               var endNode = getEndPointNode(editor, rng, false);
-               var block, siblings = [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      var startNode = getEndPointNode(editor, rng, true);
+      var endNode = getEndPointNode(editor, rng, false);
+      var block, siblings = [];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                for (var node = startNode; node; node = node.nextSibling) {
-                       siblings.push(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      for (var node = startNode; node; node = node.nextSibling) {
+        siblings.push(node);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (node === endNode) {
-                               break;
-                       }
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (node === endNode) {
+          break;
+        }
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                Tools.each(siblings, function (node) {
-                       if (NodeType.isTextBlock(editor, node)) {
-                               textBlocks.push(node);
-                               block = null;
-                               return;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      Tools.each(siblings, function (node) {
+        if (NodeType.isTextBlock(editor, node)) {
+          textBlocks.push(node);
+          block = null;
+          return;
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (dom.isBlock(node) || NodeType.isBr(node)) {
-                               if (NodeType.isBr(node)) {
-                                       dom.remove(node);
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (dom.isBlock(node) || NodeType.isBr(node)) {
+          if (NodeType.isBr(node)) {
+            dom.remove(node);
+          }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                block = null;
-                               return;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          block = null;
+          return;
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        var nextSibling = node.nextSibling;
-                       if (BookmarkManager.isBookmarkNode(node)) {
-                               if (NodeType.isTextBlock(editor, nextSibling) || (!nextSibling && node.parentNode === root)) {
-                                       block = null;
-                                       return;
-                               }
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        var nextSibling = node.nextSibling;
+        if (BookmarkManager.isBookmarkNode(node)) {
+          if (NodeType.isTextBlock(editor, nextSibling) || (!nextSibling && node.parentNode === root)) {
+            block = null;
+            return;
+          }
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (!block) {
-                               block = dom.create('p');
-                               node.parentNode.insertBefore(block, node);
-                               textBlocks.push(block);
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (!block) {
+          block = dom.create('p');
+          node.parentNode.insertBefore(block, node);
+          textBlocks.push(block);
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        block.appendChild(node);
-               });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        block.appendChild(node);
+      });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return textBlocks;
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      return textBlocks;
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var applyList = function (editor, listName, detail) {
-               var rng = editor.selection.getRng(true), bookmark, listItemName = 'LI';
-               var dom = editor.dom;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var applyList = function (editor, listName, detail) {
+      var rng = editor.selection.getRng(true), bookmark, listItemName = 'LI';
+      var dom = editor.dom;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                detail = detail ? detail : {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      detail = detail ? detail : {};
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (dom.getContentEditable(editor.selection.getNode()) === "false") {
-                       return;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (dom.getContentEditable(editor.selection.getNode()) === "false") {
+        return;
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                listName = listName.toUpperCase();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      listName = listName.toUpperCase();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (listName === 'DL') {
-                       listItemName = 'DT';
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (listName === 'DL') {
+        listItemName = 'DT';
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                bookmark = Bookmark.createBookmark(rng);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      bookmark = Bookmark.createBookmark(rng);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                Tools.each(getSelectedTextBlocks(editor, rng), function (block) {
-                       var listBlock, sibling;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      Tools.each(getSelectedTextBlocks(editor, rng), function (block) {
+        var listBlock, sibling;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        var hasCompatibleStyle = function (sib) {
-                               var sibStyle = dom.getStyle(sib, 'list-style-type');
-                               var detailStyle = detail ? detail['list-style-type'] : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        var hasCompatibleStyle = function (sib) {
+          var sibStyle = dom.getStyle(sib, 'list-style-type');
+          var detailStyle = detail ? detail['list-style-type'] : '';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                detailStyle = detailStyle === null ? '' : detailStyle;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          detailStyle = detailStyle === null ? '' : detailStyle;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                return sibStyle === detailStyle;
-                       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+          return sibStyle === detailStyle;
+        };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        sibling = block.previousSibling;
-                       if (sibling && NodeType.isListNode(sibling) && sibling.nodeName === listName && hasCompatibleStyle(sibling)) {
-                               listBlock = sibling;
-                               block = dom.rename(block, listItemName);
-                               sibling.appendChild(block);
-                       } else {
-                               listBlock = dom.create(listName);
-                               block.parentNode.insertBefore(listBlock, block);
-                               listBlock.appendChild(block);
-                               block = dom.rename(block, listItemName);
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        sibling = block.previousSibling;
+        if (sibling && NodeType.isListNode(sibling) && sibling.nodeName === listName && hasCompatibleStyle(sibling)) {
+          listBlock = sibling;
+          block = dom.rename(block, listItemName);
+          sibling.appendChild(block);
+        } else {
+          listBlock = dom.create(listName);
+          block.parentNode.insertBefore(listBlock, block);
+          listBlock.appendChild(block);
+          block = dom.rename(block, listItemName);
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        updateListWithDetails(dom, listBlock, detail);
-                       mergeWithAdjacentLists(editor.dom, listBlock);
-               });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        updateListWithDetails(dom, listBlock, detail);
+        mergeWithAdjacentLists(editor.dom, listBlock);
+      });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                editor.selection.setRng(Bookmark.resolveBookmark(bookmark));
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      editor.selection.setRng(Bookmark.resolveBookmark(bookmark));
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var removeList = function (editor) {
-               var bookmark = Bookmark.createBookmark(editor.selection.getRng(true)), root = editor.getBody();
-               var listItems = Selection.getSelectedListItems(editor);
-               var emptyListItems = Tools.grep(listItems, function (li) {
-                       return editor.dom.isEmpty(li);
-               });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var removeList = function (editor) {
+      var bookmark = Bookmark.createBookmark(editor.selection.getRng(true)), root = editor.getBody();
+      var listItems = Selection.getSelectedListItems(editor);
+      var emptyListItems = Tools.grep(listItems, function (li) {
+        return editor.dom.isEmpty(li);
+      });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                listItems = Tools.grep(listItems, function (li) {
-                       return !editor.dom.isEmpty(li);
-               });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      listItems = Tools.grep(listItems, function (li) {
+        return !editor.dom.isEmpty(li);
+      });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                Tools.each(emptyListItems, function (li) {
-                       if (NodeType.isEmpty(editor.dom, li)) {
-                               Outdent.outdent(editor, li);
-                               return;
-                       }
-               });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      Tools.each(emptyListItems, function (li) {
+        if (NodeType.isEmpty(editor.dom, li)) {
+          Outdent.outdent(editor, li);
+          return;
+        }
+      });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                Tools.each(listItems, function (li) {
-                       var node, rootList;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      Tools.each(listItems, function (li) {
+        var node, rootList;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (li.parentNode === editor.getBody()) {
-                               return;
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        if (li.parentNode === editor.getBody()) {
+          return;
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        for (node = li; node && node !== root; node = node.parentNode) {
-                               if (NodeType.isListNode(node)) {
-                                       rootList = node;
-                               }
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        for (node = li; node && node !== root; node = node.parentNode) {
+          if (NodeType.isListNode(node)) {
+            rootList = node;
+          }
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        SplitList.splitList(editor, rootList, li);
-                       NormalizeLists.normalizeLists(editor.dom, rootList.parentNode);
-               });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        SplitList.splitList(editor, rootList, li);
+        NormalizeLists.normalizeLists(editor.dom, rootList.parentNode);
+      });
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                editor.selection.setRng(Bookmark.resolveBookmark(bookmark));
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      editor.selection.setRng(Bookmark.resolveBookmark(bookmark));
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var isValidLists = function (list1, list2) {
-               return list1 && list2 && NodeType.isListNode(list1) && list1.nodeName === list2.nodeName;
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var isValidLists = function (list1, list2) {
+      return list1 && list2 && NodeType.isListNode(list1) && list1.nodeName === list2.nodeName;
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var hasSameListStyle = function (dom, list1, list2) {
-               var targetStyle = dom.getStyle(list1, 'list-style-type', true);
-               var style = dom.getStyle(list2, 'list-style-type', true);
-               return targetStyle === style;
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var hasSameListStyle = function (dom, list1, list2) {
+      var targetStyle = dom.getStyle(list1, 'list-style-type', true);
+      var style = dom.getStyle(list2, 'list-style-type', true);
+      return targetStyle === style;
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var hasSameClasses = function (elm1, elm2) {
-               return elm1.className === elm2.className;
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var hasSameClasses = function (elm1, elm2) {
+      return elm1.className === elm2.className;
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var shouldMerge = function (dom, list1, list2) {
-               return isValidLists(list1, list2) && hasSameListStyle(dom, list1, list2) && hasSameClasses(list1, list2);
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var shouldMerge = function (dom, list1, list2) {
+      return isValidLists(list1, list2) && hasSameListStyle(dom, list1, list2) && hasSameClasses(list1, list2);
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var mergeWithAdjacentLists = function (dom, listBlock) {
-               var sibling, node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var mergeWithAdjacentLists = function (dom, listBlock) {
+      var sibling, node;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                sibling = listBlock.nextSibling;
-               if (shouldMerge(dom, listBlock, sibling)) {
-                       while ((node = sibling.firstChild)) {
-                               listBlock.appendChild(node);
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      sibling = listBlock.nextSibling;
+      if (shouldMerge(dom, listBlock, sibling)) {
+        while ((node = sibling.firstChild)) {
+          listBlock.appendChild(node);
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        dom.remove(sibling);
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        dom.remove(sibling);
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                sibling = listBlock.previousSibling;
-               if (shouldMerge(dom, listBlock, sibling)) {
-                       while ((node = sibling.lastChild)) {
-                               listBlock.insertBefore(node, listBlock.firstChild);
-                       }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      sibling = listBlock.previousSibling;
+      if (shouldMerge(dom, listBlock, sibling)) {
+        while ((node = sibling.lastChild)) {
+          listBlock.insertBefore(node, listBlock.firstChild);
+        }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        dom.remove(sibling);
-               }
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        dom.remove(sibling);
+      }
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        var toggleList = function (editor, listName, detail) {
-               var parentList = editor.dom.getParent(editor.selection.getStart(), 'OL,UL,DL');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    var toggleList = function (editor, listName, detail) {
+      var parentList = editor.dom.getParent(editor.selection.getStart(), 'OL,UL,DL');
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                detail = detail ? detail : {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      detail = detail ? detail : {};
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (parentList === editor.getBody()) {
-                       return;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (parentList === editor.getBody()) {
+        return;
+      }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (parentList) {
-                       if (parentList.nodeName === listName) {
-                               removeList(editor, listName);
-                       } else {
-                               var bookmark = Bookmark.createBookmark(editor.selection.getRng(true));
-                               updateListWithDetails(editor.dom, parentList, detail);
-                               mergeWithAdjacentLists(editor.dom, editor.dom.rename(parentList, listName));
-                               editor.selection.setRng(Bookmark.resolveBookmark(bookmark));
-                       }
-               } else {
-                       applyList(editor, listName, detail);
-               }
-       };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+      if (parentList) {
+        if (parentList.nodeName === listName) {
+          removeList(editor, listName);
+        } else {
+          var bookmark = Bookmark.createBookmark(editor.selection.getRng(true));
+          updateListWithDetails(editor.dom, parentList, detail);
+          mergeWithAdjacentLists(editor.dom, editor.dom.rename(parentList, listName));
+          editor.selection.setRng(Bookmark.resolveBookmark(bookmark));
+        }
+      } else {
+        applyList(editor, listName, detail);
+      }
+    };
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        return {
-               toggleList: toggleList,
-               removeList: removeList,
-               mergeWithAdjacentLists: mergeWithAdjacentLists
-       };
-});
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    return {
+      toggleList: toggleList,
+      removeList: removeList,
+      mergeWithAdjacentLists: mergeWithAdjacentLists
+    };
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Delete.js
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * ResolveGlobal.js
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Released under LGPL License.
</span><span class="cx" style="display: block; padding: 0 10px">  * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -986,302 +1272,223 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * Contributing: http://www.tinymce.com/contributing
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-define("tinymce.lists.core.Delete", [
-       "global!tinymce.dom.TreeWalker",
-       "global!tinymce.dom.RangeUtils",
-       "global!tinymce.util.VK",
-       "tinymce.lists.core.Selection",
-       "tinymce.lists.core.NodeType",
-       "tinymce.lists.core.Bookmark",
-       "tinymce.lists.core.Range",
-       "tinymce.lists.core.NormalizeLists",
-       "tinymce.lists.actions.ToggleList"
-], function (
-       TreeWalker, RangeUtils, VK, Selection, NodeType, Bookmark, Range, NormalizeLists, ToggleList
-) {
-       var findNextCaretContainer = function (editor, rng, isForward) {
-               var node = rng.startContainer, offset = rng.startOffset;
-               var nonEmptyBlocks, walker;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+define(
+  'tinymce.core.dom.TreeWalker',
+  [
+    'global!tinymce.util.Tools.resolve'
+  ],
+  function (resolve) {
+    return resolve('tinymce.dom.TreeWalker');
+  }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (node.nodeType === 3 && (isForward ? offset < node.data.length : offset > 0)) {
-                       return node;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Delete.js
+ *
+ * Released under LGPL License.
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                nonEmptyBlocks = editor.schema.getNonEmptyElements();
-